|
Lines 299-304
The item was reserved. The value is a reference-to-hash whose keys are fields fr
Link Here
|
| 299 |
|
299 |
|
| 300 |
The item was eligible to be transferred. Barring problems communicating with the database, the transfer should indeed have succeeded. The value should be ignored. |
300 |
The item was eligible to be transferred. Barring problems communicating with the database, the transfer should indeed have succeeded. The value should be ignored. |
| 301 |
|
301 |
|
|
|
302 |
=item C<RecallPlacedAtHoldingBranch> |
| 303 |
|
| 304 |
A recall for this item was found, and the transfer has already been completed as the item's branch matches the recall's pickup branch. |
| 305 |
|
| 306 |
=item C<RecallFound> |
| 307 |
|
| 308 |
A recall for this item was found, and the item needs to be transferred to the recall's pickup branch. |
| 309 |
|
| 302 |
=back |
310 |
=back |
| 303 |
|
311 |
|
| 304 |
=back |
312 |
=back |
|
Lines 360-365
sub transferbook {
Link Here
|
| 360 |
$dotransfer = 1; |
368 |
$dotransfer = 1; |
| 361 |
} |
369 |
} |
| 362 |
|
370 |
|
|
|
371 |
# find recall |
| 372 |
my $recall = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'T' }); |
| 373 |
if ( defined $recall ) { |
| 374 |
# do a transfer if the recall branch is different to the item holding branch |
| 375 |
if ( $recall->branchcode eq $fbr ) { |
| 376 |
$dotransfer = 0; |
| 377 |
$messages->{'RecallPlacedAtHoldingBranch'} = 1; |
| 378 |
} else { |
| 379 |
$dotransfer = 1; |
| 380 |
$messages->{'RecallFound'} = $recall; |
| 381 |
} |
| 382 |
} |
| 383 |
|
| 363 |
#actually do the transfer.... |
384 |
#actually do the transfer.... |
| 364 |
if ($dotransfer) { |
385 |
if ($dotransfer) { |
| 365 |
ModItemTransfer( $itemnumber, $fbr, $tbr, $trigger ); |
386 |
ModItemTransfer( $itemnumber, $fbr, $tbr, $trigger ); |
|
Lines 669-674
sticky due date is invalid or due date in the past
Link Here
|
| 669 |
|
690 |
|
| 670 |
if the borrower borrows to much things |
691 |
if the borrower borrows to much things |
| 671 |
|
692 |
|
|
|
693 |
=head3 RECALLED |
| 694 |
|
| 695 |
recalled by someone else |
| 696 |
|
| 672 |
=cut |
697 |
=cut |
| 673 |
|
698 |
|
| 674 |
sub CanBookBeIssued { |
699 |
sub CanBookBeIssued { |
|
Lines 1020-1026
sub CanBookBeIssued {
Link Here
|
| 1020 |
} |
1045 |
} |
| 1021 |
} |
1046 |
} |
| 1022 |
|
1047 |
|
| 1023 |
unless ( $ignore_reserves ) { |
1048 |
my $recall; |
|
|
1049 |
# CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON |
| 1050 |
# Only bother doing this if UseRecalls is enabled and the item is recallable |
| 1051 |
# Don't look at recalls that are in transit |
| 1052 |
if ( C4::Context->preference('UseRecalls') and $item_object->can_be_recalled({ patron => $patron }) ) { |
| 1053 |
my @recalls = $item_object->biblio->recalls; |
| 1054 |
|
| 1055 |
foreach my $r ( @recalls ) { |
| 1056 |
if ( $r->item_level_recall and |
| 1057 |
$r->itemnumber == $item_object->itemnumber and |
| 1058 |
$r->borrowernumber != $patron->borrowernumber and |
| 1059 |
!$r->in_transit ) { |
| 1060 |
# this specific item has been recalled by a different patron |
| 1061 |
$needsconfirmation{RECALLED} = $r; |
| 1062 |
$recall = $r; |
| 1063 |
last; |
| 1064 |
} |
| 1065 |
elsif ( !$r->item_level_recall and |
| 1066 |
$r->borrowernumber != $patron->borrowernumber and |
| 1067 |
!$r->in_transit ) { |
| 1068 |
# a different patron has placed a biblio-level recall and this item is eligible to fill it |
| 1069 |
$needsconfirmation{RECALLED} = $r; |
| 1070 |
$recall = $r; |
| 1071 |
last; |
| 1072 |
} |
| 1073 |
} |
| 1074 |
} |
| 1075 |
|
| 1076 |
unless ( $ignore_reserves and defined $recall ) { |
| 1024 |
# See if the item is on reserve. |
1077 |
# See if the item is on reserve. |
| 1025 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item_object->itemnumber ); |
1078 |
my ( $restype, $res ) = C4::Reserves::CheckReserves( $item_object->itemnumber ); |
| 1026 |
if ($restype) { |
1079 |
if ($restype) { |
|
Lines 1290-1295
AddIssue does the following things :
Link Here
|
| 1290 |
* RESERVE PLACED ? |
1343 |
* RESERVE PLACED ? |
| 1291 |
- fill reserve if reserve to this patron |
1344 |
- fill reserve if reserve to this patron |
| 1292 |
- cancel reserve or not, otherwise |
1345 |
- cancel reserve or not, otherwise |
|
|
1346 |
* RECALL PLACED ? |
| 1347 |
- fill recall if recall to this patron |
| 1348 |
- cancel recall or not |
| 1349 |
- revert recall's waiting status or not |
| 1293 |
* TRANSFERT PENDING ? |
1350 |
* TRANSFERT PENDING ? |
| 1294 |
- complete the transfert |
1351 |
- complete the transfert |
| 1295 |
* ISSUE THE BOOK |
1352 |
* ISSUE THE BOOK |
|
Lines 1304-1309
sub AddIssue {
Link Here
|
| 1304 |
my $onsite_checkout = $params && $params->{onsite_checkout} ? 1 : 0; |
1361 |
my $onsite_checkout = $params && $params->{onsite_checkout} ? 1 : 0; |
| 1305 |
my $switch_onsite_checkout = $params && $params->{switch_onsite_checkout}; |
1362 |
my $switch_onsite_checkout = $params && $params->{switch_onsite_checkout}; |
| 1306 |
my $auto_renew = $params && $params->{auto_renew}; |
1363 |
my $auto_renew = $params && $params->{auto_renew}; |
|
|
1364 |
my $cancel_recall = $params && $params->{cancel_recall}; |
| 1365 |
my $recall_id = $params && $params->{recall_id}; |
| 1307 |
my $dbh = C4::Context->dbh; |
1366 |
my $dbh = C4::Context->dbh; |
| 1308 |
my $barcodecheck = CheckValidBarcode($barcode); |
1367 |
my $barcodecheck = CheckValidBarcode($barcode); |
| 1309 |
|
1368 |
|
|
Lines 1375-1380
sub AddIssue {
Link Here
|
| 1375 |
AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); |
1434 |
AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); |
| 1376 |
} |
1435 |
} |
| 1377 |
|
1436 |
|
|
|
1437 |
Koha::Recalls->move_recall({ action => $cancel_recall, recall_id => $recall_id, itemnumber => $item_object->itemnumber, borrowernumber => $borrower->{borrowernumber} }); |
| 1438 |
|
| 1378 |
C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); |
1439 |
C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); |
| 1379 |
|
1440 |
|
| 1380 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
1441 |
# Starting process for transfer job (checking transfert and validate it if we have one) |
|
Lines 1836-1841
Value 1 if return is successful.
Link Here
|
| 1836 |
|
1897 |
|
| 1837 |
If AutomaticItemReturn is disabled, return branch is given as value of NeedsTransfer. |
1898 |
If AutomaticItemReturn is disabled, return branch is given as value of NeedsTransfer. |
| 1838 |
|
1899 |
|
|
|
1900 |
=item C<RecallFound> |
| 1901 |
|
| 1902 |
This item can fill a recall. The recall object is returned. If the recall pickup branch differs from |
| 1903 |
the branch this item is being returned at, C<RecallNeedsTransfer> is also returned which contains this |
| 1904 |
branchcode. |
| 1905 |
|
| 1906 |
=item C<TransferredRecall> |
| 1907 |
|
| 1908 |
This item has been transferred to this branch to fill a recall. The recall object is returned. |
| 1909 |
|
| 1839 |
=back |
1910 |
=back |
| 1840 |
|
1911 |
|
| 1841 |
C<$iteminformation> is a reference-to-hash, giving information about the |
1912 |
C<$iteminformation> is a reference-to-hash, giving information about the |
|
Lines 2076-2081
sub AddReturn {
Link Here
|
| 2076 |
} |
2147 |
} |
| 2077 |
} |
2148 |
} |
| 2078 |
|
2149 |
|
|
|
2150 |
# find recalls... |
| 2151 |
# check if this item is recallable first, which includes checking if UseRecalls syspref is enabled |
| 2152 |
my $recall = $item->check_recalls if $item->can_be_waiting_recall; |
| 2153 |
if ( defined $recall ) { |
| 2154 |
$messages->{RecallFound} = $recall; |
| 2155 |
if ( $recall->branchcode ne $branch ) { |
| 2156 |
$messages->{RecallNeedsTransfer} = $branch; |
| 2157 |
} |
| 2158 |
} |
| 2159 |
|
| 2079 |
# find reserves..... |
2160 |
# find reserves..... |
| 2080 |
# launch the Checkreserves routine to find any holds |
2161 |
# launch the Checkreserves routine to find any holds |
| 2081 |
my ($resfound, $resrec); |
2162 |
my ($resfound, $resrec); |
|
Lines 2143-2150
sub AddReturn {
Link Here
|
| 2143 |
$request->status('RET') if $request; |
2224 |
$request->status('RET') if $request; |
| 2144 |
} |
2225 |
} |
| 2145 |
|
2226 |
|
|
|
2227 |
my $transfer_recall = Koha::Recalls->find({ itemnumber => $item->itemnumber, status => 'T' }); # all recalls that have triggered a transfer will have an allocated itemnumber |
| 2228 |
if ( $transfer_recall && $transfer_recall->branchcode eq $branch ) { |
| 2229 |
$messages->{TransferredRecall} = $transfer_recall; |
| 2230 |
} |
| 2231 |
|
| 2146 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
2232 |
# Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer |
| 2147 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ |
2233 |
if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'} and not $messages->{TransferredRecall} and $recall->branchcode ne $branch){ |
| 2148 |
my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode'; |
2234 |
my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode'; |
| 2149 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
2235 |
if (C4::Context->preference("AutomaticItemReturn" ) or |
| 2150 |
(C4::Context->preference("UseBranchTransferLimits") and |
2236 |
(C4::Context->preference("UseBranchTransferLimits") and |
|
Lines 2835-2840
sub CanBookBeRenewed {
Link Here
|
| 2835 |
} |
2921 |
} |
| 2836 |
} |
2922 |
} |
| 2837 |
|
2923 |
|
|
|
2924 |
my $recall = $item->check_recalls if $item->can_be_waiting_recall; |
| 2925 |
if ( defined $recall ) { |
| 2926 |
if ( $recall->item_level_recall ) { |
| 2927 |
# item-level recall. check if this item is the recalled item, otherwise renewal will be allowed |
| 2928 |
return ( 0, 'recalled' ) if ( $recall->itemnumber == $item->itemnumber ); |
| 2929 |
} else { |
| 2930 |
# biblio-level recall, so only disallow renewal if the biblio-level recall has been fulfilled by a different item |
| 2931 |
return ( 0, 'recalled' ) unless ( $recall->waiting ); |
| 2932 |
} |
| 2933 |
} |
| 2934 |
|
| 2838 |
my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); |
2935 |
my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); |
| 2839 |
|
2936 |
|
| 2840 |
# This item can fill one or more unfilled reserve, can those unfilled reserves |
2937 |
# This item can fill one or more unfilled reserve, can those unfilled reserves |