Bug 37563 - Refund, payout, and discount modals in patron transactions and point of sale have broken/bad formatting of values
Summary: Refund, payout, and discount modals in patron transactions and point of sale ...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Point of Sale (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: CJ Lynce
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-02 19:03 UTC by Barbara Johnson
Modified: 2024-11-18 18:51 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Refund modal for amount of 25.00 (14.01 KB, image/png)
2024-08-02 19:04 UTC, Barbara Johnson
Details
Refund amount for 2.40 (14.64 KB, image/png)
2024-08-02 19:04 UTC, Barbara Johnson
Details
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values (5.87 KB, patch)
2024-08-04 20:42 UTC, CJ Lynce
Details | Diff | Splinter Review
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values (5.93 KB, patch)
2024-08-05 16:03 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values (6.00 KB, patch)
2024-08-21 08:39 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barbara Johnson 2024-08-02 19:03:52 UTC
When issuing a refund from the transaction history page in the POS module the refund modal does not display ending zeros for amounts in the 'Amount paid' and 'Returned to patron' fields.

Payments like 25.00 or 2.40 will display as 25 or 2.4 in the modal.
Comment 1 Barbara Johnson 2024-08-02 19:04:36 UTC
Created attachment 170021 [details]
Refund modal for amount of 25.00
Comment 2 Barbara Johnson 2024-08-02 19:04:59 UTC
Created attachment 170022 [details]
Refund amount for 2.40
Comment 3 CJ Lynce 2024-08-04 20:31:17 UTC
In testing this issue, I also found that the Borrower -> Accounting -> Refund, Discount, and Payout modals have the same decimal place issue, plus a slew of other behavior issues, including similar to Bug 36998, as well as missing display of data, etc. I have a patch incoming that corrects all of these issues.

I updated the bug title to incorporate all of the related issues in both POS and member modules.
Comment 4 CJ Lynce 2024-08-04 20:42:05 UTC
Created attachment 170045 [details] [review]
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
Comment 5 ByWater Sandboxes 2024-08-05 16:03:07 UTC
Created attachment 170074 [details] [review]
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>
Comment 6 Barbara Johnson 2024-08-05 16:04:19 UTC
All seemed correct to me so I am celebrating seeing formatted amounts for money!
Comment 7 Martin Renvoize (ashimema) 2024-08-21 08:39:35 UTC
Created attachment 170536 [details] [review]
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>
Comment 8 Martin Renvoize (ashimema) 2024-08-21 08:39:58 UTC
Thanks for the fixes here, Passing QA
Comment 9 Katrin Fischer 2024-08-21 16:49:28 UTC
(In reply to Barbara Johnson from comment #6)
> All seemed correct to me so I am celebrating seeing formatted amounts for
> money!

Celebrating with Barbara, thanks CJ :)
Comment 10 Katrin Fischer 2024-08-22 14:47:34 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Lucas Gass (lukeg) 2024-11-18 18:51:58 UTC
Doesn't apply cleanly to 24.05.x, please rebase if needed.