Bugzilla – Attachment 72104 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 : Modify scripts in order to convert any string to the good format
Bug-12310--Modify-scripts-in-order-to-convert-any-.patch (text/plain), 35.26 KB, created by
Victor Grousset/tuxayo
on 2018-02-23 10:28:37 UTC
(
hide
)
Description:
Bug 12310 : Modify scripts in order to convert any string to the good format
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2018-02-23 10:28:37 UTC
Size:
35.26 KB
patch
obsolete
>From a5391b02ec819735d007ff818bedac121f1f196b Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Tue, 21 Feb 2017 15:47:36 +0000 >Subject: [PATCH] Bug 12310 : Modify scripts in order to convert any string to > the good format > >paxed's solution is obsolete since the form asks for a number. > >The script includes 2 function which check if it is possible to transform >properly into the format "XX.XX" and which do it. >The money symbols are ignored. >All other symbols are ignored. > >Modify the tooltips helping the users entering monrtary information in the right format. > >Fields on all those pages 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 > >Test plan : >1) Check you can't enter any string except like "XX.XX" when > - you create a Budget (Administration->Budget) > - you write a fine (Circulation->[select a Borrower]->new fine ) > - you pay an existing fine >2) Apply patch >3) Check you can enter any string with > - 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 >Please note that any other symbole is ignored >--- > .../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 | 25 ++ > .../prog/en/modules/admin/aqbudgetperiods.tt | 167 +++++++++++- > .../prog/en/modules/admin/aqbudgets.tt | 302 ++++++++++++++++++++- > .../en/modules/admin/preferences/i18n_l10n.pref | 4 + > .../prog/en/modules/members/mancredit.tt | 34 ++- > .../prog/en/modules/members/maninvoice.tt | 30 +- > .../prog/en/modules/members/paycollect.tt | 66 ++++- > 10 files changed, 633 insertions(+), 12 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 > >diff --git a/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql b/installer/data/mysql/atomicupdate/bug12310_added_DigitSeparator.sql >new file mode 100644 >index 0000000..5022f3c >--- /dev/null >+++ b/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'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 8f5e94b..87fe483 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc >new file mode 100644 >index 0000000..4fcb5a0 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/price-conversion-message.inc >@@ -0,0 +1,14 @@ >+[% USE Koha %] >+[% INCLUDE 'prices.inc' %] >+ >+ <span class="hint"> >+ [% 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> >+ [% IF CAN_user_parameters %] >+ <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Edit Separator </a> >+ [% END %] >+ [% ELSE %] >+ [% IF CAN_user_parameters %] >+ No Digit separator defined <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=DigitSeparator">Chose one</a> >+ [% END %] >+ [% END %] >+ </span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc >new file mode 100644 >index 0000000..561ae06 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prices.inc >@@ -0,0 +1,25 @@ >+[% USE Koha %] >+<script type="text/javascript"> >+//<![CDATA[ >+ >+function isPrice(string){ >+ var reg ="[% Koha.Preference('DigitSeparator') %]"; >+ reg = "[0-9]{1,}(["+reg+"][0-9]{1,}|)"; >+ var prix = new RegExp(reg); >+ if (!prix.test(string)) { >+ return false; >+ } >+ return true; >+} >+ >+function Price_from_string(string){ >+ if (!isPrice(string)) { >+ return false; >+ } >+ string = string.replace(/[^0-9[% Koha.Preference('DigitSeparator') %]]/g, ''); >+ string = string.replace(/[[% Koha.Preference('DigitSeparator') %]]/g, '.'); >+ return string; >+} >+ >+//]]> >+</script> >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 afd893f..c8143a9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >@@ -1,6 +1,8 @@ > [% USE KohaDates %] > [% USE Price %] > [% SET footerjs = 1 %] >+[% USE Koha %] >+ > [%- BLOCK action_menu %] > <div class="dropdown"> > <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#"> >@@ -33,12 +35,172 @@ > [% END -%] > > [% INCLUDE 'doc-head-open.inc' %] >+[% INCLUDE 'prices.inc' %] >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> > [% IF close_form %] > <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" /> > [% END %] > >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> >+<script type="text/javascript"> >+// ################################################################################# >+// Javascript >+// ################################################################################# >+ function CheckDuplicateForm(f){ >+ var ok=1; >+ var _alertString=""; >+ var alertString=""; >+ if(!(isNotNull(f.budget_period_startdate,1))){ >+ _alertString += "\n- " + _("Start date missing"); >+ } >+ if (!(isNotNull(f.budget_period_enddate,1))){ >+ _alertString += "\n- " + _("End date missing"); >+ } >+ if( f.budget_period_startdate > f.budget_period_enddate ) { >+ _alertString += "\n- " + _("Start date must be before end date"); >+ } >+ if (!(isNotNull(f.budget_period_description,1))){ >+ _alertString += "\n- " + _("Budget description missing"); >+ } >+ >+ if(_alertString.length==0){ >+ f.submit(); >+ } else { >+ alertString += _("Form not submitted because of the following problem(s)"); >+ alertString += "\n-----------------------------------------\n"; >+ alertString += _alertString; >+ 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=""; >+ var alertString2; >+ >+ if (!(isNotNull(f.budget_period_startdate,1))) { >+ _alertString += "\n- " + _("Start date missing"); >+ } >+ >+ if (!(isNotNull(f.budget_period_enddate,1))) { >+ _alertString += "\n- " + _("End date missing"); >+ } >+ >+ if ( f.budget_period_startdate > f.budget_period_enddate ) { >+ _alertString += "\n- " + _("Start date must be before end date"); >+ } >+ >+ if (!(isNotNull(f.budget_period_description,1))) { >+ _alertString += "\n- " + _("Description missing"); >+ } >+ >+ if (!(isNum(f.budget_period_total))) { >+ _alertString += "\n- " + _("Amount must be a valid number, or empty"); >+ } >+ >+/* >+ checkBudgetTotal(f) { >+ } >+*/ >+ >+ if (_alertString.length==0) { >+ f.submit(); >+ } else { >+ alertString2 = _("Form not submitted because of the following problem(s)"); >+ alertString2 += "\n------------------------------------------------------------------------------------\n"; >+ alertString2 += _alertString; >+ alert(alertString2); >+ } >+ } >+ >+ $(document).ready(function() { >+ var tabs = $('#budgetsTabs').tabs(); >+ [% IF ( tab ) %] >+ tabs.tabs("option", "active", [% tab %]); >+ [% END %] >+ $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button", >+ 'bAutoWidth': false >+ } ) ); >+ >+ [% IF close_form %] >+ $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, { >+ sDom: "t" >+ })); >+ $("#move_form").submit(function(){ >+ var budget_from = "[% budget_period_description %]"; >+ var budget_to = $("#to_budget_period_id").find("option:selected").html(); >+ var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to); >+ alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?"); >+ return confirm ( alert_message ); >+ }); >+ [% END %] >+ [% IF closed %] >+ var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, { >+ // The following is a c/p from aqbudgets.tt and is a candidate for refactoring. >+ "fnDrawCallback": function ( oSettings ) { >+ if ( oSettings.aiDisplay.length == 0 ) >+ { >+ return; >+ } >+ >+ var nTrs = $('#closed_report tbody tr'); >+ var iColspan = nTrs[1].getElementsByTagName('td').length; >+ var sLastGroup = ""; >+ for ( var i=0 ; i<nTrs.length ; i++ ) >+ { >+ var iDisplayIndex = oSettings._iDisplayStart + i; >+ var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0]; >+ if ( sGroup != sLastGroup ) >+ { >+ var nGroup = document.createElement( 'tr' ); >+ var nCell = document.createElement( 'td' ); >+ nCell.colSpan = iColspan; >+ nCell.className = "group"; >+ nCell.innerHTML = sGroup; >+ nGroup.appendChild( nCell ); >+ nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] ); >+ sLastGroup = sGroup; >+ } >+ } >+ }, >+ "aoColumnDefs": [ >+ { "bVisible": false, "aTargets": [ 0, 1 ] }, >+ { "bSortable": false, "aTargets": ["_all"] } >+ ], >+ 'bSort': true, >+ 'aaSortingFixed': [[ 1, 'asc' ]], >+ "bAutoWidth": false, >+ "sPaginationType": "full_numbers" >+ })); >+ [% END %] >+ }); >+</script> >+ > <title> > Koha › Administration › Budgets > >@@ -221,7 +383,8 @@ > <!-- ############################## --> > <label for="budget_period_total">Total amount: </label> > <input type="text" id="budget_period_total" name="budget_period_total" >- size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" /> >+ size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 %]" onchange="CheckTot(budget_period_total)" /> >+ [% INCLUDE 'price-conversion-message.inc' %] > </li> > > <li> >@@ -243,7 +406,7 @@ > <fieldset class="action"> > <!-- "save changes" button --> > <!-- ###################################### --> >- <input type="button" value="Save" onclick="Check(this.form)" /> >+ <input type="button" value="Save" onclick="Check(this.form)" /> > <!-- <input type="submit" value="Save Changes" /> --> > [% IF ( budget_period_id ) %] > <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</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 e64c9e9..95670c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -2,11 +2,297 @@ > [% USE Branches %] > [% USE Price %] > [% SET footerjs = 1 %] >+[% 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> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> > <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable_[% KOHA_VERSION %].css" rel="stylesheet" type="text/css" /> > [% INCLUDE 'doc-head-close.inc' %] >+ >+<script type="text/javascript"> >+//<![CDATA[ >+var MSG_BUDGET_PARENT_ALLOCATION = "- " + _("Fund amount exceeds parent allocation") + "\n"; >+var MSG_BUDGET_PERIOD_ALLOCATION = "- " + _("Fund amount exceeds period allocation") + "\n"; >+var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") + "\n"; >+//]]> >+</script> >+ >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script> >+[% IF op == 'add_form' %] >+[% INCLUDE 'prices.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+ >+ function userPopup() { >+ window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=add", >+ 'PatronPopup', >+ 'width=740,height=450,location=yes,toolbar=no,' >+ + 'scrollbars=yes,resize=yes' >+ ); >+ } >+ >+ function ownerPopup() { >+ window.open("/cgi-bin/koha/admin/add_user_search.pl?selection_type=select", >+ 'PatronPopup', >+ 'width=740,height=450,location=yes,toolbar=no,' >+ + 'scrollbars=yes,resize=yes' >+ ); >+ } >+ >+ function select_user(borrowernumber, borrower) { >+ ownerRemove(); >+ var borrowername = borrower.firstname + ' ' + borrower.surname >+ if (borrowernumber) { >+ var ownerlink = '<a href="/cgi-bin/koha/members/moremember.pl' >+ + '?borrowernumber=' + borrowernumber + '">' >+ + borrowername + '</a>'; >+ $('#budget_owner_name').html(ownerlink); >+ $('#budget_owner_id').val(borrowernumber); >+ } >+ } >+ >+ function ownerRemove() { >+ $('#budget_owner_name').empty(); >+ $('#budget_owner_id').val(''); >+ } >+ >+ function add_user(borrowernumber, borrowername) { >+ var ids = $("#budget_users_id").val().split(':'); >+ if(borrowernumber && ids.indexOf(borrowernumber) == -1) { >+ var li = '<li id="user_' + borrowernumber + '">' >+ + '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' >+ + borrowernumber + '">' + borrowername + '</a> ' >+ + ' • <a data-borrowernumber=" + borrowernumber +" class="del_user" href="#"><i class="fa fa-trash"></i> Remove</a> ' >+ + '</li>'; >+ $("#budget_users").prepend(li); >+ ids.push(borrowernumber); >+ $("#budget_users_id").val(ids.join(':')); >+ } else { >+ return -1; >+ } >+ return 0; >+ } >+ >+ function del_user(borrowernumber) { >+ var ids = $("#budget_users_id").val().split(':'); >+ if (borrowernumber) { >+ var idx = ids.indexOf(borrowernumber+''); >+ if (idx != -1) { >+ ids.splice(idx, 1); >+ $("#budget_users_id").val(ids.join(':')); >+ $("li#user_" + borrowernumber).remove(); >+ } >+ } >+ } >+ >+ function Check(f) { >+ var ok=1; >+ var _alertString=""; >+ var alertString2; >+ >+ if (!(isNotNull(f.budget_code,1))) { >+ _alertString += _("- Budget code cannot be blank") + "\n"; >+ } >+ >+ if (!(isNotNull(f.budget_name,1))) { >+ _alertString += _("- Budget name cannot be blank") + "\n"; >+ } >+ >+ if (!(isNotNull(f.budget_amount,1))) { >+ _alertString += _("- Budget amount cannot be blank") + "\n"; >+ } >+ >+ var budgetId; >+ if (typeof(f.budget_id ) != "undefined") { >+ budgetId = f.budget_id.value >+ } >+ >+ var newBudgetParent; >+ >+// hack to test if selected parent_id in scrolling-list... >+// if value == 'undef' its got a selected_parent :/ >+ if(f.budget_parent_id){ >+ var chkAdd = f.budget_parent_id.value ; >+ if ( typeof(chkAdd ) != "undefined") { >+ newBudgetParent = f.budget_parent_id.value >+ } else { >+ newBudgetParent = f.budget_parent_id.item(0).value >+ } >+ >+ if (budgetId > 0) { ; //its a mod ... >+ // if parent == curent-budget, fail... >+ if ( newBudgetParent == budgetId ) { >+ _alertString += _("- Budget parent is current budget") + "\n"; >+ } >+ >+ else if (newBudgetParent) { >+ var result = checkBudgetParent( budgetId , newBudgetParent ); >+ if (result) { >+ _alertString += result; >+ } >+ } >+ } >+ } >+ >+ // else do lookup >+ var budgetTotal = Math.abs(f.budget_amount.value); >+ var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value) >+ if (result) { >+ _alertString += result; >+ } >+ >+ if (_alertString.length==0) { >+ document.Aform.submit(); >+ } else { >+ alertString2 = _("Form not submitted because of the following problem(s)"); >+ alertString2 += "\n------------------------------------------------------------------------------------\n\n"; >+ alertString2 += _alertString; >+ 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(); >+ }); >+ $("#edit_owner").on("click",function(e){ >+ e.preventDefault(); >+ ownerPopup(); >+ }); >+ $("body").on("click",".del_user",function(e){ >+ e.preventDefault(); >+ var borrowernumber = $(this).data("borrowernumber"); >+ del_user(borrowernumber); >+ }); >+ $("#add_user_button").on("click",function(e){ >+ e.preventDefault(); >+ userPopup(); >+ }); >+ $("#edit_fund").on("submit",function(e){ >+ e.preventDefault(); >+ Check(this); >+ }); >+ }); >+//]]> >+</script> >+[% ELSIF op == 'list' %] >+ <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+ [% INCLUDE 'datatables.inc' %] >+ <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" /> >+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script> >+ >+<script type="text/javascript"> >+//<![CDATA[ >+ // >+ $(document).ready(function() { >+ >+ >+ var oTable = $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "fnDrawCallback": function ( oSettings ) { >+ if ( oSettings.aiDisplay.length == 0 ) >+ { >+ return; >+ } >+ >+ var nTrs = $('#budgeth tbody tr'); >+ var iColspan = nTrs[0].getElementsByTagName('td').length; >+ var sLastGroup = ""; >+ for ( var i=0 ; i<nTrs.length ; i++ ) >+ { >+ var iDisplayIndex = oSettings._iDisplayStart + i; >+ var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1]; >+ if ( sGroup != sLastGroup ) >+ { >+ var nGroup = document.createElement( 'tr' ); >+ var nCell = document.createElement( 'td' ); >+ nCell.colSpan = iColspan; >+ nCell.className = "group"; >+ nCell.innerHTML = sGroup; >+ nGroup.appendChild( nCell ); >+ nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] ); >+ sLastGroup = sGroup; >+ } >+ } >+ }, >+ "footerCallback": function ( row, data, start, end, display ) { >+ var api = this.api(), data; >+ footer_column_sum( api, [ 4, 6, 8, 10 ], 2 ); >+ }, >+ "aoColumnDefs": [ >+ { "bVisible": false, "aTargets": [ 0, 1 ] }, >+ { "bSortable": false, "aTargets": ["_all"] } >+ ], >+ 'dom': '<"top pager"ilpf>tr<"bottom pager"ip>', >+ 'bSort': true, >+ 'aaSortingFixed': [[ 1, 'asc' ]], >+ 'bPaginate': false, >+ "bAutoWidth": false >+ })); >+ >+ $(oTable).treetable({ >+ expandable: true >+ }); >+ $(oTable).treetable('expandAll'); >+ $("#expand_all").click(function(e){ >+ e.preventDefault(); >+ $(oTable).treetable('expandAll'); >+ }); >+ $("#collapse_all").click(function(e){ >+ e.preventDefault(); >+ $(oTable).treetable('collapseAll'); >+ }); >+ >+ [% UNLESS budget_period_id %] >+ $("#hide_inactive").click(function(e){ >+ e.preventDefault(); >+ oTable.fnFilter( 1, 0 ); // Show only active=1 >+ }); >+ $("#show_inactive").click(function(e){ >+ e.preventDefault(); >+ oTable.fnFilter( '', 0 ); >+ }); >+ $("#hide_inactive").click(); >+ [% END %] >+ oTable.fnAddFilters("filter", 750); >+ >+ $("#filterbutton").click(function() { >+ $("#fundfilters").slideToggle(0); >+ }); >+ >+ $(".deletefund-disabled").tooltip().on("click", function(e){ >+ e.preventDefault(); >+ alert(_("This fund has children. It cannot be deleted.")); >+ }); >+ }); >+//]]> >+</script> >+[% END %] >+ > </head> > > <body id="admin_aqbudgets" class="admin"> >@@ -232,18 +518,22 @@ > <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" /> >+ [% INCLUDE 'price-conversion-message.inc' %] > </li> > > <li> >- <label for="budget_encumb">Warning at (%): </label> >- <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" /> >- <span class="hint">0 to disable</span> >+ <label for="budget_encumb">Warning at (%): </label> >+ <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" /> >+ <span class="hint">0 to disable</span> > </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.</span> >+ [% INCLUDE 'price-conversion-message.inc' %] >+ > </li> > > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >index f7f4252..7429e16 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >@@ -66,3 +66,7 @@ I18N/L10N: > no: "Don't allow" > - notices to be translated. > - 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. >+ - >+ - "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'" >+ - pref: DigitSeparator >+ class: long >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 5f68a4c..a321f66 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -3,6 +3,35 @@ > [% 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"> >@@ -40,7 +69,10 @@ > <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 >+ [% INCLUDE 'price-conversion-message.inc' %] >+ </li> >+ > </ol></fieldset> > > <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> >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 71eeb78..1df7366 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -53,7 +53,9 @@ > <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" 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="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >+ <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" required="required"/> >+ [% INCLUDE 'price-conversion-message.inc' %] >+ </li> > </ol></fieldset> > <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> > </form> >@@ -87,4 +89,30 @@ > </script> > [% END %] > >+ >+[% INCLUDE 'prices.inc' %] >+ >+<script type="text/javascript"> >+$('#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 = _("Form not submitted because of the following problem(s)"); >+ alertString2 += "\n------------------------------------------------------------------------------------\n"; >+ alertString2 += _alertString; >+ alert(alertString2); >+ return false; >+ } >+} >+</script> >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index 39df143..0007f9b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -4,6 +4,67 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %]</title> > [% INCLUDE 'doc-head-close.inc' %] >+ >+<script type= "text/javascript"> >+//<![CDATA[ >+$(document).ready(function() { >+ $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit(); >+ $("#paid").on("change",function(){ >+ moneyFormat( this ); >+ }); >+}); >+ >+function moneyFormat(textObj) { >+ var newValue = textObj.value; >+ var decAmount = ""; >+ var dolAmount = ""; >+ var decFlag = false; >+ var aChar = ""; >+ >+ for(i=0; i < newValue.length; i++) { >+ aChar = newValue.substring(i, i+1); >+ if (aChar >= "0" && aChar <= "9") { >+ if(decFlag) { >+ decAmount = "" + decAmount + aChar; >+ } >+ else { >+ dolAmount = "" + dolAmount + aChar; >+ } >+ } >+ if (aChar == ".") { >+ if (decFlag) { >+ dolAmount = ""; >+ break; >+ } >+ decFlag = true; >+ } >+ } >+</script> >+ >+[% INCLUDE 'prices.inc' %] >+ >+<script type="text/javascript"> >+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 = _("Form not submitted because of the following problem(s)"); >+ alertString2 += "\n------------------------------------------------------------------------------------\n"; >+ alertString2 += _alertString; >+ alert(alertString2); >+ return false; >+ } >+} >+</script> >+ > </head> > > <body id="pat_paycollect" class="pat"> >@@ -83,7 +144,7 @@ > <li> > <label for="paid">Collect from patron: </label> > <!-- default to paying all --> >- <input name="paid" id="paid" value="[% amountoutstanding %]" /> >+ <input name="paid" id="paid" value="[% amountoutstanding %]" onchange="Check(document.payindivfine.paid)"/> > </li> > </ol> > </fieldset> >@@ -150,7 +211,8 @@ > <li> > <label for="paid">Collect from patron: </label> > <!-- default to paying all --> >- <input name="paid" id="paid" value="[% total | format('%.2f') %]" /> >+ <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="Check(document.payfine.paid)"/> >+ [% INCLUDE 'price-conversion-message.inc' %] > </li> > <li> > <label for="selected_accts_notes">Note: </label> >-- >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