Bug 20395

Summary: Use Price formatter in more templates (paycollect, request, parcel, smart-rules)
Product: Koha Reporter: paxed <pasi.kallinen>
Component: TemplatesAssignee: paxed <pasi.kallinen>
Status: CLOSED FIXED QA Contact:
Severity: trivial    
Priority: P5 - low CC: arthur.suzuki, josef.moravec, katrin.fischer, lucas, martin.renvoize, mtompset, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22112
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Bug Depends on:    
Bug Blocks: 32271    
Attachments: Bug 20395: Change paycollect to use Price formatter
Bug 20395: Followup to change format to use price filter
Bug 20395: Change paycollect to use Price formatter
Bug 20395: Followup to change format to use price filter
Bug 20395: Change paycollect to use Price formatter
Bug 20395: Followup to change format to use price filter
Bug 20395: (follow-up) Change format to use price filter

Description paxed 2018-03-14 06:46:14 UTC
paycollect.tt still uses format('%.2f') instead of $Price
Comment 1 Josef Moravec 2018-03-14 14:21:35 UTC
And also these templates are using it too:

acqui/parcel.tt
admin/smart-rules.tt
reserve/request.tt
Comment 2 paxed 2018-03-15 07:43:37 UTC
Created attachment 72903 [details] [review]
Bug 20395: Change paycollect to use Price formatter
Comment 3 Mark Tompsett 2018-03-15 15:49:23 UTC
Confirmed Josef's comment with:
git grep "format(['\"]%.2f['\"])" | grep [.]tt:

git show 3910d5e8b
I believe the best course of action for the currency line is to cut it.
Comment 4 Mark Tompsett 2018-03-15 16:13:04 UTC
Created attachment 72976 [details] [review]
Bug 20395: Followup to change format to use price filter

See comment #1.
Comment 5 Roch D'Amour 2018-03-16 18:22:04 UTC
Created attachment 73057 [details] [review]
Bug 20395: Change paycollect to use Price formatter

Test plan:
1) Apply patch
2) Go to Home -> Patrons -> Patron details (for any patron)
3) Create manual invoice for the patron
4) Pay fines -> Pay -button
5) Check that the currency values look correct

6) Pay fines -> Pay amount -button
7) Check that the currency values look correct

8) Pay fines -> Pay selected -button
9) Check that the currency values look correct

10) Change the CurrencyFormat setting
11) Repeat 2-9

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Comment 6 Roch D'Amour 2018-03-16 18:22:52 UTC
Created attachment 73058 [details] [review]
Bug 20395: Followup to change format to use price filter

See comment #1.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Comment 7 Katrin Fischer 2018-03-20 20:42:50 UTC
Hi Josef and others - I think fixing one file here is ok and easier to test. Let's move the others to separate bugs?
Comment 8 Katrin Fischer 2018-03-20 20:52:42 UTC
... Hm, missed the patch was already done. We should change the title in that case.
Comment 9 Katrin Fischer 2018-03-20 21:05:30 UTC
The change on smart rules is incomplete, the fine amount still doesn't use the formatter, so we are getting a mixed display. can you please fix?

Everything else appears to work nicely.
Comment 10 Mark Tompsett 2018-03-21 06:03:08 UTC
(In reply to Katrin Fischer from comment #9)
> The change on smart rules is incomplete, the fine amount still doesn't use
> the formatter, so we are getting a mixed display. can you please fix?

Anything that was formatted has been fixed already. Are you finding a different bug?
Comment 11 Katrin Fischer 2018-03-21 06:04:52 UTC
It might look a little different in the code, but I think still worth fixing as with this patches we have a formatted value appearing right next to an unformatted value.
Comment 12 Martin Renvoize 2022-06-24 10:14:07 UTC
Created attachment 136484 [details] [review]
Bug 20395: Change paycollect to use Price formatter

Test plan:
1) Apply patch
2) Go to Home -> Patrons -> Patron details (for any patron)
3) Create manual invoice for the patron
4) Pay fines -> Pay -button
5) Check that the currency values look correct

6) Pay fines -> Pay amount -button
7) Check that the currency values look correct

8) Pay fines -> Pay selected -button
9) Check that the currency values look correct

10) Change the CurrencyFormat setting
11) Repeat 2-9

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2022-06-24 10:14:11 UTC
Created attachment 136485 [details] [review]
Bug 20395: Followup to change format to use price filter

See comment #1.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2022-06-24 10:15:19 UTC
Wow, can't believe this is still the case.. all sorted now and rebased.

Passing QA
Comment 15 Tomás Cohen Arazi 2022-06-24 14:35:48 UTC
Created attachment 136503 [details] [review]
Bug 20395: (follow-up) Change format to use price filter

See comment #1.

Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 16 Tomás Cohen Arazi 2022-06-24 14:37:54 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 17 Lucas Gass 2022-07-29 15:52:00 UTC
Backported to 22.05.x for 22.05.04
Comment 18 Arthur Suzuki 2022-08-11 09:19:38 UTC
backported to 21.11.x for 21.11.11
Comment 19 Victor Grousset/tuxayo 2022-08-13 16:08:02 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.