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

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

Return to bug 15905