View | Details | Raw Unified | Return to bug 12310
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('DigitSeparator',  ',.', NULL ,  'The separator between entire and decimal part',  'Free');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 138-143 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
138
('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'),
138
('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'),
139
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
139
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
140
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
140
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
141
('DigitSeparator',  '.,', NULL ,  'The separator between entire and decimal part',  'Free'),
141
('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'),
142
('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'),
142
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
143
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
143
('displayFacetCount','0',NULL,NULL,'YesNo'),
144
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc (+14 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'prices.inc' %]
3
4
    <span class="hint">
5
        [% 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".</span>
6
            [% IF CAN_user_parameters %]
7
                <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Edit Separator </a>
8
            [% END %]
9
        [% ELSE %]
10
            [% IF CAN_user_parameters %]
11
                No Digit separator defined <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Chose one</a>
12
            [% END %]
13
       [% END %]
14
    </span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc (+25 lines)
Line 0 Link Here
1
[% USE Koha %]
2
<script type="text/javascript">
3
//<![CDATA[
4
5
function isPrice(string){
6
    var reg ="[% Koha.Preference('DigitSeparator') %]";
7
    reg = "[0-9]{1,}(["+reg+"][0-9]{1,}|)";
8
    var prix = new RegExp(reg);
9
    if (!prix.test(string)) {
10
        return false;
11
    }
12
    return true;
13
}
14
15
function Price_from_string(string){
16
    if (!isPrice(string)) {
17
        return false;
18
    }
19
    string = string.replace(/[^0-9[% Koha.Preference('DigitSeparator') %]]/g, '');
20
    string = string.replace(/[[% Koha.Preference('DigitSeparator') %]]/g, '.');
21
    return string;
22
}
23
24
//]]>
25
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-2 / +27 lines)
Lines 1-6 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Price %]
2
[% USE Price %]
3
[% USE Koha %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
5
4
[%- BLOCK action_menu %]
6
[%- BLOCK action_menu %]
5
    <div class="dropdown">
7
    <div class="dropdown">
6
        <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
8
        <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
Lines 33-38 Link Here
33
[% END -%]
35
[% END -%]
34
36
35
[% INCLUDE 'doc-head-open.inc' %]
37
[% INCLUDE 'doc-head-open.inc' %]
38
[% INCLUDE 'prices.inc' %]
36
[% INCLUDE 'doc-head-close.inc' %]
39
[% INCLUDE 'doc-head-close.inc' %]
37
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
40
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
38
[% IF close_form %]
41
[% IF close_form %]
Lines 221-227 Link Here
221
        <!-- ############################## -->
224
        <!-- ############################## -->
222
        <label for="budget_period_total">Total amount: </label>
225
        <label for="budget_period_total">Total amount: </label>
223
        <input type="text" id="budget_period_total" name="budget_period_total"
226
        <input type="text" id="budget_period_total" name="budget_period_total"
224
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
227
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" />
228
        [% INCLUDE 'price-conversion-message.inc' %]
225
    </li>
229
    </li>
226
230
227
    <li>
231
    <li>
Lines 243-249 Link Here
243
    <fieldset class="action">
247
    <fieldset class="action">
244
        <!-- "save changes" button -->
248
        <!-- "save changes" button -->
245
        <!-- ###################################### -->
249
        <!-- ###################################### -->
246
        <input type="button" value="Save"  onclick="Check(this.form)" />
250
        <input type="button" value="Save" onclick="Check(this.form)" />
247
        <!--             <input type="submit" value="Save Changes"  />  -->
251
        <!--             <input type="submit" value="Save Changes"  />  -->
248
        [% IF ( budget_period_id ) %]
252
        [% IF ( budget_period_id ) %]
249
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
253
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
Lines 528-533 Link Here
528
              alert(alertString);
532
              alert(alertString);
529
            }
533
            }
530
        }
534
        }
535
536
        function CheckTot(f){
537
            var ok=1;
538
            var _alertString="";
539
            var alertString2;
540
            if (!(isPrice(f.value))) {
541
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
542
            }else{
543
            f.value=Price_from_string(f.value);
544
            }
545
            if (_alertString.length==0) {
546
                return true;
547
            } else {
548
                alertString2  = _("Form not submitted because of the following problem(s)");
549
                alertString2 += "\n------------------------------------------------------------------------------------\n";
550
                alertString2 += _alertString;
551
                alert(alertString2);
552
                return false;
553
            }
554
        }
