From ae3d70d310a8e298cfb9f8f25be4e9c73683ef65 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 | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 9ec8d43..903473f 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(){ @@ -109,6 +110,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 d8d6156..638659b 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -25,7 +25,7 @@ use JSON qw(to_json); use C4::Auth qw(check_cookie_auth haspermission get_session); use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); -use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); +use C4::Circulation qw(CanBookBeRenewed GetRenewCount GetSoonestRenewDate); use C4::Overdues qw(GetFine); use C4::Context; @@ -64,7 +64,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 ) = @@ -179,7 +185,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