|
Lines 1411-1417
sub AddIssue {
Link Here
|
| 1411 |
# If it costs to borrow this book, charge it to the patron's account. |
1411 |
# If it costs to borrow this book, charge it to the patron's account. |
| 1412 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
1412 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
| 1413 |
if ( $charge > 0 ) { |
1413 |
if ( $charge > 0 ) { |
| 1414 |
AddIssuingCharge( $issue, $charge ); |
1414 |
my $description = "Rental"; |
|
|
1415 |
AddIssuingCharge( $issue, $charge, $description ); |
| 1415 |
$item->{'charge'} = $charge; |
1416 |
$item->{'charge'} = $charge; |
| 1416 |
} |
1417 |
} |
| 1417 |
|
1418 |
|
|
Lines 2878-2903
sub AddRenewal {
Link Here
|
| 2878 |
# Charge a new rental fee, if applicable? |
2879 |
# Charge a new rental fee, if applicable? |
| 2879 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2880 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
| 2880 |
if ( $charge > 0 ) { |
2881 |
if ( $charge > 0 ) { |
| 2881 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2882 |
my $description = "Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}"; |
| 2882 |
my $manager_id = 0; |
2883 |
AddIssuingCharge($issue, $charge, $description); |
| 2883 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
|
|
| 2884 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
| 2885 |
Koha::Account::Line->new( |
| 2886 |
{ |
| 2887 |
date => dt_from_string(), |
| 2888 |
borrowernumber => $borrowernumber, |
| 2889 |
accountno => $accountno, |
| 2890 |
amount => $charge, |
| 2891 |
manager_id => $manager_id, |
| 2892 |
accounttype => 'Rent', |
| 2893 |
amountoutstanding => $charge, |
| 2894 |
itemnumber => $itemnumber, |
| 2895 |
branchcode => $branchcode, |
| 2896 |
description => 'Renewal of Rental Item ' |
| 2897 |
. $biblio->title |
| 2898 |
. " $item->{'barcode'}", |
| 2899 |
} |
| 2900 |
)->store(); |
| 2901 |
} |
2884 |
} |
| 2902 |
|
2885 |
|
| 2903 |
# Send a renewal slip according to checkout alert preferencei |
2886 |
# Send a renewal slip according to checkout alert preferencei |
|
Lines 3222-3228
sub _get_discount_from_rule {
Link Here
|
| 3222 |
=cut |
3205 |
=cut |
| 3223 |
|
3206 |
|
| 3224 |
sub AddIssuingCharge { |
3207 |
sub AddIssuingCharge { |
| 3225 |
my ( $checkout, $charge ) = @_; |
3208 |
my ( $checkout, $charge, $description ) = @_; |
| 3226 |
|
3209 |
|
| 3227 |
# FIXME What if checkout does not exist? |
3210 |
# FIXME What if checkout does not exist? |
| 3228 |
|
3211 |
|
|
Lines 3230-3236
sub AddIssuingCharge {
Link Here
|
| 3230 |
my $accountline = $account->add_debit( |
3213 |
my $accountline = $account->add_debit( |
| 3231 |
{ |
3214 |
{ |
| 3232 |
amount => $charge, |
3215 |
amount => $charge, |
| 3233 |
description => 'Rental', |
3216 |
description => $description, |
| 3234 |
note => undef, |
3217 |
note => undef, |
| 3235 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
3218 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 3236 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
3219 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 3237 |
- |
|
|