Lines 146-152
sub recordpayment {
Link Here
|
146 |
my $usth = $dbh->prepare( |
146 |
my $usth = $dbh->prepare( |
147 |
"INSERT INTO accountlines |
147 |
"INSERT INTO accountlines |
148 |
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) |
148 |
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) |
149 |
VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)" |
149 |
VALUES (?,?,now(),?,'','Pay',?,?)" |
150 |
); |
150 |
); |
151 |
$usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); |
151 |
$usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); |
152 |
|
152 |
|
Lines 208-214
sub makepayment {
Link Here
|
208 |
my $udp = |
208 |
my $udp = |
209 |
$dbh->prepare( |
209 |
$dbh->prepare( |
210 |
"UPDATE accountlines |
210 |
"UPDATE accountlines |
211 |
SET amountoutstanding = 0, description = 'Payment,thanks' |
211 |
SET amountoutstanding = 0 |
212 |
WHERE accountlines_id = ? |
212 |
WHERE accountlines_id = ? |
213 |
" |
213 |
" |
214 |
); |
214 |
); |
Lines 231-237
sub makepayment {
Link Here
|
231 |
$dbh->prepare( |
231 |
$dbh->prepare( |
232 |
"INSERT |
232 |
"INSERT |
233 |
INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) |
233 |
INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) |
234 |
VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)" |
234 |
VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)" |
235 |
); |
235 |
); |
236 |
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); |
236 |
$ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); |
237 |
} |
237 |
} |
Lines 413-449
sub manualinvoice {
Link Here
|
413 |
my $accountno = getnextacctno($borrowernumber); |
413 |
my $accountno = getnextacctno($borrowernumber); |
414 |
my $amountleft = $amount; |
414 |
my $amountleft = $amount; |
415 |
|
415 |
|
416 |
# if ( $type eq 'CS' |
|
|
417 |
# || $type eq 'CB' |
418 |
# || $type eq 'CW' |
419 |
# || $type eq 'CF' |
420 |
# || $type eq 'CL' ) |
421 |
# { |
422 |
# my $amount2 = $amount * -1; # FIXME - $amount2 = -$amount |
423 |
# $amountleft = |
424 |
# fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user ); |
425 |
# } |
426 |
if ( $type eq 'N' ) { |
427 |
$desc .= " New Card"; |
428 |
} |
429 |
if ( $type eq 'F' ) { |
430 |
$desc .= " Fine"; |
431 |
} |
432 |
if ( $type eq 'A' ) { |
433 |
$desc .= " Account Management fee"; |
434 |
} |
435 |
if ( $type eq 'M' ) { |
436 |
$desc .= " Sundry"; |
437 |
} |
438 |
|
439 |
if ( $type eq 'L' && $desc eq '' ) { |
440 |
|
441 |
$desc = " Lost Item"; |
442 |
} |
443 |
# if ( $type eq 'REF' ) { |
444 |
# $desc .= " Cash Refund"; |
445 |
# $amountleft = refund( '', $borrowernumber, $amount ); |
446 |
# } |
447 |
if ( ( $type eq 'L' ) |
416 |
if ( ( $type eq 'L' ) |
448 |
or ( $type eq 'F' ) |
417 |
or ( $type eq 'F' ) |
449 |
or ( $type eq 'A' ) |
418 |
or ( $type eq 'A' ) |
Lines 835-841
sub recordpayment_selectaccts {
Link Here
|
835 |
# create new line |
804 |
# create new line |
836 |
$sql = 'INSERT INTO accountlines ' . |
805 |
$sql = 'INSERT INTO accountlines ' . |
837 |
'(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . |
806 |
'(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . |
838 |
q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|; |
807 |
q|VALUES (?,?,now(),?,'','Pay',?,?,?)|; |
839 |
$dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); |
808 |
$dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); |
840 |
UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); |
809 |
UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); |
841 |
|
810 |
|