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