Bug 41688

Summary: Refund modal and amount as NaN, rejected comma separator
Product: Koha Reporter: Thibaud Guillot (thibaud_g) <thibaud.guillot>
Component: Point of SaleAssignee: Bugs List <koha-bugs>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: david, fridolin.somers, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31513
GIT URL: Initiative type: ---
Sponsorship status: Sponsored Comma delimited list of Sponsors: BibLibre
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41688: Fix NaN display in POS refund modal
Bug 41688: Fix NaN display in POS refund modal
Bug 41688: Fix NaN display in POS refund modal
Bug 41688: Fix NaN display in POS refund modal
Screenshot - refund modal formatting

Description Thibaud Guillot (thibaud_g) 2026-01-22 15:45:35 UTC
Hello @ll

The problem here is on the refund modal, when retrieving the default value before being modified it is NaN because in some cases for decimal separators with comma, the recovery fails due to formatting a value already formatted in js.

After a quick search I think it's a return of bug 31513 fix
Comment 1 Thibaud Guillot (thibaud_g) 2026-01-22 15:54:53 UTC Comment hidden (obsolete)
Comment 2 Thibaud Guillot (thibaud_g) 2026-01-22 15:56:39 UTC Comment hidden (obsolete)
Comment 3 Fridolin Somers 2026-02-02 10:58:21 UTC
Oh this removes "$Price" filter.
Needs to be replaced by "html" filter right ?
Comment 4 Thibaud Guillot (thibaud_g) 2026-02-02 15:56:45 UTC
Created attachment 192333 [details] [review]
Bug 41688: Fix NaN display in POS refund modal

Test plan:

Prerequisites: CurrencyFormat as 'FR' activated, have already produced a payment (with a comma separator)

1. Go to POS > register > transaction history
2. Click "Issue refund" on any paid transaction
3. Verify "Amount paid" shows correct amount (not NaN but get the value
   with comma separator)
4. Enter refund amount (point separator is mandatory to valid input)
5. Verify no validation error occurs
6. Process refund successfully

Sponsored-by: BibLibre
Comment 5 Thibaud Guillot (thibaud_g) 2026-02-02 15:57:32 UTC
(In reply to Fridolin Somers from comment #3)
> Oh this removes "$Price" filter.
> Needs to be replaced by "html" filter right ?

Yes Fred.. my bad :)
Fixed !
Comment 6 David Nind 2026-02-06 07:36:15 UTC
Created attachment 192584 [details] [review]
Bug 41688: Fix NaN display in POS refund modal

Test plan:

Prerequisites: CurrencyFormat as 'FR' activated, have already produced a payment (with a comma separator)

1. Go to POS > register > transaction history
2. Click "Issue refund" on any paid transaction
3. Verify "Amount paid" shows correct amount (not NaN but get the value
   with comma separator)
4. Enter refund amount (point separator is mandatory to valid input)
5. Verify no validation error occurs
6. Process refund successfully

Sponsored-by: BibLibre
Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2026-02-06 07:38:54 UTC
Created attachment 192585 [details]
Screenshot - refund modal formatting

Just attaching a screenshot of the refund form - not sure if it is this bug, but it may need some formatting changes to make it "tidy".
Comment 8 David Nind 2026-02-06 07:39:41 UTC
NaN = Not a Number