Merge branch 'qwann/decimal_fixes' into 'k-fet'
Qwann/decimal fixes Répare les problèmes suivants : * On ne pouvait pas lire la balance d'un compte à l'aide du templatetag correspond sur lequel était effectué un mauvais cast en float * On ne pouvait pas effectuer d'opération à cause d'une absence de cast en Decimal pour operation.amount See merge request !154
This commit is contained in:
commit
939e0f32a2
2 changed files with 3 additions and 2 deletions
|
@ -38,4 +38,5 @@ def highlight_clipper(clipper, q):
|
||||||
@register.filter()
|
@register.filter()
|
||||||
def ukf(balance, is_cof):
|
def ukf(balance, is_cof):
|
||||||
grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1
|
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)
|
||||||
|
|
|
@ -963,7 +963,7 @@ def kpsul_perform_operations(request):
|
||||||
if operationgroup.on_acc.is_cof:
|
if operationgroup.on_acc.is_cof:
|
||||||
if is_addcost:
|
if is_addcost:
|
||||||
operation.addcost_amount = operation.addcost_amount / cof_grant_divisor
|
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
|
to_articles_stocks[operation.article] -= operation.article_nb
|
||||||
else:
|
else:
|
||||||
if operationgroup.on_acc.is_cash:
|
if operationgroup.on_acc.is_cash:
|
||||||
|
|
Loading…
Reference in a new issue