@@ -, +, @@ --- members/paycollect.pl | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) --- a/members/paycollect.pl +++ a/members/paycollect.pl @@ -110,8 +110,15 @@ if ( $total_paid and $total_paid ne '0.00' ) { } else { if ($individual) { if ( $total_paid == $total_due ) { - makepayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user, - $branch, $payment_note ); + 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 + } + ); } else { my $line = Koha::Account::Lines->find($accountlines_id); @@ -134,8 +141,28 @@ if ( $total_paid and $total_paid ne '0.00' ) { } my @acc = split /,/, $select; my $note = $input->param('selected_accts_notes'); - recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, $note ); - } else { + + my @lines = Koha::Account::Lines->search( + { + borrowernumber => $borrowernumber, + accountno => { 'IN' => \@acc }, + }, + { order_by => 'date' } + ); + + return Koha::Account->new( + { + patron_id => $borrowernumber, + } + )->pay( + { + amount => $total_paid, + lines => \@lines, + note => $note, + } + ); + } + else { my $note = $input->param('selected_accts_notes'); Koha::Account->new( { patron_id => $borrowernumber } ) ->pay( { amount => $total_paid, note => $note } ); --