From e8ad906f9c8219a786927701e1a05f1bc477a759 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 17 Mar 2020 18:31:26 +0100 Subject: [PATCH] Human-readable amounts --- templates/note/transaction_form.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/templates/note/transaction_form.html b/templates/note/transaction_form.html index 37cccee0..b75ad7c6 100644 --- a/templates/note/transaction_form.html +++ b/templates/note/transaction_form.html @@ -122,7 +122,12 @@ SPDX-License-Identifier: GPL-2.0-or-later
- +
+ +
+ +
+
@@ -241,7 +246,7 @@ SPDX-License-Identifier: GPL-2.0-or-later { "csrfmiddlewaretoken": CSRF_TOKEN, "quantity": dest.quantity, - "amount": $("#amount").val(), + "amount": 100 * $("#amount").val(), "reason": $("#reason").val(), "valid": true, "polymorphic_ctype": {{ polymorphic_ctype }}, @@ -250,13 +255,13 @@ SPDX-License-Identifier: GPL-2.0-or-later "destination": dest.id }, function () { addMsg("Le transfert de " - + pretty_money(dest.quantity * $("#amount").val()) + " de votre note " + + pretty_money(dest.quantity * 100 * $("#amount").val()) + " de votre note " + " vers la note " + dest.name + " a été fait avec succès !", "success"); reset(); }).fail(function (err) { addMsg("Le transfert de " - + pretty_money(dest.quantity * $("#amount").val()) + " de votre note " + + pretty_money(dest.quantity * 100 * $("#amount").val()) + " de votre note " + " vers la note " + dest.name + " a échoué : " + err.responseText, "danger"); reset(); @@ -270,7 +275,7 @@ SPDX-License-Identifier: GPL-2.0-or-later { "csrfmiddlewaretoken": CSRF_TOKEN, "quantity": source.quantity * dest.quantity, - "amount": $("#amount").val(), + "amount": 100 * $("#amount").val(), "reason": $("#reason").val(), "valid": true, "polymorphic_ctype": {{ polymorphic_ctype }}, @@ -279,13 +284,13 @@ SPDX-License-Identifier: GPL-2.0-or-later "destination": dest.id }, function () { addMsg("Le transfert de " - + pretty_money(source.quantity * dest.quantity * $("#amount").val()) + " de la note " + source.name + + pretty_money(source.quantity * dest.quantity * 100 * $("#amount").val()) + " de la note " + source.name + " vers la note " + dest.name + " a été fait avec succès !", "success"); reset(); }).fail(function (err) { addMsg("Le transfert de " - + pretty_money(source.quantity * dest.quantity * $("#amount").val()) + " de la note " + source.name + + pretty_money(source.quantity * dest.quantity * 100 * $("#amount").val()) + " de la note " + source.name + " vers la note " + dest.name + " a échoué : " + err.responseText, "danger"); reset(); @@ -316,7 +321,7 @@ SPDX-License-Identifier: GPL-2.0-or-later { "csrfmiddlewaretoken": CSRF_TOKEN, "quantity": 1, - "amount": $("#amount").val(), + "amount": 100 * $("#amount").val(), "reason": reason, "valid": true, "polymorphic_ctype": {{ special_polymorphic_ctype }},