Bugzilla – Attachment 98107 Details for
Bug 24482
Purchase Items broken by costs containing a comma
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24482: Fix for formatted price issue with value over 1000
Bug-24482-Fix-for-formatted-price-issue-with-value.patch (text/plain), 2.59 KB, created by
Martin Renvoize (ashimema)
on 2020-01-30 08:21:48 UTC
(
hide
)
Description:
Bug 24482: Fix for formatted price issue with value over 1000
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-01-30 08:21:48 UTC
Size:
2.59 KB
patch
obsolete
>From f6e51deb885e6dab8bad989cade9b0ece632f526 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 27 Jan 2020 14:56:35 +0000 >Subject: [PATCH] Bug 24482: Fix for formatted price issue with value over 1000 > >This patch for the point of sale feature fixes an issue where items for >purchase with a value of $1,000 or more break the payment calculations. > >Test plan: >1) Enable the point of sale feature > (EnablePointOfSale + UseCashRegisters system preferences) >2) Add a cash register for a library > (Home > Point of sale > Cash registers > New cash register) >3) Create a purchase item with a cost of $1000 > (Home > Point of sale > Purchase items > New debit type) >4) Go to to the point of sale page and attempt to sell one of your items > (Home > Point of sale > click 'Add' next to the item to purchase) >5) Note that Koha inserts a comma into the price in the list of items for > purchase >6) Note that the 'Amount being paid' changes to 0.00 instead of $1,000, > which affects the other calculations >7) Apply the patch >8) Repeat step 4 >9) Amount being paid and other calculations should now be correct >10) Enter an amount for 'Collected from patron' and click 'Confirm' > check that the change calculation is correct. >11) Sign-off the patch! > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index 6f87d8b510..ddc7ac15d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -323,7 +323,7 @@ > }, > "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { > var iTotal = aData[1] * aData[2]; >- this.fnUpdate( iTotal.format_price(), nRow, 3, false, false ); >+ this.fnUpdate( iTotal, nRow, 3, false, false ); > }, > "fnFooterCallback": function(nFoot, aData, iStart, iEnd, aiDisplay) { > var iTotalPrice = 0; >@@ -331,9 +331,7 @@ > { > iTotalPrice += aData[i][3]*1; > } >- >- iTotalPrice = Number.parseFloat(iTotalPrice).toFixed(2); >- nFoot.getElementsByTagName('td')[1].innerHTML = iTotalPrice; >+ nFoot.getElementsByTagName('td')[1].innerHTML = iTotalPrice.format_price(); > $('#paid').val(iTotalPrice); > $('#paid').trigger('change'); > } >-- >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 24482
:
97983
|
98058
|
98107
|
98582