Bugzilla – Attachment 60629 Details for
Bug 14803
Rental and fine fees are not updating on circulation screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14803: Reload checkouts table on renewal
Bug-14803-Reload-checkouts-table-on-renewal.patch (text/plain), 3.69 KB, created by
Srdjan Jankovic
on 2017-02-24 04:56:27 UTC
(
hide
)
Description:
Bug 14803: Reload checkouts table on renewal
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2017-02-24 04:56:27 UTC
Size:
3.69 KB
patch
obsolete
>From 9c3270ee2dacc3914a92e2049cfd4ed221f94b50 Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >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 f12743f..6309439 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 0b0d329..c227d22 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; > >@@ -63,7 +63,7 @@ binmode STDOUT, ":encoding(UTF-8)"; > print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); > > my @parameters; >-my $sql = ' >+my $sql = <<EOQ; > SELECT > issuedate, > date_due, >@@ -100,6 +100,8 @@ my $sql = ' > location, > items.enumchron, > >+ acc.amountoutstanding, >+ > DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today > FROM issues > LEFT JOIN items USING ( itemnumber ) >@@ -108,8 +110,13 @@ my $sql = ' > LEFT JOIN borrowers USING ( borrowernumber ) > LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) > LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) >+ LEFT OUTER JOIN ( >+ SELECT borrowernumber, itemnumber, SUM(amountoutstanding) AS amountoutstanding >+ FROM accountlines WHERE accounttype = 'Rent' >+ GROUP BY borrowernumber, itemnumber >+ ) acc USING ( borrowernumber, itemnumber ) > WHERE borrowernumber >-'; >+EOQ > > if ( @borrowernumber == 1 ) { > $sql .= '= ?'; >@@ -130,7 +137,6 @@ my $item_level_itypes = C4::Context->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 ) = >@@ -178,7 +184,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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14803
:
52208
|
52209
|
52210
|
52473
|
52474
|
53406
|
53482
|
60629
|
60630
|
60631
|
62294
|
62432
|
63047
|
63153
|
63230
|
65696
|
65697
|
65698
|
65783
|
65868
|
66261
|
73541
|
73542
|
98891
|
98892
|
115620
|
115621