Bug 24479

Summary: POS doesn't follow CurrencyFormat
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Fines and feesAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, jonathan.druart, martin.renvoize, sally.healey, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on: 22359, 23354    
Bug Blocks: 13985    
Attachments: Bug 24479: Use $Price filters for '0' amounts
Bug 24479: Use $Price filters for '0' amounts
Bug 24479: Use $Price filters for '0' amounts

Description Katrin Fischer 2020-01-22 07:31:50 UTC
There is some hardcoded stuff in the new POS feature that is wrong when another CurrencyFormat tha US is used:

<p>The change to give is <b><span id="modal_change">0.00</span></b>.</p>
<span id="change">0.00</span>
<input type="hidden" name="change" value="0.00"/>

This needs a thorough check and fix.
Comment 1 Martin Renvoize 2020-01-22 11:19:57 UTC
The points you've made apply equally to the change feature elsewhere and should be fixed there at the same time.
Comment 2 Katrin Fischer 2020-01-22 13:17:52 UTC
I am not sure I undertand - you are using the Price TT plugin in parts of the page, but when you get the confirmation message for change the value is not formatted.


<p>The change to give is <b><span id="modal_change">0.00</span></b>.</p>

I am not even sure why there is 0.00 in there - and the b span construct seems risky for translation.
Comment 3 Martin Renvoize 2020-03-02 11:33:39 UTC
Created attachment 99903 [details] [review]
Bug 24479: Use $Price filters for '0' amounts

This patch adds the use of the $Price TT filter to properly format '0'
amounts in the POS system.
Comment 4 Martin Renvoize 2020-03-02 17:19:10 UTC
Test plan
1) Change the Currency format preference
2) enter an amount equal to or less than the amount owed into the collected field in the point of sale page and note that on leaving the field it will be formatted as per the system preference.
Comment 5 PTFS Europe Sandboxes 2020-03-03 15:03:27 UTC
Created attachment 100037 [details] [review]
Bug 24479: Use $Price filters for '0' amounts

This patch adds the use of the $Price TT filter to properly format '0'
amounts in the POS system.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 6 Tomás Cohen Arazi 2020-03-04 12:06:30 UTC
Created attachment 100099 [details] [review]
Bug 24479: Use $Price filters for '0' amounts

This patch adds the use of the $Price TT filter to properly format '0'
amounts in the POS system.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Martin Renvoize 2020-03-04 14:54:31 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-04-01 21:16:27 UTC
not pushed to 19.11.x due to dependencies
Comment 9 Jonathan Druart 2020-07-30 13:26:22 UTC
+                                <input type="hidden" name="change" value="[% 0 | $Price %]"/>

I think this is not correct, $Price should not be used for hidden inputs.