Bug 16768 - Add official number format for Switzerland: 1'234'567.89
Summary: Add official number format for Switzerland: 1'234'567.89
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-18 07:29 UTC by Marc Véron
Modified: 2017-06-14 22:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16768 - Add official number format for Switzerland: 1'234'567.89 (2.17 KB, patch)
2016-06-18 07:38 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16768: Add tests for Swiss number format (2.06 KB, patch)
2016-06-18 08:33 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16768 - Add official number format for Switzerland: 1'234'567.89 (2.22 KB, patch)
2016-06-18 08:53 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 16768: Add tests for Swiss number format (2.11 KB, patch)
2016-06-18 08:54 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 16768: Update systempreferences.options (additional value CH) (1.02 KB, patch)
2016-06-18 15:33 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc) (1.33 KB, patch)
2016-06-18 15:58 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16768: Update systempreferences.options (additional value CH) (1.07 KB, patch)
2016-06-18 16:36 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc) (1.38 KB, patch)
2016-06-18 16:36 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 16768 - Add official number format for Switzerland: 1'234'567.89 (2.29 KB, patch)
2016-06-19 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16768: Add tests for Swiss number format (2.19 KB, patch)
2016-06-19 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16768: Update systempreferences.options (additional value CH) (1.14 KB, patch)
2016-06-19 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc) (1.46 KB, patch)
2016-06-19 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16768: Update options in sysprefs.sql (1.78 KB, patch)
2016-06-19 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2016-06-18 07:29:18 UTC
Add the official number format for Switzerland ( 1'234'567.89 ) and make it selectable in system preferenc 'CurrencyFormat'.
Comment 1 Marc Véron 2016-06-18 07:38:54 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-06-18 08:33:32 UTC Comment hidden (obsolete)
Comment 3 Mirko Tietgen 2016-06-18 08:53:44 UTC Comment hidden (obsolete)
Comment 4 Mirko Tietgen 2016-06-18 08:54:37 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-06-18 14:37:47 UTC
Marc, please update the systempreferences.options as well.
Comment 6 Jonathan Druart 2016-06-18 14:41:09 UTC
koha-tmpl/intranet-tmpl/prog/en/includes/format_price.inc should be updated.
Comment 7 Jonathan Druart 2016-06-18 14:42:34 UTC
And have a look at
  git grep CurrencyFormat acqui/addorderiso2709.pl C4/Biblio.pm
Comment 8 Marc Véron 2016-06-18 15:33:06 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2016-06-18 15:47:51 UTC
(In reply to Jonathan Druart from comment #7)
> And have a look at
>   git grep CurrencyFormat acqui/addorderiso2709.pl C4/Biblio.pm
Thanks for the hint!

However, at both places the decimal separator '.' is replaced by a ',' for the French format. Swiss format uses '.', so no changes needed here.
Comment 10 Marc Véron 2016-06-18 15:58:58 UTC Comment hidden (obsolete)
Comment 11 Marc Véron 2016-06-18 16:08:27 UTC
Test plan for format_price.inc:
- Go to  Home: Administration: Budgets administration 
- Verify that numbers appear as appropriate.
Comment 12 Mirko Tietgen 2016-06-18 16:36:17 UTC Comment hidden (obsolete)
Comment 13 Mirko Tietgen 2016-06-18 16:36:20 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2016-06-19 10:44:30 UTC
Created attachment 52527 [details] [review]
Bug 16768 - Add official number format for Switzerland: 1'234'567.89

This patch adds the official number format for Switzerland (CH) and makes
it selectable in syspref 'CurrencyFormat'

To test:
- Apply patch
- Set syspref 'CurrencyFormat' to '360'000.00 (CH)'
- Go to Home > Administration > Budgets administration
- Create or edit a budget with Total amount of 1234567.89
- Verify that the amount appears properly formated as 1'234'567.89

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Jonathan Druart 2016-06-19 10:44:33 UTC
Created attachment 52528 [details] [review]
Bug 16768: Add tests for Swiss number format

Testplan:
- Apply patch
- Run t/Number/Price.t

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2016-06-19 10:44:37 UTC
Created attachment 52529 [details] [review]
Bug 16768: Update systempreferences.options (additional value CH)

As of comment #5, adding file
installer/data/mysql/atomicupdate/bug_Bug_16768_official_number_format_switzerland.sql

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Jonathan Druart 2016-06-19 10:44:41 UTC
Created attachment 52530 [details] [review]
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc)

This patch adds CH price format to:
koha-tmpl/intranet-tmpl/prog/en/includes/format_price.inc
(as of comment #6)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2016-06-19 10:44:45 UTC
Created attachment 52531 [details] [review]
Bug 16768: Update options in sysprefs.sql

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Kyle M Hall 2016-06-24 14:04:17 UTC
Pushed to master for 16.11, thanks Marc, Jonathan!