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

(-)a/C4/Circulation.pm (-20 / +7 lines)
Lines 2852-2877 sub AddRenewal { Link Here
2852
    # Charge a new rental fee, if applicable?
2852
    # Charge a new rental fee, if applicable?
2853
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2853
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2854
    if ( $charge > 0 ) {
2854
    if ( $charge > 0 ) {
2855
        my $accountno = C4::Accounts::getnextacctno( $borrowernumber );
2855
        my $description = 'Renewal of Rental Item '
2856
        my $manager_id = 0;
2856
            . $biblio->title
2857
        $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; 
2857
            . " $item->{'barcode'}";
2858
        my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
2858
2859
        Koha::Account::Line->new(
2859
        C4::Accounts::manualinvoice(
2860
            {
2860
            $borrowernumber, $itemnumber, $description, 'Rent', $charge
2861
                date              => dt_from_string(),
2861
        );
2862
                borrowernumber    => $borrowernumber,
2863
                accountno         => $accountno,
2864
                amount            => $charge,
2865
                manager_id        => $manager_id,
2866
                accounttype       => 'Rent',
2867
                amountoutstanding => $charge,
2868
                itemnumber        => $itemnumber,
2869
                branchcode        => $branchcode,
2870
                description       => 'Renewal of Rental Item '
2871
                  . $biblio->title
2872
                  . " $item->{'barcode'}",
2873
            }
2874
        )->store();
2875
    }
2862
    }
2876
2863
2877
    # Send a renewal slip according to checkout alert preferencei
2864
    # Send a renewal slip according to checkout alert preferencei
(-)a/C4/Reserves.pm (-15 / +3 lines)
Lines 570-589 sub ChargeReserveFee { Link Here
570
570
571
    return if !$fee || $fee == 0;    # the last test is needed to include 0.00
571
    return if !$fee || $fee == 0;    # the last test is needed to include 0.00
572
572
573
    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
573
    C4::Accounts::manualinvoice(
574
    my $nextacctno = C4::Accounts::getnextacctno($borrowernumber);
574
        $borrowernumber, undef, "Reserve Charge - $title", 'Res', $fee
575
575
    );
576
    Koha::Account::Line->new(
577
        {
578
            borrowernumber    => $borrowernumber,
579
            accountno         => $nextacctno,
580
            date              => dt_from_string(),
581
            amount            => $fee,
582
            description       => "Reserve Charge - $title",
583
            accounttype       => 'Res',
584
            amountoutstanding => $fee,
585
        }
586
    )->store();
587
}
576
}
588
577
589
=head2 GetReserveFee
578
=head2 GetReserveFee
590
- 

Return to bug 21678