View | Details | Raw Unified | Return to bug 15899
Collapse All | Expand All

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

Return to bug 15899