View | Details | Raw Unified | Return to bug 21728
Collapse All | Expand All

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

Return to bug 21728