From fdb0cc80dbd323f8b7d60bb57af1e9bc6d126086 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Sun, 4 Oct 2015 11:38:03 +0200 Subject: [PATCH] Bug 14948 - Display amounts right aligned in tables on patron pages This patch set display amounts for charge, fine, price etc. right aligned in tables on patron pages. To test, apply patch and verify that amounts appear right aligned on following pages: - Go to Home > Patrons, perform a search (Column 'Fines') - Go to a patron with fines and credits - Checkout tab (circulation.pl): Columns 'Charge', 'Fine', 'Price' (maybe you have to show column with 'Show / hide colums') - Fines Tab > Pay fines (pay.pl): Columns 'Amount', 'Amount Outstanding' - Fines Tab > Account (boraccount.pl): Columns 'Amount', 'Outstanding' Note: Test here 'Filter paid transactions' as well Signed-off-by: Nicole Engard Signed-off-by: Jonathan Druart Signed-off-by: Brendan A Gallagher (cherry picked from commit 1acc6094be7670c180bc006182a0f8e464abac03) Signed-off-by: Julian Maurice --- .../en/includes/checkouts-table-footer.inc | 6 +++--- .../intranet-tmpl/prog/en/js/checkouts.js | 6 +++--- .../prog/en/modules/members/boraccount.tt | 20 ++++++++----------- .../prog/en/modules/members/pay.tt | 10 +++++----- .../modules/members/tables/members_results.tt | 2 +- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index 0de211f8cf..0039c8e68e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,9 +1,9 @@ Totals: - [% totaldue %] - [% finetotal %] - [% totalprice %] + [% totaldue %] + [% finetotal %] + [% totalprice %]

diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 1269013300..3c079606a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -278,19 +278,19 @@ $(document).ready(function() { { "mDataProp": function ( oObj ) { if ( ! oObj.charge ) oObj.charge = 0; - return parseFloat(oObj.charge).toFixed(2); + return '' + parseFloat(oObj.charge).toFixed(2) + ''; } }, { "mDataProp": function ( oObj ) { if ( ! oObj.fine ) oObj.fine = 0; - return parseFloat(oObj.fine).toFixed(2); + return '' + parseFloat(oObj.fine).toFixed(2) + ''; } }, { "mDataProp": function ( oObj ) { if ( ! oObj.price ) oObj.price = 0; - return parseFloat(oObj.price).toFixed(2); + return '' + parseFloat(oObj.price).toFixed(2) + ''; } }, { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index e115c59ed8..824c41c3e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -102,8 +102,8 @@ $(document).ready(function() { [%- IF account.description %], [% account.description %][% END %]  [% IF ( account.itemnumber ) %]View item [% END %][% account.title |html %] [% account.note | html_line_break %] - [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount %] - [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] + [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount %] + [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] [% IF ( reverse_col ) %] [% IF ( account.payment ) %] @@ -127,19 +127,15 @@ $(document).ready(function() { Total due [% IF ( totalcredit ) %] - [% IF ( reverse_col ) %] - - [% ELSE %] - - [% END %] + [% total %] [% ELSE %] - [% IF ( reverse_col ) %] - + [% total %] + [% END %] + [% IF ( reverse_col ) %] + [% ELSE %] - - [% END %] + [% END %] - [% total %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 64a0f689ce..e56bd613d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -85,7 +85,7 @@ function enableCheckboxActions(){ Total due: - [% total | format('%.2f') %] + [% total | format('%.2f') %] @@ -142,15 +142,15 @@ function enableCheckboxActions(){ [% line.accounttype %] [% line.notify_id %] [% line.notify_level %] - [% line.amount | format('%.2f') %] - [% line.amountoutstanding | format('%.2f') %] + [% line.amount | format('%.2f') %] + [% line.amountoutstanding | format('%.2f') %] [% END %] [% IF ( account_grp.total ) %] - Sub total: - [% account_grp.total | format('%.2f') %] + Sub total: + [% account_grp.total | format('%.2f') %] [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt index e4b7337eba..7d5e9622e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt @@ -24,7 +24,7 @@ "dt_od_checkouts": "[% IF data.overdues %][% data.overdues %][% ELSE %][% data.overdues %][% END %] / [% data.issues %]", "dt_fines": - "[% IF data.fines < 0 %][% data.fines |html %] [% ELSIF data.fines > 0 %] [% data.fines |html %] [% ELSE %] [% data.fines |html%] [% END %]", + "[% IF data.fines < 0 %][% data.fines |html %] [% ELSIF data.fines > 0 %] [% data.fines |html %] [% ELSE %] [% data.fines |html%] [% END %]", "dt_borrowernotes": "[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]", "dt_action": -- 2.39.5