Lines 3221-3256
sub AddIssuingCharge {
Link Here
|
3221 |
|
3221 |
|
3222 |
# FIXME What if checkout does not exist? |
3222 |
# FIXME What if checkout does not exist? |
3223 |
|
3223 |
|
3224 |
my $nextaccntno = C4::Accounts::getnextacctno( $checkout->borrowernumber ); |
3224 |
my $account = Koha::Account->new({ patron_id => $checkout->borrowernumber }); |
3225 |
|
3225 |
my $accountline = $account->add_debit( |
3226 |
my $manager_id = 0; |
|
|
3227 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
3228 |
|
3229 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
3230 |
|
3231 |
my $accountline = Koha::Account::Line->new( |
3232 |
{ |
3226 |
{ |
3233 |
borrowernumber => $checkout->borrowernumber, |
3227 |
amount => $charge, |
3234 |
itemnumber => $checkout->itemnumber, |
3228 |
description => 'Rental', |
3235 |
issue_id => $checkout->issue_id, |
3229 |
note => undef, |
3236 |
accountno => $nextaccntno, |
3230 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
3237 |
amount => $charge, |
3231 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
3238 |
amountoutstanding => $charge, |
3232 |
type => 'rent', |
3239 |
manager_id => $manager_id, |
3233 |
item_id => $checkout->itemnumber, |
3240 |
branchcode => $branchcode, |
3234 |
issue_id => $checkout->issue_id, |
3241 |
description => 'Rental', |
|
|
3242 |
accounttype => 'Rent', |
3243 |
date => \'NOW()', |
3244 |
} |
3235 |
} |
3245 |
)->store(); |
3236 |
); |
3246 |
|
|
|
3247 |
Koha::Account::Offset->new( |
3248 |
{ |
3249 |
debit_id => $accountline->id, |
3250 |
type => 'Rental Fee', |
3251 |
amount => $charge, |
3252 |
} |
3253 |
)->store(); |
3254 |
} |
3237 |
} |
3255 |
|
3238 |
|
3256 |
=head2 GetTransfers |
3239 |
=head2 GetTransfers |
3257 |
- |
|
|