Lines 683-689
sub CanBookBeIssued {
Link Here
|
683 |
my $item = GetItem(undef, $barcode ); |
683 |
my $item = GetItem(undef, $barcode ); |
684 |
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
684 |
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
685 |
my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); |
685 |
my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); |
686 |
$item->{'itemtype'}=$item->{'itype'}; |
686 |
my $effective_itemtype = $item->{itype}; # GetItem deals with that |
687 |
my $dbh = C4::Context->dbh; |
687 |
my $dbh = C4::Context->dbh; |
688 |
|
688 |
|
689 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
689 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
Lines 703-710
sub CanBookBeIssued {
Link Here
|
703 |
my $issuedate = $now->clone(); |
703 |
my $issuedate = $now->clone(); |
704 |
|
704 |
|
705 |
my $branch = _GetCircControlBranch($item,$borrower); |
705 |
my $branch = _GetCircControlBranch($item,$borrower); |
706 |
my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'}; |
706 |
$duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $borrower ); |
707 |
$duedate = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
|
|
708 |
|
707 |
|
709 |
# Offline circ calls AddIssue directly, doesn't run through here |
708 |
# Offline circ calls AddIssue directly, doesn't run through here |
710 |
# So issuingimpossible should be ok. |
709 |
# So issuingimpossible should be ok. |
Lines 729-735
sub CanBookBeIssued {
Link Here
|
729 |
branch => C4::Context->userenv->{'branch'}, |
728 |
branch => C4::Context->userenv->{'branch'}, |
730 |
type => 'localuse', |
729 |
type => 'localuse', |
731 |
itemnumber => $item->{'itemnumber'}, |
730 |
itemnumber => $item->{'itemnumber'}, |
732 |
itemtype => $item->{'itype'}, |
731 |
itemtype => $effective_itemtype, |
733 |
borrowernumber => $borrower->{'borrowernumber'}, |
732 |
borrowernumber => $borrower->{'borrowernumber'}, |
734 |
ccode => $item->{'ccode'}} |
733 |
ccode => $item->{'ccode'}} |
735 |
); |
734 |
); |
Lines 941-960
sub CanBookBeIssued {
Link Here
|
941 |
if ($notforloan->{'notforloan'}) { |
940 |
if ($notforloan->{'notforloan'}) { |
942 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
941 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
943 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
942 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
944 |
$issuingimpossible{itemtype_notforloan} = $item->{'itype'}; |
943 |
$issuingimpossible{itemtype_notforloan} = $effective_itemtype; |
945 |
} else { |
944 |
} else { |
946 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
945 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
947 |
$needsconfirmation{itemtype_notforloan} = $item->{'itype'}; |
946 |
$needsconfirmation{itemtype_notforloan} = $effective_itemtype; |
948 |
} |
947 |
} |
949 |
} |
948 |
} |
950 |
} |
949 |
} |
951 |
elsif ($biblioitem->{'notforloan'} == 1){ |
950 |
elsif ($biblioitem->{'notforloan'} == 1){ |
952 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
951 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
953 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
952 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
954 |
$issuingimpossible{itemtype_notforloan} = $biblioitem->{'itemtype'}; |
953 |
$issuingimpossible{itemtype_notforloan} = $effective_itemtype; |
955 |
} else { |
954 |
} else { |
956 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
955 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
957 |
$needsconfirmation{itemtype_notforloan} = $biblioitem->{'itemtype'}; |
956 |
$needsconfirmation{itemtype_notforloan} = $effective_itemtype; |
958 |
} |
957 |
} |
959 |
} |
958 |
} |
960 |
} |
959 |
} |
961 |
- |
|
|