The table of checkouts on the checkouts and details tabs in the patron account can display the columns Charge, Price and Fine. Those columns are not formatted according to the CurrencyFormat systme preference. I don't know how to fix this. It appears the formatting is currently done in checkouts.js using toFixed(2): Example: "mDataProp": function ( oObj ) { if ( ! oObj.charge ) oObj.charge = 0; return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>'; }
Would it make sense to format the price in svc/checkouts? e.g. charge => Koha::Number::Price->new( $charge )->format_for_editing, Not sure if that is correct, copied from Price.pm.
Ideally we need a JS function that copies what format_for_editing does.
We already have koha-tmpl/intranet-tmpl/prog/en/includes/format_price.inc: Number.prototype.format_price = function( value, params ) {
Created attachment 140807 [details] [review] 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
Created attachment 140811 [details] [review] 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>
The only edge case I noticed was if the charge or replacement price is 1,000.00 or greater and the currency is FR, then because of the space instead of the , it appears in the columns for check out and details tabs as: 1 000,00
Created attachment 141256 [details] [review] 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>
Created attachment 141257 [details] [review] Bug 22115: (QA follow-up) prevent wrap on price columns Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 22.11. Nice work everyone, thanks!
Doesn't apply cleanly to 22.05.x, no backport