Fix calcul majoration

La subvention COF s'applique correctement à une majoration
This commit is contained in:
Aurélien Delobelle 2016-08-22 18:08:44 +02:00
parent 44d9e8d8ed
commit 4e6f12bb6d

View file

@ -621,6 +621,8 @@ def kpsul_perform_operations(request):
if operationgroup.on_acc.is_cash:
to_checkout_balance += -operation.amount
if operationgroup.on_acc.is_cof:
if is_addcost:
operation.addcost_amount = operation.addcost_amount / cof_grant_divisor
operation.amount = operation.amount / cof_grant_divisor
to_articles_stocks[operation.article] -= operation.article_nb
else:
@ -630,6 +632,8 @@ def kpsul_perform_operations(request):
operationgroup.amount += operation.amount
if operation.type == Operation.DEPOSIT:
required_perms.add('kfet.perform_deposit')
if operationgroup.on_acc.is_cof:
to_addcost_for_balance = to_addcost_for_balance / cof_grant_divisor
(perms, stop) = operationgroup.on_acc.perms_to_perform_operation(
amount = operationgroup.amount)