def GenerateOwnerReport(report, schemes, internal, holdercomp, shareclass, omode, date, colnames, trnum, level, cid): tr = trnum ifhc = None ifc = None ifid = None scc = None schc = None scid = None total_payments = 0 for scheme in schemes: valcol = getNumColName(scheme.getname()) units = 0 payment = 0 if valcol is not None and valcol in colnames: scc, schc, ifhc, ifc, scid, ifid = po.getOwnerFundCode( scheme, level, internal, holdercomp, shareclass) if level == 3: price = getprice(scid, date, omode) for r in report: units = units + (r[valcol] / float(price)) payment = payment + r[valcol] total_payments += payment tr = WriteToFile('share', scc, schc, units, price, payment, date, tr, cid) else: price = getprice(ifid, date, omode) for r in report: units = units + (r[valcol] / float(price)) payment = payment + r[valcol] tr = WriteToFile('internal', ifc, ifhc, units, price, payment, date, tr, cid) # fill out internal fund for only level 3 if level == 3: price = getprice(ifid, date, omode) units = total_payments / float(price) tr = WriteToFile('internal', ifc, ifhc, units, price, total_payments, date, tr, cid) print "\nGenerated internal and share files." return tr
def GenerateOwnerReport(report,schemes,internal,holdercomp,shareclass,omode,date,colnames,trnum,level,cid): tr = trnum ifhc = None ifc = None ifid = None scc = None schc = None scid = None total_payments = 0 for scheme in schemes: valcol = getNumColName(scheme.getname()) units = 0 payment = 0 if valcol is not None and valcol in colnames: scc, schc, ifhc, ifc, scid, ifid = po.getOwnerFundCode(scheme, level, internal,holdercomp,shareclass) if level == 3: price = getprice(scid, date, omode) for r in report: units = units + (r[valcol] / float(price)) payment = payment + r[valcol] total_payments += payment tr = WriteToFile('share',scc,schc,units,price,payment,date,tr,cid) else: price = getprice(ifid, date, omode) for r in report: units = units + (r[valcol] / float(price)) payment = payment + r[valcol] tr=WriteToFile('internal',ifc,ifhc,units,price,payment,date,tr,cid) # fill out internal fund for only level 3 if level == 3: price = getprice(ifid, date, omode) units = total_payments / float(price) tr = WriteToFile('internal',ifc,ifhc,units,price,total_payments,date,tr,cid) print "\nGenerated internal and share files." return tr