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

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

Return to bug 23382