From 1448fae50faefeca44d8efabde347e29f7af2d8c Mon Sep 17 00:00:00 2001 From: Srdjan Date: Fri, 10 Jun 2016 12:50:28 +1200 Subject: [PATCH] Bug 14803: Reload checkouts table on renewal svc/checkouts: get real rental charges for patron, rather than itemtype indication --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 2 ++ svc/checkouts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index bf419d7..9643d0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -2,6 +2,7 @@ $(document).ready(function() { $.ajaxSetup ({ cache: false }); var barcodefield = $("#barcode"); + var issuesTable; // Handle the select all/none links for checkouts table columns $("#CheckAllRenewals").on("click",function(){ @@ -96,6 +97,7 @@ $(document).ready(function() { var content = ""; if ( data.renew_okay ) { + issuesTable.api().ajax.reload(); content = CIRCULATION_RENEWED_DUE + " " + data.date_due; $('#date_due_' + data.itemnumber).replaceWith( data.date_due ); } else { diff --git a/svc/checkouts b/svc/checkouts index e613126..5cabdee 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -63,7 +63,7 @@ binmode STDOUT, ":encoding(UTF-8)"; print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); my @parameters; -my $sql = ' +my $sql = <preference('item-level_itypes'); 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 ) = @@ -159,7 +165,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { branchcode => $c->{branchcode}, branchname => $c->{branchname}, itemcallnumber => $c->{itemcallnumber} || q{}, - charge => $charge, + charge => $c->{amountoutstanding} || 0.00, fine => $fine, price => $c->{replacementprice} || q{}, can_renew => $can_renew, -- 2.7.4