From 4e6f12bb6d8eb58355946ab957f5f5f2875c5609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Mon, 22 Aug 2016 18:08:44 +0200 Subject: [PATCH] Fix calcul majoration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La subvention COF s'applique correctement à une majoration --- kfet/views.py | 4 ++++ 1 file changed, 4 insertions(+) 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)