|
Lines 135-141
sub recordpayment {
Link Here
|
| 135 |
|
135 |
|
| 136 |
=head2 makepayment |
136 |
=head2 makepayment |
| 137 |
|
137 |
|
| 138 |
&makepayment($borrowernumber, $acctnumber, $amount, $branchcode); |
138 |
&makepayment($borrowernumber, $acctnumber, $amount, $branchcode, $modeofpayment, $receiptno, $notes); |
| 139 |
|
139 |
|
| 140 |
Records the fact that a patron has paid off the entire amount he or |
140 |
Records the fact that a patron has paid off the entire amount he or |
| 141 |
she owes. |
141 |
she owes. |
|
Lines 144-150
C<$borrowernumber> is the patron's borrower number. C<$acctnumber> is
Link Here
|
| 144 |
the account that was credited. C<$amount> is the amount paid (this is |
144 |
the account that was credited. C<$amount> is the amount paid (this is |
| 145 |
only used to record the payment. It is assumed to be equal to the |
145 |
only used to record the payment. It is assumed to be equal to the |
| 146 |
amount owed). C<$branchcode> is the code of the branch where payment |
146 |
amount owed). C<$branchcode> is the code of the branch where payment |
| 147 |
was made. |
147 |
was made. C<$modeofpayment> is the code to capture mode of payment via cash, cheque etc. |
|
|
148 |
C<$receiptno> is the code to capture receiptnumber. |
| 149 |
C<$notes> is the code to capture notes. |
| 148 |
|
150 |
|
| 149 |
=cut |
151 |
=cut |
| 150 |
|
152 |
|
|
Lines 156-162
sub makepayment {
Link Here
|
| 156 |
#here we update both the accountoffsets and the account lines |
158 |
#here we update both the accountoffsets and the account lines |
| 157 |
#updated to check, if they are paying off a lost item, we return the item |
159 |
#updated to check, if they are paying off a lost item, we return the item |
| 158 |
# from their card, and put a note on the item record |
160 |
# from their card, and put a note on the item record |
| 159 |
my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_; |
161 |
my ( $borrowernumber, $accountno, $amount, $user, $branch, $modeofpayment, $receiptno, $notes) = @_; |
| 160 |
my $dbh = C4::Context->dbh; |
162 |
my $dbh = C4::Context->dbh; |
| 161 |
|
163 |
|
| 162 |
# begin transaction |
164 |
# begin transaction |
|
Lines 190-198
sub makepayment {
Link Here
|
| 190 |
$dbh->do( " |
192 |
$dbh->do( " |
| 191 |
INSERT INTO accountlines |
193 |
INSERT INTO accountlines |
| 192 |
(borrowernumber, accountno, date, amount, |
194 |
(borrowernumber, accountno, date, amount, |
| 193 |
description, accounttype, amountoutstanding) |
195 |
description, accounttype, amountoutstanding, modeofpayment, receiptno, notes) |
| 194 |
VALUES ($borrowernumber, $nextaccntno, now(), $payment, |
196 |
VALUES ($borrowernumber, $nextaccntno, now(), $payment, |
| 195 |
'Payment,thanks - $user', 'Pay', 0) |
197 |
'Payment,thanks - $user', 'Pay', 0, '$modeofpayment', '$receiptno', '$notes') |
| 196 |
" ); |
198 |
" ); |
| 197 |
|
199 |
|
| 198 |
# FIXME - The second argument to &UpdateStats is supposed to be the |
200 |
# FIXME - The second argument to &UpdateStats is supposed to be the |