Bug 16768

Summary: Add official number format for Switzerland: 1'234'567.89
Product: Koha Reporter: Marc Véron <veron>
Component: System AdministrationAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, jonathan.druart, katrin.fischer, kyle, mirko
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 16768 - Add official number format for Switzerland: 1'234'567.89
Bug 16768: Add tests for Swiss number format
Bug 16768 - Add official number format for Switzerland: 1'234'567.89
Bug 16768: Add tests for Swiss number format
Bug 16768: Update systempreferences.options (additional value CH)
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc)
Bug 16768: Update systempreferences.options (additional value CH)
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc)
Bug 16768 - Add official number format for Switzerland: 1'234'567.89
Bug 16768: Add tests for Swiss number format
Bug 16768: Update systempreferences.options (additional value CH)
Bug 16768: (followup) Add Swiss format for datatables (format_price.inc)
Bug 16768: Update options in sysprefs.sql

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!