|
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 921-940
sub CanBookBeIssued {
Link Here
|
| 921 |
if ($notforloan->{'notforloan'}) { |
920 |
if ($notforloan->{'notforloan'}) { |
| 922 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
921 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
| 923 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
922 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
| 924 |
$issuingimpossible{itemtype_notforloan} = $item->{'itype'}; |
923 |
$issuingimpossible{itemtype_notforloan} = $effective_itemtype; |
| 925 |
} else { |
924 |
} else { |
| 926 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
925 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
| 927 |
$needsconfirmation{itemtype_notforloan} = $item->{'itype'}; |
926 |
$needsconfirmation{itemtype_notforloan} = $effective_itemtype; |
| 928 |
} |
927 |
} |
| 929 |
} |
928 |
} |
| 930 |
} |
929 |
} |
| 931 |
elsif ($biblioitem->{'notforloan'} == 1){ |
930 |
elsif ($biblioitem->{'notforloan'} == 1){ |
| 932 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
931 |
if (!C4::Context->preference("AllowNotForLoanOverride")) { |
| 933 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
932 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
| 934 |
$issuingimpossible{itemtype_notforloan} = $biblioitem->{'itemtype'}; |
933 |
$issuingimpossible{itemtype_notforloan} = $effective_itemtype; |
| 935 |
} else { |
934 |
} else { |
| 936 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
935 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
| 937 |
$needsconfirmation{itemtype_notforloan} = $biblioitem->{'itemtype'}; |
936 |
$needsconfirmation{itemtype_notforloan} = $effective_itemtype; |
| 938 |
} |
937 |
} |
| 939 |
} |
938 |
} |
| 940 |
} |
939 |
} |
| 941 |
- |
|
|