Lines 2852-2877
sub AddRenewal {
Link Here
|
2852 |
# Charge a new rental fee, if applicable? |
2852 |
# Charge a new rental fee, if applicable? |
2853 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2853 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2854 |
if ( $charge > 0 ) { |
2854 |
if ( $charge > 0 ) { |
2855 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2855 |
my $description = 'Renewal of Rental Item ' |
2856 |
my $manager_id = 0; |
2856 |
. $biblio->title |
2857 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
2857 |
. " $item->{'barcode'}"; |
2858 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
2858 |
|
2859 |
Koha::Account::Line->new( |
2859 |
C4::Accounts::manualinvoice( |
2860 |
{ |
2860 |
$borrowernumber, $itemnumber, $description, 'Rent', $charge |
2861 |
date => dt_from_string(), |
2861 |
); |
2862 |
borrowernumber => $borrowernumber, |
|
|
2863 |
accountno => $accountno, |
2864 |
amount => $charge, |
2865 |
manager_id => $manager_id, |
2866 |
accounttype => 'Rent', |
2867 |
amountoutstanding => $charge, |
2868 |
itemnumber => $itemnumber, |
2869 |
branchcode => $branchcode, |
2870 |
description => 'Renewal of Rental Item ' |
2871 |
. $biblio->title |
2872 |
. " $item->{'barcode'}", |
2873 |
} |
2874 |
)->store(); |
2875 |
} |
2862 |
} |
2876 |
|
2863 |
|
2877 |
# Send a renewal slip according to checkout alert preferencei |
2864 |
# Send a renewal slip according to checkout alert preferencei |