@@ -, +, @@
to the good format
- you create a Budget (Administration->Budget)
- you write a fine (Circulation->[select a Borrower]->new fine )
- you pay an existing fine
- anything you want
- a , or a . as separator (both are default)
- change the syspref DigitSeparator into the separator you with and check again
ex : XXX,XXX,XXX.XX => .
XXX XXX XXX,XX => ,. or ,
XXX XXX XXX.XX => ,. or .
The string is immediately changed after you change the field
---
.../atomicupdate/bug12310_added_DigitSeparator.sql | 2 +
installer/data/mysql/sysprefs.sql | 1 +
.../intranet-tmpl/prog/en/includes/prices.inc | 25 +++++++
.../prog/en/modules/admin/aqbudgetperiods.tt | 26 +++++++-
.../en/modules/admin/preferences/i18n_l10n.pref | 4 ++
.../prog/en/modules/members/maninvoice.tt | 30 ++++++++-
.../prog/en/modules/members/paycollect.tt | 78 +++++++++-------------
7 files changed, 117 insertions(+), 49 deletions(-)
create mode 100644 installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql
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
@@ -135,6 +135,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/prices.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc
@@ -0,0 +1,25 @@
+[% 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,5 +1,6 @@
[% USE KohaDates %]
[% USE Price %]
+[% USE Koha %]
[%- BLOCK action_menu %]
@@ -27,6 +28,7 @@
[% END -%]
[% INCLUDE 'doc-head-open.inc' %]
+[% INCLUDE 'prices.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
@@ -66,6 +68,25 @@
alert(alertString);
}
}
+ function CheckTot(f){
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+ if (!(isPrice(f.value))) {
+ _alertString += "\n- " + _("Amount must be a valid number, or empty");
+ }else{
+ f.value=Price_from_string(f.value);
+ }
+ if (_alertString.length==0) {
+ return true;
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ return false;
+ }
+ }
function Check(f) {
var ok=1;
var _alertString="";
@@ -356,7 +377,8 @@
+ size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" />
+ Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX"
+<<<<<<< 16ee11980e3d1f0c5cbd3650d3a90b7d00d971e4
+=======
+
+>>>>>>> BUG 12310 : Modified scripts in order to convert any string to the good format
@@ -211,7 +192,12 @@ function moneyFormat(textObj) {
+<<<<<<< 16ee11980e3d1f0c5cbd3650d3a90b7d00d971e4
+=======
+
+ Please use the "[% Koha.Preference('DigitSeparator') %]" as separator : ex "XX[% Koha.Preference('DigitSeparator') %]XX"
+>>>>>>> BUG 12310 : Modified scripts in order to convert any string to the good format