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

(-)a/C4/Accounts.pm (-29 lines)
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
		&makepayment
39
		&manualinvoice
38
		&manualinvoice
40
		&getnextacctno
39
		&getnextacctno
41
		&getcharges
40
		&getcharges
Lines 65-97 patron. Link Here
65
64
66
=head1 FUNCTIONS
65
=head1 FUNCTIONS
67
66
68
=head2 makepayment
69
70
  &makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode);
71
72
Records the fact that a patron has paid off the entire amount he or
73
she owes.
74
75
C<$borrowernumber> is the patron's borrower number. C<$acctnumber> is
76
the account that was credited. C<$amount> is the amount paid (this is
77
only used to record the payment. It is assumed to be equal to the
78
amount owed). C<$branchcode> is the code of the branch where payment
79
was made.
80
81
=cut
82
83
#'
84
# FIXME - I'm not at all sure about the above, because I don't
85
# understand what the acct* tables in the Koha database are for.
86
sub makepayment {
87
    my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_;
88
89
    my $line = Koha::Account::Lines->find( $accountlines_id );
90
91
    return Koha::Account->new( { patron_id => $borrowernumber } )
92
      ->pay( { lines => [ $line ], amount => $amount, library_id => $branch, note => $payment_note } );
93
}
94
95
=head2 getnextacctno
67
=head2 getnextacctno
96
68
97
  $nextacct = &getnextacctno($borrowernumber);
69
  $nextacct = &getnextacctno($borrowernumber);
98
- 

Return to bug 15905