Bugzilla – Attachment 136486 Details for
Bug 31038
Amounts in cashup summary modal no longer properly formatted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31038: Fix price formating in cashup summary
Bug-31038-Fix-price-formating-in-cashup-summary.patch (text/plain), 3.61 KB, created by
Martin Renvoize (ashimema)
on 2022-06-24 10:38:06 UTC
(
hide
)
Description:
Bug 31038: Fix price formating in cashup summary
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-24 10:38:06 UTC
Size:
3.61 KB
patch
obsolete
>From 55b767e7f1876a9cbb0e9819d3ee6971cfc49d40 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Jun 2022 11:36:32 +0100 >Subject: [PATCH] Bug 31038: Fix price formating in cashup summary > >This patch uses the existing format_price JS include to format prices in >the cashup summary modal > >Test plan >1) Create some transactions and a cashup >2) View the cashup summary modal and confirm amounts are not nicely > formatted >3) Apply patch >4) Confirm amounts in cashup summary modals are now nicely formatted >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 1 + > koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt | 1 + > koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js | 8 ++++---- > 3 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >index b5604d8f97..8499727d48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -332,6 +332,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] >+ [% INCLUDE 'format_price.inc' %] > [% Asset.js("js/cashup_modal.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'js-date-format.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >index 4a15758d6a..9d5c94c9ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >@@ -195,6 +195,7 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'format_price.inc' %] > [% Asset.js("js/cashup_modal.js") | $raw %] > <script> > $(document).ready(function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >index 01e8849e23..4df0403eea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >@@ -16,19 +16,19 @@ $('#cashupSummaryModal').on('show.bs.modal', function(e) { > var tbody = summary_modal.find('tbody') > tbody.empty(); > for (out of data.summary.payout_grouped) { >- tbody.append('<tr><td>' + out.credit_type.description + '</td><td>- ' + out.total + '</td></tr>'); >+ tbody.append('<tr><td>' + out.credit_type.description + '</td><td>- ' + out.total.format_price() + '</td></tr>'); > } > > for (income of data.summary.income_grouped) { >- tbody.append('<tr><td>' + income.debit_type.description + '</td><td>' + income.total + '</td></tr>'); >+ tbody.append('<tr><td>' + income.debit_type.description + '</td><td>' + income.total.format_price() + '</td></tr>'); > } > > var tfoot = summary_modal.find('tfoot'); > tfoot.empty(); >- tfoot.append('<tr><td>Total</td><td>' + data.summary.total + '</td></tr>'); >+ tfoot.append('<tr><td>Total</td><td>' + data.summary.total.format_price() + '</td></tr>'); > for (type of data.summary.total_grouped) { > if (type.total !== 0) { >- tfoot.append('<tr><td>' + type.payment_type + '</td><td>' + type.total + '</td></tr>'); >+ tfoot.append('<tr><td>' + type.payment_type + '</td><td>' + type.total.format_price() + '</td></tr>'); > } > } > } >-- >2.20.1
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 31038
:
136486
|
136489
|
136490
|
137401