version = 1
status = active
UUID = a23b6d567-5cc1-eeee-ak47-2a99c235eaa8
calculation_rule_name = “payment: commission“
type = account_payable
sub_type = commissions
dateValidTo = None
dateValidFrom = 2000-01-01
list of impacted parameters: NULL (will take data from product, claims … )
description = “ This calculation will, for the selected level and product, calculate how much the insurance need to pay the commission to EO “
Service
activeForObject(self, instance, context, type, sub_type)
instance.__class__ == PaymentPan and context IN (submit) and self.checkCalculation(instance)
check_calculation
return true (to be updated once real payment plan will be in place)
calculate(cls, instance, *args[date_from, date_to, productid, location])
instance.__class__ == PaymentPlan
get all paid contribution that are eligible for commission
create a bill through the converters
billCreationFromCalculation(date_from, date_to, type, sub_type, product_id, location)
Registration on signals from other module(existing or not):
billCreationFromCalculation
Batchrun will trigger billCreationFromCalculation and will send: when the payment plan would be deliver the batch run page could be replaced by payment plan (this page could call billCreationFromCalculation service on selected payment plans) page and bill page.
if active_for_object(<fakepaymentplan>, 'submit', type, sub_type):
calculate(cls, <fakepaymentplan>, *args[date_from, date_to, productid, location])
Converters
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)