Add logic in views and templates

This commit is contained in:
Ludovic Stephan 2019-11-27 14:14:33 +01:00
parent 20ceec0e64
commit affdf43e0b
3 changed files with 7 additions and 2 deletions

View file

@ -1056,7 +1056,10 @@ def kpsul_perform_operations(request):
to_addcost_for_balance += operation.addcost_amount
if operationgroup.on_acc.is_cash:
to_checkout_balance += -operation.amount
if operationgroup.on_acc.is_cof:
if (
operationgroup.on_acc.is_cof
and operation.article.category.has_reduction
):
if is_addcost and operation.article.category.has_addcost:
operation.addcost_amount /= cof_grant_divisor
operation.amount = operation.amount / cof_grant_divisor