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 134-139 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
134
('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'),
134
('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'),
135
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
135
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
136
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
136
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
137
('DigitSeparator',  '.,', NULL ,  'The separator between entire and decimal part',  'Free'),
137
('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'),
138
('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'),
138
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
139
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
139
('displayFacetCount','0',NULL,NULL,'YesNo'),
140
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc (+15 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>
15
(-)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 / +24 lines)
Lines 1-5 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Price %]
2
[% USE Price %]
3
[% USE Koha %]
3
4
4
[%- BLOCK action_menu %]
5
[%- BLOCK action_menu %]
5
    <div class="dropdown">
6
    <div class="dropdown">
Lines 27-32 Link Here
27
[% END -%]
28
[% END -%]
28
29
29
[% INCLUDE 'doc-head-open.inc' %]
30
[% INCLUDE 'doc-head-open.inc' %]
31
[% INCLUDE 'prices.inc' %]
30
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
32
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
31
[% INCLUDE 'doc-head-close.inc' %]
33
[% INCLUDE 'doc-head-close.inc' %]
32
[% INCLUDE 'calendar.inc' %]
34
[% INCLUDE 'calendar.inc' %]
Lines 66-71 Link Here
66
              alert(alertString);
68
              alert(alertString);
67
            }
69
            }
68
    }
70
    }
71
    function CheckTot(f){
72
        var ok=1;
73
        var _alertString="";
74
        var alertString2;
75
        if (!(isPrice(f.value))) {
76
            _alertString += "\n- " + _("Amount must be a valid number, or empty");
77
        }else{
78
            f.value=Price_from_string(f.value);
79
        }
80
        if (_alertString.length==0) {
81
            return true;
82
        } else {
83
            alertString2  = _("Form not submitted because of the following problem(s)");
84
            alertString2 += "\n------------------------------------------------------------------------------------\n";
85
            alertString2 += _alertString;
86
            alert(alertString2);
87
            return false;
88
        }
89
    }
69
    function Check(f) {
90
    function Check(f) {
70
            var ok=1;
91
            var ok=1;
71
            var _alertString="";
92
            var _alertString="";
Lines 356-362 Link Here
356
        <!-- ############################## -->
377
        <!-- ############################## -->
357
        <label for="budget_period_total">Total amount: </label>
378
        <label for="budget_period_total">Total amount: </label>
358
        <input type="text" id="budget_period_total" name="budget_period_total"
379
        <input type="text" id="budget_period_total" name="budget_period_total"
359
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" />
380
        size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" />
381
        [% INCLUDE 'price-conversion-message.inc' %]
360
    </li>
382
    </li>
361
383
362
    <li>
384
    <li>
Lines 378-384 Link Here
378
    <fieldset class="action">
400
    <fieldset class="action">
379
        <!-- "save changes" button -->
401
        <!-- "save changes" button -->
380
        <!-- ###################################### -->
402
        <!-- ###################################### -->
381
        <input type="button" value="Save"  onclick="Check(this.form)" />
403
        <input type="button" value="Save" onclick="Check(this.form)" />
382
        <!--             <input type="submit" value="Save Changes"  />  -->
404
        <!--             <input type="submit" value="Save Changes"  />  -->
383
        [% IF ( budget_period_id ) %]
405
        [% IF ( budget_period_id ) %]
384
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
406
            <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-3 / +34 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
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<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>
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>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
Lines 14-19 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
14
15
15
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
16
<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
16
[% IF op == 'add_form' %]
17
[% IF op == 'add_form' %]
18
[% INCLUDE 'prices.inc' %]
17
<script type="text/javascript">
19
<script type="text/javascript">
18
//<![CDATA[
20
//<![CDATA[
19
21
Lines 144-150 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
144
            alert(alertString2);
146
            alert(alertString2);
145
        }
147
        }
146
    }
148
    }
