From 7e5910e0b36ac3c51fd337c07f8315df1b24a2a3 Mon Sep 17 00:00:00 2001 From: Qwann Date: Fri, 20 Jan 2017 18:10:49 +0100 Subject: [PATCH 1/3] balance templatetag fixed --- kfet/templatetags/kfet_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index bb8bce9f..91feefa1 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -38,4 +38,4 @@ def highlight_clipper(clipper, q): def ukf(balance, is_cof): grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 # float nécessaire car sinon problème avec le round de future.builtins - return round(float(balance * 10 * grant)) + return round(float(balance) * 10 * grant) From 8b4f7ad60cb911034ca6236bd1f152e34f2bd74d Mon Sep 17 00:00:00 2001 From: Qwann Date: Fri, 20 Jan 2017 18:34:45 +0100 Subject: [PATCH 2/3] decimal cast for operation.amount --- kfet/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 94f8705ea4e45a8d4cf827ceaf4e9ac61951e0fb Mon Sep 17 00:00:00 2001 From: Qwann Date: Tue, 24 Jan 2017 19:42:15 +0100 Subject: [PATCH 3/3] wrong merge fixed --- kfet/templatetags/kfet_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kfet/templatetags/kfet_tags.py b/kfet/templatetags/kfet_tags.py index 9894cf7f..66152dfe 100644 --- a/kfet/templatetags/kfet_tags.py +++ b/kfet/templatetags/kfet_tags.py @@ -39,4 +39,4 @@ def highlight_clipper(clipper, q): def ukf(balance, is_cof): grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1 # float nécessaire car sinon problème avec le round de future.builtins - return round(float(balance) * 10 * grant) + return floor(float(balance) * 10 * grant)