Bugzilla – Attachment 76433 Details for
Bug 20946
Cannot pay fines for patrons with credits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20946: Use K::Account->outstanding_debits in pay.pl and paycollect.pl
Bug-20946-Use-KAccount-outstandingdebits-in-paypl-.patch (text/plain), 2.23 KB, created by
Kyle M Hall (khall)
on 2018-06-26 13:09:31 UTC
(
hide
)
Description:
Bug 20946: Use K::Account->outstanding_debits in pay.pl and paycollect.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-06-26 13:09:31 UTC
Size:
2.23 KB
patch
obsolete
>From bd50f837c58cf4471dc8a37babffc9b69b27bdbd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 16 Jun 2018 09:44:19 -0300 >Subject: [PATCH] Bug 20946: Use K::Account->outstanding_debits in pay.pl and > paycollect.pl > >This patch changes the how account lines are fetched (using >Koha::Account->outstanding_debits) so credits are not picked. > >To test: >- Add a $5 credit to a patron >- Add a $1 fine >- Go to the 'Pay fines' tab >=> FAIL: Credit is displayed >- Try to pay all fines >=> FAIL: You are told to enter a value less than or equal to -4.00 > (Observe you cannot do that) >- Apply this patch >- Reload >=> SUCCESS: Credit is not displayed >=> SUCCESS: You are able to pay all fines >- Sign off :-D > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > members/pay.pl | 3 +-- > members/paycollect.pl | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) > >diff --git a/members/pay.pl b/members/pay.pl >index 53a8f37794..8245f38b2e 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -139,8 +139,7 @@ output_html_with_http_headers $input, $cookie, $template->output; > sub add_accounts_to_template { > > my $patron = Koha::Patrons->find( $borrowernumber ); >- my $total = $patron->account->balance; >- my $account_lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber, amountoutstanding => { '!=' => 0 } }, { order_by => ['accounttype'] }); >+ my ( $total, $account_lines ) = Koha::Account->new( { patron_id => $borrowernumber } )->outstanding_debits; > my @accounts; > while ( my $account_line = $account_lines->next ) { > $account_line = $account_line->unblessed; >diff --git a/members/paycollect.pl b/members/paycollect.pl >index 0f98a9d3f1..167617778f 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -59,8 +59,7 @@ my $category = $patron->category; > my $user = $input->remote_user; > > my $branch = C4::Context->userenv->{'branch'}; >- >-my $total_due = $patron->account->balance; >+my ( $total_due ) = Koha::Account->new( { patron_id => $borrowernumber } )->outstanding_debits; > my $total_paid = $input->param('paid'); > > my $individual = $input->param('pay_individual'); >-- >2.15.2 (Apple Git-101.1)
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 20946
:
76116
|
76317
|
76318
|
76394
|
76395
|
76432
| 76433 |
76434
|
76435
|
76437
|
76519
|
76521
|
76522
|
76632