@@ -, +, @@ and acquisitions - x100 or /100 of the amounts - decimal part truncation It will be done in a follow up patch. This one is already too huge to test. - get rid of the spaces, currency symbols, names (EUR) - by default comma and dot as decimal separators on the same instance - dot or comma as thousands separators if choose to use only one of them as decimal separator. See DigitSeparator syspref. staff://cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form previous versions, then try. You might spare librarian tears by finding something before it's released. spell won't work! The details of expressing your happinnes depends on your culture and habits. the conversion. Validating the form does the same but it's a trick to test more quickly by not changing the page. well handled. --- .../atomicupdate/bug12310_added_DigitSeparator.sql | 2 + installer/data/mysql/sysprefs.sql | 1 + .../prog/en/includes/price-conversion-message.inc | 14 +++++++ .../intranet-tmpl/prog/en/includes/prices.inc | 46 ++++++++++++++++++++++ .../prog/en/modules/admin/aqbudgetperiods.tt | 9 ++++- .../prog/en/modules/admin/aqbudgets.tt | 21 +++++++--- .../en/modules/admin/preferences/i18n_l10n.pref | 4 ++ .../prog/en/modules/members/mancredit.tt | 7 +++- .../prog/en/modules/members/maninvoice.tt | 7 +++- .../prog/en/modules/members/paycollect.tt | 29 +++----------- 10 files changed, 107 insertions(+), 33 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc --- a/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql +++ a/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql @@ -0,0 +1,2 @@ +INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES +('DigitSeparator', ',.', NULL , 'The separator between entire and decimal part', 'Free'); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -138,6 +138,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DefaultToLoggedInLibraryNoticesSlips', '0', NULL , 'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.', 'YesNo'), ('DefaultToLoggedInLibraryOverdueTriggers', '0', NULL , 'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.', 'YesNo'), ('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), +('DigitSeparator', '.,', NULL , 'The separator between entire and decimal part', 'Free'), ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','Choice'), ('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'), ('displayFacetCount','0',NULL,NULL,'YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc @@ -0,0 +1,14 @@ +[% USE Koha %] +[% INCLUDE 'prices.inc' %] + + + [% IF Koha.Preference('DigitSeparator') %]Please use any of the following character(s) "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX". + [% IF CAN_user_parameters %] + Edit Separator + [% END %] + [% ELSE %] + [% IF CAN_user_parameters %] + No Digit separator defined Chose one + [% END %] + [% END %] + --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc @@ -0,0 +1,46 @@ +[% USE Koha %] + --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -1,6 +1,8 @@ [% USE KohaDates %] [% USE Price %] +[% USE Koha %] [% SET footerjs = 1 %] + [%- BLOCK action_menu %] +[% INCLUDE 'prices.inc' %] [% MACRO jsinclude BLOCK %] [% END %] + [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -83,7 +83,7 @@
  • - +
  • @@ -150,7 +150,8 @@
  • - + + [% INCLUDE 'price-conversion-message.inc' %]
  • @@ -206,30 +207,10 @@ decFlag = true; } } + - if (dolAmount == "") { - dolAmount = "0"; - } - // Strip leading 0s - if (dolAmount.length > 1) { - while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") { - dolAmount = dolAmount.substring(1,dolAmount.length); - } - } - if (decAmount.length > 2) { - decAmount = decAmount.substring(0,2); - } - // Pad right side - if (decAmount.length == 1) { - decAmount = decAmount + "0"; - } - if (decAmount.length == 0) { - decAmount = decAmount + "00"; - } + [% INCLUDE 'prices.inc' %] - textObj.value = dolAmount + "." + decAmount; - } - [% END %] [% INCLUDE 'intranet-bottom.inc' %] --