From b190a293ff30c5b5a456d1523cb1f366247017fe Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 20 Sep 2022 21:20:57 +0000 Subject: [PATCH] Bug 22115: Format prices in table of checkouts according to CurrencyFormat setting In the patron account in the staff interface, all amounts in the checkouts table should be formatted according to the CurrencyFormat system preference setting. To test: * Edit some items, setting the replacement cost * Make sure one of the item type is set to charge a rental charge * Check out items * Verify the checkouts table displays on both checkouts and details tabs correctly * Try different settings of CurrencyFormat and verify all amounts display correctly Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/checkouts-table.inc | 1 + koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc index c74be444ac..ab75568e52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -1,5 +1,6 @@ [% USE Koha %] [% PROCESS 'modal-claims.inc' %] +[% INCLUDE 'format_price.inc' %]
[% IF ( issuecount ) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 0afb4514f0..8af8dff9f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -437,19 +437,19 @@ $(document).ready(function() { { "mDataProp": function ( oObj ) { if ( ! oObj.charge ) oObj.charge = 0; - return '' + parseFloat(oObj.charge).toFixed(2) + ''; + return '' + parseFloat(oObj.charge).format_price() + ''; } }, { "mDataProp": function ( oObj ) { if ( ! oObj.fine ) oObj.fine = 0; - return '' + parseFloat(oObj.fine).toFixed(2) + ''; + return '' + parseFloat(oObj.fine).format_price() + ''; } }, { "mDataProp": function ( oObj ) { if ( ! oObj.price ) oObj.price = 0; - return '' + parseFloat(oObj.price).toFixed(2) + ''; + return '' + parseFloat(oObj.price).format_price() + ''; } }, { @@ -645,9 +645,9 @@ $(document).ready(function() { total_fine += aaData[i]['fine'] * 1; total_price += aaData[i]['price'] * 1; } - $("#totaldue").html(total_charge.toFixed(2)); - $("#totalfine").html(total_fine.toFixed(2)); - $("#totalprice").html(total_price.toFixed(2)); + $("#totaldue").html(total_charge.format_price() ); + $("#totalfine").html(total_fine.format_price() ); + $("#totalprice").html(total_price.format_price() ); }, "bPaginate": false, "bProcessing": true, -- 2.39.5