Lines 1860-1878
sub MoveReserve {
Link Here
|
1860 |
$cancelreserve //= 0; |
1860 |
$cancelreserve //= 0; |
1861 |
|
1861 |
|
1862 |
my $lookahead = C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
1862 |
my $lookahead = C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds |
1863 |
my ( $restype, $res, undef ) = CheckReserves( $itemnumber, undef, $lookahead ); |
|
|
1864 |
return unless $res; |
1865 |
|
1863 |
|
1866 |
my $biblionumber = $res->{biblionumber}; |
1864 |
my ( $restype, $res, undef ) = CheckReserves( $itemnumber, undef, $lookahead ); |
1867 |
|
1865 |
|
1868 |
if ($res->{borrowernumber} == $borrowernumber) { |
1866 |
if ($res && $res->{borrowernumber} == $borrowernumber) { |
1869 |
ModReserveFill($res); |
1867 |
ModReserveFill($res); |
1870 |
} |
1868 |
} |
1871 |
else { |
1869 |
else { |
1872 |
# warn "Reserved"; |
1870 |
my $item = Koha::Items->find($itemnumber); |
|
|
1871 |
my $biblionumber = $item->biblionumber; |
1872 |
|
1873 |
# The item is reserved by someone else. |
1873 |
# The item is reserved by someone else. |
1874 |
# Find this item in the reserves |
1874 |
# Find this item in the reserves |
1875 |
|
|
|
1876 |
my $borr_res = Koha::Holds->search({ |
1875 |
my $borr_res = Koha::Holds->search({ |
1877 |
borrowernumber => $borrowernumber, |
1876 |
borrowernumber => $borrowernumber, |
1878 |
biblionumber => $biblionumber, |
1877 |
biblionumber => $biblionumber, |
Lines 1888-1894
sub MoveReserve {
Link Here
|
1888 |
if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1 |
1887 |
if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1 |
1889 |
RevertWaitingStatus({ itemnumber => $itemnumber }); |
1888 |
RevertWaitingStatus({ itemnumber => $itemnumber }); |
1890 |
} |
1889 |
} |
1891 |
elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item |
1890 |
elsif ( $res && ( $cancelreserve eq 'cancel' || $cancelreserve ) ) { # cancel reserves on this item |
1892 |
my $hold = Koha::Holds->find( $res->{reserve_id} ); |
1891 |
my $hold = Koha::Holds->find( $res->{reserve_id} ); |
1893 |
$hold->cancel; |
1892 |
$hold->cancel; |
1894 |
} |
1893 |
} |
1895 |
- |
|
|