|
Lines 1421-1427
sub AddIssue {
Link Here
|
| 1421 |
# If it costs to borrow this book, charge it to the patron's account. |
1421 |
# If it costs to borrow this book, charge it to the patron's account. |
| 1422 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
1422 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
| 1423 |
if ( $charge > 0 ) { |
1423 |
if ( $charge > 0 ) { |
| 1424 |
AddIssuingCharge( $issue, $charge ); |
1424 |
my $description = "Rental"; |
|
|
1425 |
AddIssuingCharge( $issue, $charge, $description ); |
| 1425 |
$item->{'charge'} = $charge; |
1426 |
$item->{'charge'} = $charge; |
| 1426 |
} |
1427 |
} |
| 1427 |
|
1428 |
|
|
Lines 2892-2917
sub AddRenewal {
Link Here
|
| 2892 |
# Charge a new rental fee, if applicable? |
2893 |
# Charge a new rental fee, if applicable? |
| 2893 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2894 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
| 2894 |
if ( $charge > 0 ) { |
2895 |
if ( $charge > 0 ) { |
| 2895 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2896 |
my $description = "Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}"; |
| 2896 |
my $manager_id = 0; |
2897 |
AddIssuingCharge($issue, $charge, $description); |
| 2897 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
|
|
| 2898 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
| 2899 |
Koha::Account::Line->new( |
| 2900 |
{ |
| 2901 |
date => dt_from_string(), |
| 2902 |
borrowernumber => $borrowernumber, |
| 2903 |
accountno => $accountno, |
| 2904 |
amount => $charge, |
| 2905 |
manager_id => $manager_id, |
| 2906 |
accounttype => 'Rent', |
| 2907 |
amountoutstanding => $charge, |
| 2908 |
itemnumber => $itemnumber, |
| 2909 |
branchcode => $branchcode, |
| 2910 |
description => 'Renewal of Rental Item ' |
| 2911 |
. $biblio->title |
| 2912 |
. " $item->{'barcode'}", |
| 2913 |
} |
| 2914 |
)->store(); |
| 2915 |
} |
2898 |
} |
| 2916 |
|
2899 |
|
| 2917 |
# Send a renewal slip according to checkout alert preferencei |
2900 |
# Send a renewal slip according to checkout alert preferencei |
|
Lines 3236-3242
sub _get_discount_from_rule {
Link Here
|
| 3236 |
=cut |
3219 |
=cut |
| 3237 |
|
3220 |
|
| 3238 |
sub AddIssuingCharge { |
3221 |
sub AddIssuingCharge { |
| 3239 |
my ( $checkout, $charge ) = @_; |
3222 |
my ( $checkout, $charge, $description ) = @_; |
| 3240 |
|
3223 |
|
| 3241 |
# FIXME What if checkout does not exist? |
3224 |
# FIXME What if checkout does not exist? |
| 3242 |
|
3225 |
|
|
Lines 3244-3250
sub AddIssuingCharge {
Link Here
|
| 3244 |
my $accountline = $account->add_debit( |
3227 |
my $accountline = $account->add_debit( |
| 3245 |
{ |
3228 |
{ |
| 3246 |
amount => $charge, |
3229 |
amount => $charge, |
| 3247 |
description => 'Rental', |
3230 |
description => $description, |
| 3248 |
note => undef, |
3231 |
note => undef, |
| 3249 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
3232 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 3250 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
3233 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 3251 |
- |
|
|