Bugzilla – Attachment 170536 Details for
Bug 37563
Refund, payout, and discount modals in patron transactions and point of sale have broken/bad formatting of values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values
Bug-37563-Refund-payout-and-discount-modals-in-bor.patch (text/plain), 6.00 KB, created by
Martin Renvoize (ashimema)
on 2024-08-21 08:39:35 UTC
(
hide
)
Description:
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-08-21 08:39:35 UTC
Size:
6.00 KB
patch
obsolete
>From 10779ab71c0b727100528eeccb77addbe4627327 Mon Sep 17 00:00:00 2001 >From: CJ Lynce <cj.lynce@westlakelibrary.org> >Date: Sun, 4 Aug 2024 20:33:51 +0000 >Subject: [PATCH] Bug 37563: Refund, payout, and discount modals in borrower > transactions and Point of Sale have broken/bad formatting of values > >This patch corrects formatting of amounts in both the POS and member > accounting module Payment, Discount, and Payout modals. >It also corrects an issue where amounts of a previous modal show up > when clicking on the same modal for a different accountline > the member Accounting page. >Finally, it corrects an issue with the member Accounting Discount > modal in that an amount without both decimal places will not > display. > >Steps to test: >1) Login to staff client >2) Enable the 'EnablePointOfSale' system preference >3) Enable the 'UseCashRegisters' system preference >4) Open POS module and configure a cash register >5) In the POS module -> 'Configure items for purchase', create some > items with different costs (divisible by .10, e.g 25 or 1.10, etc.)) >6) Use the POS module to make a few transactions >7) Open POS -> 'Cash Summary for [BRANCH]', and open your configured > register >8) Click 'Issue Refund' and check the formatting of the paid and > returned to patron numbers >*** Issue A) See that numbers are not formatted with two decimal places >9) Pull up the 'Accounting' tab for a borrower >10) Create at least 3 invoices for different amounts (divisible by .10, > e.g 25 or 1.10, etc.) >11) Pay TWO of your invoices then open the 'Transactions' tab >12) Create a manual credit for an amount (divisible by .10, e.g 25 or > 1.10, etc.) >13) Click the 'Apply discount' button on one of your invoices >*** Issue B) No 'Amount charged' appears >14) Click 'Issue refund' for one of the paid invoices. >*** Issue C) The 'Return to Patron' line does not have 2 decimal places >15) Click 'Issue refund' for another paid invoice >*** Issue D) The 'Amount Paid' shows the amount from the first modal >16) Click 'Apply discount' for one of the unpaid invoices >*** Issue E) The 'Amount charged' line is blank >*** Issue F) The discount line is also blank, should at least have a > 0.00 value >17) Click 'Issue Payout' for your manual credit. >*** Issue G) The 'Return to Patron' line does not have 2 decimal places >18) Apply patch >19) Repeat steps 7 & 8 and check the formatting is correct for issue A >20) Repeat steps 13-17 and check behavior and formatting is correct > for issues B-G >21) Celebrate that you are done with all the steps and looking at > numbers, and that all is right in the Koha payment world (maybe) > >Sponsored by: Westlake Porter Public Library >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/members/boraccount.tt | 14 +++++++------- > .../intranet-tmpl/prog/en/modules/pos/register.tt | 4 ++-- > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index 5ed00b06f3d..ae9a4aba99f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -439,8 +439,8 @@ > var accountline = button.data('accountline'); > $('#payoutline').val(accountline); > var amount = button.data('amount') * -1; >- $("#paid + span").replaceWith(amount.format_price()); >- $("#amount").attr({ "value": amount, "max": amount, "min": 0 }); >+ $("#paid + span").text(amount.format_price()); >+ $("#amount").attr({ "value": amount.format_price(), "max": amount, "min": 0 }); > $("#amount, #payout_transaction_type").focus(); > }); > >@@ -453,8 +453,8 @@ > var amount = button.data('amount'); > var amountoutstanding = button.data('amountoutstanding') || 0; > var paid = amount - amountoutstanding; >- $("#paid + span").replaceWith(paid.format_price()); >- $("#returned").attr({ "value": paid, "max": paid, "min": 0 }); >+ $("#paid + span").text(paid.format_price()); >+ $("#returned").attr({ "value": paid.format_price(), "max": paid.format_price(), "min": 0 }); > var member = button.data('member'); > if ( member === '' ) { > $("#refund_type option[value='AC']").remove(); >@@ -470,9 +470,9 @@ > $("#item + span").replaceWith(item); > var accountline = button.data('accountline'); > $('#discountline').val(accountline); >- var amount = button.data('amount'); >- $("#charged + span").replaceWith(amount.format_price()); >- $("#discount").attr({ "max": amount, "min": 0 }); >+ var amountoutstanding = button.data('amountoutstanding'); >+ $("#charged + span").text(amountoutstanding); >+ $("#discount").attr({ "value": (0).format_price(), "max": amountoutstanding, "min": 0 }); > $("#discount").focus(); > }); > >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 7d59f35a63f..81de56160bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -413,8 +413,8 @@ > var amount = button.data('amount'); > var amountoutstanding = button.data('amountoutstanding') || 0; > var paid = amount - amountoutstanding; >- $("#paid + span").text(paid); >- $("#returned").attr({ "value": paid, "max": paid }); >+ $("#paid + span").text(paid.format_price()); >+ $("#returned").attr({ "value": paid.format_price(), "max": paid }); > var member = button.data('member'); > if ( member === '' ) { > $("#refund_type option[value='AC']").remove(); >-- >2.46.0
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 37563
:
170021
|
170022
|
170045
|
170074
| 170536