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

(-)a/C4/Circulation.pm (-9 / +14 lines)
Lines 709-716 sub CanBookBeIssued { Link Here
709
    unless ( $duedate ) {
709
    unless ( $duedate ) {
710
        my $issuedate = $now->clone();
710
        my $issuedate = $now->clone();
711
711
712
        my $branch = $circ_library;
712
        $duedate = CalcDateDue( $issuedate, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
713
        $duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed );
714
713
715
        # Offline circ calls AddIssue directly, doesn't run through here
714
        # Offline circ calls AddIssue directly, doesn't run through here
716
        #  So issuingimpossible should be ok.
715
        #  So issuingimpossible should be ok.
Lines 1000-1015 sub CanBookBeIssued { Link Here
1000
              if ( $patron->branchcode ne $userenv->{branch} );
999
              if ( $patron->branchcode ne $userenv->{branch} );
1001
        }
1000
        }
1002
    }
1001
    }
1002
1003
    #
1003
    #
1004
    # CHECK IF THERE IS RENTAL CHARGES. RENTAL MUST BE CONFIRMED BY THE BORROWER
1004
    # CHECK IF THERE IS RENTAL CHARGES. RENTAL MUST BE CONFIRMED BY THE BORROWER
1005
    #
1005
    #
1006
    my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation");
1006
    my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation");
1007
1007
    if ($rentalConfirmation) {
1008
    if ( $rentalConfirmation ){
1009
        my ($rentalCharge) = GetIssuingCharges( $item_object->itemnumber, $patron->borrowernumber );
1008
        my ($rentalCharge) = GetIssuingCharges( $item_object->itemnumber, $patron->borrowernumber );
1010
        my $itemtype = Koha::ItemTypes->find( $item_object->itype ); # GetItem sets effective itemtype
1009
1011
        $rentalCharge += $fees->accumulate_rentalcharge({ from => dt_from_string(), to => $duedate });
1010
        my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
1012
        if ( $rentalCharge > 0 ){
1011
        if ($itemtype_object) {
1012
            my $accumulate_charge = $fees->accumulate_rentalcharge();
1013
            if ( $accumulate_charge > 0 ) {
1014
                $rentalCharge += $accumulate_charge;
1015
            }
1016
        }
1017
1018
        if ( $rentalCharge > 0 ) {
1013
            $needsconfirmation{RENTALCHARGE} = $rentalCharge;
1019
            $needsconfirmation{RENTALCHARGE} = $rentalCharge;
1014
        }
1020
        }
1015
    }
1021
    }
Lines 1477-1483 sub AddIssue { Link Here
1477
            if ( $itemtype_object ) {
1483
            if ( $itemtype_object ) {
1478
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1484
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1479
                if ( $accumulate_charge > 0 ) {
1485
                if ( $accumulate_charge > 0 ) {
1480
                    AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0;
1486
                    AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' );
1481
                    $charge += $accumulate_charge;
1487
                    $charge += $accumulate_charge;
1482
                    $item_unblessed->{charge} = $charge;
1488
                    $item_unblessed->{charge} = $charge;
1483
                }
1489
                }
1484
- 

Return to bug 23382