|
Lines 724-733
sub GetLastPickupDate {
Link Here
|
| 724 |
} elsif ( $controlbranch eq "PatronLibrary" ) { |
724 |
} elsif ( $controlbranch eq "PatronLibrary" ) { |
| 725 |
$branchcode = $borrower->branchcode; |
725 |
$branchcode = $borrower->branchcode; |
| 726 |
} |
726 |
} |
| 727 |
warn 'getlastpickup'; |
|
|
| 728 |
warn $branchcode; |
| 729 |
warn $borrower->{'categorycode'}; |
| 730 |
warn $item->{itype}; |
| 731 |
my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule({ |
727 |
my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule({ |
| 732 |
branchcode => $branchcode, |
728 |
branchcode => $branchcode, |
| 733 |
categorycode => $borrower->{'categorycode'}, |
729 |
categorycode => $borrower->{'categorycode'}, |
|
Lines 920-926
sub CheckReserves {
Link Here
|
| 920 |
|
916 |
|
| 921 |
CancelExpiredReserves(); |
917 |
CancelExpiredReserves(); |
| 922 |
|
918 |
|
| 923 |
Cancels all reserves with an expiration date from before today. |
919 |
Cancels all reserves with a lastpickupdate value from before today. |
| 924 |
|
920 |
|
| 925 |
=cut |
921 |
=cut |
| 926 |
|
922 |
|
|
Lines 928-941
sub CancelExpiredReserves {
Link Here
|
| 928 |
my $today = dt_from_string(); |
924 |
my $today = dt_from_string(); |
| 929 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
925 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
| 930 |
my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); |
926 |
my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); |
| 931 |
|
|
|
| 932 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
927 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
| 933 |
my $params = { expirationdate => { '<', $dtf->format_date($today) } }; |
928 |
my $params = { lastpickupdate => { '<', $dtf->format_date($today) } }; |
| 934 |
$params->{found} = [ { '!=', 'W' }, undef ] unless $expireWaiting; |
929 |
$params->{found} = [ { '!=', 'W' }, undef ] unless $expireWaiting; |
| 935 |
|
930 |
|
| 936 |
# FIXME To move to Koha::Holds->search_expired (?) |
931 |
# FIXME To move to Koha::Holds->search_expired (?) |
| 937 |
my $holds = Koha::Holds->search( $params ); |
932 |
my $holds = Koha::Holds->search( $params ); |
| 938 |
|
|
|
| 939 |
while ( my $hold = $holds->next ) { |
933 |
while ( my $hold = $holds->next ) { |
| 940 |
my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); |
934 |
my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); |
| 941 |
|
935 |
|