From 9dc12627885955c5d9ed8e50add55cb722cf1b2b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 4 Nov 2016 11:39:12 +0100 Subject: [PATCH] Bug 15896: [QA Follow-up] Add accountlines_id parameter in paycollect Content-Type: text/plain; charset=utf-8 We can solve the minor problem reported on 15906 now by using the accountlines_id parameter of this report. Test plan: [1] Add two manual fines (say 20 and 30). [2] Pay the second one in full, and check that the first one is not paid first. So the 20 should remain and not the 30 with 20 outstanding. Signed-off-by: Marcel de Rooy --- members/paycollect.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/members/paycollect.pl b/members/paycollect.pl index b341e8c..b34dba6 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -112,15 +112,12 @@ if ( $total_paid and $total_paid ne '0.00' ) { } else { if ($individual) { if ( $total_paid == $total_due ) { - my $line = Koha::Account::Lines->find($accountlines_id); - Koha::Account->new( { patron_id => $borrowernumber } )->pay( - { - lines => [$line], - amount => $total_paid, - library_id => $branch, - note => $payment_note - } - ); + Koha::Account->new( { patron_id => $borrowernumber } )->pay({ + accountlines_id => $accountlines_id, + amount => $total_paid, + library_id => $branch, + note => $payment_note, + }); } else { makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user, $branch, $payment_note ); -- 1.7.10.4