|
Lines 35-41
BEGIN {
Link Here
|
| 35 |
require Exporter; |
35 |
require Exporter; |
| 36 |
@ISA = qw(Exporter); |
36 |
@ISA = qw(Exporter); |
| 37 |
@EXPORT = qw( |
37 |
@EXPORT = qw( |
| 38 |
&recordpayment |
|
|
| 39 |
&makepayment |
38 |
&makepayment |
| 40 |
&manualinvoice |
39 |
&manualinvoice |
| 41 |
&getnextacctno |
40 |
&getnextacctno |
|
Lines 68-100
patron.
Link Here
|
| 68 |
|
67 |
|
| 69 |
=head1 FUNCTIONS |
68 |
=head1 FUNCTIONS |
| 70 |
|
69 |
|
| 71 |
=head2 recordpayment |
|
|
| 72 |
|
| 73 |
&recordpayment($borrowernumber, $payment, $sip_paytype, $note); |
| 74 |
|
| 75 |
Record payment by a patron. C<$borrowernumber> is the patron's |
| 76 |
borrower number. C<$payment> is a floating-point number, giving the |
| 77 |
amount that was paid. C<$sip_paytype> is an optional flag to indicate this |
| 78 |
payment was made over a SIP2 interface, rather than the staff client. The |
| 79 |
value passed is the SIP2 payment type value (message 37, characters 21-22) |
| 80 |
|
| 81 |
Amounts owed are paid off oldest first. That is, if the patron has a |
| 82 |
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment |
| 83 |
of $1.50, then the oldest fine will be paid off in full, and $0.50 |
| 84 |
will be credited to the next one. |
| 85 |
|
| 86 |
=cut |
| 87 |
|
| 88 |
#' |
| 89 |
sub recordpayment { |
| 90 |
|
| 91 |
#here we update the account lines |
| 92 |
my ( $borrowernumber, $data, $sip_paytype, $payment_note ) = @_; |
| 93 |
|
| 94 |
return Koha::Account->new( { patron_id => $borrowernumber } ) |
| 95 |
->pay( { amount => $data, sip => $sip_paytype, note => $payment_note } ); |
| 96 |
} |
| 97 |
|
| 98 |
=head2 makepayment |
70 |
=head2 makepayment |
| 99 |
|
71 |
|
| 100 |
&makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode); |
72 |
&makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode); |
| 101 |
- |
|
|