|
Lines 3240-3275
sub AddIssuingCharge {
Link Here
|
| 3240 |
|
3240 |
|
| 3241 |
# FIXME What if checkout does not exist? |
3241 |
# FIXME What if checkout does not exist? |
| 3242 |
|
3242 |
|
| 3243 |
my $nextaccntno = C4::Accounts::getnextacctno( $checkout->borrowernumber ); |
3243 |
my $account = Koha::Account->new({ patron_id => $checkout->borrowernumber }); |
| 3244 |
|
3244 |
my $accountline = $account->add_debit( |
| 3245 |
my $manager_id = 0; |
|
|
| 3246 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
| 3247 |
|
| 3248 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
| 3249 |
|
| 3250 |
my $accountline = Koha::Account::Line->new( |
| 3251 |
{ |
3245 |
{ |
| 3252 |
borrowernumber => $checkout->borrowernumber, |
3246 |
amount => $charge, |
| 3253 |
itemnumber => $checkout->itemnumber, |
3247 |
description => 'Rental', |
| 3254 |
issue_id => $checkout->issue_id, |
3248 |
note => undef, |
| 3255 |
accountno => $nextaccntno, |
3249 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 3256 |
amount => $charge, |
3250 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 3257 |
amountoutstanding => $charge, |
3251 |
type => 'rent', |
| 3258 |
manager_id => $manager_id, |
3252 |
item_id => $checkout->itemnumber, |
| 3259 |
branchcode => $branchcode, |
3253 |
issue_id => $checkout->issue_id, |
| 3260 |
description => 'Rental', |
|
|
| 3261 |
accounttype => 'Rent', |
| 3262 |
date => \'NOW()', |
| 3263 |
} |
3254 |
} |
| 3264 |
)->store(); |
3255 |
); |
| 3265 |
|
|
|
| 3266 |
Koha::Account::Offset->new( |
| 3267 |
{ |
| 3268 |
debit_id => $accountline->id, |
| 3269 |
type => 'Rental Fee', |
| 3270 |
amount => $charge, |
| 3271 |
} |
| 3272 |
)->store(); |
| 3273 |
} |
3256 |
} |
| 3274 |
|
3257 |
|
| 3275 |
=head2 GetTransfers |
3258 |
=head2 GetTransfers |
| 3276 |
- |
|
|