|
Lines 1409-1415
sub AddIssue {
Link Here
|
| 1409 |
# If it costs to borrow this book, charge it to the patron's account. |
1409 |
# If it costs to borrow this book, charge it to the patron's account. |
| 1410 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
1410 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
| 1411 |
if ( $charge > 0 ) { |
1411 |
if ( $charge > 0 ) { |
| 1412 |
AddIssuingCharge( $issue, $charge ); |
1412 |
my $description = "Rental"; |
|
|
1413 |
AddIssuingCharge( $issue, $charge, $description ); |
| 1413 |
$item->{'charge'} = $charge; |
1414 |
$item->{'charge'} = $charge; |
| 1414 |
} |
1415 |
} |
| 1415 |
|
1416 |
|
|
Lines 2873-2890
sub AddRenewal {
Link Here
|
| 2873 |
# Charge a new rental fee, if applicable? |
2874 |
# Charge a new rental fee, if applicable? |
| 2874 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2875 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
| 2875 |
if ( $charge > 0 ) { |
2876 |
if ( $charge > 0 ) { |
| 2876 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2877 |
my $description = "Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}"; |
| 2877 |
my $manager_id = 0; |
2878 |
AddIssuingCharge($issue, $charge, $description); |
| 2878 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
|
|
| 2879 |
$sth = $dbh->prepare( |
| 2880 |
"INSERT INTO accountlines |
| 2881 |
(date, borrowernumber, accountno, amount, manager_id, |
| 2882 |
description,accounttype, amountoutstanding, itemnumber) |
| 2883 |
VALUES (now(),?,?,?,?,?,?,?,?)" |
| 2884 |
); |
| 2885 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
| 2886 |
"Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}", |
| 2887 |
'Rent', $charge, $itemnumber ); |
| 2888 |
} |
2879 |
} |
| 2889 |
|
2880 |
|
| 2890 |
# Send a renewal slip according to checkout alert preferencei |
2881 |
# Send a renewal slip according to checkout alert preferencei |
|
Lines 3209-3215
sub _get_discount_from_rule {
Link Here
|
| 3209 |
=cut |
3200 |
=cut |
| 3210 |
|
3201 |
|
| 3211 |
sub AddIssuingCharge { |
3202 |
sub AddIssuingCharge { |
| 3212 |
my ( $checkout, $charge ) = @_; |
3203 |
my ( $checkout, $charge, $description ) = @_; |
| 3213 |
|
3204 |
|
| 3214 |
# FIXME What if checkout does not exist? |
3205 |
# FIXME What if checkout does not exist? |
| 3215 |
|
3206 |
|
|
Lines 3227-3233
sub AddIssuingCharge {
Link Here
|
| 3227 |
amount => $charge, |
3218 |
amount => $charge, |
| 3228 |
amountoutstanding => $charge, |
3219 |
amountoutstanding => $charge, |
| 3229 |
manager_id => $manager_id, |
3220 |
manager_id => $manager_id, |
| 3230 |
description => 'Rental', |
3221 |
description => $description, |
| 3231 |
accounttype => 'Rent', |
3222 |
accounttype => 'Rent', |
| 3232 |
date => \'NOW()', |
3223 |
date => \'NOW()', |
| 3233 |
} |
3224 |
} |
| 3234 |
- |
|
|