555
531
        function Check(f) {
556
        function Check(f) {
532
            var ok=1;
557
            var ok=1;
533
            var _alertString="";
558
            var _alertString="";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-5 / +36 lines)
Lines 1-6 Link Here
1
[% USE AuthorisedValues %]
1
[% USE AuthorisedValues %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE Price %]
3
[% USE Price %]
4
[% USE Koha %]
4
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
7
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
Lines 232-237 Link Here
232
    <li>
233
    <li>
233
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
234
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
234
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
235
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
236
        [% INCLUDE 'price-conversion-message.inc' %]
235
    </li>
237
    </li>
236
238
237
    <li>
239
    <li>
Lines 241-249 Link Here
241
    </li>
243
    </li>
242
244
243
    <li>
245
    <li>
244
      <label for="budget_expend">Warning at (amount): </label>
246
    <label for="budget_expend">Warning at (amount): </label>
245
      <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
247
    <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
246
      <span class="hint">0 to disable</span>
248
249
    <span class="hint">0 to disable.</span>
250
        [% INCLUDE 'price-conversion-message.inc' %]
251
247
    </li>
252
    </li>
248
253
249
    <li>
254
    <li>
Lines 449-454 Link Here
449
454
450
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
455
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
451
    [% IF op == 'add_form' %]
456
    [% IF op == 'add_form' %]
457
        [% INCLUDE 'prices.inc' %]
452
        <script type="text/javascript">
458
        <script type="text/javascript">
453
        //<![CDATA[
459
        //<![CDATA[
454
460
Lines 563-569 Link Here
563
                    }
569
                    }
564
                }
570
                }
565
571
566
                 // else do lookup
572
                // else do lookup
567
                var budgetTotal = Math.abs(f.budget_amount.value);
573
                var budgetTotal = Math.abs(f.budget_amount.value);
568
                var result =   budgetExceedsParent  (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
574
                var result =   budgetExceedsParent  (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
569
                if (result) {
575
                if (result) {
Lines 579-585 Link Here
579
                    alert(alertString2);
585
                    alert(alertString2);
580
                }
586
                }
581
            }
587
            }
