Commit 5fe1786a authored by Christophe Francois's avatar Christophe Francois Committed by ntome

[societegenerale] Fixed balance for revolving credits

In some revolving credits the displayed balance is the available amount
instead of the used amount, it needs to be overriden with the used
amount.

Closes: 14567@zendesk
parent 08d506c4
......@@ -354,8 +354,11 @@ class LoansPage(JsonBasePage):
# used amount
if Dict('reserveUtilisee', default=NotAvailable)(acc):
loan.used_amount = eval_decimal_amount('reserveUtilisee/valeur', 'reserveUtilisee/posDecimale')(acc)
# in some cases, the displayed balance is the available amount and must be overriden
loan.balance = loan.used_amount
elif Dict('montantUtilise', default=NotAvailable)(acc):
loan.available_amount = eval_decimal_amount('montantUtilise/valeur', 'montantUtilise/posDecimale')(acc)
loan.used_amount = eval_decimal_amount('montantUtilise/valeur', 'montantUtilise/posDecimale')(acc)
loan.balance = loan.used_amount
# next payment amount
if Dict('prochaineEcheance', default=NotAvailable)(acc):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment