|
Lines 201-210
sub makepayment {
Link Here
|
| 201 |
my $ins = |
201 |
my $ins = |
| 202 |
$dbh->prepare( |
202 |
$dbh->prepare( |
| 203 |
"INSERT |
203 |
"INSERT |
| 204 |
INTO accountlines (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding) |
204 |
INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id) |
| 205 |
VALUES ( ?, ?, now(), ?, 'Payment,thanks', 'Pay', 0)" |
205 |
VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?)" |
| 206 |
); |
206 |
); |
| 207 |
$ins->execute($borrowernumber, $nextaccntno, $payment); |
207 |
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id); |
| 208 |
$ins->finish; |
208 |
$ins->finish; |
| 209 |
} |
209 |
} |
| 210 |
|
210 |
|
|
Lines 725-730
sub recordpayment_selectaccts {
Link Here
|
| 725 |
# fills in |
725 |
# fills in |
| 726 |
sub makepartialpayment { |
726 |
sub makepartialpayment { |
| 727 |
my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_; |
727 |
my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_; |
|
|
728 |
my $manager_id = 0; |
| 729 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
| 728 |
if (!$amount || $amount < 0) { |
730 |
if (!$amount || $amount < 0) { |
| 729 |
return; |
731 |
return; |
| 730 |
} |
732 |
} |
|
Lines 743-753
sub makepartialpayment {
Link Here
|
| 743 |
|
745 |
|
| 744 |
# create new line |
746 |
# create new line |
| 745 |
my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, ' |
747 |
my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, ' |
| 746 |
. 'description, accounttype, amountoutstanding) ' |
748 |
. 'description, accounttype, amountoutstanding, itemnumber, manager_id) ' |
| 747 |
. ' VALUES (?, ?, now(), ?, ?, ?, 0)'; |
749 |
. ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?)'; |
| 748 |
|
750 |
|
| 749 |
$dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, |
751 |
$dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, |
| 750 |
"Payment, thanks - $user", 'Pay'); |
752 |
"Payment, thanks - $user", 'Pay', $data->{'itemnumber'}, $manager_id); |
| 751 |
|
753 |
|
| 752 |
UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno ); |
754 |
UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno ); |
| 753 |
|
755 |
|
| 754 |
- |
|
|