From 6bbb9a0766497334bd246a9244f68af8b6acbc3e 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 | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index b5347c0bae..43d5c74987 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -4,6 +4,7 @@ $(document).ready(function() { $.ajaxSetup ({ cache: false }); var barcodefield = $("#barcode"); + var issuesTable; var onHoldDueDateSet = false; @@ -175,6 +176,7 @@ $(document).ready(function() { var content = ""; if ( data.renew_okay ) { + issuesTable.api().ajax.reload(); content = __("Renewed, due:") + " " + data.date_due; $('#date_due_' + data.itemnumber).replaceWith( data.date_due ); } else { diff --git a/svc/checkouts b/svc/checkouts index 38c0017e2c..c2f8c7d911 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -23,8 +23,7 @@ use CGI; use JSON qw(to_json); use C4::Auth qw(check_cookie_auth haspermission get_session); -use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); -use C4::Overdues qw(GetFine); +use C4::Circulation qw(CanBookBeRenewed GetRenewCount GetSoonestRenewDate); use C4::Context; use Koha::AuthorisedValues; @@ -62,7 +61,7 @@ binmode STDOUT, ":encoding(UTF-8)"; print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); my @parameters; -my $sql = ' +my $sql = <{itemtype} => $_->{translated_description} } @{ Koha 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} ); my $can_renew_date = @@ -231,8 +237,8 @@ while ( my $c = $sth->fetchrow_hashref() ) { branchname => $c->{branchname}, itemcallnumber => $c->{itemcallnumber} || q{}, copynumber => $c->{copynumber} || q{}, - charge => $charge, - fine => $fine, + charge => $c->{charge} || 0.00, + fine => $c->{fine} || 0.00, price => $c->{replacementprice} || q{}, can_renew => $can_renew, can_renew_error => $can_renew_error, -- 2.11.0