diff --git a/kfet/views.py b/kfet/views.py index 68d4bb13..ac8afcb8 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -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)