|
Lines 567-590
sub GetOtherReserves {
Link Here
|
| 567 |
|
567 |
|
| 568 |
sub ChargeReserveFee { |
568 |
sub ChargeReserveFee { |
| 569 |
my ( $borrowernumber, $fee, $title ) = @_; |
569 |
my ( $borrowernumber, $fee, $title ) = @_; |
| 570 |
|
|
|
| 571 |
return if !$fee || $fee == 0; # the last test is needed to include 0.00 |
570 |
return if !$fee || $fee == 0; # the last test is needed to include 0.00 |
| 572 |
|
571 |
Koha::Account->new( { patron_id => $borrowernumber } )->add_debit( |
| 573 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
|
|
| 574 |
my $nextacctno = C4::Accounts::getnextacctno($borrowernumber); |
| 575 |
|
| 576 |
Koha::Account::Line->new( |
| 577 |
{ |
572 |
{ |
| 578 |
borrowernumber => $borrowernumber, |
573 |
amount => $fee, |
| 579 |
accountno => $nextacctno, |
574 |
description => "Reserve Charge - " . $title, |
| 580 |
date => dt_from_string(), |
575 |
note => undef, |
| 581 |
amount => $fee, |
576 |
user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 582 |
description => "Reserve Charge - $title", |
577 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 583 |
accounttype => 'Res', |
578 |
sip => undef, |
| 584 |
amountoutstanding => $fee, |
579 |
invoice_type => undef, |
| 585 |
branchcode => $branchcode |
580 |
type => 'reserve', |
|
|
581 |
item_id => undef |
| 586 |
} |
582 |
} |
| 587 |
)->store(); |
583 |
); |
| 588 |
} |
584 |
} |
| 589 |
|
585 |
|
| 590 |
=head2 GetReserveFee |
586 |
=head2 GetReserveFee |
| 591 |
- |
|
|