Lines 145-151
sub recordpayment {
Link Here
|
145 |
my $usth = $dbh->prepare( |
145 |
my $usth = $dbh->prepare( |
146 |
"INSERT INTO accountlines |
146 |
"INSERT INTO accountlines |
147 |
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) |
147 |
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) |
148 |
VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)" |
148 |
VALUES (?,?,now(),?,'','Pay',?,?)" |
149 |
); |
149 |
); |
150 |
$usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); |
150 |
$usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); |
151 |
|
151 |
|
Lines 207-213
sub makepayment {
Link Here
|
207 |
my $udp = |
207 |
my $udp = |
208 |
$dbh->prepare( |
208 |
$dbh->prepare( |
209 |
"UPDATE accountlines |
209 |
"UPDATE accountlines |
210 |
SET amountoutstanding = 0, description = 'Payment,thanks' |
210 |
SET amountoutstanding = 0 |
211 |
WHERE accountlines_id = ? |
211 |
WHERE accountlines_id = ? |
212 |
" |
212 |
" |
213 |
); |
213 |
); |
Lines 230-236
sub makepayment {
Link Here
|
230 |
$dbh->prepare( |
230 |
$dbh->prepare( |
231 |
"INSERT |
231 |
"INSERT |
232 |
INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) |
232 |
INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) |
233 |
VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)" |
233 |
VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)" |
234 |
); |
234 |
); |
235 |
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); |
235 |
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); |
236 |
} |
236 |
} |
Lines 412-434
sub manualinvoice {
Link Here
|
412 |
my $accountno = getnextacctno($borrowernumber); |
412 |
my $accountno = getnextacctno($borrowernumber); |
413 |
my $amountleft = $amount; |
413 |
my $amountleft = $amount; |
414 |
|
414 |
|
415 |
if ( $type eq 'N' ) { |
|
|
416 |
$desc .= " New Card"; |
417 |
} |
418 |
if ( $type eq 'F' ) { |
419 |
$desc .= " Fine"; |
420 |
} |
421 |
if ( $type eq 'A' ) { |
422 |
$desc .= " Account Management fee"; |
423 |
} |
424 |
if ( $type eq 'M' ) { |
425 |
$desc .= " Sundry"; |
426 |
} |
427 |
|
428 |
if ( $type eq 'L' && $desc eq '' ) { |
429 |
|
430 |
$desc = " Lost Item"; |
431 |
} |
432 |
if ( ( $type eq 'L' ) |
415 |
if ( ( $type eq 'L' ) |
433 |
or ( $type eq 'F' ) |
416 |
or ( $type eq 'F' ) |
434 |
or ( $type eq 'A' ) |
417 |
or ( $type eq 'A' ) |
Lines 657-663
sub recordpayment_selectaccts {
Link Here
|
657 |
# create new line |
640 |
# create new line |
658 |
$sql = 'INSERT INTO accountlines ' . |
641 |
$sql = 'INSERT INTO accountlines ' . |
659 |
'(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . |
642 |
'(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . |
660 |
q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|; |
643 |
q|VALUES (?,?,now(),?,'','Pay',?,?,?)|; |
661 |
$dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); |
644 |
$dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); |
662 |
UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); |
645 |
UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); |
663 |
|
646 |
|