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 <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2022-09-20 21:20:57 +00:00 committed by Tomas Cohen Arazi
parent 28d41896dd
commit b190a293ff
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 7 additions and 6 deletions

View file

@ -1,5 +1,6 @@
[% USE Koha %]
[% PROCESS 'modal-claims.inc' %]
[% INCLUDE 'format_price.inc' %]
<div id="checkouts">
[% IF ( issuecount ) %]
<div id="issues-table-loading-message">

View file

@ -437,19 +437,19 @@ $(document).ready(function() {
{
"mDataProp": function ( oObj ) {
if ( ! oObj.charge ) oObj.charge = 0;
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>';
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).format_price() + '<span>';
}
},
{
"mDataProp": function ( oObj ) {
if ( ! oObj.fine ) oObj.fine = 0;
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).toFixed(2) + '<span>';
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).format_price() + '<span>';
}
},
{
"mDataProp": function ( oObj ) {
if ( ! oObj.price ) oObj.price = 0;
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).toFixed(2) + '<span>';
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).format_price() + '<span>';
}
},
{
@ -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,