From 023171b373b6197bd08fc4d934244b1f9cb1fea3 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 23 Aug 2023 16:53:31 +0000 Subject: [PATCH] Bug 32595: Add price formatting to cost and price paid fields in ILL list table Test plan: 1) Enable ILLmodule and install FreeForm, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) Create a new FreeForm request and edit its price on the manage page to something like '123' 3) Check back the ILL list table and confirm its shows as '123' 4) Apply patch 5) Verify the table again, see that it now shows as '123.00' --- koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 801143cf57..f09c88ed7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -342,14 +342,16 @@ $(document).ready(function() { "data": "cost", "orderable": true, "render": function(data, type, row, meta) { - return escape_str(data); + let cost = parseInt(row.cost) || 0; + return cost.escapeHtml().format_price(); } }, { "data": "paid_price", "orderable": true, "render": function(data, type, row, meta) { - return escape_str(data); + let paid_price = parseInt(row.paid_price) || 0; + return paid_price.escapeHtml().format_price(); } }, { -- 2.30.2