Lines 668-684
sub CanBookBeIssued {
Link Here
|
668 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
668 |
my $onsite_checkout = $params->{onsite_checkout} || 0; |
669 |
my $override_high_holds = $params->{override_high_holds} || 0; |
669 |
my $override_high_holds = $params->{override_high_holds} || 0; |
670 |
|
670 |
|
671 |
my $item = GetItem(undef, $barcode ); |
671 |
my $item = Koha::Items->find({barcode => $barcode }); |
672 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
672 |
# MANDATORY CHECKS - unless item exists, nothing else matters |
673 |
unless ( $item ) { |
673 |
unless ( $item ) { |
674 |
$issuingimpossible{UNKNOWN_BARCODE} = 1; |
674 |
$issuingimpossible{UNKNOWN_BARCODE} = 1; |
675 |
} |
675 |
} |
676 |
return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; |
676 |
return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible; |
677 |
|
677 |
|
678 |
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
678 |
my $item_unblessed = $item->unblessed; # Transition... |
679 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
679 |
my $issue = $item->checkout; |
|
|
680 |
my $biblio = $item->biblio; |
680 |
my $biblioitem = $biblio->biblioitem; |
681 |
my $biblioitem = $biblio->biblioitem; |
681 |
my $effective_itemtype = $item->{itype}; # GetItem deals with that |
682 |
my $effective_itemtype = $item->effective_itemtype; |
682 |
my $dbh = C4::Context->dbh; |
683 |
my $dbh = C4::Context->dbh; |
683 |
my $patron_unblessed = $patron->unblessed; |
684 |
my $patron_unblessed = $patron->unblessed; |
684 |
|
685 |
|
Lines 692-698
sub CanBookBeIssued {
Link Here
|
692 |
unless ( $duedate ) { |
693 |
unless ( $duedate ) { |
693 |
my $issuedate = $now->clone(); |
694 |
my $issuedate = $now->clone(); |
694 |
|
695 |
|
695 |
my $branch = _GetCircControlBranch($item, $patron_unblessed); |
696 |
my $branch = _GetCircControlBranch($item_unblessed, $patron_unblessed); |
696 |
$duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); |
697 |
$duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); |
697 |
|
698 |
|
698 |
# Offline circ calls AddIssue directly, doesn't run through here |
699 |
# Offline circ calls AddIssue directly, doesn't run through here |
Lines 711-727
sub CanBookBeIssued {
Link Here
|
711 |
# |
712 |
# |
712 |
# BORROWER STATUS |
713 |
# BORROWER STATUS |
713 |
# |
714 |
# |
714 |
if ( $patron->category->category_type eq 'X' && ( $item->{barcode} )) { |
715 |
if ( $patron->category->category_type eq 'X' && ( $item->barcode )) { |
715 |
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . |
716 |
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . |
716 |
&UpdateStats({ |
717 |
&UpdateStats({ |
717 |
branch => C4::Context->userenv->{'branch'}, |
718 |
branch => C4::Context->userenv->{'branch'}, |
718 |
type => 'localuse', |
719 |
type => 'localuse', |
719 |
itemnumber => $item->{'itemnumber'}, |
720 |
itemnumber => $item->itemnumber, |
720 |
itemtype => $effective_itemtype, |
721 |
itemtype => $effective_itemtype, |
721 |
borrowernumber => $patron->borrowernumber, |
722 |
borrowernumber => $patron->borrowernumber, |
722 |
ccode => $item->{'ccode'}} |
723 |
ccode => $item->ccode} |
723 |
); |
724 |
); |
724 |
ModDateLastSeen( $item->{'itemnumber'} ); |
725 |
ModDateLastSeen( $item->itemnumber ); # FIXME Move to Koha::Item |
725 |
return( { STATS => 1 }, {}); |
726 |
return( { STATS => 1 }, {}); |
726 |
} |
727 |
} |
727 |
|
728 |
|
Lines 832-838
sub CanBookBeIssued {
Link Here
|
832 |
} else { |
833 |
} else { |
833 |
my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( |
834 |
my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( |
834 |
$patron->borrowernumber, |
835 |
$patron->borrowernumber, |
835 |
$item->{'itemnumber'}, |
836 |
$item->itemnumber, |
836 |
); |
837 |
); |
837 |
if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed |
838 |
if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed |
838 |
if ( $renewerror eq 'onsite_checkout' ) { |
839 |
if ( $renewerror eq 'onsite_checkout' ) { |
Lines 853-859
sub CanBookBeIssued {
Link Here
|
853 |
|
854 |
|
854 |
my $patron = Koha::Patrons->find( $issue->borrowernumber ); |
855 |
my $patron = Koha::Patrons->find( $issue->borrowernumber ); |
855 |
|
856 |
|
856 |
my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
857 |
my ( $can_be_returned, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); |
857 |
|
858 |
|
858 |
unless ( $can_be_returned ) { |
859 |
unless ( $can_be_returned ) { |
859 |
$issuingimpossible{RETURN_IMPOSSIBLE} = 1; |
860 |
$issuingimpossible{RETURN_IMPOSSIBLE} = 1; |
Lines 874-880
sub CanBookBeIssued {
Link Here
|
874 |
and $issue |
875 |
and $issue |
875 |
and $issue->onsite_checkout |
876 |
and $issue->onsite_checkout |
876 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
877 |
and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); |
877 |
my $toomany = TooMany( $patron_unblessed, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
878 |
my $toomany = TooMany( $patron_unblessed, $item->biblionumber, $item_unblessed, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); |
878 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
879 |
# if TooMany max_allowed returns 0 the user doesn't have permission to check out this book |
879 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
880 |
if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { |
880 |
if ( $toomany->{max_allowed} == 0 ) { |
881 |
if ( $toomany->{max_allowed} == 0 ) { |
Lines 897-915
sub CanBookBeIssued {
Link Here
|
897 |
$patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed |
898 |
$patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed |
898 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
899 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
899 |
$needsconfirmation{PREVISSUE} = 1 |
900 |
$needsconfirmation{PREVISSUE} = 1 |
900 |
if ($wants_check and $patron->do_check_for_previous_checkout($item)); |
901 |
if ($wants_check and $patron->do_check_for_previous_checkout($item_unblessed)); |
901 |
|
902 |
|
902 |
# |
903 |
# |
903 |
# ITEM CHECKING |
904 |
# ITEM CHECKING |
904 |
# |
905 |
# |
905 |
if ( $item->{'notforloan'} ) |
906 |
if ( $item->notforloan ) |
906 |
{ |
907 |
{ |
907 |
if(!C4::Context->preference("AllowNotForLoanOverride")){ |
908 |
if(!C4::Context->preference("AllowNotForLoanOverride")){ |
908 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
909 |
$issuingimpossible{NOT_FOR_LOAN} = 1; |
909 |
$issuingimpossible{item_notforloan} = $item->{'notforloan'}; |
910 |
$issuingimpossible{item_notforloan} = $item->notforloan; |
910 |
}else{ |
911 |
}else{ |
911 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
912 |
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; |
912 |
$needsconfirmation{item_notforloan} = $item->{'notforloan'}; |
913 |
$needsconfirmation{item_notforloan} = $item->notforloan; |
913 |
} |
914 |
} |
914 |
} |
915 |
} |
915 |
else { |
916 |
else { |
Lines 942-958
sub CanBookBeIssued {
Link Here
|
942 |
} |
943 |
} |
943 |
} |
944 |
} |
944 |
} |
945 |
} |
945 |
if ( $item->{'withdrawn'} && $item->{'withdrawn'} > 0 ) |
946 |
if ( $item->withdrawn && $item->withdrawn > 0 ) |
946 |
{ |
947 |
{ |
947 |
$issuingimpossible{WTHDRAWN} = 1; |
948 |
$issuingimpossible{WTHDRAWN} = 1; |
948 |
} |
949 |
} |
949 |
if ( $item->{'restricted'} |
950 |
if ( $item->restricted |
950 |
&& $item->{'restricted'} == 1 ) |
951 |
&& $item->restricted == 1 ) |
951 |
{ |
952 |
{ |
952 |
$issuingimpossible{RESTRICTED} = 1; |
953 |
$issuingimpossible{RESTRICTED} = 1; |
953 |
} |
954 |
} |
954 |
if ( $item->{'itemlost'} && C4::Context->preference("IssueLostItem") ne 'nothing' ) { |
955 |
if ( $item->itemlost && C4::Context->preference("IssueLostItem") ne 'nothing' ) { |
955 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $item->{itemlost} }); |
956 |
my $av = Koha::AuthorisedValues->search({ category => 'LOST', authorised_value => $item->itemlost }); |
956 |
my $code = $av->count ? $av->next->lib : ''; |
957 |
my $code = $av->count ? $av->next->lib : ''; |
957 |
$needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); |
958 |
$needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); |
958 |
$alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); |
959 |
$alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); |
Lines 960-968
sub CanBookBeIssued {
Link Here
|
960 |
if ( C4::Context->preference("IndependentBranches") ) { |
961 |
if ( C4::Context->preference("IndependentBranches") ) { |
961 |
my $userenv = C4::Context->userenv; |
962 |
my $userenv = C4::Context->userenv; |
962 |
unless ( C4::Context->IsSuperLibrarian() ) { |
963 |
unless ( C4::Context->IsSuperLibrarian() ) { |
963 |
if ( $item->{C4::Context->preference("HomeOrHoldingBranch")} ne $userenv->{branch} ){ |
964 |
my $HomeOrHoldingBranch = C4::Context->preference("HomeOrHoldingBranch"); |
|
|
965 |
if ( $item->$HomeOrHoldingBranch ne $userenv->{branch} ){ |
964 |
$issuingimpossible{ITEMNOTSAMEBRANCH} = 1; |
966 |
$issuingimpossible{ITEMNOTSAMEBRANCH} = 1; |
965 |
$issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")}; |
967 |
$issuingimpossible{'itemhomebranch'} = $item->$HomeOrHoldingBranch; |
966 |
} |
968 |
} |
967 |
$needsconfirmation{BORRNOTSAMEBRANCH} = $patron->branchcode |
969 |
$needsconfirmation{BORRNOTSAMEBRANCH} = $patron->branchcode |
968 |
if ( $patron->branchcode ne $userenv->{branch} ); |
970 |
if ( $patron->branchcode ne $userenv->{branch} ); |
Lines 974-980
sub CanBookBeIssued {
Link Here
|
974 |
my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); |
976 |
my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); |
975 |
|
977 |
|
976 |
if ( $rentalConfirmation ){ |
978 |
if ( $rentalConfirmation ){ |
977 |
my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $patron->borrowernumber ); |
979 |
my ($rentalCharge) = GetIssuingCharges( $item->itemnumber, $patron->borrowernumber ); |
978 |
if ( $rentalCharge > 0 ){ |
980 |
if ( $rentalCharge > 0 ){ |
979 |
$needsconfirmation{RENTALCHARGE} = $rentalCharge; |
981 |
$needsconfirmation{RENTALCHARGE} = $rentalCharge; |
980 |
} |
982 |
} |
Lines 982-988
sub CanBookBeIssued {
Link Here
|
982 |
|
984 |
|
983 |
unless ( $ignore_reserves ) { |
985 |
unless ( $ignore_reserves ) { |
984 |
# See if the item is on reserve. |
986 |
# See if the item is on reserve. |
985 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); |
987 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->itemnumber ); |
986 |
if ($restype) { |
988 |
if ($restype) { |
987 |
my $resbor = $res->{'borrowernumber'}; |
989 |
my $resbor = $res->{'borrowernumber'}; |
988 |
if ( $resbor ne $patron->borrowernumber ) { |
990 |
if ( $resbor ne $patron->borrowernumber ) { |
Lines 1027-1033
sub CanBookBeIssued {
Link Here
|
1027 |
|
1029 |
|
1028 |
## check for high holds decreasing loan period |
1030 |
## check for high holds decreasing loan period |
1029 |
if ( C4::Context->preference('decreaseLoanHighHolds') ) { |
1031 |
if ( C4::Context->preference('decreaseLoanHighHolds') ) { |
1030 |
my $check = checkHighHolds( $item, $patron_unblessed ); |
1032 |
my $check = checkHighHolds( $item_unblessed, $patron_unblessed ); |
1031 |
|
1033 |
|
1032 |
if ( $check->{exceeded} ) { |
1034 |
if ( $check->{exceeded} ) { |
1033 |
if ($override_high_holds) { |
1035 |
if ($override_high_holds) { |
Lines 1056-1062
sub CanBookBeIssued {
Link Here
|
1056 |
) { |
1058 |
) { |
1057 |
# Check if borrower has already issued an item from the same biblio |
1059 |
# Check if borrower has already issued an item from the same biblio |
1058 |
# Only if it's not a subscription |
1060 |
# Only if it's not a subscription |
1059 |
my $biblionumber = $item->{biblionumber}; |
1061 |
my $biblionumber = $item->biblionumber; |
1060 |
require C4::Serials; |
1062 |
require C4::Serials; |
1061 |
my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber); |
1063 |
my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber); |
1062 |
unless ($is_a_subscription) { |
1064 |
unless ($is_a_subscription) { |
Lines 1089-1095
Check whether the item can be returned to the provided branch
Link Here
|
1089 |
|
1091 |
|
1090 |
=over 4 |
1092 |
=over 4 |
1091 |
|
1093 |
|
1092 |
=item C<$item> is a hash of item information as returned from GetItem |
1094 |
=item C<$item> is a hash of item information as returned Koha::Items->find->unblessed (Temporary, should be a Koha::Item instead) |
1093 |
|
1095 |
|
1094 |
=item C<$branch> is the branchcode where the return is taking place |
1096 |
=item C<$branch> is the branchcode where the return is taking place |
1095 |
|
1097 |
|
Lines 1287-1307
sub AddIssue {
Link Here
|
1287 |
# Stop here if the patron or barcode doesn't exist |
1289 |
# Stop here if the patron or barcode doesn't exist |
1288 |
if ( $borrower && $barcode && $barcodecheck ) { |
1290 |
if ( $borrower && $barcode && $barcodecheck ) { |
1289 |
# find which item we issue |
1291 |
# find which item we issue |
1290 |
my $item = GetItem( '', $barcode ) |
1292 |
my $item = Koha::Items->find({ barcode => $barcode }) |
1291 |
or return; # if we don't get an Item, abort. |
1293 |
or return; # if we don't get an Item, abort. |
1292 |
my $item_object = Koha::Items->find( { barcode => $barcode } ); |
1294 |
my $item_unblessed = $item->unblessed; |
1293 |
|
1295 |
|
1294 |
my $branch = _GetCircControlBranch( $item, $borrower ); |
1296 |
my $branch = _GetCircControlBranch( $item_unblessed, $borrower ); |
1295 |
|
1297 |
|
1296 |
# get actual issuing if there is one |
1298 |
# get actual issuing if there is one |
1297 |
my $actualissue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); |
1299 |
my $actualissue = $item->checkout; |
1298 |
|
1300 |
|
1299 |
# check if we just renew the issue. |
1301 |
# check if we just renew the issue. |
1300 |
if ( $actualissue and $actualissue->borrowernumber eq $borrower->{'borrowernumber'} |
1302 |
if ( $actualissue and $actualissue->borrowernumber eq $borrower->{'borrowernumber'} |
1301 |
and not $switch_onsite_checkout ) { |
1303 |
and not $switch_onsite_checkout ) { |
1302 |
$datedue = AddRenewal( |
1304 |
$datedue = AddRenewal( |
1303 |
$borrower->{'borrowernumber'}, |
1305 |
$borrower->{'borrowernumber'}, |
1304 |
$item->{'itemnumber'}, |
1306 |
$item->itemnumber, |
1305 |
$branch, |
1307 |
$branch, |
1306 |
$datedue, |
1308 |
$datedue, |
1307 |
$issuedate, # here interpreted as the renewal date |
1309 |
$issuedate, # here interpreted as the renewal date |
Lines 1312-1326
sub AddIssue {
Link Here
|
1312 |
if ( $actualissue and not $switch_onsite_checkout ) { |
1314 |
if ( $actualissue and not $switch_onsite_checkout ) { |
1313 |
# This book is currently on loan, but not to the person |
1315 |
# This book is currently on loan, but not to the person |
1314 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
1316 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
1315 |
my ( $allowed, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
1317 |
my ( $allowed, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); |
1316 |
return unless $allowed; |
1318 |
return unless $allowed; |
1317 |
AddReturn( $item->{'barcode'}, C4::Context->userenv->{'branch'} ); |
1319 |
AddReturn( $item->barcode, C4::Context->userenv->{'branch'} ); |
1318 |
} |
1320 |
} |
1319 |
|
1321 |
|
1320 |
C4::Reserves::MoveReserve( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $cancelreserve ); |
1322 |
C4::Reserves::MoveReserve( $item->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); |
1321 |
|
1323 |
|
1322 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
1324 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
1323 |
my ($datesent) = GetTransfers( $item->{'itemnumber'} ); |
1325 |
my ($datesent) = GetTransfers( $item->itemnumber ); |
1324 |
if ($datesent) { |
1326 |
if ($datesent) { |
1325 |
# updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....) |
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 ....) |
1326 |
my $sth = $dbh->prepare( |
1328 |
my $sth = $dbh->prepare( |
Lines 1331-1344
sub AddIssue {
Link Here
|
1331 |
WHERE itemnumber= ? AND datearrived IS NULL" |
1333 |
WHERE itemnumber= ? AND datearrived IS NULL" |
1332 |
); |
1334 |
); |
1333 |
$sth->execute( C4::Context->userenv->{'branch'}, |
1335 |
$sth->execute( C4::Context->userenv->{'branch'}, |
1334 |
$item->{'itemnumber'} ); |
1336 |
$item->itemnumber ); |
1335 |
} |
1337 |
} |
1336 |
|
1338 |
|
1337 |
# If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. |
1339 |
# If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. |
1338 |
unless ($auto_renew) { |
1340 |
unless ($auto_renew) { |
1339 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1341 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
1340 |
{ categorycode => $borrower->{categorycode}, |
1342 |
{ categorycode => $borrower->{categorycode}, |
1341 |
itemtype => $item->{itype}, |
1343 |
itemtype => $item->effective_itemtype, |
1342 |
branchcode => $branch |
1344 |
branchcode => $branch |
1343 |
} |
1345 |
} |
1344 |
); |
1346 |
); |
Lines 1348-1354
sub AddIssue {
Link Here
|
1348 |
|
1350 |
|
1349 |
# Record in the database the fact that the book was issued. |
1351 |
# Record in the database the fact that the book was issued. |
1350 |
unless ($datedue) { |
1352 |
unless ($datedue) { |
1351 |
my $itype = $item_object->effective_itemtype; |
1353 |
my $itype = $item->effective_itemtype; |
1352 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1354 |
$datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower ); |
1353 |
|
1355 |
|
1354 |
} |
1356 |
} |
Lines 1357-1363
sub AddIssue {
Link Here
|
1357 |
$issue = Koha::Database->new()->schema()->resultset('Issue')->update_or_create( |
1359 |
$issue = Koha::Database->new()->schema()->resultset('Issue')->update_or_create( |
1358 |
{ |
1360 |
{ |
1359 |
borrowernumber => $borrower->{'borrowernumber'}, |
1361 |
borrowernumber => $borrower->{'borrowernumber'}, |
1360 |
itemnumber => $item->{'itemnumber'}, |
1362 |
itemnumber => $item->itemnumber, |
1361 |
issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), |
1363 |
issuedate => $issuedate->strftime('%Y-%m-%d %H:%M:%S'), |
1362 |
date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), |
1364 |
date_due => $datedue->strftime('%Y-%m-%d %H:%M:%S'), |
1363 |
branchcode => C4::Context->userenv->{'branch'}, |
1365 |
branchcode => C4::Context->userenv->{'branch'}, |
Lines 1368-1416
sub AddIssue {
Link Here
|
1368 |
|
1370 |
|
1369 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
1371 |
if ( C4::Context->preference('ReturnToShelvingCart') ) { |
1370 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
1372 |
# ReturnToShelvingCart is on, anything issued should be taken off the cart. |
1371 |
CartToShelf( $item->{'itemnumber'} ); |
1373 |
CartToShelf( $item->itemnumber ); |
1372 |
} |
1374 |
} |
1373 |
$item->{'issues'}++; |
1375 |
|
1374 |
if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { |
1376 |
if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { |
1375 |
UpdateTotalIssues( $item->{'biblionumber'}, 1 ); |
1377 |
UpdateTotalIssues( $item->biblionumber, 1 ); |
1376 |
} |
1378 |
} |
1377 |
|
1379 |
|
1378 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
1380 |
## If item was lost, it has now been found, reverse any list item charges if necessary. |
1379 |
if ( $item->{'itemlost'} ) { |
1381 |
if ( $item->itemlost ) { |
1380 |
if ( |
1382 |
if ( |
1381 |
Koha::RefundLostItemFeeRules->should_refund( |
1383 |
Koha::RefundLostItemFeeRules->should_refund( |
1382 |
{ |
1384 |
{ |
1383 |
current_branch => C4::Context->userenv->{branch}, |
1385 |
current_branch => C4::Context->userenv->{branch}, |
1384 |
item_home_branch => $item->{homebranch}, |
1386 |
item_home_branch => $item->homebranch, |
1385 |
item_holding_branch => $item->{holdingbranch} |
1387 |
item_holding_branch => $item->holdingbranch, |
1386 |
} |
1388 |
} |
1387 |
) |
1389 |
) |
1388 |
) |
1390 |
) |
1389 |
{ |
1391 |
{ |
1390 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, |
1392 |
_FixAccountForLostAndReturned( $item->itemnumber, undef, |
1391 |
$item->{'barcode'} ); |
1393 |
$item->barcode ); |
1392 |
} |
1394 |
} |
1393 |
} |
1395 |
} |
1394 |
|
1396 |
|
1395 |
ModItem( |
1397 |
ModItem( |
1396 |
{ |
1398 |
{ |
1397 |
issues => $item->{'issues'}, |
1399 |
issues => $item->issues + 1, |
1398 |
holdingbranch => C4::Context->userenv->{'branch'}, |
1400 |
holdingbranch => C4::Context->userenv->{'branch'}, |
1399 |
itemlost => 0, |
1401 |
itemlost => 0, |
1400 |
onloan => $datedue->ymd(), |
1402 |
onloan => $datedue->ymd(), |
1401 |
datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(), |
1403 |
datelastborrowed => DateTime->now( time_zone => C4::Context->tz() )->ymd(), |
1402 |
}, |
1404 |
}, |
1403 |
$item->{'biblionumber'}, |
1405 |
$item->biblionumber, |
1404 |
$item->{'itemnumber'}, |
1406 |
$item->itemnumber, |
1405 |
{ log_action => 0 } |
1407 |
{ log_action => 0 } |
1406 |
); |
1408 |
); |
1407 |
ModDateLastSeen( $item->{'itemnumber'} ); |
1409 |
ModDateLastSeen( $item->itemnumber ); |
1408 |
|
1410 |
|
1409 |
# If it costs to borrow this book, charge it to the patron's account. |
1411 |
# If it costs to borrow this book, charge it to the patron's account. |
1410 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); |
1412 |
my ( $charge, $itemtype ) = GetIssuingCharges( $item->itemnumber, $borrower->{'borrowernumber'} ); |
1411 |
if ( $charge > 0 ) { |
1413 |
if ( $charge > 0 ) { |
1412 |
AddIssuingCharge( $issue, $charge ); |
1414 |
AddIssuingCharge( $issue, $charge ); |
1413 |
$item->{'charge'} = $charge; |
|
|
1414 |
} |
1415 |
} |
1415 |
|
1416 |
|
1416 |
# Record the fact that this book was issued. |
1417 |
# Record the fact that this book was issued. |
Lines 1420-1430
sub AddIssue {
Link Here
|
1420 |
type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), |
1421 |
type => ( $onsite_checkout ? 'onsite_checkout' : 'issue' ), |
1421 |
amount => $charge, |
1422 |
amount => $charge, |
1422 |
other => ( $sipmode ? "SIP-$sipmode" : '' ), |
1423 |
other => ( $sipmode ? "SIP-$sipmode" : '' ), |
1423 |
itemnumber => $item->{'itemnumber'}, |
1424 |
itemnumber => $item->itemnumber, |
1424 |
itemtype => $item->{'itype'}, |
1425 |
itemtype => $item->effective_itemtype, |
1425 |
location => $item->{location}, |
1426 |
location => $item->location, |
1426 |
borrowernumber => $borrower->{'borrowernumber'}, |
1427 |
borrowernumber => $borrower->{'borrowernumber'}, |
1427 |
ccode => $item->{'ccode'} |
1428 |
ccode => $item->ccode, |
1428 |
} |
1429 |
} |
1429 |
); |
1430 |
); |
1430 |
|
1431 |
|
Lines 1433-1439
sub AddIssue {
Link Here
|
1433 |
my %conditions = ( |
1434 |
my %conditions = ( |
1434 |
branchcode => $branch, |
1435 |
branchcode => $branch, |
1435 |
categorycode => $borrower->{categorycode}, |
1436 |
categorycode => $borrower->{categorycode}, |
1436 |
item_type => $item->{itype}, |
1437 |
item_type => $item->effective_itemtype, |
1437 |
notification => 'CHECKOUT', |
1438 |
notification => 'CHECKOUT', |
1438 |
); |
1439 |
); |
1439 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
1440 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
Lines 1449-1455
sub AddIssue {
Link Here
|
1449 |
logaction( |
1450 |
logaction( |
1450 |
"CIRCULATION", "ISSUE", |
1451 |
"CIRCULATION", "ISSUE", |
1451 |
$borrower->{'borrowernumber'}, |
1452 |
$borrower->{'borrowernumber'}, |
1452 |
$item->{'itemnumber'} |
1453 |
$item->itemnumber, |
1453 |
) if C4::Context->preference("IssueLog"); |
1454 |
) if C4::Context->preference("IssueLog"); |
1454 |
} |
1455 |
} |
1455 |
} |
1456 |
} |
Lines 1802-1814
sub AddReturn {
Link Here
|
1802 |
my $stat_type = 'return'; |
1803 |
my $stat_type = 'return'; |
1803 |
|
1804 |
|
1804 |
# get information on item |
1805 |
# get information on item |
1805 |
my $item = GetItem( undef, $barcode ); |
1806 |
my $item = Koha::Items->find({ barcode => $barcode }); |
1806 |
unless ($item) { |
1807 |
unless ($item) { |
1807 |
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. |
1808 |
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. |
1808 |
} |
1809 |
} |
1809 |
|
1810 |
|
1810 |
my $itemnumber = $item->{ itemnumber }; |
1811 |
my $itemnumber = $item->itemnumber; |
1811 |
my $itemtype = $item->{itype}; # GetItem called effective_itemtype |
1812 |
my $itemtype = $item->effective_itemtype; |
1812 |
|
1813 |
|
1813 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
1814 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
1814 |
if ( $issue ) { |
1815 |
if ( $issue ) { |
Lines 1827-1847
sub AddReturn {
Link Here
|
1827 |
} |
1828 |
} |
1828 |
} |
1829 |
} |
1829 |
|
1830 |
|
1830 |
if ( $item->{'location'} eq 'PROC' ) { |
1831 |
my $item_unblessed = $item->unblessed; |
|
|
1832 |
if ( $item->location eq 'PROC' ) { |
1831 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1833 |
if ( C4::Context->preference("InProcessingToShelvingCart") ) { |
1832 |
$item->{'location'} = 'CART'; |
1834 |
$item_unblessed->{location} = 'CART'; |
1833 |
} |
1835 |
} |
1834 |
else { |
1836 |
else { |
1835 |
$item->{location} = $item->{permanent_location}; |
1837 |
$item_unblessed->{location} = $item->permanent_location; |
1836 |
} |
1838 |
} |
1837 |
|
1839 |
|
1838 |
ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, { log_action => 0 } ); |
1840 |
ModItem( $item_unblessed, $item->biblionumber, $item->itemnumber, { log_action => 0 } ); |
1839 |
} |
1841 |
} |
1840 |
|
1842 |
|
1841 |
# full item data, but no borrowernumber or checkout info (no issue) |
1843 |
# full item data, but no borrowernumber or checkout info (no issue) |
1842 |
my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch"; |
1844 |
my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch"; |
1843 |
# get the proper branch to which to return the item |
1845 |
# get the proper branch to which to return the item |
1844 |
my $returnbranch = $item->{$hbr} || $branch ; |
1846 |
my $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $branch; |
1845 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1847 |
# if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch) |
1846 |
|
1848 |
|
1847 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
1849 |
my $borrowernumber = $patron ? $patron->borrowernumber : undef; # we don't know if we had a borrower or not |
Lines 1857-1864
sub AddReturn {
Link Here
|
1857 |
} |
1859 |
} |
1858 |
else { |
1860 |
else { |
1859 |
foreach my $key ( keys %$rules ) { |
1861 |
foreach my $key ( keys %$rules ) { |
1860 |
if ( $item->{notforloan} eq $key ) { |
1862 |
if ( $item->notforloan eq $key ) { |
1861 |
$messages->{'NotForLoanStatusUpdated'} = { from => $item->{notforloan}, to => $rules->{$key} }; |
1863 |
$messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} }; |
1862 |
ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber, { log_action => 0 } ); |
1864 |
ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber, { log_action => 0 } ); |
1863 |
last; |
1865 |
last; |
1864 |
} |
1866 |
} |
Lines 1867-1873
sub AddReturn {
Link Here
|
1867 |
} |
1869 |
} |
1868 |
|
1870 |
|
1869 |
# check if the return is allowed at this branch |
1871 |
# check if the return is allowed at this branch |
1870 |
my ($returnallowed, $message) = CanBookBeReturned($item, $branch); |
1872 |
my ($returnallowed, $message) = CanBookBeReturned($item_unblessed, $branch); |
1871 |
unless ($returnallowed){ |
1873 |
unless ($returnallowed){ |
1872 |
$messages->{'Wrongbranch'} = { |
1874 |
$messages->{'Wrongbranch'} = { |
1873 |
Wrongbranch => $branch, |
1875 |
Wrongbranch => $branch, |
Lines 1877-1888
sub AddReturn {
Link Here
|
1877 |
return ( $doreturn, $messages, $issue, $patron_unblessed); |
1879 |
return ( $doreturn, $messages, $issue, $patron_unblessed); |
1878 |
} |
1880 |
} |
1879 |
|
1881 |
|
1880 |
if ( $item->{'withdrawn'} ) { # book has been cancelled |
1882 |
if ( $item->withdrawn ) { # book has been cancelled |
1881 |
$messages->{'withdrawn'} = 1; |
1883 |
$messages->{'withdrawn'} = 1; |
1882 |
$doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); |
1884 |
$doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); |
1883 |
} |
1885 |
} |
1884 |
|
1886 |
|
1885 |
if ( $item->{itemlost} and C4::Context->preference("BlockReturnOfLostItems") ) { |
1887 |
if ( $item->itemlost and C4::Context->preference("BlockReturnOfLostItems") ) { |
1886 |
$doreturn = 0; |
1888 |
$doreturn = 0; |
1887 |
} |
1889 |
} |
1888 |
|
1890 |
|
Lines 1899-1905
sub AddReturn {
Link Here
|
1899 |
# don't allow dropbox mode to create an invalid entry in issues (issuedate > today) |
1901 |
# don't allow dropbox mode to create an invalid entry in issues (issuedate > today) |
1900 |
# FIXME: check issuedate > returndate, factoring in holidays |
1902 |
# FIXME: check issuedate > returndate, factoring in holidays |
1901 |
|
1903 |
|
1902 |
$circControlBranch = _GetCircControlBranch($item,$patron_unblessed); |
1904 |
$circControlBranch = _GetCircControlBranch($item_unblessed, $patron_unblessed); |
1903 |
$is_overdue = $issue->is_overdue( $dropboxdate ); |
1905 |
$is_overdue = $issue->is_overdue( $dropboxdate ); |
1904 |
} else { |
1906 |
} else { |
1905 |
$is_overdue = $issue->is_overdue; |
1907 |
$is_overdue = $issue->is_overdue; |
Lines 1907-1918
sub AddReturn {
Link Here
|
1907 |
|
1909 |
|
1908 |
if ($patron) { |
1910 |
if ($patron) { |
1909 |
eval { |
1911 |
eval { |
1910 |
MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, |
1912 |
MarkIssueReturned( $borrowernumber, $item->itemnumber, |
1911 |
$circControlBranch, $return_date, $patron->privacy ); |
1913 |
$circControlBranch, $return_date, $patron->privacy ); |
1912 |
}; |
1914 |
}; |
1913 |
unless ( $@ ) { |
1915 |
unless ( $@ ) { |
1914 |
if ( ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue ) || $return_date ) { |
1916 |
if ( ( C4::Context->preference('CalculateFinesOnReturn') && $is_overdue ) || $return_date ) { |
1915 |
_CalculateAndUpdateFine( { issue => $issue, item => $item, borrower => $patron_unblessed, return_date => $return_date } ); |
1917 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed, return_date => $return_date } ); |
1916 |
} |
1918 |
} |
1917 |
} else { |
1919 |
} else { |
1918 |
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 ); |
1920 |
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 1925-1980
sub AddReturn {
Link Here
|
1925 |
|
1927 |
|
1926 |
} |
1928 |
} |
1927 |
|
1929 |
|
1928 |
ModItem( { onloan => undef }, $item->{biblionumber}, $item->{itemnumber}, { log_action => 0 } ); |
1930 |
ModItem( { onloan => undef }, $item->biblionumber, $item->itemnumber, { log_action => 0 } ); |
1929 |
} |
1931 |
} |
1930 |
|
1932 |
|
1931 |
# the holdingbranch is updated if the document is returned to another location. |
1933 |
# the holdingbranch is updated if the document is returned to another location. |
1932 |
# this is always done regardless of whether the item was on loan or not |
1934 |
# this is always done regardless of whether the item was on loan or not |
1933 |
my $item_holding_branch = $item->{ holdingbranch }; |
1935 |
my $item_holding_branch = $item->holdingbranch; |
1934 |
if ($item->{'holdingbranch'} ne $branch) { |
1936 |
if ($item->holdingbranch ne $branch) { |
1935 |
UpdateHoldingbranch($branch, $item->{'itemnumber'}); |
1937 |
UpdateHoldingbranch($branch, $item->itemnumber); |
1936 |
$item->{'holdingbranch'} = $branch; # update item data holdingbranch too |
1938 |
$item_unblessed->{'holdingbranch'} = $branch; # update item data holdingbranch too # FIXME I guess this is for the _debar_user_on_return call later |
1937 |
} |
1939 |
} |
1938 |
ModDateLastSeen( $item->{'itemnumber'} ); |
1940 |
ModDateLastSeen( $item->itemnumber ); |
1939 |
|
1941 |
|
1940 |
# check if we have a transfer for this document |
1942 |
# check if we have a transfer for this document |
1941 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); |
1943 |
my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->itemnumber ); |
1942 |
|
1944 |
|
1943 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1945 |
# if we have a transfer to do, we update the line of transfers with the datearrived |
1944 |
my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->{'itemnumber'} ); |
1946 |
my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); |
1945 |
if ($datesent) { |
1947 |
if ($datesent) { |
1946 |
if ( $tobranch eq $branch ) { |
1948 |
if ( $tobranch eq $branch ) { |
1947 |
my $sth = C4::Context->dbh->prepare( |
1949 |
my $sth = C4::Context->dbh->prepare( |
1948 |
"UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" |
1950 |
"UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" |
1949 |
); |
1951 |
); |
1950 |
$sth->execute( $item->{'itemnumber'} ); |
1952 |
$sth->execute( $item->itemnumber ); |
1951 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1953 |
# if we have a reservation with valid transfer, we can set it's status to 'W' |
1952 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1954 |
ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1953 |
C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W'); |
1955 |
C4::Reserves::ModReserveStatus($item->itemnumber, 'W'); |
1954 |
} else { |
1956 |
} else { |
1955 |
$messages->{'WrongTransfer'} = $tobranch; |
1957 |
$messages->{'WrongTransfer'} = $tobranch; |
1956 |
$messages->{'WrongTransferItem'} = $item->{'itemnumber'}; |
1958 |
$messages->{'WrongTransferItem'} = $item->itemnumber; |
1957 |
} |
1959 |
} |
1958 |
$validTransfert = 1; |
1960 |
$validTransfert = 1; |
1959 |
} else { |
1961 |
} else { |
1960 |
ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1962 |
ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") ); |
1961 |
} |
1963 |
} |
1962 |
|
1964 |
|
1963 |
# fix up the accounts..... |
1965 |
# fix up the accounts..... |
1964 |
if ( $item->{'itemlost'} ) { |
1966 |
if ( $item->itemlost ) { |
1965 |
$messages->{'WasLost'} = 1; |
1967 |
$messages->{'WasLost'} = 1; |
1966 |
unless ( C4::Context->preference("BlockReturnOfLostItems") ) { |
1968 |
unless ( C4::Context->preference("BlockReturnOfLostItems") ) { |
1967 |
if ( |
1969 |
if ( |
1968 |
Koha::RefundLostItemFeeRules->should_refund( |
1970 |
Koha::RefundLostItemFeeRules->should_refund( |
1969 |
{ |
1971 |
{ |
1970 |
current_branch => C4::Context->userenv->{branch}, |
1972 |
current_branch => C4::Context->userenv->{branch}, |
1971 |
item_home_branch => $item->{homebranch}, |
1973 |
item_home_branch => $item->homebranch, |
1972 |
item_holding_branch => $item_holding_branch |
1974 |
item_holding_branch => $item_holding_branch |
1973 |
} |
1975 |
} |
1974 |
) |
1976 |
) |
1975 |
) |
1977 |
) |
1976 |
{ |
1978 |
{ |
1977 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, |
1979 |
_FixAccountForLostAndReturned( $item->itemnumber, |
1978 |
$borrowernumber, $barcode ); |
1980 |
$borrowernumber, $barcode ); |
1979 |
$messages->{'LostItemFeeRefunded'} = 1; |
1981 |
$messages->{'LostItemFeeRefunded'} = 1; |
1980 |
} |
1982 |
} |
Lines 1983-1996
sub AddReturn {
Link Here
|
1983 |
|
1985 |
|
1984 |
# fix up the overdues in accounts... |
1986 |
# fix up the overdues in accounts... |
1985 |
if ($borrowernumber) { |
1987 |
if ($borrowernumber) { |
1986 |
my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); |
1988 |
my $fix = _FixOverduesOnReturn($borrowernumber, $item->itemnumber, $exemptfine, $dropbox); |
1987 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined |
1989 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->itemnumber...) failed!"; # zero is OK, check defined |
1988 |
|
1990 |
|
1989 |
if ( $issue and $issue->is_overdue ) { |
1991 |
if ( $issue and $issue->is_overdue ) { |
1990 |
# fix fine days |
1992 |
# fix fine days |
1991 |
$today = dt_from_string($return_date) if $return_date; |
1993 |
$today = dt_from_string($return_date) if $return_date; |
1992 |
$today = $dropboxdate if $dropbox; |
1994 |
$today = $dropboxdate if $dropbox; |
1993 |
my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item, dt_from_string($issue->date_due), $today ); |
1995 |
my ($debardate,$reminder) = _debar_user_on_return( $patron_unblessed, $item_unblessed, dt_from_string($issue->date_due), $today ); |
1994 |
if ($reminder){ |
1996 |
if ($reminder){ |
1995 |
$messages->{'PrevDebarred'} = $debardate; |
1997 |
$messages->{'PrevDebarred'} = $debardate; |
1996 |
} else { |
1998 |
} else { |
Lines 2015-2021
sub AddReturn {
Link Here
|
2015 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
2017 |
# if we don't have a reserve with the status W, we launch the Checkreserves routine |
2016 |
my ($resfound, $resrec); |
2018 |
my ($resfound, $resrec); |
2017 |
my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
2019 |
my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
2018 |
($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'}, undef, $lookahead ) unless ( $item->{'withdrawn'} ); |
2020 |
($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $lookahead ) unless ( $item->withdrawn ); |
2019 |
if ($resfound) { |
2021 |
if ($resfound) { |
2020 |
$resrec->{'ResFound'} = $resfound; |
2022 |
$resrec->{'ResFound'} = $resfound; |
2021 |
$messages->{'ResFound'} = $resrec; |
2023 |
$messages->{'ResFound'} = $resrec; |
Lines 2028-2034
sub AddReturn {
Link Here
|
2028 |
itemnumber => $itemnumber, |
2030 |
itemnumber => $itemnumber, |
2029 |
itemtype => $itemtype, |
2031 |
itemtype => $itemtype, |
2030 |
borrowernumber => $borrowernumber, |
2032 |
borrowernumber => $borrowernumber, |
2031 |
ccode => $item->{ ccode } |
2033 |
ccode => $item->ccode, |
2032 |
}); |
2034 |
}); |
2033 |
|
2035 |
|
2034 |
# Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. |
2036 |
# Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. |
Lines 2037-2055
sub AddReturn {
Link Here
|
2037 |
my %conditions = ( |
2039 |
my %conditions = ( |
2038 |
branchcode => $branch, |
2040 |
branchcode => $branch, |
2039 |
categorycode => $patron->categorycode, |
2041 |
categorycode => $patron->categorycode, |
2040 |
item_type => $item->{itype}, |
2042 |
item_type => $itemtype, |
2041 |
notification => 'CHECKIN', |
2043 |
notification => 'CHECKIN', |
2042 |
); |
2044 |
); |
2043 |
if ($doreturn && $circulation_alert->is_enabled_for(\%conditions)) { |
2045 |
if ($doreturn && $circulation_alert->is_enabled_for(\%conditions)) { |
2044 |
SendCirculationAlert({ |
2046 |
SendCirculationAlert({ |
2045 |
type => 'CHECKIN', |
2047 |
type => 'CHECKIN', |
2046 |
item => $item, |
2048 |
item => $item_unblessed, |
2047 |
borrower => $patron->unblessed, |
2049 |
borrower => $patron->unblessed, |
2048 |
branch => $branch, |
2050 |
branch => $branch, |
2049 |
}); |
2051 |
}); |
2050 |
} |
2052 |
} |
2051 |
|
2053 |
|
2052 |
logaction("CIRCULATION", "RETURN", $borrowernumber, $item->{'itemnumber'}) |
2054 |
logaction("CIRCULATION", "RETURN", $borrowernumber, $item->itemnumber) |
2053 |
if C4::Context->preference("ReturnLog"); |
2055 |
if C4::Context->preference("ReturnLog"); |
2054 |
} |
2056 |
} |
2055 |
|
2057 |
|
Lines 2065-2077
sub AddReturn {
Link Here
|
2065 |
|
2067 |
|
2066 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
2068 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
2067 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ |
2069 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ |
|
|
2070 |
my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType"); |
2068 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
2071 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
2069 |
(C4::Context->preference("UseBranchTransferLimits") and |
2072 |
(C4::Context->preference("UseBranchTransferLimits") and |
2070 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->{C4::Context->preference("BranchTransferLimitsType")} ) |
2073 |
! IsBranchTransferAllowed($branch, $returnbranch, $item->$BranchTransferLimitsType ) |
2071 |
)) { |
2074 |
)) { |
2072 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->{'itemnumber'},$branch, $returnbranch; |
2075 |
$debug and warn sprintf "about to call ModItemTransfer(%s, %s, %s)", $item->itemnumber,$branch, $returnbranch; |
2073 |
$debug and warn "item: " . Dumper($item); |
2076 |
$debug and warn "item: " . Dumper($item_unblessed); |
2074 |
ModItemTransfer($item->{'itemnumber'}, $branch, $returnbranch); |
2077 |
ModItemTransfer($item->itemnumber, $branch, $returnbranch); |
2075 |
$messages->{'WasTransfered'} = 1; |
2078 |
$messages->{'WasTransfered'} = 1; |
2076 |
} else { |
2079 |
} else { |
2077 |
$messages->{'NeedsTransfer'} = $returnbranch; |
2080 |
$messages->{'NeedsTransfer'} = $returnbranch; |
Lines 2589-2595
sub CanBookBeRenewed {
Link Here
|
2589 |
my $dbh = C4::Context->dbh; |
2592 |
my $dbh = C4::Context->dbh; |
2590 |
my $renews = 1; |
2593 |
my $renews = 1; |
2591 |
|
2594 |
|
2592 |
my $item = GetItem($itemnumber) or return ( 0, 'no_item' ); |
2595 |
my $item = Koha::Items->find($itemnumber) or return ( 0, 'no_item' ); |
2593 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return ( 0, 'no_checkout' ); |
2596 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return ( 0, 'no_checkout' ); |
2594 |
return ( 0, 'onsite_checkout' ) if $issue->onsite_checkout; |
2597 |
return ( 0, 'onsite_checkout' ) if $issue->onsite_checkout; |
2595 |
|
2598 |
|
Lines 2645-2651
sub CanBookBeRenewed {
Link Here
|
2645 |
my @reservable; |
2648 |
my @reservable; |
2646 |
my %borrowers; |
2649 |
my %borrowers; |
2647 |
ITEM: foreach my $i (@itemnumbers) { |
2650 |
ITEM: foreach my $i (@itemnumbers) { |
2648 |
my $item = GetItem($i); |
2651 |
my $item = Koha::Items->find($i)->unblessed; |
2649 |
next if IsItemOnHoldAndFound($i); |
2652 |
next if IsItemOnHoldAndFound($i); |
2650 |
for my $b (@borrowernumbers) { |
2653 |
for my $b (@borrowernumbers) { |
2651 |
my $borr = $borrowers{$b} //= Koha::Patrons->find( $b )->unblessed; |
2654 |
my $borr = $borrowers{$b} //= Koha::Patrons->find( $b )->unblessed; |
Lines 2666-2675
sub CanBookBeRenewed {
Link Here
|
2666 |
|
2669 |
|
2667 |
return ( 1, undef ) if $override_limit; |
2670 |
return ( 1, undef ) if $override_limit; |
2668 |
|
2671 |
|
2669 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
2672 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
2670 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2673 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2671 |
{ categorycode => $patron->categorycode, |
2674 |
{ categorycode => $patron->categorycode, |
2672 |
itemtype => $item->{itype}, |
2675 |
itemtype => $item->effective_itemtype, |
2673 |
branchcode => $branchcode |
2676 |
branchcode => $branchcode |
2674 |
} |
2677 |
} |
2675 |
); |
2678 |
); |
Lines 2793-2807
sub AddRenewal {
Link Here
|
2793 |
my $datedue = shift; |
2796 |
my $datedue = shift; |
2794 |
my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd(); |
2797 |
my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd(); |
2795 |
|
2798 |
|
2796 |
my $item = GetItem($itemnumber) or return; |
2799 |
my $item = Koha::Items->find($itemnumber) or return; |
2797 |
my $item_object = Koha::Items->find( $itemnumber ); # Should replace $item |
2800 |
my $biblio = $item->biblio; |
2798 |
my $biblio = $item_object->biblio; |
2801 |
my $issue = $item->checkout; |
|
|
2802 |
my $item_unblessed = $item->unblessed; |
2799 |
|
2803 |
|
2800 |
my $dbh = C4::Context->dbh; |
2804 |
my $dbh = C4::Context->dbh; |
2801 |
|
2805 |
|
2802 |
# Find the issues record for this book |
|
|
2803 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
2804 |
|
2805 |
return unless $issue; |
2806 |
return unless $issue; |
2806 |
|
2807 |
|
2807 |
$borrowernumber ||= $issue->borrowernumber; |
2808 |
$borrowernumber ||= $issue->borrowernumber; |
Lines 2815-2821
sub AddRenewal {
Link Here
|
2815 |
my $patron_unblessed = $patron->unblessed; |
2816 |
my $patron_unblessed = $patron->unblessed; |
2816 |
|
2817 |
|
2817 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { |
2818 |
if ( C4::Context->preference('CalculateFinesOnReturn') && $issue->is_overdue ) { |
2818 |
_CalculateAndUpdateFine( { issue => $issue, item => $item, borrower => $patron_unblessed } ); |
2819 |
_CalculateAndUpdateFine( { issue => $issue, item => $item_unblessed, borrower => $patron_unblessed } ); |
2819 |
} |
2820 |
} |
2820 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber ); |
2821 |
_FixOverduesOnReturn( $borrowernumber, $itemnumber ); |
2821 |
|
2822 |
|
Lines 2824-2834
sub AddRenewal {
Link Here
|
2824 |
# based on the value of the RenewalPeriodBase syspref. |
2825 |
# based on the value of the RenewalPeriodBase syspref. |
2825 |
unless ($datedue) { |
2826 |
unless ($datedue) { |
2826 |
|
2827 |
|
2827 |
my $itemtype = $item_object->effective_itemtype; |
2828 |
my $itemtype = $item->effective_itemtype; |
2828 |
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2829 |
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2829 |
dt_from_string( $issue->date_due, 'sql' ) : |
2830 |
dt_from_string( $issue->date_due, 'sql' ) : |
2830 |
DateTime->now( time_zone => C4::Context->tz()); |
2831 |
DateTime->now( time_zone => C4::Context->tz()); |
2831 |
$datedue = CalcDateDue($datedue, $itemtype, _GetCircControlBranch($item, $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2832 |
$datedue = CalcDateDue($datedue, $itemtype, _GetCircControlBranch($item_unblessed, $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2832 |
} |
2833 |
} |
2833 |
|
2834 |
|
2834 |
# Update the issues record to have the new due date, and a new count |
2835 |
# Update the issues record to have the new due date, and a new count |
Lines 2842-2849
sub AddRenewal {
Link Here
|
2842 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber ); |
2843 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber ); |
2843 |
|
2844 |
|
2844 |
# Update the renewal count on the item, and tell zebra to reindex |
2845 |
# Update the renewal count on the item, and tell zebra to reindex |
2845 |
$renews = $item->{renewals} + 1; |
2846 |
$renews = $item->renewals + 1; |
2846 |
ModItem( { renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $item->{biblionumber}, $itemnumber, { log_action => 0 } ); |
2847 |
ModItem( { renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $item->biblionumber, $itemnumber, { log_action => 0 } ); |
2847 |
|
2848 |
|
2848 |
# Charge a new rental fee, if applicable? |
2849 |
# Charge a new rental fee, if applicable? |
2849 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2850 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
Lines 2858-2864
sub AddRenewal {
Link Here
|
2858 |
VALUES (now(),?,?,?,?,?,?,?,?)" |
2859 |
VALUES (now(),?,?,?,?,?,?,?,?)" |
2859 |
); |
2860 |
); |
2860 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
2861 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
2861 |
"Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}", |
2862 |
"Renewal of Rental Item " . $biblio->title . " " . $item->barcode, |
2862 |
'Rent', $charge, $itemnumber ); |
2863 |
'Rent', $charge, $itemnumber ); |
2863 |
} |
2864 |
} |
2864 |
|
2865 |
|
Lines 2868-2881
sub AddRenewal {
Link Here
|
2868 |
my %conditions = ( |
2869 |
my %conditions = ( |
2869 |
branchcode => $branch, |
2870 |
branchcode => $branch, |
2870 |
categorycode => $patron->categorycode, |
2871 |
categorycode => $patron->categorycode, |
2871 |
item_type => $item->{itype}, |
2872 |
item_type => $item->effective_itemtype, |
2872 |
notification => 'CHECKOUT', |
2873 |
notification => 'CHECKOUT', |
2873 |
); |
2874 |
); |
2874 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
2875 |
if ( $circulation_alert->is_enabled_for( \%conditions ) ) { |
2875 |
SendCirculationAlert( |
2876 |
SendCirculationAlert( |
2876 |
{ |
2877 |
{ |
2877 |
type => 'RENEWAL', |
2878 |
type => 'RENEWAL', |
2878 |
item => $item, |
2879 |
item => $item_unblessed, |
2879 |
borrower => $patron->unblessed, |
2880 |
borrower => $patron->unblessed, |
2880 |
branch => $branch, |
2881 |
branch => $branch, |
2881 |
} |
2882 |
} |
Lines 2903-2912
sub AddRenewal {
Link Here
|
2903 |
type => 'renew', |
2904 |
type => 'renew', |
2904 |
amount => $charge, |
2905 |
amount => $charge, |
2905 |
itemnumber => $itemnumber, |
2906 |
itemnumber => $itemnumber, |
2906 |
itemtype => $item->{itype}, |
2907 |
itemtype => $item->effective_itemtype, |
2907 |
location => $item->{location}, |
2908 |
location => $item->location, |
2908 |
borrowernumber => $borrowernumber, |
2909 |
borrowernumber => $borrowernumber, |
2909 |
ccode => $item->{'ccode'} |
2910 |
ccode => $item->ccode, |
2910 |
} |
2911 |
} |
2911 |
); |
2912 |
); |
2912 |
|
2913 |
|
Lines 2924-2930
sub GetRenewCount {
Link Here
|
2924 |
my $renewsleft = 0; |
2925 |
my $renewsleft = 0; |
2925 |
|
2926 |
|
2926 |
my $patron = Koha::Patrons->find( $bornum ); |
2927 |
my $patron = Koha::Patrons->find( $bornum ); |
2927 |
my $item = GetItem($itemno); |
2928 |
my $item = Koha::Items->find($itemno); |
2928 |
|
2929 |
|
2929 |
return (0, 0, 0) unless $patron or $item; # Wrong call, no renewal allowed |
2930 |
return (0, 0, 0) unless $patron or $item; # Wrong call, no renewal allowed |
2930 |
|
2931 |
|
Lines 2941-2951
sub GetRenewCount {
Link Here
|
2941 |
my $data = $sth->fetchrow_hashref; |
2942 |
my $data = $sth->fetchrow_hashref; |
2942 |
$renewcount = $data->{'renewals'} if $data->{'renewals'}; |
2943 |
$renewcount = $data->{'renewals'} if $data->{'renewals'}; |
2943 |
# $item and $borrower should be calculated |
2944 |
# $item and $borrower should be calculated |
2944 |
my $branchcode = _GetCircControlBranch($item, $patron->unblessed); |
2945 |
my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed); |
2945 |
|
2946 |
|
2946 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2947 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2947 |
{ categorycode => $patron->categorycode, |
2948 |
{ categorycode => $patron->categorycode, |
2948 |
itemtype => $item->{itype}, |
2949 |
itemtype => $item->effective_itemtype, |
2949 |
branchcode => $branchcode |
2950 |
branchcode => $branchcode |
2950 |
} |
2951 |
} |
2951 |
); |
2952 |
); |
Lines 2980-2996
sub GetSoonestRenewDate {
Link Here
|
2980 |
|
2981 |
|
2981 |
my $dbh = C4::Context->dbh; |
2982 |
my $dbh = C4::Context->dbh; |
2982 |
|
2983 |
|
2983 |
my $item = GetItem($itemnumber) or return; |
2984 |
my $item = Koha::Items->find($itemnumber) or return; |
2984 |
my $itemissue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
2985 |
my $itemissue = $item->checkout or return; |
2985 |
|
2986 |
|
2986 |
$borrowernumber ||= $itemissue->borrowernumber; |
2987 |
$borrowernumber ||= $itemissue->borrowernumber; |
2987 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
2988 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
2988 |
or return; |
2989 |
or return; |
2989 |
|
2990 |
|
2990 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
2991 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
2991 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2992 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2992 |
{ categorycode => $patron->categorycode, |
2993 |
{ categorycode => $patron->categorycode, |
2993 |
itemtype => $item->{itype}, |
2994 |
itemtype => $item->effective_itemtype, |
2994 |
branchcode => $branchcode |
2995 |
branchcode => $branchcode |
2995 |
} |
2996 |
} |
2996 |
); |
2997 |
); |
Lines 3039-3055
sub GetLatestAutoRenewDate {
Link Here
|
3039 |
|
3040 |
|
3040 |
my $dbh = C4::Context->dbh; |
3041 |
my $dbh = C4::Context->dbh; |
3041 |
|
3042 |
|
3042 |
my $item = GetItem($itemnumber) or return; |
3043 |
my $item = Koha::Items->find($itemnumber) or return; |
3043 |
my $itemissue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
3044 |
my $itemissue = $item->checkout or return; |
3044 |
|
3045 |
|
3045 |
$borrowernumber ||= $itemissue->borrowernumber; |
3046 |
$borrowernumber ||= $itemissue->borrowernumber; |
3046 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3047 |
my $patron = Koha::Patrons->find( $borrowernumber ) |
3047 |
or return; |
3048 |
or return; |
3048 |
|
3049 |
|
3049 |
my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); |
3050 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
3050 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3051 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
3051 |
{ categorycode => $patron->categorycode, |
3052 |
{ categorycode => $patron->categorycode, |
3052 |
itemtype => $item->{itype}, |
3053 |
itemtype => $item->effective_itemtype, |
3053 |
branchcode => $branchcode |
3054 |
branchcode => $branchcode |
3054 |
} |
3055 |
} |
3055 |
); |
3056 |
); |
Lines 3626-3633
sub ReturnLostItem{
Link Here
|
3626 |
|
3627 |
|
3627 |
MarkIssueReturned( $borrowernumber, $itemnum ); |
3628 |
MarkIssueReturned( $borrowernumber, $itemnum ); |
3628 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
3629 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
3629 |
my $item = C4::Items::GetItem( $itemnum ); |
3630 |
my $item = Koha::Items->find($itemnum); |
3630 |
my $old_note = ($item->{'paidfor'} && ($item->{'paidfor'} ne q{})) ? $item->{'paidfor'}.' / ' : q{}; |
3631 |
my $old_note = ($item->paidfor && ($item->paidfor ne q{})) ? $item->paidfor.' / ' : q{}; |
3631 |
my @datearr = localtime(time); |
3632 |
my @datearr = localtime(time); |
3632 |
my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; |
3633 |
my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3]; |
3633 |
my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; |
3634 |
my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber; |
Lines 3815-3822
sub ProcessOfflinePayment {
Link Here
|
3815 |
sub TransferSlip { |
3816 |
sub TransferSlip { |
3816 |
my ($branch, $itemnumber, $barcode, $to_branch) = @_; |
3817 |
my ($branch, $itemnumber, $barcode, $to_branch) = @_; |
3817 |
|
3818 |
|
3818 |
my $item = GetItem( $itemnumber, $barcode ) |
3819 |
my $item = |
3819 |
or return; |
3820 |
$itemnumber |
|
|
3821 |
? Koha::Items->find($itemnumber) |
3822 |
: Koha::Items->find( { barcode => $barcode } ); |
3823 |
|
3824 |
$item or return; |
3820 |
|
3825 |
|
3821 |
return C4::Letters::GetPreparedLetter ( |
3826 |
return C4::Letters::GetPreparedLetter ( |
3822 |
module => 'circulation', |
3827 |
module => 'circulation', |
Lines 3824-3831
sub TransferSlip {
Link Here
|
3824 |
branchcode => $branch, |
3829 |
branchcode => $branch, |
3825 |
tables => { |
3830 |
tables => { |
3826 |
'branches' => $to_branch, |
3831 |
'branches' => $to_branch, |
3827 |
'biblio' => $item->{biblionumber}, |
3832 |
'biblio' => $item->biblionumber, |
3828 |
'items' => $item, |
3833 |
'items' => $item->unblessed, |
3829 |
}, |
3834 |
}, |
3830 |
); |
3835 |
); |
3831 |
} |
3836 |
} |