Lines 46-52
BEGIN {
Link Here
|
46 |
&chargelostitem |
46 |
&chargelostitem |
47 |
&ReversePayment |
47 |
&ReversePayment |
48 |
&makepartialpayment |
48 |
&makepartialpayment |
49 |
&recordpayment_selectaccts |
|
|
50 |
&WriteOffFee |
49 |
&WriteOffFee |
51 |
&purge_zero_balance_fees |
50 |
&purge_zero_balance_fees |
52 |
); |
51 |
); |
Lines 353-399
sub ReversePayment {
Link Here
|
353 |
|
352 |
|
354 |
} |
353 |
} |
355 |
|
354 |
|
356 |
=head2 recordpayment_selectaccts |
|
|
357 |
|
358 |
recordpayment_selectaccts($borrowernumber, $payment,$accts); |
359 |
|
360 |
Record payment by a patron. C<$borrowernumber> is the patron's |
361 |
borrower number. C<$payment> is a floating-point number, giving the |
362 |
amount that was paid. C<$accts> is an array ref to a list of |
363 |
accountnos which the payment can be recorded against |
364 |
|
365 |
Amounts owed are paid off oldest first. That is, if the patron has a |
366 |
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment |
367 |
of $1.50, then the oldest fine will be paid off in full, and $0.50 |
368 |
will be credited to the next one. |
369 |
|
370 |
=cut |
371 |
|
372 |
sub recordpayment_selectaccts { |
373 |
my ( $borrowernumber, $amount, $accts, $note ) = @_; |
374 |
|
375 |
my @lines = Koha::Account::Lines->search( |
376 |
{ |
377 |
borrowernumber => $borrowernumber, |
378 |
amountoutstanding => { '<>' => 0 }, |
379 |
accountno => { 'IN' => $accts }, |
380 |
}, |
381 |
{ order_by => 'date' } |
382 |
); |
383 |
|
384 |
return Koha::Account->new( |
385 |
{ |
386 |
patron_id => $borrowernumber, |
387 |
} |
388 |
)->pay( |
389 |
{ |
390 |
amount => $amount, |
391 |
lines => \@lines, |
392 |
note => $note, |
393 |
} |
394 |
); |
395 |
} |
396 |
|
397 |
sub makepartialpayment { |
355 |
sub makepartialpayment { |
398 |
my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_; |
356 |
my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_; |
399 |
|
357 |
|