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

(-)a/C4/Circulation.pm (-9 / +7 lines)
Lines 670-676 sub CanBookBeIssued { Link Here
670
    my $item = GetItem(undef, $barcode );
670
    my $item = GetItem(undef, $barcode );
671
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
671
    my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
672
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
672
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
673
	$item->{'itemtype'}=$item->{'itype'}; 
673
    my $effective_itemtype = $item->{itype}; # GetItem deals with that
674
    my $dbh             = C4::Context->dbh;
674
    my $dbh             = C4::Context->dbh;
675
    my $patron_unblessed = $patron->unblessed;
675
    my $patron_unblessed = $patron->unblessed;
676
676
Lines 691-698 sub CanBookBeIssued { Link Here
691
        my $issuedate = $now->clone();
691
        my $issuedate = $now->clone();
692
692
693
        my $branch = _GetCircControlBranch($item, $patron_unblessed);
693
        my $branch = _GetCircControlBranch($item, $patron_unblessed);
694
        my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'};
694
        $duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed );
695
        $duedate = CalcDateDue( $issuedate, $itype, $branch, $patron_unblessed );
696
695
697
        # Offline circ calls AddIssue directly, doesn't run through here
696
        # Offline circ calls AddIssue directly, doesn't run through here
698
        #  So issuingimpossible should be ok.
697
        #  So issuingimpossible should be ok.
Lines 716-722 sub CanBookBeIssued { Link Here
716
                     branch => C4::Context->userenv->{'branch'},
715
                     branch => C4::Context->userenv->{'branch'},
717
                     type => 'localuse',
716
                     type => 'localuse',
718
                     itemnumber => $item->{'itemnumber'},
717
                     itemnumber => $item->{'itemnumber'},
719
                     itemtype => $item->{'itype'},
718
                     itemtype => $effective_itemtype,
720
                     borrowernumber => $patron->borrowernumber,
719
                     borrowernumber => $patron->borrowernumber,
721
                     ccode => $item->{'ccode'}}
720
                     ccode => $item->{'ccode'}}
722
                    );
721
                    );
Lines 923-942 sub CanBookBeIssued { Link Here
923
            if ($notforloan->{'notforloan'}) {
922
            if ($notforloan->{'notforloan'}) {
924
                if (!C4::Context->preference("AllowNotForLoanOverride")) {
923
                if (!C4::Context->preference("AllowNotForLoanOverride")) {
925
                    $issuingimpossible{NOT_FOR_LOAN} = 1;
924
                    $issuingimpossible{NOT_FOR_LOAN} = 1;
926
                    $issuingimpossible{itemtype_notforloan} = $item->{'itype'};
925
                    $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
927
                } else {
926
                } else {
928
                    $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
927
                    $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
929
                    $needsconfirmation{itemtype_notforloan} = $item->{'itype'};
928
                    $needsconfirmation{itemtype_notforloan} = $effective_itemtype;
930
                }
929
                }
931
            }
930
            }
932
        }
931
        }
933
        elsif ($biblioitem->{'notforloan'} == 1){
932
        elsif ($biblioitem->{'notforloan'} == 1){
934
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
933
            if (!C4::Context->preference("AllowNotForLoanOverride")) {
935
                $issuingimpossible{NOT_FOR_LOAN} = 1;
934
                $issuingimpossible{NOT_FOR_LOAN} = 1;
936
                $issuingimpossible{itemtype_notforloan} = $biblioitem->{'itemtype'};
935
                $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
937
            } else {
936
            } else {
938
                $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
937
                $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
939
                $needsconfirmation{itemtype_notforloan} = $biblioitem->{'itemtype'};
938
                $needsconfirmation{itemtype_notforloan} = $effective_itemtype;
940
            }
939
            }
941
        }
940
        }
942
    }
941
    }
943
- 

Return to bug 19943