...
{'type':"number",'name':"commission_rate",'label':{'en':'Commission rate(%)',’fr':'Taux de commission (%)'},'rights':{'read':"157101", “write':'157102', 'update’:'157103','replace’:'157206'}, relevance:"True",condition:".$_<100",'default':'10'},
]}
...
activeForObject(self, instance, context, type, sub_type)
instance.__class__ == PaymentPan and context IN (
...
batchValuation) and self.checkCalculation(instance)
check_calculation(cls, instance)
...
calculate(cls, instance, *args[date_from, date_to, productid, location])
instance.__class__ ==
...
get all paid contribution that are eligible for commission
create a bill through the converters
...
contribution
return comission_rate / 100 * contribution value
convert(from, to, context, **agrs)
...
if context == BatchPayment
argv:
batch_id
sub_type,
product_id,
Batchrun will trigger convert_batch for all the product part of it.
if active_for_object(<fakepaymentplan><paymentplan>, 'submit'context , type, sub_type):
calculate(cls,
...
<paymentplan>, *args[date_from, date_to, productid, location])
then convert
one accountPayable per EO,
one asset (line) per product/commission, sum of policy value as quantity, commission as unit price, product account code as ledger account
one asset (line) per policy : policy value as quantity, commission as unit price, product account code as ledger account (dependent detail as asset description)
...
field | type | comment |
subject_type | json | batch_run |
subject_id | json | run_id |
thirdparty_type | str | User |
thirdparty_id | id/uuid | UserID |
code | str | CP-User_name-HFID-YYYYMM |
date_due | date | batch run date +30 days |
date_invoice | date | batch run date |
*dateValidFrom | date | validFrom: first day of batch run |
*dateValidTo | date | validTo: last first day of batch run |
amount_discount | float | N/A |
amount_net | float | Total without tax |
tax_analysis | json | N/A |
amount_total | float | total net |
status | int | validated |
currency_rcp_code | str | default-curency |
currency_code | str | default-curency-code |
note | bigttext |
|
terms | bigttext | Product: Product Name, commission_rate |
...