Bugzilla – Attachment 115620 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), 4.27 KB, created by
Ava
on 2021-01-21 20:53:25 UTC
(
hide
)
Description:
Bug 14803: Reload checkouts table on renewal
Filename:
MIME Type:
Creator:
Ava
Created:
2021-01-21 20:53:25 UTC
Size:
4.27 KB
patch
obsolete
>From 6bbb9a0766497334bd246a9244f68af8b6acbc3e 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 | 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 = <<EOQ; > SELECT > issues.issuedate, > issues.date_due, >@@ -112,7 +111,10 @@ my $sql = ' > return_claims.id AS return_claim_id, > return_claims.notes AS return_claim_notes, > return_claims.created_on AS return_claim_created_on, >- return_claims.updated_on AS return_claim_updated_on >+ return_claims.updated_on AS return_claim_updated_on, >+ >+ acc.charge, >+ acc.fine > > FROM issues > LEFT JOIN items USING ( itemnumber ) >@@ -121,9 +123,16 @@ 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 JOIN return_claims USING ( issue_id ) >+ LEFT JOIN return_claims USING ( issue_id, borrowernumber, itemnumber ) >+ LEFT OUTER JOIN ( >+ SELECT borrowernumber, itemnumber, >+ SUM(CASE WHEN debit_type_code LIKE 'RENT%' THEN amountoutstanding ELSE 0.00 END) AS charge, >+ SUM(CASE WHEN debit_type_code = 'OVERDUE' THEN amountoutstanding ELSE 0.00 END) AS fine >+ FROM accountlines >+ GROUP BY borrowernumber, itemnumber >+ ) acc USING ( borrowernumber, itemnumber ) > WHERE issues.borrowernumber >-'; >+EOQ > > if ( @borrowernumber == 1 ) { > $sql .= '= ?'; >@@ -148,9 +157,6 @@ my $itemtypes = { map { $_->{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
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