Bugzilla – Attachment 107591 Details for
Bug 26076
Paying selected accountlines in full may result in the error "You must pay a value less than or equal to $x"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26076: (QA Follow up) Prevent error by using a fresh resultset
Bug-26076-QA-Follow-up-Prevent-error-by-using-a-fr.patch (text/plain), 1.72 KB, created by
Kyle M Hall (khall)
on 2020-07-30 13:37:37 UTC
(
hide
)
Description:
Bug 26076: (QA Follow up) Prevent error by using a fresh resultset
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-07-30 13:37:37 UTC
Size:
1.72 KB
patch
obsolete
>From fceeed593071a925d428c6c02a5446cd78d4ec54 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 30 Jul 2020 09:35:38 -0400 >Subject: [PATCH] Bug 26076: (QA Follow up) Prevent error by using a fresh > resultset > >--- > members/paycollect.pl | 22 ++++++++++++++-------- > 1 file changed, 14 insertions(+), 8 deletions(-) > >diff --git a/members/paycollect.pl b/members/paycollect.pl >index a8f449e8ab..9ef0053f90 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -145,21 +145,27 @@ if ( $selected_accts ) { > } > my @acc = split /,/, $selected_accts; > >- my $selected_accountlines = Koha::Account::Lines->search( >- { >- borrowernumber => $borrowernumber, >+ my $search_params = { >+ borrowernumber => $borrowernumber, > amountoutstanding => { '<>' => 0 }, > accountlines_id => { 'in' => \@acc }, >- }, >+ }; >+ >+ my @selected_accountlines = Koha::Account::Lines->search( >+ $search_params, > { order_by => 'date' } > ); > >- $total_due = $selected_accountlines->_resultset->get_column('amountoutstanding')->sum(); >- >- @selected_accountlines = $selected_accountlines->as_list; >+ my $sum = Koha::Account::Lines->search( >+ $search_params, >+ { >+ select => [ { sum => 'amountoutstanding' } ], >+ as => [ 'total_amountoutstanding'], >+ } >+ ); >+ $total_due = $sum->_resultset->first->get_column('total_amountoutstanding'); > } > >- > if ( $total_paid and $total_paid ne '0.00' ) { > $total_paid = $total_due if (abs($total_paid - $total_due) < 0.01) && C4::Context->preference('RoundFinesAtPayment'); > if ( $total_paid < 0 or $total_paid > $total_due ) { >-- >2.24.1 (Apple Git-126)
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 26076
:
107471
|
107503
|
107516
|
107589
|
107590
|
107591
|
108938
|
108939