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 <nengard@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 1acc6094be)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Marc Véron 2015-10-04 11:38:03 +02:00 committed by Julian Maurice
parent 21465d93d5
commit fdb0cc80db
5 changed files with 21 additions and 25 deletions

View File

@ -1,9 +1,9 @@
<tfoot>
<tr>
<td colspan="10" style="text-align: right; font-weight:bold;">Totals:</td>
<td id="totaldue">[% totaldue %]</td>
<td id="totalfine">[% finetotal %]</td>
<td id="totalprice">[% totalprice %]</td>
<td id="totaldue" style="text-align: right;">[% totaldue %]</td>
<td id="totalfine" style="text-align: right;">[% finetotal %]</td>
<td id="totalprice" style="text-align: right;">[% totalprice %]</td>
<td colspan="3"><div class="date-select">
<p><label for="newduedate">Renewal due date:</label> <input type="text" size="12" id="newduedate" name="newduedate" value="[% newduedate %]" readonly="readonly" />
</p>

View File

@ -278,19 +278,19 @@ $(document).ready(function() {
{
"mDataProp": function ( oObj ) {
if ( ! oObj.charge ) oObj.charge = 0;
return parseFloat(oObj.charge).toFixed(2);
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.charge).toFixed(2) + '<span>';
}
},
{
"mDataProp": function ( oObj ) {
if ( ! oObj.fine ) oObj.fine = 0;
return parseFloat(oObj.fine).toFixed(2);
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.fine).toFixed(2) + '<span>';
}
},
{
"mDataProp": function ( oObj ) {
if ( ! oObj.price ) oObj.price = 0;
return parseFloat(oObj.price).toFixed(2);
return '<span style="text-align: right; display: block;">' + parseFloat(oObj.price).toFixed(2) + '<span>';
}
},
{

View File

@ -102,8 +102,8 @@ $(document).ready(function() {
[%- IF account.description %], [% account.description %][% END %]
&nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">View item</a>&nbsp;[% END %][% account.title |html %]</td>
<td>[% account.note | html_line_break %]</td>
[% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
[% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td>
[% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount %]</td>
[% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding %]</td>
[% IF ( reverse_col ) %]
<td>
[% IF ( account.payment ) %]
@ -127,19 +127,15 @@ $(document).ready(function() {
<tr>
<td colspan="4">Total due</td>
[% IF ( totalcredit ) %]
[% IF ( reverse_col ) %]
<td colspan="3" class="credit">
[% ELSE %]
<td colspan="2" class="credit">
[% END %]
<td class="credit" style="text-align: right;">[% total %]</td>
[% ELSE %]
[% IF ( reverse_col ) %]
<td colspan="3" class="debit">
[% ELSE %]
<td colspan="2" class="credit">
[% END %]
<td class="debit"style="text-align: right;">[% total %]</td>
[% END %]
[% IF ( reverse_col ) %]
<td colspan="2"></td>
[% ELSE %]
<td></td>
[% END %]
[% total %]</td>
</tr>
</tfoot>
</table>

View File

@ -85,7 +85,7 @@ function enableCheckboxActions(){
<tfoot>
<tr>
<td class="total" colspan="8">Total due:</td>
<td>[% total | format('%.2f') %]</td>
<td style="text-align: right;">[% total | format('%.2f') %]</td>
</tr>
</tfoot>
<tbody>
@ -142,15 +142,15 @@ function enableCheckboxActions(){
<td>[% line.accounttype %]</td>
<td>[% line.notify_id %]</td>
<td>[% line.notify_level %]</td>
<td class="debit">[% line.amount | format('%.2f') %]</td>
<td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
<td class="debit" style="text-align: right;">[% line.amount | format('%.2f') %]</td>
<td class="debit" style="text-align: right;">[% line.amountoutstanding | format('%.2f') %]</td>
</tr>
[% END %]
[% IF ( account_grp.total ) %]
<tr>
<td class="total" colspan="8">Sub total:</td>
<td>[% account_grp.total | format('%.2f') %]</td>
<td class="total" colspan="8" style="text-align: right;">Sub total:</td>
<td style="text-align: right;">[% account_grp.total | format('%.2f') %]</td>
</tr>
[% END %]
[% END %]

View File

@ -24,7 +24,7 @@
"dt_od_checkouts":
"[% IF data.overdues %]<span class='overdue'><strong>[% data.overdues %]</strong></span>[% ELSE %][% data.overdues %][% END %] / [% data.issues %]",
"dt_fines":
"[% IF data.fines < 0 %]<span class='credit'>[% data.fines |html %]</span> [% ELSIF data.fines > 0 %] <span class='debit'><strong>[% data.fines |html %]</strong></span> [% ELSE %] [% data.fines |html%] [% END %]</td>",
"<span style='text-align: right; display: block;'>[% IF data.fines < 0 %]<span class='credit'>[% data.fines |html %]</span> [% ELSIF data.fines > 0 %] <span class='debit'><strong>[% data.fines |html %]</strong></span> [% ELSE %] [% data.fines |html%] [% END %]</span>",
"dt_borrowernotes":
"[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]",
"dt_action":