class INCOME(INVTRAN, SECID, ORIGCURRENCY): incometype = OneOf(*INCOMETYPES, required=True) total = Decimal(required=True) subacctsec = OneOf(*INVSUBACCTS, required=True) subacctfund = OneOf(*INVSUBACCTS, required=True) taxexempt = Bool() withholding = Decimal() inv401ksource = OneOf(*INV401KSOURCES)
def inctran(self, inctran, dtstart, dtend): """ """ tran = ET.Element('INCTRAN') if dtstart: ET.SubElement(tran, 'DTSTART').text = DateTime().unconvert(dtstart) if dtend: ET.SubElement(tran, 'DTEND').text = DateTime().unconvert(dtend) ET.SubElement(tran, 'INCLUDE').text = Bool().unconvert(inctran) return tran
class REINVEST(INVTRAN, SECID, ORIGCURRENCY): incometype = OneOf(*INCOMETYPES, required=True) total = Decimal(required=True) subacctsec = OneOf(*INVSUBACCTS) units = Decimal(required=True) unitprice = Decimal(4, required=True) commission = Decimal() taxes = Decimal() fees = Decimal() load = Decimal() taxexempt = Bool() inv401ksource = OneOf(*INV401KSOURCES)
class INVBUY(INVTRAN, SECID, ORIGCURRENCY): units = Decimal(required=True) unitprice = Decimal(4, required=True) markup = Decimal() commission = Decimal() taxes = Decimal() fees = Decimal() load = Decimal() total = Decimal(required=True) subacctsec = OneOf(*INVSUBACCTS, required=True) subacctfund = OneOf(*INVSUBACCTS, required=True) loanid = String(32) loanprincipal = Decimal() loaninterest = Decimal() inv401ksource = OneOf(*INV401KSOURCES) dtpayroll = DateTime() prioryearcontrib = Bool()
class INVSELL(INVTRAN, SECID, ORIGCURRENCY): units = Decimal(required=True) unitprice = Decimal(4, required=True) markdown = Decimal() commission = Decimal() taxes = Decimal() fees = Decimal() load = Decimal() withholding = Decimal() taxexempt = Bool() total = Decimal(required=True) gain = Decimal() subacctsec = OneOf(*INVSUBACCTS, required=True) subacctfund = OneOf(*INVSUBACCTS, required=True) loanid = String(32) statewithholding = Decimal() penalty = Decimal() inv401ksource = OneOf(*INV401KSOURCES)
def incbal(self, incbal): bal = ET.Element('INCBAL') bal.text = Bool().unconvert(incbal) return bal
def incpos(self, dtasof, incpos): pos = ET.Element('INCPOS') if dtasof: ET.SubElement(pos, 'DTASOF').text = DateTime().unconvert(dtasof) ET.SubElement(pos, 'INCLUDE').text = Bool().unconvert(incpos) return pos
def incoo(self): # Include Open Orders - not implemented oo = ET.Element('INCOO') oo.text = Bool().unconvert(False) return oo
class POSSTOCK(INVPOS): unitsstreet = Decimal() unitsuser = Decimal() reinvdiv = Bool()
class POSMF(INVPOS): unitsstreet = Decimal() unitsuser = Decimal() reinvdiv = Bool() reinvcg = Bool()