@@ -, +, @@ and 'Details'. --- .../prog/en/includes/checkouts-table-footer.inc | 5 +++-- .../prog/en/includes/checkouts-table.inc | 1 + koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 17 ++++++++++++++++- svc/checkouts | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,8 +1,9 @@ Totals: - [% totaldue %] - [% totalprice %] + [% totaldue %] + [% finetotal %] + [% totalprice %]

--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -19,6 +19,7 @@ Checked out from Call no Charge + Fine Price Renew

select all | none

Check in

select all | none

--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -273,6 +273,12 @@ $(document).ready(function() { }, { "mDataProp": function ( oObj ) { + if ( ! oObj.fine ) oObj.fine = 0; + return parseFloat(oObj.fine).toFixed(2); + } + }, + { + "mDataProp": function ( oObj ) { if ( ! oObj.price ) oObj.price = 0; return parseFloat(oObj.price).toFixed(2); } @@ -376,14 +382,17 @@ $(document).ready(function() { ], "fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) { var total_charge = 0; + var total_fine = 0; var total_price = 0; for ( var i=0; i < aaData.length; i++ ) { total_charge += aaData[i]['charge'] * 1; + total_fine += aaData[i]['fine'] * 1; total_price += aaData[i]['price'] * 1; } var nCells = nRow.getElementsByTagName('td'); nCells[1].innerHTML = total_charge.toFixed(2); - nCells[2].innerHTML = total_price.toFixed(2); + nCells[2].innerHTML = total_fine.toFixed(2); + nCells[3].innerHTML = total_price.toFixed(2); }, "bPaginate": false, "bProcessing": true, @@ -508,6 +517,12 @@ $(document).ready(function() { }, { "mDataProp": function ( oObj ) { + if ( ! oObj.fine ) oObj.fine = 0; + return parseFloat(oObj.fine).toFixed(2); + } + }, + { + "mDataProp": function ( oObj ) { if ( ! oObj.price ) oObj.price = 0; return parseFloat(oObj.price).toFixed(2); } --- a/svc/checkouts +++ a/svc/checkouts @@ -27,6 +27,7 @@ use C4::Auth qw(check_cookie_auth); use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); use C4::Koha qw(GetAuthorisedValueByCode); +use C4::Overdues qw(GetFine); use C4::Context; use Koha::DateUtils; @@ -126,6 +127,7 @@ my @checkouts_today; my @checkouts_previous; while ( my $c = $sth->fetchrow_hashref() ) { my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} ); + my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} ); my ( $can_renew, $can_renew_error ) = CanBookBeRenewed( $c->{borrowernumber}, $c->{itemnumber} ); @@ -154,6 +156,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { branchname => $c->{branchname}, itemcallnumber => $c->{itemcallnumber} || q{}, charge => $charge, + fine => $fine, price => $c->{replacementprice} || q{}, can_renew => $can_renew, can_renew_error => $can_renew_error, --