149
150
147
    $(document).ready(function(){
151
    $(document).ready(function(){
152
        $('#budget_expend').on('change', function(){CheckAmount(this)});
153
        $('#budget_amount').on('change', function(){CheckAmount(this)});
154
        function CheckAmount(f){
155
            var ok=1;
156
            var _alertString="";
157
            var alertString2;
158
            if (!(isPrice(f.value))) {
159
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
160
            }else{
161
                f.value=Price_from_string(f.value);
162
163
            }
164
            if (_alertString.length==0) {
165
                return true;
166
            } else {
167
                alertString2  = _("Form not submitted because of the following problem(s)");
168
                alertString2 += "\n------------------------------------------------------------------------------------\n";
169
                alertString2 += _alertString;
170
                alert(alertString2);
171
                return false;
172
            }
173
        }
174
148
        $("#remove_owner").on("click",function(e){
175
        $("#remove_owner").on("click",function(e){
149
            e.preventDefault();
176
            e.preventDefault();
150
            ownerRemove();
177
            ownerRemove();
Lines 486-491 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
486
    <li>
513
    <li>
487
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
514
    <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
488
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
515
    <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
516
        [% INCLUDE 'price-conversion-message.inc' %]
489
    </li>
517
    </li>
490
518
491
    <li>
519
    <li>
Lines 495-503 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
495
    </li>
523
    </li>
496
524
497
    <li>
525
    <li>
498
      <label for="budget_expend">Warning at (amount): </label>
526
    <label for="budget_expend">Warning at (amount): </label>
499
      <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
527
    <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
500
      <span class="hint">0 to disable</span>
528
529
    <span class="hint">0 to disable.</span>
530
        [% INCLUDE 'price-conversion-message.inc' %]
531
501
    </li>
532
    </li>
502
533
503
    <li>
534
    <li>
(-)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 (-2 / +25 lines)
Lines 2-14 Link Here
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
3
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'prices.inc' %]
5
<script type="text/javascript">
6
<script type="text/javascript">
6
//<![CDATA[
7
//<![CDATA[
7
$(document).ready(function(){
8
$(document).ready(function(){
8
        $('#mancredit').preventDoubleFormSubmit();
9
        $('#mancredit').preventDoubleFormSubmit();
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
10
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
11
        $('#amount').on('change', function(){Check(this)});
12
        function Check(f){
13
            var ok=1;
14
            var _alertString="";
15
            var alertString2;
16
            if (!(isPrice(f.value))) {
17
                _alertString += "\n- " + _("Amount must be a valid number, or empty");
18
            }else{
19
                f.value=Price_from_string(f.value);
20
            }
21
            if (_alertString.length==0) {
22
                return true;
23
            } else {
24
                alertString2  = _("Error: ");
25
                alertString2 += "\n------------------------------------------------------------------------------------\n";
26
                alertString2 += _alertString;
27
                alert(alertString2);
28
                return false;
29
            }
30
        }
10
});
31
});
11
//]]>
12
</script>
32
</script>
13
</head>
33
</head>
14
<body id="pat_mancredit" class="pat">
34
<body id="pat_mancredit" class="pat">
Lines 46-52 $(document).ready(function(){ Link Here
46
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
66
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
47
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
67
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
48
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
68
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
49
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
69
    <li><label for="amount">Amount: </label><input name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00 
70
        [% INCLUDE 'price-conversion-message.inc' %]
71
    </li>
72
50
</ol></fieldset>
73
</ol></fieldset>
51
74
52
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
75
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-1 / +29 lines)
Lines 67-73 $(document).ready(function(){ Link Here
67
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
67
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
68
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
68
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
69
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
69
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
70
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
70
    <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" required="required"/>
71
        [% INCLUDE 'price-conversion-message.inc' %]
72
    </li>
71
	</ol></fieldset>
73
	</ol></fieldset>
72
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
74
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
73
</form>
75
</form>
Lines 82-85 $(document).ready(function(){ Link Here
82
[% INCLUDE 'circ-menu.inc' %]
84
[% INCLUDE 'circ-menu.inc' %]
83
</div>
85
</div>
84
</div>
86
</div>
87
88
[% INCLUDE 'prices.inc' %]
89
90
<script type="text/javascript">
91
$('#amount').on('change', function(){Check(this)});
92
function Check(f){
93
    var ok=1;
94
    var _alertString="";
95
    var alertString2;
96
    if (!(isPrice(f.value))) {
97
        _alertString += "\n- " + _("Amount must be a valid number, or empty");
98
    }else{
99
        f.value=Price_from_string(f.value);
100
    }
101
    if (_alertString.length==0) {
102
        return true;
103
    } else {
104
        alertString2  = _("Form not submitted because of the following problem(s)");
105
        alertString2 += "\n------------------------------------------------------------------------------------\n";
106
        alertString2 += _alertString;
107
        alert(alertString2);
108
        return false;
109
    }
110
}
111
</script>
112
85
[% INCLUDE 'intranet-bottom.inc' %]
113
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-23 / +25 lines)
Lines 37-67 function moneyFormat(textObj) { Link Here
37
            decFlag = true;
37
            decFlag = true;
38
        }
38
        }
39
    }
39
    }
40
</script>
40
41
41
    if (dolAmount == "") {
42
[% INCLUDE 'prices.inc' %]
42
        dolAmount = "0";
43
43
    }
44
<script type="text/javascript">
44
// Strip leading 0s
45
function Check(f){
45
    if (dolAmount.length > 1) {
46
    var ok=1;
46
        while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
47
    var _alertString="";
47
            dolAmount = dolAmount.substring(1,dolAmount.length);
48
    var alertString2;
48
        }
49
    if (!(isPrice(f.value))) {
49
    }
50
        _alertString += "\n- " + _("Amount must be a valid number, or empty");
50
    if (decAmount.length > 2) {
51
    }else{
51
        decAmount = decAmount.substring(0,2);
52
        f.value=Price_from_string(f.value);
52
    }
53
    }
53
// Pad right side
54
    if (_alertString.length==0) {
54
    if (decAmount.length == 1) {
55
        return true;
55
       decAmount = decAmount + "0";
56
    } else {
57
        alertString2  = _("Form not submitted because of the following problem(s)");
58
        alertString2 += "\n------------------------------------------------------------------------------------\n";
59
        alertString2 += _alertString;
60
        alert(alertString2);
61
        return false;
56
    }
62
    }
57
    if (decAmount.length == 0) {
58
       decAmount = decAmount + "00";
59
    }
60
61
    textObj.value = dolAmount + "." + decAmount;
62
}
63
}
63
//]]>
64
</script>
64
</script>
65
66
65
</head>
67
</head>
66
<body id="pat_paycollect" class="pat">
68
<body id="pat_paycollect" class="pat">
67
[% INCLUDE 'header.inc' %]
69
[% INCLUDE 'header.inc' %]
Lines 146-152 function moneyFormat(textObj) { Link Here
146
    <li>
148
    <li>
147
        <label for="paid">Collect from patron: </label>
149
        <label for="paid">Collect from patron: </label>
148
            <!-- default to paying all -->
150
            <!-- default to paying all -->
149
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" />
151
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="Check(document.payindivfine.paid)"/>
150
    </li>
152
    </li>
151
</ol>
153
</ol>
152
</fieldset>
154
</fieldset>
Lines 211-217 function moneyFormat(textObj) { Link Here
211
    <li>
213
    <li>
212
        <label for="paid">Collect from patron: </label>
214
        <label for="paid">Collect from patron: </label>
213
        <!-- default to paying all -->
215
        <!-- default to paying all -->
214
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
216
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="Check(document.payfine.paid)"/>
217
        [% INCLUDE 'price-conversion-message.inc' %]
215
    </li>
218
    </li>
216
    <li>
219
    <li>
217
        <label for="selected_accts_notes">Note: </label>
220
        <label for="selected_accts_notes">Note: </label>
218
- 

Return to bug 12310