Lines 670-686
sub CanBookBeIssued {
Link Here
|
670 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
670 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
671 |
my $override_high_holds = $params->{override_high_holds} || 0; |
671 |
my $override_high_holds = $params->{override_high_holds} || 0; |
672 |
|
672 |
|
673 |
my $item = GetItem(undef, $barcode ); |
673 |
my $item = Koha::Items->find({barcode => $barcode }); |
674 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
674 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
675 |
unless ( $item ) { |
675 |
unless ( $item ) { |
676 |
$issuingimpossible{UNKNOWN_BARCODE} = 1; |
676 |
$issuingimpossible{UNKNOWN_BARCODE} = 1; |
677 |
} |
677 |
} |
678 |
return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; |
678 |
return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; |
679 |
|
679 |
|
680 |
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
680 |
my $item_unblessed = $item->unblessed; # Transition... |
681 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
681 |
my $issue = $item->checkout; |
|
|
682 |
my $biblio = $item->biblio; |
682 |
my $biblioitem = $biblio->biblioitem; |
683 |
my $biblioitem = $biblio->biblioitem; |
683 |
my $effective_itemtype = $item->{itype}; # GetItem deals with that |
684 |
my $effective_itemtype = $item->effective_itemtype; |
684 |
my $dbh = C4::Context->dbh; |
685 |
my $dbh = C4::Context->dbh; |
685 |
my $patron_unblessed = $patron->unblessed; |
686 |
my $patron_unblessed = $patron->unblessed; |
686 |
|
687 |
|
Lines 694-700
sub CanBookBeIssued {
Link Here
|
694 |
unless ( $duedate ) { |
695 |
unless ( $duedate ) { |
695 |
my $issuedate = $now->clone(); |
696 |
my $issuedate = $now->clone(); |
696 |
|
697 |
|
697 |
my $branch = _GetCircControlBranch($item, $patron_unblessed); |
698 |
my $branch = _GetCircControlBranch($item_unblessed, $patron_unblessed); |
698 |
$duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); |
699 |
$duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); |
699 |
|
700 |
|
700 |
# Offline circ calls AddIssue directly, doesn't run through here |
701 |
# Offline circ calls AddIssue directly, doesn't run through here |
Lines 713-729
sub CanBookBeIssued {
Link Here
|
713 |
# |
714 |
# |
714 |
# BORROWER STATUS |
715 |
# BORROWER STATUS |
715 |
# |
716 |
# |
716 |
if ( $patron->category->category_type eq 'X' && ( $item->{barcode} )) { |
717 |
if ( $patron->category->category_type eq 'X' && ( $item->barcode )) { |
717 |
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . |
718 |
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . |
718 |
&UpdateStats({ |
719 |
&UpdateStats({ |
719 |
branch => C4::Context->userenv->{'branch'}, |
720 |
branch => C4::Context->userenv->{'branch'}, |
720 |
type => 'localuse', |
721 |
type => 'localuse', |
721 |
itemnumber => $item->{'itemnumber'}, |
722 |
itemnumber => $item->itemnumber, |
722 |
itemtype => $effective_itemtype, |
723 |
itemtype => $effective_itemtype, |
723 |
borrowernumber => $patron->borrowernumber, |
724 |
borrowernumber => $patron->borrowernumber, |
724 |
ccode => $item->{'ccode'}} |
725 |
ccode => $item->ccode} |
725 |
); |
726 |
); |
726 |
ModDateLastSeen( $item->{'itemnumber'} ); |
727 |
ModDateLastSeen( $item->itemnumber ); # FIXME Move to Koha::Item |
727 |
return( { STATS => 1 }, {}); |
728 |
return( { STATS => 1 }, {}); |
728 |
} |
729 |
} |
729 |
|
730 |
|
Lines 834-840
sub CanBookBeIssued {
Link Here
|
834 |
} else { |
835 |
} else { |
835 |
my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( |
836 |
my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( |
836 |
$patron->borrowernumber, |
837 |
$patron->borrowernumber, |
837 |
$item->{'itemnumber'}, |
838 |
$item->itemnumber, |
838 |
); |
839 |
); |
839 |
if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed |
840 |
if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed |
840 |
if ( $renewerror eq 'onsite_checkout' ) { |
841 |
if ( $renewerror eq 'onsite_checkout' ) { |
Lines 855-861
sub CanBookBeIssued {
Link Here
|
855 |
|
856 |
|
856 |
my $patron = Koha::Patrons->find( $issue->borrowernumber ); |
857 |
my $patron = Koha::Patrons->find( $issue->borrowernumber ); |
857 |
|
858 |
|
858 |
my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
859 |
my ( $can_be_returned, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); |
859 |
|
860 |
|
860 |
unless ( $can_be_returned ) { |
861 |
unless ( $can_be_returned ) { |
861 |
$issuingimpossible{RETURN_IMPOSSIBLE} = 1; |
862 |
$issuingimpossible{RETURN_IMPOSSIBLE} = 1; |
Lines 876-882
sub CanBookBeIssued {
Link Here
|
876 |
and $issue |
877 |
and $issue |
877 |
and $issue->onsite_checkout |
878 |
and $issue->onsite_checkout |
878 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
879 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
879 |
my $toomany = TooMany( $patron_unblessed, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
880 |
my $toomany = TooMany( $patron_unblessed, $item->biblionumber, $item_unblessed, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
880 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
881 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
881 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
882 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
882 |
if ( $toomany->{max_allowed} == 0 ) { |
883 |
if ( $toomany->{max_allowed} == 0 ) { |
Lines 899-917
sub CanBookBeIssued {
Link Here
|
899 |
$patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed |
900 |
$patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed |
900 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
901 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
901 |
$needsconfirmation{PREVISSUE} = 1 |
902 |
$needsconfirmation{PREVISSUE} = 1 |
902 |
if ($wants_check and $patron->do_check_for_previous_checkout($item)); |
903 |
if ($wants_check and $patron->do_check_for_previous_checkout($item_unblessed)); |
903 |
|
904 |
|
904 |
# |
905 |
# |
905 |
# ITEM CHECKING |
906 |
# ITEM CHECKING |
906 |
# |
907 |
# |
907 |
if ( $item->{'notforloan'} ) |
908 |
if ( $item->notforloan ) |
908 |
{ |
909 |
{ |
909 |
if(!C4::Context->preference("AllowNotForLoanOverride")){ |
910 |
if(!C4::Context->preference("AllowNotForLoanOverride")){ |
910 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
911 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
911 |
$issuingimpossible{item_notforloan} = $item->{'notforloan'}; |
912 |
$issuingimpossible{item_notforloan} = $item->notforloan; |
912 |
}else{ |
913 |
}else{ |
913 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
914 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
914 |
$needsconfirmation{item_notforloan} = $item->{'notforloan'}; |
915 |
$needsconfirmation{item_notforloan} = $item->notforloan; |
915 |
} |
916 |
} |
916 |
} |
917 |
} |
917 |
else { |
918 |
else { |
Lines 944-960
sub CanBookBeIssued {
Link Here
|
944 |
} |
945 |
} |
945 |
} |
946 |
} |
946 |
} |
947 |
} |
947 |
if ( $item->{'withdrawn'} && $item->{'withdrawn'} > 0 ) |
948 |
if ( $item->withdrawn && $item->withdrawn > 0 ) |
948 |
{ |
949 |
{ |
949 |
$issuingimpossible{WTHDRAWN} = 1; |
950 |
$issuingimpossible{WTHDRAWN} = 1; |
950 |
} |
951 |
} |
951 |
if ( $item->{'restricted'} |
952 |
if ( $item->restricted |
952 |
&& $item->{'restricted'} == 1 ) |
953 |
&& $item->restricted == 1 ) |
953 |
{ |
954 |
{ |
954 |
$issuingimpossible{RESTRICTED} = 1; |
955 |
$issuingimpossible{RESTRICTED} = 1; |
955 |
} |
956 |
} |
956 |
if ( $item->{'itemlost'} && C4::Context->preference("IssueLostItem") ne 'nothing' ) { |
957 |
if ( $item->itemlost && C4::Context->preference("IssueLostItem") ne 'nothing' ) { |
957 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $item->{itemlost} }); |
958 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $item->itemlost }); |
958 |
my $code = $av->count ? $av->next->lib : ''; |
959 |
my $code = $av->count ? $av->next->lib : ''; |
959 |
$needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); |
960 |
$needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); |
960 |
$alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); |
961 |
$alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); |
Lines 962-970
sub CanBookBeIssued {
Link Here
|
962 |
if ( C4::Context->preference("IndependentBranches") ) { |
963 |
if ( C4::Context->preference("IndependentBranches") ) { |
963 |
my $userenv = C4::Context->userenv; |
964 |
my $userenv = C4::Context->userenv; |
964 |
unless ( C4::Context->IsSuperLibrarian() ) { |
965 |
unless ( C4::Context->IsSuperLibrarian() ) { |
965 |
if ( $item->{C4::Context->preference("HomeOrHoldingBranch")} ne $userenv->{branch} ){ |
966 |
my $HomeOrHoldingBranch = C4::Context->preference("HomeOrHoldingBranch"); |
|
|
967 |
if ( $item->$HomeOrHoldingBranch ne $userenv->{branch} ){ |
966 |
$issuingimpossible{ITEMNOTSAMEBRANCH} = 1; |
968 |
$issuingimpossible{ITEMNOTSAMEBRANCH} = 1; |
967 |
$issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")}; |
969 |
$issuingimpossible{'itemhomebranch'} = $item->$HomeOrHoldingBranch; |
968 |
} |
970 |
} |
969 |
$needsconfirmation{BORRNOTSAMEBRANCH} = $patron->branchcode |
971 |
$needsconfirmation{BORRNOTSAMEBRANCH} = $patron->branchcode |
970 |
if ( $patron->branchcode ne $userenv->{branch} ); |
972 |
if ( $patron->branchcode ne $userenv->{branch} ); |
Lines 976-982
sub CanBookBeIssued {
Link Here
|
976 |
my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); |
978 |
my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); |
977 |
|
979 |
|
978 |
if ( $rentalConfirmation ){ |
980 |
if ( $rentalConfirmation ){ |
979 |
my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $patron->borrowernumber ); |
981 |
my ($rentalCharge) = GetIssuingCharges( $item->itemnumber, $patron->borrowernumber ); |
980 |
if ( $rentalCharge > 0 ){ |
982 |
if ( $rentalCharge > 0 ){ |
981 |
$needsconfirmation{RENTALCHARGE} = $rentalCharge; |
983 |
$needsconfirmation{RENTALCHARGE} = $rentalCharge; |
982 |
} |
984 |
} |
Lines 984-990
sub CanBookBeIssued {
Link Here
|
984 |
|
986 |
|
985 |
unless ( $ignore_reserves ) { |
987 |
unless ( $ignore_reserves ) { |
986 |
# See if the item is on reserve. |
988 |
# See if the item is on reserve. |
987 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); |
989 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->itemnumber ); |
988 |
if ($restype) { |
990 |
if ($restype) { |
989 |
my $resbor = $res->{'borrowernumber'}; |
991 |
my $resbor = $res->{'borrowernumber'}; |
990 |
if ( $resbor ne $patron->borrowernumber ) { |
992 |
if ( $resbor ne $patron->borrowernumber ) { |
Lines 1029-1035
sub CanBookBeIssued {
Link Here
|
1029 |
|
1031 |
|
1030 |
## check for high holds decreasing loan period |
1032 |
## check for high holds decreasing loan period |
1031 |
if ( C4::Context->preference('decreaseLoanHighHolds') ) { |
1033 |
if ( C4::Context->preference('decreaseLoanHighHolds') ) { |
1032 |
my $check = checkHighHolds( $item, $patron_unblessed ); |
1034 |
my $check = checkHighHolds( $item_unblessed, $patron_unblessed ); |
1033 |
|
1035 |
|
1034 |
if ( $check->{exceeded} ) { |
1036 |
if ( $check->{exceeded} ) { |
1035 |
if ($override_high_holds) { |
1037 |
if ($override_high_holds) { |
Lines 1058-1064
sub CanBookBeIssued {
Link Here
|
1058 |
) { |
1060 |
) { |
1059 |
# Check if borrower has already issued an item from the same biblio |
1061 |
# Check if borrower has already issued an item from the same biblio |
1060 |
# Only if it's not a subscription |
1062 |
# Only if it's not a subscription |
1061 |
my $biblionumber = $item->{biblionumber}; |
1063 |
my $biblionumber = $item->biblionumber; |
1062 |
require C4::Serials; |
1064 |
require C4::Serials; |
1063 |
my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber); |
1065 |
my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber); |
1064 |
unless ($is_a_subscription) { |
1066 |
unless ($is_a_subscription) { |
Lines 1091-1097
Check whether the item can be returned to the provided branch
Link Here
|
1091 |
|
1093 |
|
1092 |
=over 4 |
1094 |
=over 4 |
1093 |
|
1095 |
|
1094 |
=item C<$item> is a hash of item information as returned from GetItem |
1096 |
=item C<$item> is a hash of item information as returned Koha::Items->find->unblessed (Temporary, should be a Koha::Item instead) |
1095 |
|
1097 |
|
1096 |
=item C<$branch> is the branchcode where the return is taking place |
1098 |
=item C<$branch> is the branchcode where the return is taking place |
1097 |
|
1099 |
|
Lines 1289-1309
sub AddIssue {
Link Here
|
1289 |
# Stop here if the patron or barcode doesn't exist |
1291 |
# Stop here if the patron or barcode doesn't exist |
1290 |
if ( $borrower && $barcode && $barcodecheck ) { |
1292 |
if ( $borrower && $barcode && $barcodecheck ) { |
1291 |
# find which item we issue |
1293 |
# find which item we issue |
1292 |
my $item = GetItem( '', $barcode ) |
1294 |
my $item = Koha::Items->find({ barcode => $barcode }) |
1293 |
or return; # if we don't get an Item, abort. |
1295 |
or return; # if we don't get an Item, abort. |
1294 |
my $item_object = Koha::Items->find( { barcode => $barcode } ); |
1296 |
my $item_unblessed = $item->unblessed; |
1295 |
|
1297 |
|
1296 |
my $branch = _GetCircControlBranch( $item, $borrower ); |
1298 |
my $branch = _GetCircControlBranch( $item_unblessed, $borrower ); |
1297 |
|
1299 |
|
1298 |
# get actual issuing if there is one |
1300 |
# get actual issuing if there is one |
1299 |
my $actualissue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
1301 |
my $actualissue = $item->checkout; |
1300 |
|
1302 |
|
1301 |
# check if we just renew the issue. |
1303 |
# check if we just renew the issue. |
1302 |
if ( $actualissue and $actualissue->borrowernumber eq $borrower->{'borrowernumber'} |
1304 |
if ( $actualissue and $actualissue->borrowernumber eq $borrower->{'borrowernumber'} |
1303 |
and not $switch_onsite_checkout ) { |
1305 |
and not $switch_onsite_checkout ) { |
1304 |
$datedue = AddRenewal( |
1306 |
$datedue = AddRenewal( |
1305 |
$borrower->{'borrowernumber'}, |
1307 |
$borrower->{'borrowernumber'}, |
1306 |
$item->{'itemnumber'}, |
1308 |
$item->itemnumber, |
1307 |
$branch, |
1309 |
$branch, |
1308 |
$datedue, |
1310 |
$datedue, |
1309 |
$issuedate, # here interpreted as the renewal date |
1311 |
$issuedate, # here interpreted as the renewal date |
Lines 1314-1328
sub AddIssue {
Link Here
|
1314 |
if ( $actualissue and not $switch_onsite_checkout ) { |
1316 |
if ( $actualissue and not $switch_onsite_checkout ) { |
1315 |
# This book is currently on loan, but not to the person |
1317 |
# This book is currently on loan, but not to the person |
1316 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
1318 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
1317 |
my ( $allowed, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
1319 |
my ( $allowed, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); |
1318 |
return unless $allowed; |
1320 |
return unless $allowed; |
1319 |
AddReturn( $item->{'barcode'}, C4::Context->userenv->{'branch'} ); |
1321 |
AddReturn( $item->barcode, C4::Context->userenv->{'branch'} ); |
1320 |
} |
1322 |
} |
1321 |
|
1323 |
|
1322 |
C4::Reserves::MoveReserve( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $cancelreserve ); |
1324 |
C4::Reserves::MoveReserve( $item->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); |
1323 |
|
1325 |
|
1324 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
1326 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
1325 |
my ($datesent) = GetTransfers( $item->{'itemnumber'} ); |
1327 |
my ($datesent) = GetTransfers( $item->itemnumber ); |
1326 |
if ($datesent) { |
1328 |
if ($datesent) { |
1327 |
# updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....) |
1329 |
# updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....) |
1328 |
my $sth = $dbh->prepare( |
1330 |
my $sth = $dbh->prepare( |
Lines 1333-1346
sub AddIssue {
Link Here
|
1333 |
WHERE itemnumber= ? AND datearrived IS NULL" |
1335 |
WHERE itemnumber= ? AND datearrived IS NULL" |
1334 |
); |
1336 |
); |
1335 |
$sth->execute( C4::Context->userenv->{'branch'}, |
1337 |
$sth->execute( C4::Context->userenv->{'branch'}, |
1336 |
$item->{'itemnumber'} ); |
1338 |
$item->itemnumber ); |
1337 |
} |
1339 |
} |
1338 |
|
1340 |
|
1339 |
# If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. |
1341 |
# If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. |
1340 |
unless ($auto_renew) { |
1342 |
unless ($auto_renew) { |
1341 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1343 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1342 |
{ categorycode => $borrower->{categorycode}, |
1344 |
{ categorycode => $borrower->{categorycode}, |
1343 |
itemtype => $item->{itype}, |
1345 |
itemtype => $item->effective_itemtype, |
1344 |
branchcode => $branch |
1346 |
branchcode => $branch |
1345 |
} |
1347 |
} |
1346 |
); |
1348 |
); |
Lines 1350-1356
sub AddIssue {
Link Here
|
1350 |
|
1352 |
|
1351 |
# Record in the database the fact that the book was issued. |
1353 |
# Record in the database the fact that the book was issued. |
1352 |
unless ($datedue) { |
1354 |
unless ($datedue) { |
1353 |
my $itype = $item_object->effective_itemtype; |
1355 |
my $itype = $item->effective_itemtype; |
1354 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1356 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1355 |
|
1357 |
|
1356 |
} |
1358 |
} |
Lines 1372-1378
sub AddIssue {
Link Here
|
1372 |
else { |
1374 |
else { |
1373 |
$issue = Koha::Checkout->new( |
1375 |
$issue = Koha::Checkout->new( |
1374 |
{ |
1376 |
{ |
1375 |
itemnumber => $item->{itemnumber}, |
1377 |
itemnumber => $item->itemnumber, |
1376 |
%$issue_attributes, |
1378 |
%$issue_attributes, |
1377 |
} |
1379 |
} |
1378 |
)->store; |
1380 |
)->store; |
Lines 1380-1428
sub AddIssue {
Link Here
|
1380 |
|
1382 |
|
1381 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
1383 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
1382 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
1384 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
1383 |
CartToShelf( $item->{'itemnumber'} ); |
1385 |
CartToShelf( $item->itemnumber ); |
1384 |
} |
1386 |
} |
1385 |
$item->{'issues'}++; |
1387 |
|
1386 |
if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { |
1388 |
if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { |
1387 |
UpdateTotalIssues( $item->{'biblionumber'}, 1 ); |
1389 |
UpdateTotalIssues( $item->biblionumber, 1 ); |
1388 |
} |
1390 |
} |
1389 |
|
1391 |
|
1390 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
1392 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
1391 |
if ( $item->{'itemlost'} ) { |
1393 |
if ( $item->itemlost ) { |
1392 |
if ( |
1394 |
if ( |
1393 |
Koha::RefundLostItemFeeRules->should_refund( |
1395 |
Koha::RefundLostItemFeeRules->should_refund( |
1394 |
{ |
1396 |
{ |
1395 |
current_branch => C4::Context->userenv->{branch}, |
1397 |
current_branch => C4::Context->userenv->{branch}, |
1396 |
item_home_branch => $item->{homebranch}, |
1398 |
item_home_branch => $item->homebranch, |
1397 |
item_holding_branch => $item->{holdingbranch} |
1399 |
item_holding_branch => $item->holdingbranch, |
1398 |
} |
1400 |
} |
1399 |
) |
1401 |
) |
1400 |
) |
1402 |
) |
1401 |
{ |
1403 |
{ |
1402 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, |
1404 |
_FixAccountForLostAndReturned( $item->itemnumber, undef, |
1403 |
$item->{'barcode'} ); |
1405 |
$item->barcode ); |
1404 |
} |
1406 |
} |
1405 |
} |
1407 |
} |
1406 |
|
1408 |
|
1407 |
ModItem( |
1409 |
ModItem( |
1408 |
{ |
1410 |
{ |
1409 |
issues => $item->{'issues'}, |
1411 |
issues => $item->issues + 1, |
1410 |
holdingbranch => C4::Context->userenv->{'branch'}, |
1412 |
holdingbranch => C4::Context->userenv->{'branch'}, |
1411 |
itemlost => 0, |
1413 |
itemlost => 0, |
1412 |
onloan => $datedue->ymd(), |
1414 |
onloan => $datedue->ymd(), |
1413 |
datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(), |
1415 |
datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(), |
1414 |
}, |
1416 |
}, |
1415 |
$item->{'biblionumber'}, |
1417 |
$item->biblionumber, |
1416 |
$item->{'itemnumber'}, |
1418 |
$item->itemnumber, |
1417 |
{ log_action => 0 } |
1419 |
{ log_action => 0 } |
1418 |
); |
1420 |
); |
1419 |
ModDateLastSeen( $item->{'itemnumber'} ); |
1421 |
ModDateLastSeen( $item->itemnumber ); |
1420 |
|
1422 |
|
1421 |
# If it costs to borrow this book, charge it to the patron's account. |
1423 |
# If it costs to borrow this book, charge it to the patron's account. |
1422 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
1424 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->itemnumber, $borrower->{'borrowernumber'} ); |
1423 |
if ( $charge > 0 ) { |
1425 |
if ( $charge > 0 ) { |
1424 |
AddIssuingCharge( $issue, $charge ); |
1426 |
AddIssuingCharge( $issue, $charge ); |
1425 |
$item->{'charge'} = $charge; |
|
|
1426 |
} |
1427 |
} |
1427 |
|
1428 |
|
1428 |
# Record the fact that this book was issued. |
1429 |
# Record the fact that this book was issued. |
Lines 1432-1442
sub AddIssue {
Link Here
|
1432 |
type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), |
1433 |
type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), |
1433 |
amount => $charge, |
1434 |
amount => $charge, |
1434 |
other => ( $sipmode ? "SIP-$sipmode" : '' ), |
1435 |
other => ( $sipmode ? "SIP-$sipmode" : '' ), |
1435 |
itemnumber => $item->{'itemnumber'}, |
1436 |
itemnumber => $item->itemnumber, |
1436 |
itemtype => $item->{'itype'}, |
1437 |
itemtype => $item->effective_itemtype, |
1437 |
location => $item->{location}, |
1438 |
location => $item->location, |
1438 |
borrowernumber => $borrower->{'borrowernumber'}, |
1439 |
borrowernumber => $borrower->{'borrowernumber'}, |
1439 |
ccode => $item->{'ccode'} |
1440 |
ccode => $item->ccode, |
1440 |
} |
1441 |
} |
1441 |
); |
1442 |
); |
1442 |
|
1443 |
|
Lines 1445-1451
sub AddIssue {
Link Here
|
1445 |
my %conditions = ( |
1446 |
my %conditions = ( |
1446 |
branchcode => $branch, |
1447 |
branchcode => $branch, |
1447 |
categorycode => $borrower->{categorycode}, |
1448 |
categorycode => $borrower->{categorycode}, |
1448 |
item_type => $item->{itype}, |
1449 |
item_type => $item->effective_itemtype, |
1449 |
notification => 'CHECKOUT', |
1450 |
notification => 'CHECKOUT', |
1450 |
); |
1451 |
); |
1451 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
1452 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
Lines 1461-1467
sub AddIssue {
Link Here
|
1461 |
logaction( |
1462 |
logaction( |
1462 |
"CIRCULATION", "ISSUE", |
1463 |
"CIRCULATION", "ISSUE", |
1463 |
$borrower->{'borrowernumber'}, |
1464 |
$borrower->{'borrowernumber'}, |
1464 |
$item->{'itemnumber'} |
1465 |
$item->itemnumber, |
1465 |
) if C4::Context->preference("IssueLog"); |
1466 |
) if C4::Context->preference("IssueLog"); |
1466 |
} |
1467 |
} |
1467 |
} |
1468 |
} |
Lines 1814-1826
sub AddReturn {
Link Here
|
1814 |
my $stat_type = 'return'; |
1815 |
my $stat_type = 'return'; |
1815 |
|
1816 |
|
1816 |
# get information on item |
1817 |
# get information on item |
1817 |
my $item = GetItem( undef, $barcode ); |
1818 |
my $item = Koha::Items->find({ barcode => $barcode }); |
1818 |
unless ($item) { |
1819 |
unless ($item) { |
1819 |
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. |
1820 |
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. |
1820 |
} |
1821 |
} |
1821 |
|
1822 |
|
1822 |
my $itemnumber = $item->{ itemnumber }; |
1823 |
my $itemnumber = $item->itemnumber; |
1823 |
my $itemtype = $item->{itype}; # GetItem called effective_itemtype |
1824 |
my $itemtype = $item->effective_itemtype; |
1824 |
|
1825 |
|
1825 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
1826 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
1826 |
if ( $issue ) { |
1827 |
if ( $issue ) { |
Lines 1840-1860
sub AddReturn {
Link Here
|
1840 |
} |
1841 |
} |
1841 |
} |
1842 |
} |
1842 |
|
1843 |
|
1843 |
if ( $item->{'location'} eq 'PROC' ) { |
1844 |
my $item_unblessed = $item->unblessed; |
|
|
1845 |
if ( $item->location eq 'PROC' ) { |
1844 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1846 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1845 |
$item->{'location'} = 'CART'; |
1847 |
$item_unblessed->{location} = 'CART'; |
1846 |
} |
1848 |
} |
1847 |
else { |
1849 |
else { |
1848 |
$item->{location} = $item->{permanent_location}; |
1850 |
$item_unblessed->{location} = $item->permanent_location; |
1849 |
} |
1851 |
} |
1850 |
|
1852 |
|
1851 |
ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, { log_action => 0 } ); |
1853 |
ModItem( $item_unblessed, $item->biblionumber, $item->itemnumber, { log_action => 0 } ); |
1852 |
} |
1854 |
} |
1853 |
|
1855 |
|
1854 |
# full item data, but no borrowernumber or checkout info (no issue) |
1856 |
# full item data, but no borrowernumber or checkout info (no issue) |
1855 |
my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch"; |
1857 |
my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch"; |
1856 |
# get the proper branch to which to return the item |
1858 |
# get the proper branch to which to return the item |
1857 |
my $returnbranch = $item->{$hbr} || $branch ; |
1859 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1858 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1860 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1859 |
|
1861 |
|
1860 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1862 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
Lines 1870-1877
sub AddReturn {
Link Here
|
1870 |
} |
1872 |
} |
1871 |
else { |
1873 |
else { |
1872 |
foreach my $key ( keys %$rules ) { |
1874 |
foreach my $key ( keys %$rules ) { |
1873 |
if ( $item->{notforloan} eq $key ) { |
1875 |
if ( $item->notforloan eq $key ) { |
1874 |
$messages->{'NotForLoanStatusUpdated'} = { from => $item->{notforloan}, to => $rules->{$key} }; |
1876 |
$messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} }; |
1875 |
ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber, { log_action => 0 } ); |
1877 |
ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber, { log_action => 0 } ); |
1876 |
last; |
1878 |
last; |
1877 |
} |
1879 |
} |
Lines 1880-1886
sub AddReturn {
Link Here
|
1880 |
} |
1882 |
} |
1881 |
|
1883 |
|
1882 |
# check if the return is allowed at this branch |
1884 |
# check if the return is allowed at this branch |
1883 |
my ($returnallowed, $message) = CanBookBeReturned($item, $branch); |
1885 |
my ($returnallowed, $message) = CanBookBeReturned($item_unblessed, $branch); |
1884 |
unless ($returnallowed){ |
1886 |
unless ($returnallowed){ |
1885 |
$messages->{'Wrongbranch'} = { |
1887 |
$messages->{'Wrongbranch'} = { |
1886 |
Wrongbranch => $branch, |
1888 |
Wrongbranch => $branch, |
Lines 1890-1901
sub AddReturn {
Link Here
|
1890 |
return ( $doreturn, $messages, $issue, $patron_unblessed); |
1892 |
return ( $doreturn, $messages, $issue, $patron_unblessed); |
1891 |
} |
1893 |
} |
1892 |
|
1894 |
|
1893 |
if ( $item->{'withdrawn'} ) { # book has been cancelled |
1895 |
if ( $item->withdrawn ) { # book has been cancelled |
1894 |
$messages->{'withdrawn'} = 1; |
1896 |
$messages->{'withdrawn'} = 1; |
1895 |
$doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); |
1897 |
$doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); |
1896 |
} |
1898 |
} |
1897 |
|
1899 |
|
1898 |
if ( $item->{itemlost} and C4::Context->preference("BlockReturnOfLostItems") ) { |
1900 |
if ( $item->itemlost and C4::Context->preference("BlockReturnOfLostItems") ) { |
1899 |
$doreturn = 0; |
1901 |
$doreturn = 0; |
1900 |
} |
1902 |
} |
1901 |
|
1903 |
|
Lines 1915-1931
sub AddReturn {
Link Here
|
1915 |
if ($patron) { |
1917 |
if ($patron) { |
1916 |
eval { |
1918 |
eval { |
1917 |
if ( $dropbox ) { |
1919 |
if ( $dropbox ) { |
1918 |
MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, |
1920 |
MarkIssueReturned( $borrowernumber, $item->itemnumber, |
1919 |
$dropboxdate, $patron->privacy ); |
1921 |
$dropboxdate, $patron->privacy ); |
1920 |
} |
1922 |
} |
1921 |
else { |
1923 |
else { |
1922 |
MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, |
1924 |
MarkIssueReturned( $borrowernumber, $item->itemnumber, |
1923 |
$return_date, $patron->privacy ); |
1925 |
$return_date, $patron->privacy ); |
1924 |
} |
1926 |
} |
1925 |
}; |
1927 |
}; |
1926 |
unless ( $@ ) { |
1928 |
unless ( $@ ) { |
1927 |
if ( ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue ) || $return_date ) { |
1929 |
if ( ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue ) || $return_date ) { |
1928 |
_CalculateAndUpdateFine( { issue => $issue, item => $item, borrower => $patron_unblessed, return_date => $return_date } ); |
1930 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); |
1929 |
} |
1931 |
} |
1930 |
} else { |
1932 |
} else { |
1931 |
carp "The checkin for the following issue failed, Please go to the about page, section 'data corrupted' to know how to fix this problem ($@)" . Dumper( $issue->unblessed ); |
1933 |
carp "The checkin for the following issue failed, Please go to the about page, section 'data corrupted' to know how to fix this problem ($@)" . Dumper( $issue->unblessed ); |
Lines 1938-1995
sub AddReturn {
Link Here
|
1938 |
|
1940 |
|
1939 |
} |
1941 |
} |
1940 |
|
1942 |
|
1941 |
ModItem( { onloan => undef }, $item->{biblionumber}, $item->{itemnumber}, { log_action => 0 } ); |
1943 |
ModItem( { onloan => undef }, $item->biblionumber, $item->itemnumber, { log_action => 0 } ); |
1942 |
} |
1944 |
} |
1943 |
|
1945 |
|
1944 |
# the holdingbranch is updated if the document is returned to another location. |
1946 |
# the holdingbranch is updated if the document is returned to another location. |
1945 |
# this is always done regardless of whether the item was on loan or not |
1947 |
# this is always done regardless of whether the item was on loan or not |
1946 |
my $item_holding_branch = $item->{ holdingbranch }; |
1948 |
my $item_holding_branch = $item->holdingbranch; |
1947 |
if ($item->{'holdingbranch'} ne $branch) { |
1949 |
if ($item->holdingbranch ne $branch) { |
1948 |
UpdateHoldingbranch($branch, $item->{'itemnumber'}); |
1950 |
UpdateHoldingbranch($branch, $item->itemnumber); |
1949 |
$item->{'holdingbranch'} = $branch; # update item data holdingbranch too |
1951 |
$item_unblessed->{'holdingbranch'} = $branch; # update item data holdingbranch too # FIXME I guess this is for the _debar_user_on_return call later |
1950 |
} |
1952 |
} |
1951 |
|
1953 |
|
1952 |
my $leave_item_lost = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; |
1954 |
my $leave_item_lost = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; |
1953 |
ModDateLastSeen( $item->{itemnumber}, $leave_item_lost ); |
1955 |
ModDateLastSeen( $item->itemnumber, $leave_item_lost ); |
1954 |
|
1956 |
|
1955 |
# check if we have a transfer for this document |
1957 |
# check if we have a transfer for this document |
1956 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); |
1958 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->itemnumber ); |
1957 |
|
1959 |
|
1958 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1960 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1959 |
my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->{'itemnumber'} ); |
1961 |
my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); |
1960 |
if ($datesent) { |
1962 |
if ($datesent) { |
1961 |
if ( $tobranch eq $branch ) { |
1963 |
if ( $tobranch eq $branch ) { |
1962 |
my $sth = C4::Context->dbh->prepare( |
1964 |
my $sth = C4::Context->dbh->prepare( |
1963 |
"UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" |
1965 |
"UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" |
1964 |
); |
1966 |
); |
1965 |
$sth->execute( $item->{'itemnumber'} ); |
1967 |
$sth->execute( $item->itemnumber ); |
1966 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1968 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1967 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1969 |
ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1968 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
1970 |
C4::Reserves::ModReserveStatus($item->itemnumber, 'W'); |
1969 |
} else { |
1971 |
} else { |
1970 |
$messages->{'WrongTransfer'} = $tobranch; |
1972 |
$messages->{'WrongTransfer'} = $tobranch; |
1971 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
1973 |
$messages->{'WrongTransferItem'} = $item->itemnumber; |
1972 |
} |
1974 |
} |
1973 |
$validTransfert = 1; |
1975 |
$validTransfert = 1; |
1974 |
} else { |
1976 |
} else { |
1975 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1977 |
ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1976 |
} |
1978 |
} |
1977 |
|
1979 |
|
1978 |
# fix up the accounts..... |
1980 |
# fix up the accounts..... |
1979 |
if ( $item->{'itemlost'} ) { |
1981 |
if ( $item->itemlost ) { |
1980 |
$messages->{'WasLost'} = 1; |
1982 |
$messages->{'WasLost'} = 1; |
1981 |
unless ( C4::Context->preference("BlockReturnOfLostItems") ) { |
1983 |
unless ( C4::Context->preference("BlockReturnOfLostItems") ) { |
1982 |
if ( |
1984 |
if ( |
1983 |
Koha::RefundLostItemFeeRules->should_refund( |
1985 |
Koha::RefundLostItemFeeRules->should_refund( |
1984 |
{ |
1986 |
{ |
1985 |
current_branch => C4::Context->userenv->{branch}, |
1987 |
current_branch => C4::Context->userenv->{branch}, |
1986 |
item_home_branch => $item->{homebranch}, |
1988 |
item_home_branch => $item->homebranch, |
1987 |
item_holding_branch => $item_holding_branch |
1989 |
item_holding_branch => $item_holding_branch |
1988 |
} |
1990 |
} |
1989 |
) |
1991 |
) |
1990 |
) |
1992 |
) |
1991 |
{ |
1993 |
{ |
1992 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, |
1994 |
_FixAccountForLostAndReturned( $item->itemnumber, |
1993 |
$borrowernumber, $barcode ); |
1995 |
$borrowernumber, $barcode ); |
1994 |
$messages->{'LostItemFeeRefunded'} = 1; |
1996 |
$messages->{'LostItemFeeRefunded'} = 1; |
1995 |
} |
1997 |
} |
Lines 1998-2011
sub AddReturn {
Link Here
|
1998 |
|
2000 |
|
1999 |
# fix up the overdues in accounts... |
2001 |
# fix up the overdues in accounts... |
2000 |
if ($borrowernumber) { |
2002 |
if ($borrowernumber) { |
2001 |
my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); |
2003 |
my $fix = _FixOverduesOnReturn($borrowernumber, $item->itemnumber, $exemptfine, $dropbox); |
2002 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined |
2004 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!"; # zero is OK, check defined |
2003 |
|
2005 |
|
2004 |
if ( $issue and $issue->is_overdue ) { |
2006 |
if ( $issue and $issue->is_overdue ) { |
2005 |
# fix fine days |
2007 |
# fix fine days |
2006 |
$today = dt_from_string($return_date) if $return_date; |
2008 |
$today = dt_from_string($return_date) if $return_date; |
2007 |
$today = $dropboxdate if $dropbox; |
2009 |
$today = $dropboxdate if $dropbox; |
2008 |
my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today ); |
2010 |
my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item_unblessed, dt_from_string($issue->date_due), $today ); |
2009 |
if ($reminder){ |
2011 |
if ($reminder){ |
2010 |
$messages->{'PrevDebarred'} = $debardate; |
2012 |
$messages->{'PrevDebarred'} = $debardate; |
2011 |
} else { |
2013 |
} else { |
Lines 2030-2036
sub AddReturn {
Link Here
|
2030 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
2032 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
2031 |
my ($resfound, $resrec); |
2033 |
my ($resfound, $resrec); |
2032 |
my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
2034 |
my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
2033 |
($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'}, undef, $lookahead ) unless ( $item->{'withdrawn'} ); |
2035 |
($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); |
2034 |
if ($resfound) { |
2036 |
if ($resfound) { |
2035 |
$resrec->{'ResFound'} = $resfound; |
2037 |
$resrec->{'ResFound'} = $resfound; |
2036 |
$messages->{'ResFound'} = $resrec; |
2038 |
$messages->{'ResFound'} = $resrec; |
Lines 2043-2049
sub AddReturn {
Link Here
|
2043 |
itemnumber => $itemnumber, |
2045 |
itemnumber => $itemnumber, |
2044 |
itemtype => $itemtype, |
2046 |
itemtype => $itemtype, |
2045 |
borrowernumber => $borrowernumber, |
2047 |
borrowernumber => $borrowernumber, |
2046 |
ccode => $item->{ ccode } |
2048 |
ccode => $item->ccode, |
2047 |
}); |
2049 |
}); |
2048 |
|
2050 |
|
2049 |
# Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. |
2051 |
# Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. |
Lines 2052-2070
sub AddReturn {
Link Here
|
2052 |
my %conditions = ( |
2054 |
my %conditions = ( |
2053 |
branchcode => $branch, |
2055 |
branchcode => $branch, |
2054 |
categorycode => $patron->categorycode, |
2056 |
categorycode => $patron->categorycode, |
2055 |
item_type => $item->{itype}, |
2057 |
item_type => $itemtype, |
2056 |
notification => 'CHECKIN', |
2058 |
notification => 'CHECKIN', |
2057 |
); |
2059 |
); |
2058 |
if ($doreturn && $circulation_alert->is_enabled_for(\%conditions)) { |
2060 |
if ($doreturn && $circulation_alert->is_enabled_for(\%conditions)) { |
2059 |
SendCirculationAlert({ |
2061 |
SendCirculationAlert({ |
2060 |
type => 'CHECKIN', |
2062 |
type => 'CHECKIN', |
2061 |
item => $item, |
2063 |
item => $item_unblessed, |
2062 |
borrower => $patron->unblessed, |
2064 |
borrower => $patron->unblessed, |
2063 |
branch => $branch, |
2065 |
branch => $branch, |
2064 |
}); |
2066 |
}); |
2065 |
} |
2067 |
} |
2066 |
|
2068 |
|
2067 |
logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'}) |
2069 |
logaction("CIRCULATION", "RETURN", $borrowernumber, $item->itemnumber) |
2068 |
if C4::Context->preference("ReturnLog"); |
2070 |
if C4::Context->preference("ReturnLog"); |
2069 |
} |
2071 |
} |
2070 |
|
2072 |
|
Lines 2080-2092
sub AddReturn {
Link Here
|
2080 |
|
2082 |
|
2081 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
2083 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
2082 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ |
2084 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ |
|
|
2085 |
my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType"); |
2083 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
2086 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
2084 |
(C4::Context->preference("UseBranchTransferLimits") and |
2087 |
(C4::Context->preference("UseBranchTransferLimits") and |
2085 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->{C4::Context->preference("BranchTransferLimitsType")} ) |
2088 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2086 |
)) { |
2089 |
)) { |
2087 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $returnbranch; |
2090 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->itemnumber,$branch, $returnbranch; |
2088 |
$debug and warn "item: " . Dumper($item); |
2091 |
$debug and warn "item: " . Dumper($item_unblessed); |
2089 |
ModItemTransfer($item->{'itemnumber'}, $branch, $returnbranch); |
2092 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch); |
2090 |
$messages->{'WasTransfered'} = 1; |
2093 |
$messages->{'WasTransfered'} = 1; |
2091 |
} else { |
2094 |
} else { |
2092 |
$messages->{'NeedsTransfer'} = $returnbranch; |
2095 |
$messages->{'NeedsTransfer'} = $returnbranch; |
Lines 2612-2618
sub CanBookBeRenewed {
Link Here
|
2612 |
my $dbh = C4::Context->dbh; |
2615 |
my $dbh = C4::Context->dbh; |
2613 |
my $renews = 1; |
2616 |
my $renews = 1; |
2614 |
|
2617 |
|
2615 |
my $item = GetItem($itemnumber) or return ( 0, 'no_item' ); |
2618 |
my $item = Koha::Items->find($itemnumber) or return ( 0, 'no_item' ); |
2616 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return ( 0, 'no_checkout' ); |
2619 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return ( 0, 'no_checkout' ); |
2617 |
return ( 0, 'onsite_checkout' ) if $issue->onsite_checkout; |
2620 |
return ( 0, 'onsite_checkout' ) if $issue->onsite_checkout; |
2618 |
return ( 0, 'item_denied_renewal') if _item_denied_renewal({ item => $item }); |
2621 |
return ( 0, 'item_denied_renewal') if _item_denied_renewal({ item => $item }); |
Lines 2670-2676
sub CanBookBeRenewed {
Link Here
|
2670 |
my @reservable; |
2673 |
my @reservable; |
2671 |
my %borrowers; |
2674 |
my %borrowers; |
2672 |
ITEM: foreach my $i (@itemnumbers) { |
2675 |
ITEM: foreach my $i (@itemnumbers) { |
2673 |
my $item = GetItem($i); |
2676 |
my $item = Koha::Items->find($i)->unblessed; |
2674 |
next if IsItemOnHoldAndFound($i); |
2677 |
next if IsItemOnHoldAndFound($i); |
2675 |
for my $b (@borrowernumbers) { |
2678 |
for my $b (@borrowernumbers) { |
2676 |
my $borr = $borrowers{$b} //= Koha::Patrons->find( $b )->unblessed; |
2679 |
my $borr = $borrowers{$b} //= Koha::Patrons->find( $b )->unblessed; |
Lines 2691-2700
sub CanBookBeRenewed {
Link Here
|
2691 |
|
2694 |
|
2692 |
return ( 1, undef ) if $override_limit; |
2695 |
return ( 1, undef ) if $override_limit; |
2693 |
|
2696 |
|
2694 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
2697 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
2695 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2698 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2696 |
{ categorycode => $patron->categorycode, |
2699 |
{ categorycode => $patron->categorycode, |
2697 |
itemtype => $item->{itype}, |
2700 |
itemtype => $item->effective_itemtype, |
2698 |
branchcode => $branchcode |
2701 |
branchcode => $branchcode |
2699 |
} |
2702 |
} |
2700 |
); |
2703 |
); |
Lines 2818-2832
sub AddRenewal {
Link Here
|
2818 |
my $datedue = shift; |
2821 |
my $datedue = shift; |
2819 |
my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd(); |
2822 |
my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd(); |
2820 |
|
2823 |
|
2821 |
my $item = GetItem($itemnumber) or return; |
2824 |
my $item = Koha::Items->find($itemnumber) or return; |
2822 |
my $item_object = Koha::Items->find( $itemnumber ); # Should replace $item |
2825 |
my $biblio = $item->biblio; |
2823 |
my $biblio = $item_object->biblio; |
2826 |
my $issue = $item->checkout; |
|
|
2827 |
my $item_unblessed = $item->unblessed; |
2824 |
|
2828 |
|
2825 |
my $dbh = C4::Context->dbh; |
2829 |
my $dbh = C4::Context->dbh; |
2826 |
|
2830 |
|
2827 |
# Find the issues record for this book |
|
|
2828 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
2829 |
|
2830 |
return unless $issue; |
2831 |
return unless $issue; |
2831 |
|
2832 |
|
2832 |
$borrowernumber ||= $issue->borrowernumber; |
2833 |
$borrowernumber ||= $issue->borrowernumber; |
Lines 2840-2846
sub AddRenewal {
Link Here
|
2840 |
my $patron_unblessed = $patron->unblessed; |
2841 |
my $patron_unblessed = $patron->unblessed; |
2841 |
|
2842 |
|
2842 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { |
2843 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { |
2843 |
_CalculateAndUpdateFine( { issue => $issue, item => $item, borrower => $patron_unblessed } ); |
2844 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); |
2844 |
} |
2845 |
} |
2845 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber ); |
2846 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber ); |
2846 |
|
2847 |
|
Lines 2849-2859
sub AddRenewal {
Link Here
|
2849 |
# based on the value of the RenewalPeriodBase syspref. |
2850 |
# based on the value of the RenewalPeriodBase syspref. |
2850 |
unless ($datedue) { |
2851 |
unless ($datedue) { |
2851 |
|
2852 |
|
2852 |
my $itemtype = $item_object->effective_itemtype; |
2853 |
my $itemtype = $item->effective_itemtype; |
2853 |
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2854 |
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2854 |
dt_from_string( $issue->date_due, 'sql' ) : |
2855 |
dt_from_string( $issue->date_due, 'sql' ) : |
2855 |
DateTime->now( time_zone => C4::Context->tz()); |
2856 |
DateTime->now( time_zone => C4::Context->tz()); |
2856 |
$datedue = CalcDateDue($datedue, $itemtype, _GetCircControlBranch($item, $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2857 |
$datedue = CalcDateDue($datedue, $itemtype, _GetCircControlBranch($item_unblessed, $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2857 |
} |
2858 |
} |
2858 |
|
2859 |
|
2859 |
# Update the issues record to have the new due date, and a new count |
2860 |
# Update the issues record to have the new due date, and a new count |
Lines 2867-2881
sub AddRenewal {
Link Here
|
2867 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber ); |
2868 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber ); |
2868 |
|
2869 |
|
2869 |
# Update the renewal count on the item, and tell zebra to reindex |
2870 |
# Update the renewal count on the item, and tell zebra to reindex |
2870 |
$renews = $item->{renewals} + 1; |
2871 |
$renews = $item->renewals + 1; |
2871 |
ModItem( { renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $item->{biblionumber}, $itemnumber, { log_action => 0 } ); |
2872 |
ModItem( { renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $item->biblionumber, $itemnumber, { log_action => 0 } ); |
2872 |
|
2873 |
|
2873 |
# Charge a new rental fee, if applicable? |
2874 |
# Charge a new rental fee, if applicable? |
2874 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2875 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2875 |
if ( $charge > 0 ) { |
2876 |
if ( $charge > 0 ) { |
2876 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2877 |
my $accountno = C4::Accounts::getnextacctno( $borrowernumber ); |
2877 |
my $manager_id = 0; |
2878 |
my $manager_id = 0; |
2878 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
2879 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
2879 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
2880 |
my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; |
2880 |
Koha::Account::Line->new( |
2881 |
Koha::Account::Line->new( |
2881 |
{ |
2882 |
{ |
Lines 2890-2896
sub AddRenewal {
Link Here
|
2890 |
branchcode => $branchcode, |
2891 |
branchcode => $branchcode, |
2891 |
description => 'Renewal of Rental Item ' |
2892 |
description => 'Renewal of Rental Item ' |
2892 |
. $biblio->title |
2893 |
. $biblio->title |
2893 |
. " $item->{'barcode'}", |
2894 |
. " $item->barcode", |
2894 |
} |
2895 |
} |
2895 |
)->store(); |
2896 |
)->store(); |
2896 |
} |
2897 |
} |
Lines 2901-2914
sub AddRenewal {
Link Here
|
2901 |
my %conditions = ( |
2902 |
my %conditions = ( |
2902 |
branchcode => $branch, |
2903 |
branchcode => $branch, |
2903 |
categorycode => $patron->categorycode, |
2904 |
categorycode => $patron->categorycode, |
2904 |
item_type => $item->{itype}, |
2905 |
item_type => $item->effective_itemtype, |
2905 |
notification => 'CHECKOUT', |
2906 |
notification => 'CHECKOUT', |
2906 |
); |
2907 |
); |
2907 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
2908 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
2908 |
SendCirculationAlert( |
2909 |
SendCirculationAlert( |
2909 |
{ |
2910 |
{ |
2910 |
type => 'RENEWAL', |
2911 |
type => 'RENEWAL', |
2911 |
item => $item, |
2912 |
item => $item_unblessed, |
2912 |
borrower => $patron->unblessed, |
2913 |
borrower => $patron->unblessed, |
2913 |
branch => $branch, |
2914 |
branch => $branch, |
2914 |
} |
2915 |
} |
Lines 2936-2945
sub AddRenewal {
Link Here
|
2936 |
type => 'renew', |
2937 |
type => 'renew', |
2937 |
amount => $charge, |
2938 |
amount => $charge, |
2938 |
itemnumber => $itemnumber, |
2939 |
itemnumber => $itemnumber, |
2939 |
itemtype => $item->{itype}, |
2940 |
itemtype => $item->effective_itemtype, |
2940 |
location => $item->{location}, |
2941 |
location => $item->location, |
2941 |
borrowernumber => $borrowernumber, |
2942 |
borrowernumber => $borrowernumber, |
2942 |
ccode => $item->{'ccode'} |
2943 |
ccode => $item->ccode, |
2943 |
} |
2944 |
} |
2944 |
); |
2945 |
); |
2945 |
|
2946 |
|
Lines 2957-2963
sub GetRenewCount {
Link Here
|
2957 |
my $renewsleft = 0; |
2958 |
my $renewsleft = 0; |
2958 |
|
2959 |
|
2959 |
my $patron = Koha::Patrons->find( $bornum ); |
2960 |
my $patron = Koha::Patrons->find( $bornum ); |
2960 |
my $item = GetItem($itemno); |
2961 |
my $item = Koha::Items->find($itemno); |
2961 |
|
2962 |
|
2962 |
return (0, 0, 0) unless $patron or $item; # Wrong call, no renewal allowed |
2963 |
return (0, 0, 0) unless $patron or $item; # Wrong call, no renewal allowed |
2963 |
|
2964 |
|
Lines 2974-2984
sub GetRenewCount {
Link Here
|
2974 |
my $data = $sth->fetchrow_hashref; |
2975 |
my $data = $sth->fetchrow_hashref; |
2975 |
$renewcount = $data->{'renewals'} if $data->{'renewals'}; |
2976 |
$renewcount = $data->{'renewals'} if $data->{'renewals'}; |
2976 |
# $item and $borrower should be calculated |
2977 |
# $item and $borrower should be calculated |
2977 |
my $branchcode = _GetCircControlBranch($item, $patron->unblessed); |
2978 |
my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed); |
2978 |
|
2979 |
|
2979 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2980 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2980 |
{ categorycode => $patron->categorycode, |
2981 |
{ categorycode => $patron->categorycode, |
2981 |
itemtype => $item->{itype}, |
2982 |
itemtype => $item->effective_itemtype, |
2982 |
branchcode => $branchcode |
2983 |
branchcode => $branchcode |
2983 |
} |
2984 |
} |
2984 |
); |
2985 |
); |
Lines 3013-3029
sub GetSoonestRenewDate {
Link Here
|
3013 |
|
3014 |
|
3014 |
my $dbh = C4::Context->dbh; |
3015 |
my $dbh = C4::Context->dbh; |
3015 |
|
3016 |
|
3016 |
my $item = GetItem($itemnumber) or return; |
3017 |
my $item = Koha::Items->find($itemnumber) or return; |
3017 |
my $itemissue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
3018 |
my $itemissue = $item->checkout or return; |
3018 |
|
3019 |
|
3019 |
$borrowernumber ||= $itemissue->borrowernumber; |
3020 |
$borrowernumber ||= $itemissue->borrowernumber; |
3020 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3021 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3021 |
or return; |
3022 |
or return; |
3022 |
|
3023 |
|
3023 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
3024 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
3024 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3025 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3025 |
{ categorycode => $patron->categorycode, |
3026 |
{ categorycode => $patron->categorycode, |
3026 |
itemtype => $item->{itype}, |
3027 |
itemtype => $item->effective_itemtype, |
3027 |
branchcode => $branchcode |
3028 |
branchcode => $branchcode |
3028 |
} |
3029 |
} |
3029 |
); |
3030 |
); |
Lines 3072-3088
sub GetLatestAutoRenewDate {
Link Here
|
3072 |
|
3073 |
|
3073 |
my $dbh = C4::Context->dbh; |
3074 |
my $dbh = C4::Context->dbh; |
3074 |
|
3075 |
|
3075 |
my $item = GetItem($itemnumber) or return; |
3076 |
my $item = Koha::Items->find($itemnumber) or return; |
3076 |
my $itemissue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
3077 |
my $itemissue = $item->checkout or return; |
3077 |
|
3078 |
|
3078 |
$borrowernumber ||= $itemissue->borrowernumber; |
3079 |
$borrowernumber ||= $itemissue->borrowernumber; |
3079 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3080 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3080 |
or return; |
3081 |
or return; |
3081 |
|
3082 |
|
3082 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
3083 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
3083 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3084 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3084 |
{ categorycode => $patron->categorycode, |
3085 |
{ categorycode => $patron->categorycode, |
3085 |
itemtype => $item->{itype}, |
3086 |
itemtype => $item->effective_itemtype, |
3086 |
branchcode => $branchcode |
3087 |
branchcode => $branchcode |
3087 |
} |
3088 |
} |
3088 |
); |
3089 |
); |
Lines 3662-3669
sub ReturnLostItem{
Link Here
|
3662 |
|
3663 |
|
3663 |
MarkIssueReturned( $borrowernumber, $itemnum ); |
3664 |
MarkIssueReturned( $borrowernumber, $itemnum ); |
3664 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
3665 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
3665 |
my $item = C4::Items::GetItem( $itemnum ); |
3666 |
my $item = Koha::Items->find($itemnum); |
3666 |
my $old_note = ($item->{'paidfor'} && ($item->{'paidfor'} ne q{})) ? $item->{'paidfor'}.' / ' : q{}; |
3667 |
my $old_note = ($item->paidfor && ($item->paidfor ne q{})) ? $item->paidfor.' / ' : q{}; |
3667 |
my @datearr = localtime(time); |
3668 |
my @datearr = localtime(time); |
3668 |
my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; |
3669 |
my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; |
3669 |
my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; |
3670 |
my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; |
Lines 3852-3859
sub ProcessOfflinePayment {
Link Here
|
3852 |
sub TransferSlip { |
3853 |
sub TransferSlip { |
3853 |
my ($branch, $itemnumber, $barcode, $to_branch) = @_; |
3854 |
my ($branch, $itemnumber, $barcode, $to_branch) = @_; |
3854 |
|
3855 |
|
3855 |
my $item = GetItem( $itemnumber, $barcode ) |
3856 |
my $item = |
3856 |
or return; |
3857 |
$itemnumber |
|
|
3858 |
? Koha::Items->find($itemnumber) |
3859 |
: Koha::Items->find( { barcode => $barcode } ); |
3860 |
|
3861 |
$item or return; |
3857 |
|
3862 |
|
3858 |
return C4::Letters::GetPreparedLetter ( |
3863 |
return C4::Letters::GetPreparedLetter ( |
3859 |
module => 'circulation', |
3864 |
module => 'circulation', |
Lines 3861-3868
sub TransferSlip {
Link Here
|
3861 |
branchcode => $branch, |
3866 |
branchcode => $branch, |
3862 |
tables => { |
3867 |
tables => { |
3863 |
'branches' => $to_branch, |
3868 |
'branches' => $to_branch, |
3864 |
'biblio' => $item->{biblionumber}, |
3869 |
'biblio' => $item->biblionumber, |
3865 |
'items' => $item, |
3870 |
'items' => $item->unblessed, |
3866 |
}, |
3871 |
}, |
3867 |
); |
3872 |
); |
3868 |
} |
3873 |
} |