From b6d5748c001febc5acd67938d12ba25844d11fbc 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 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 Signed-off-by: Kyle M Hall --- members/paycollect.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/members/paycollect.pl b/members/paycollect.pl index b341e8c856..b34dba660a 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 ); -- 2.39.5