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