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

(-)a/C4/Accounts.pm (-31 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
		&makepayment
41
		&manualinvoice
40
		&manualinvoice
42
		&getnextacctno
41
		&getnextacctno
43
		&getcharges
42
		&getcharges
Lines 69-101 patron. Link Here
69
68
70
=head1 FUNCTIONS
69
=head1 FUNCTIONS
71
70
72
=head2 makepayment
73
74
  &makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode);
75
76
Records the fact that a patron has paid off the entire amount he or
77
she owes.
78
79
C<$borrowernumber> is the patron's borrower number. C<$acctnumber> is
80
the account that was credited. C<$amount> is the amount paid (this is
81
only used to record the payment. It is assumed to be equal to the
82
amount owed). C<$branchcode> is the code of the branch where payment
83
was made.
84
85
=cut
86
87
#'
88
# FIXME - I'm not at all sure about the above, because I don't
89
# understand what the acct* tables in the Koha database are for.
90
sub makepayment {
91
    my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_;
92
93
    my $line = Koha::Account::Lines->find( $accountlines_id );
94
95
    return Koha::Account->new( { patron_id => $borrowernumber } )
96
      ->pay( { lines => [ $line ], amount => $amount, library_id => $branch, note => $payment_note } );
97
}
98
99
=head2 getnextacctno
71
=head2 getnextacctno
100
72
101
  $nextacct = &getnextacctno($borrowernumber);
73
  $nextacct = &getnextacctno($borrowernumber);
Lines 422-429 sub recordpayment_selectaccts { Link Here
422
      );
394
      );
423
}
395
}
424
396
425
# makepayment needs to be fixed to handle partials till then this separate subroutine
426
# fills in
427
sub makepartialpayment {
397
sub makepartialpayment {
428
    my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_;
398
    my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch, $payment_note ) = @_;
429
399
430
- 

Return to bug 15905