Bugzilla – Attachment 154787 Details for
Bug 32595
Price format cost in ILL requests table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32595: Add price formatting to cost and price paid fields in ILL list table
Bug-32595-Add-price-formatting-to-cost-and-price-p.patch (text/plain), 1.96 KB, created by
Pedro Amorim
on 2023-08-25 09:22:14 UTC
(
hide
)
Description:
Bug 32595: Add price formatting to cost and price paid fields in ILL list table
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-25 09:22:14 UTC
Size:
1.96 KB
patch
obsolete
>From 04197d73adb6b783bbce3b6e45764d608b566f6a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >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' > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 8 ++++++-- > 1 file changed, 6 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..f22f5190c0 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,18 @@ $(document).ready(function() { > "data": "cost", > "orderable": true, > "render": function(data, type, row, meta) { >- return escape_str(data); >+ let cost = row.cost && row.cost.replaceAll(',','.'); >+ cost = Number(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 = row.paid_price && row.paid_price.replaceAll(',','.'); >+ paid_price = Number(paid_price) || 0; >+ return paid_price.escapeHtml().format_price(); > } > }, > { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32595
:
154717
|
154731
|
154780
|
154787
|
154788
|
157622
|
157623