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