588
589
582
            $(document).ready(function(){
590
            $(document).ready(function(){
591
                $('#budget_expend').on('change', function(){CheckAmount(this)});
592
                $('#budget_amount').on('change', function(){CheckAmount(this)});
593
                function CheckAmount(f){
594
                    var ok=1;
595
                    var _alertString="";
596
                    var alertString2;
597
                    if (!(isPrice(f.value))) {
598
                        _alertString += "\n- " + _("Amount must be a valid number, or empty");
599
                    }else{
600
                        f.value=Price_from_string(f.value);
601
602
                    }
603
                    if (_alertString.length==0) {
604
                        return true;
605
                    } else {
606
                        alertString2  = _("Form not submitted because of the following problem(s)");
607
                        alertString2 += "\n------------------------------------------------------------------------------------\n";
608
                        alertString2 += _alertString;
609
                        alert(alertString2);
610
                        return false;
611
                    }
612
                }
613
583
                $("#remove_owner").on("click",function(e){
614
                $("#remove_owner").on("click",function(e){
584
                    e.preventDefault();
615
                    e.preventDefault();
585
                    ownerRemove();
616
                    ownerRemove();
Lines 692-696 Link Here
692
        //]]>
723
        //]]>
693
        </script>
724
        </script>
694
    [% END %]
725
    [% END %]
695
[% END %]
726
[% END %][%# end of MACRO jsinclude %]
696
[% INCLUDE 'intranet-bottom.inc' %]
727
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref (+4 lines)
Lines 66-68 I18N/L10N: Link Here
66
              no: "Don't allow"
66
              no: "Don't allow"
67
        - notices to be translated.
67
        - notices to be translated.
68
        - If set, notices will be translatable from the "Notices and Slips" interface. The language used to send a notice to a patron will be the one defined for the patron.
68
        - If set, notices will be translatable from the "Notices and Slips" interface. The language used to send a notice to a patron will be the one defined for the patron.
69
    -
70
        - "Any of this characters can be used as separator between integer or decimal part in the price fields. It you want to format price output, please use the system preference 'CurrencyFormat'"
71
        - pref: DigitSeparator
72
          class: long
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-1 / +25 lines)
Lines 3-8 Link Here
3
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'prices.inc' %]
6
</head>
7
</head>
7
8
8
<body id="pat_mancredit" class="pat">
9
<body id="pat_mancredit" class="pat">
Lines 40-46 Link Here
40
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
41
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
41
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
42
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
42
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
43
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
43
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
44
    <li><label for="amount">Amount: </label><input name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00
45
        [% INCLUDE 'price-conversion-message.inc' %]
46
    </li>
47
44
</ol></fieldset>
48
</ol></fieldset>
45
49
46
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
50
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
Lines 62-67 Link Here
62
        $(document).ready(function(){
66
        $(document).ready(function(){
63
            $('#mancredit').preventDoubleFormSubmit();
67
            $('#mancredit').preventDoubleFormSubmit();
64
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
68
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
69
            $('#amount').on('change', function(){Check(this)});
70
            function Check(f){
71
                var ok=1;
72
                var _alertString="";
73
                var alertString2;
74
                if (!(isPrice(f.value))) {
75
                    _alertString += "\n- " + _("Amount must be a valid number, or empty");
76
                } else {
77
                    f.value=Price_from_string(f.value);
78
                }
79
                if (_alertString.length==0) {
80
                    return true;
81
                } else {
82
                    alertString2  = _("Error: ");
83
                    alertString2 += "\n------------------------------------------------------------------------------------\n";
84
                    alertString2 += _alertString;
85
                    alert(alertString2);
86
                    return false;
87
                }
88
            }
65
        });
89
        });
66
    </script>
90
    </script>
67
[% END %]
91
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-1 / +28 lines)
Lines 53-59 Link Here
53
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
53
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
54
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
54
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
55
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
55
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
56
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
56
    <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" required="required"/>
57
        [% INCLUDE 'price-conversion-message.inc' %]
58
    </li>
57
	</ol></fieldset>
59
	</ol></fieldset>
58
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
60
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
59
</form>
61
</form>
Lines 87-90 Link Here
87
    </script>
89
    </script>
88
[% END %]
90
[% END %]
89
91
92
93
[% INCLUDE 'prices.inc' %]
94
<script type="text/javascript">
95
$('#amount').on('change', function(){Check(this)});
96
function Check(f){
97
    var ok=1;
98
    var _alertString="";
99
    var alertString2;
100
    if (!(isPrice(f.value))) {
101
        _alertString += "\n- " + _("Amount must be a valid number, or empty");
102
    }else{
103
        f.value=Price_from_string(f.value);
104
    }
105
    if (_alertString.length==0) {
106
        return true;
107
    } else {
108
        alertString2  = _("Form not submitted because of the following problem(s)");
109
        alertString2 += "\n------------------------------------------------------------------------------------\n";
110
        alertString2 += _alertString;
111
        alert(alertString2);
112
        return false;
113
    }
114
}
115
</script>
116
90
[% INCLUDE 'intranet-bottom.inc' %]
117
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-24 / +25 lines)
Lines 83-89 Link Here
83
    <li>
83
    <li>
84
        <label for="paid">Collect from patron: </label>
84
        <label for="paid">Collect from patron: </label>
85
            <!-- default to paying all -->
85
            <!-- default to paying all -->
86
        <input name="paid" id="paid" value="[% amountoutstanding %]" />
86
        <input name="paid" id="paid" value="[% amountoutstanding %]" onchange="Check(document.payindivfine.paid)"/>
87
    </li>
87
    </li>
88
</ol>
88
</ol>
89
</fieldset>
89
</fieldset>
Lines 150-156 Link Here
150
    <li>
150
    <li>
151
        <label for="paid">Collect from patron: </label>
151
        <label for="paid">Collect from patron: </label>
152
        <!-- default to paying all -->
152
        <!-- default to paying all -->
153
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
153
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="Check(document.payfine.paid)"/>
154
        [% INCLUDE 'price-conversion-message.inc' %]
154
    </li>
155
    </li>
155
    <li>
156
    <li>
156
        <label for="selected_accts_notes">Note: </label>
157
        <label for="selected_accts_notes">Note: </label>
Lines 206-235 Link Here
206
                    decFlag = true;
207
                    decFlag = true;
207
                }
208
                }
208
            }
209
            }
209
210
        </script>
210
            if (dolAmount == "") {
211
211
                dolAmount = "0";
212
        [% INCLUDE 'prices.inc' %]
212
            }
213
213
        // Strip leading 0s
214
        <script type="text/javascript">
214
            if (dolAmount.length > 1) {
215
        function Check(f){
215
                while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
216
            var ok=1;
216
                    dolAmount = dolAmount.substring(1,dolAmount.length);
217
            var _alertString="";
217
                }
218
            var alertString2;
219
            if (!(isPrice(f.value))) {
220
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
221
            }else{
222
                f.value=Price_from_string(f.value);
218
            }
223
            }
219
            if (decAmount.length > 2) {
224
            if (_alertString.length==0) {
220
                decAmount = decAmount.substring(0,2);
225
                return true;
226
            } else {
227
                alertString2  = _("Form not submitted because of the following problem(s)");
228
                alertString2 += "\n------------------------------------------------------------------------------------\n";
229
                alertString2 += _alertString;
230
                alert(alertString2);
231
                return false;
221
            }
232
            }
222
        // Pad right side
223
            if (decAmount.length == 1) {
224
               decAmount = decAmount + "0";
225
            }
226
            if (decAmount.length == 0) {
227
               decAmount = decAmount + "00";
228
            }
229
230
            textObj.value = dolAmount + "." + decAmount;
231
        }
233
        }
232
    </script>
234
        </script>
233
[% END %]
235
[% END %]
234
236
235
[% INCLUDE 'intranet-bottom.inc' %]
237
[% INCLUDE 'intranet-bottom.inc' %]
236
- 

Return to bug 12310