diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index f27f590e..66152dfe 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -38,4 +38,5 @@ def highlight_clipper(clipper, q): @register.filter() def ukf(balance, is_cof): grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 - return floor(balance * 10 * grant) + # float nécessaire car sinon problème avec le round de future.builtins + return floor(float(balance) * 10 * grant) diff --git a/kfet/views.py b/kfet/views.py index 7083d489..125ce9b1 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -963,7 +963,7 @@ def kpsul_perform_operations(request): 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 + operation.amount = Decimal(float(operation.amount) / cof_grant_divisor) to_articles_stocks[operation.article] -= operation.article_nb else: if operationgroup.on_acc.is_cash: