From df9d04843056d000c8d50d98d2424756f0090c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 --- .../prog/en/includes/checkouts-table-footer.inc | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 6 +++--- .../prog/en/modules/members/boraccount.tt | 20 ++++++++------------ .../intranet-tmpl/prog/en/modules/members/pay.tt | 10 +++++----- .../en/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 0de211f..0039c8e 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 b4b676b..f436377 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -270,19 +270,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 e115c59..824c41c 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 64a0f68..e56bd61 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 e4b7337..7d5e962 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": -- 1.7.10.4