Lines 182-203
sub makepayment {
Link Here
|
182 |
$descriptionpayment="Part Payment for account n°".$accountno.",thanks - ".$user." : ".$data->{'description'}; |
182 |
$descriptionpayment="Part Payment for account n°".$accountno.",thanks - ".$user." : ".$data->{'description'}; |
183 |
} |
183 |
} |
184 |
|
184 |
|
185 |
$dbh->do( |
185 |
$sth = $dbh->prepare( |
186 |
"UPDATE accountlines |
186 |
"UPDATE accountlines |
187 |
SET amountoutstanding = $newamountoutstanding |
187 |
SET amountoutstanding = ? |
188 |
WHERE id = $accountlineid |
188 |
WHERE id = ? |
189 |
" |
189 |
"); |
190 |
); |
190 |
$sth->execute($newamountoutstanding,$accountlineid); |
191 |
|
191 |
|
192 |
# create new line |
192 |
$sth = $dbh->prepare( " |
193 |
$dbh->do( " |
193 |
INSERT INTO accountlines |
194 |
INSERT INTO accountlines |
194 |
(borrowernumber, accountno, date, time, amount, |
195 |
(borrowernumber, accountno, date, time, amount, |
195 |
description, accounttype, amountoutstanding, note, |
196 |
description, accounttype, amountoutstanding, |
196 |
meansofpayment, manager_id) |
197 |
note, meansofpayment, manager_id) |
197 |
VALUES (?,?, now(), CURRENT_TIME, ?, ?, 'Pay', 0, ?, ?, ?) |
198 |
VALUES ($borrowernumber, $nextaccntno, now(), CURRENT_TIME, $payment, |
|
|
199 |
'$descriptionpayment', 'Pay', 0, '$note', '$meansofpayment', '$manager_id') |
200 |
" ); |
198 |
" ); |
|
|
199 |
$sth->execute($borrowernumber, $nextaccntno, $payment, $descriptionpayment, $note, $meansofpayment, $manager_id); |
201 |
|
200 |
|
202 |
# FIXME - The second argument to &UpdateStats is supposed to be the |
201 |
# FIXME - The second argument to &UpdateStats is supposed to be the |
203 |
# branch code. |
202 |
# branch code. |
Lines 211-217
sub makepayment {
Link Here
|
211 |
returnlost( $borrowernumber, $data->{'itemnumber'} ); |
210 |
returnlost( $borrowernumber, $data->{'itemnumber'} ); |
212 |
} |
211 |
} |
213 |
|
212 |
|
214 |
my $sth = $dbh->prepare("SELECT max(id) AS lastinsertid FROM accountlines"); |
213 |
$sth = $dbh->prepare("SELECT max(id) AS lastinsertid FROM accountlines"); |
215 |
$sth->execute(); |
214 |
$sth->execute(); |
216 |
my $datalastinsertid = $sth->fetchrow_hashref; |
215 |
my $datalastinsertid = $sth->fetchrow_hashref; |
217 |
$sth->finish; |
216 |
$sth->finish; |
218 |
- |
|
|