Lines 2209-2217
sub _FixAccountForLostAndReturned {
Link Here
|
2209 |
$amountleft *= -1 if ($amountleft > 0); |
2209 |
$amountleft *= -1 if ($amountleft > 0); |
2210 |
my $desc = "Item Returned " . $item_id; |
2210 |
my $desc = "Item Returned " . $item_id; |
2211 |
$usth = $dbh->prepare("INSERT INTO accountlines |
2211 |
$usth = $dbh->prepare("INSERT INTO accountlines |
2212 |
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) |
2212 |
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,branchcode) |
2213 |
VALUES (?,?,now(),?,?,'CR',?)"); |
2213 |
VALUES (?,?,now(),?,?,'CR',?,?)"); |
2214 |
$usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft); |
2214 |
$usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft,C4::Context->userenv->{'branch'}); |
2215 |
if ($borrowernumber) { |
2215 |
if ($borrowernumber) { |
2216 |
# FIXME: same as query above. use 1 sth for both |
2216 |
# FIXME: same as query above. use 1 sth for both |
2217 |
$usth = $dbh->prepare("INSERT INTO accountoffsets |
2217 |
$usth = $dbh->prepare("INSERT INTO accountoffsets |
Lines 2582-2593
sub AddRenewal {
Link Here
|
2582 |
$sth = $dbh->prepare( |
2582 |
$sth = $dbh->prepare( |
2583 |
"INSERT INTO accountlines |
2583 |
"INSERT INTO accountlines |
2584 |
(date, borrowernumber, accountno, amount, manager_id, |
2584 |
(date, borrowernumber, accountno, amount, manager_id, |
2585 |
description,accounttype, amountoutstanding, itemnumber) |
2585 |
description,accounttype, amountoutstanding, itemnumber, branch) |
2586 |
VALUES (now(),?,?,?,?,?,?,?,?)" |
2586 |
VALUES (now(),?,?,?,?,?,?,?,?,?)" |
2587 |
); |
2587 |
); |
2588 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
2588 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
2589 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2589 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2590 |
'Rent', $charge, $itemnumber ); |
2590 |
'Rent', $charge, $itemnumber, C4::Context->userenv->{'branch'} ); |
2591 |
} |
2591 |
} |
2592 |
|
2592 |
|
2593 |
# Send a renewal slip according to checkout alert preferencei |
2593 |
# Send a renewal slip according to checkout alert preferencei |
Lines 2764-2774
sub AddIssuingCharge {
Link Here
|
2764 |
INSERT INTO accountlines |
2764 |
INSERT INTO accountlines |
2765 |
(borrowernumber, itemnumber, accountno, |
2765 |
(borrowernumber, itemnumber, accountno, |
2766 |
date, amount, description, accounttype, |
2766 |
date, amount, description, accounttype, |
2767 |
amountoutstanding, manager_id) |
2767 |
amountoutstanding, manager_id, branchcode) |
2768 |
VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?) |
2768 |
VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?,?) |
2769 |
"; |
2769 |
"; |
2770 |
my $sth = $dbh->prepare($query); |
2770 |
my $sth = $dbh->prepare($query); |
2771 |
$sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id ); |
2771 |
$sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id, C4::Context->userenv->{'branch'} ); |
2772 |
$sth->finish; |
2772 |
$sth->finish; |
2773 |
} |
2773 |
} |
2774 |
|
2774 |
|