Bugzilla – Attachment 62655 Details for
Bug 12310
Decimal separators issues in patrons payments/fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12310: Format prices on other pages
Bug-12310-Format-prices-on-other-pages.patch (text/plain), 10.69 KB, created by
Baptiste Wojtkowski (bwoj)
on 2017-04-25 10:24:33 UTC
(
hide
)
Description:
Bug 12310: Format prices on other pages
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2017-04-25 10:24:33 UTC
Size:
10.69 KB
patch
obsolete
>From 7921a3325d44e190cbe7af2df0003c8f72a54286 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Tue, 25 Apr 2017 10:20:47 +0000 >Subject: [PATCH] Bug 12310: Format prices on other pages > >Fields on thoses page are now automatically formatted. >- cgi-bin/koha/admin/aqbudgetperiods.tt >- cgi-bin/koha/admin/aqbudgets.tt >- cgi-bin/koha/members/mancredit.tt >- cgi-bin/koha/members/maninvoice.tt >--- > .../prog/en/modules/admin/aqbudgetperiods.tt | 2 +- > .../prog/en/modules/admin/aqbudgets.tt | 49 ++++++++++++++++++++-- > .../prog/en/modules/members/mancredit.tt | 33 ++++++++++++++- > .../prog/en/modules/members/maninvoice.tt | 9 +++- > 4 files changed, 86 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >index 0624c84..ad86143 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >@@ -379,7 +379,7 @@ > <input type="text" id="budget_period_total" name="budget_period_total" > size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" /> > [% IF Koha.Preference('DigitSeparator') %] >- Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX", if you want to change it, click here <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+ Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX", if you want to change it, click <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here > </a> > [% ELSE %] > Please chose a digit separator by clicking <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here </a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >index a3c9ee9..6e25964 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -1,6 +1,7 @@ > [% USE AuthorisedValues %] > [% USE Branches %] > [% USE Price %] >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Funds[% IF op == 'add_form' %] › [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -14,6 +15,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > > <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> > [% IF op == 'add_form' %] >+[% INCLUDE 'prices.inc' %] > <script type="text/javascript"> > //<![CDATA[ > >@@ -144,7 +146,32 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > alert(alertString2); > } > } >+ >+ > $(document).ready(function(){ >+ $('#budget_expend').on('change', function(){CheckAmount(this)}); >+ $('#budget_amount').on('change', function(){CheckAmount(this)}); >+ function CheckAmount(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; >+ } >+ } >+ > $("#remove_owner").on("click",function(e){ > e.preventDefault(); > ownerRemove(); >@@ -486,6 +513,15 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > <li> > <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label> > <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" /> >+ <span class="hint"> >+ [% IF Koha.Preference('DigitSeparator') %]Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr( >+0,1) %]XX", if you want to change it, click <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+</a> >+ [% ELSE %]Please chose a digit separator by clicking <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+ </a> >+ [% END %] >+ </span> >+ > </li> > > <li> >@@ -495,9 +531,16 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > </li> > > <li> >- <label for="budget_expend">Warning at (amount): </label> >- <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" /> >- <span class="hint">0 to disable</span> >+ <label for="budget_expend">Warning at (amount): </label> >+ <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" /> >+ <span class="hint">0 to disable. >+ [% IF Koha.Preference('DigitSeparator') %]Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr( >+0,1) %]XX", if you want to change it, click <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+</a> >+ [% ELSE %]Please chose a digit separator by clicking <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+ </a> >+ [% END %] >+ </span> > </li> > > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >index 65a61a5..ff67e4e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -2,13 +2,33 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons › Create manual credit</title> > [% INCLUDE 'doc-head-close.inc' %] >+[% INCLUDE 'prices.inc' %] > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function(){ > $('#mancredit').preventDoubleFormSubmit(); > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >+ $('#amount').on('change', function(){Check(this)}); >+ function Check(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 = _("Error: "); >+ alertString2 += "\n------------------------------------------------------------------------------------\n"; >+ alertString2 += _alertString; >+ alert(alertString2); >+ return false; >+ } >+ } > }); >-//]]> > </script> > </head> > <body id="pat_mancredit" class="pat"> >@@ -46,7 +66,16 @@ $(document).ready(function(){ > <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> > <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li> > <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> >- <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >+ <li><label for="amount">Amount: </label><input name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >+<span class="hint"> >+ [% IF Koha.Preference('DigitSeparator') %]Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr( >+0,1) %]XX", if you want to change it, click <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+</a> >+ [% ELSE %]Please chose a digit separator by clicking <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+</a> >+ [% END %] >+</span> >+ > </ol></fieldset> > > <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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 826df17..40578c5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -68,7 +68,14 @@ $(document).ready(function(){ > <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li> > <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> > <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" required="required"/> >- Please use the "[% Koha.Preference('DigitSeparator').substr(0, 1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr(0,1) %]XX" >+ <span class="hint"> >+ [% IF Koha.Preference('DigitSeparator') %]Please use the "[% Koha.Preference('DigitSeparator').substr(0,1) %]" as separator : ex "XX[% Koha.Preference('DigitSeparator').substr( >+ 0,1) %]XX", if you want to change it, click <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+ </a> >+ [% ELSE %]Please chose a digit separator by clicking <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">here >+ </a> >+ [% END %] >+ </span> > </li> > </ol></fieldset> > <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> >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12310
:
28455
|
60530
|
60563
|
61357
|
61603
|
61604
|
62655
|
64671
|
64672
|
64673
|
64674
|
64675
|
64678
|
64679
|
64696
|
72104
|
72213
|
72983
|
73055
|
73215
|
73546
|
73657
|
73784
|
73785
|
73873
|
73874
|
73880
|
74524
|
74525
|
74526
|
74527
|
74528
|
74529
|
75123
|
75127
|
75128
|
75129
|
75130
|
75947
|
75948
|
75949
|
75950
|
75951
|
75952
|
75954
|
75955
|
75956
|
75957
|
75958
|
75959
|
76896
|
76933
|
77971
|
77972
|
77973
|
77995
|
78017
|
78631
|
78632
|
78633
|
78634
|
78635
|
78636
|
78637
|
78638