|
Lines 44-50
BEGIN {
Link Here
|
| 44 |
&getrefunds |
44 |
&getrefunds |
| 45 |
&chargelostitem |
45 |
&chargelostitem |
| 46 |
&ReversePayment |
46 |
&ReversePayment |
| 47 |
&recordpayment_selectaccts |
|
|
| 48 |
&WriteOffFee |
47 |
&WriteOffFee |
| 49 |
&purge_zero_balance_fees |
48 |
&purge_zero_balance_fees |
| 50 |
); |
49 |
); |
|
Lines 378-424
sub ReversePayment {
Link Here
|
| 378 |
|
377 |
|
| 379 |
} |
378 |
} |
| 380 |
|
379 |
|
| 381 |
=head2 recordpayment_selectaccts |
|
|
| 382 |
|
| 383 |
recordpayment_selectaccts($borrowernumber, $payment,$accts); |
| 384 |
|
| 385 |
Record payment by a patron. C<$borrowernumber> is the patron's |
| 386 |
borrower number. C<$payment> is a floating-point number, giving the |
| 387 |
amount that was paid. C<$accts> is an array ref to a list of |
| 388 |
accountnos which the payment can be recorded against |
| 389 |
|
| 390 |
Amounts owed are paid off oldest first. That is, if the patron has a |
| 391 |
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment |
| 392 |
of $1.50, then the oldest fine will be paid off in full, and $0.50 |
| 393 |
will be credited to the next one. |
| 394 |
|
| 395 |
=cut |
| 396 |
|
| 397 |
sub recordpayment_selectaccts { |
| 398 |
my ( $borrowernumber, $amount, $accts, $note ) = @_; |
| 399 |
|
| 400 |
my @lines = Koha::Account::Lines->search( |
| 401 |
{ |
| 402 |
borrowernumber => $borrowernumber, |
| 403 |
amountoutstanding => { '<>' => 0 }, |
| 404 |
accountno => { 'IN' => $accts }, |
| 405 |
}, |
| 406 |
{ order_by => 'date' } |
| 407 |
); |
| 408 |
|
| 409 |
return Koha::Account->new( |
| 410 |
{ |
| 411 |
patron_id => $borrowernumber, |
| 412 |
} |
| 413 |
)->pay( |
| 414 |
{ |
| 415 |
amount => $amount, |
| 416 |
lines => \@lines, |
| 417 |
note => $note, |
| 418 |
} |
| 419 |
); |
| 420 |
} |
| 421 |
|
| 422 |
=head2 WriteOffFee |
380 |
=head2 WriteOffFee |
| 423 |
|
381 |
|
| 424 |
WriteOffFee( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch, $payment_note ); |
382 |
WriteOffFee( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch, $payment_note ); |