Lines 1151-1173
sub CanBookBeIssued {
Link Here
|
1151 |
} |
1151 |
} |
1152 |
} |
1152 |
} |
1153 |
|
1153 |
|
1154 |
my $now = dt_from_string(); |
1154 |
if ( C4::Context->preference("PreventCheckoutOnSameReservePeriod") ) { |
1155 |
my $preventCheckoutOnSameReservePeriod = |
1155 |
my $now = dt_from_string(); |
1156 |
C4::Context->preference("PreventCheckoutOnSameReservePeriod"); |
1156 |
my $reserves_on_same_period = |
1157 |
my $reserves_on_same_period = |
1157 |
ReservesOnSamePeriod($item_object->biblionumber, $item_object->itemnumber, $now->ymd, $duedate->ymd); |
1158 |
ReservesOnSamePeriod($item_object->biblionumber, $item_object->itemnumber, $now->ymd, $duedate->ymd); |
1158 |
if ($reserves_on_same_period) { |
1159 |
if ($preventCheckoutOnSameReservePeriod && $reserves_on_same_period) { |
1159 |
my $reserve = $reserves_on_same_period->[0]; |
1160 |
my $reserve = $reserves_on_same_period->[0]; |
1160 |
if ($reserve->{borrowernumber} ne $patron->borrowernumber) { |
1161 |
if ($reserve->{borrowernumber} ne $patron->borrowernumber) { |
1161 |
my $patron = Koha::Patrons->find( $reserve->{borrowernumber} ); |
1162 |
my $patron = Koha::Patrons->find( $reserve->{borrowernumber} ); |
1162 |
$needsconfirmation{RESERVED} = 1; |
1163 |
$needsconfirmation{RESERVED} = 1; |
1163 |
$needsconfirmation{resfirstname} = $patron->firstname; |
1164 |
$needsconfirmation{resfirstname} = $patron->firstname; |
1164 |
$needsconfirmation{ressurname} = $patron->surname; |
1165 |
$needsconfirmation{ressurname} = $patron->surname; |
1165 |
$needsconfirmation{rescardnumber} = $patron->cardnumber; |
1166 |
$needsconfirmation{rescardnumber} = $patron->cardnumber; |
1166 |
$needsconfirmation{resborrowernumber} = $patron->borrowernumber; |
1167 |
$needsconfirmation{resborrowernumber} = $patron->borrowernumber; |
1167 |
$needsconfirmation{resbranchcode} = $patron->branchcode; |
1168 |
$needsconfirmation{resbranchcode} = $patron->branchcode; |
1168 |
$needsconfirmation{resreservedate} = $reserve->{reservedate}; |
1169 |
$needsconfirmation{resreservedate} = $reserve->{reservedate}; |
1169 |
$needsconfirmation{reserve_id} = $reserve->{reserve_id}; |
1170 |
$needsconfirmation{reserve_id} = $reserve->{reserve_id}; |
1170 |
} |
1171 |
} |
1171 |
} |
1172 |
} |
1172 |
} |
1173 |
|
1173 |
|
Lines 2849-2871
sub CanBookBeRenewed {
Link Here
|
2849 |
} |
2849 |
} |
2850 |
} |
2850 |
} |
2851 |
|
2851 |
|
2852 |
unless ($date_due) { |
2852 |
if ( C4::Context->preference("PreventCheckoutOnSameReservePeriod") ) { |
2853 |
my $itemtype = $item->effective_itemtype; |
2853 |
unless ($date_due) { |
2854 |
my $patron_unblessed = $patron->unblessed; |
2854 |
my $itemtype = $item->effective_itemtype; |
2855 |
$date_due = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2855 |
my $patron_unblessed = $patron->unblessed; |
2856 |
dt_from_string( $issue->date_due, 'sql' ) : |
2856 |
$date_due = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ? |
2857 |
dt_from_string(); |
2857 |
dt_from_string( $issue->date_due, 'sql' ) : |
2858 |
$date_due = CalcDateDue($date_due, $itemtype, _GetCircControlBranch($item->unblessed(), $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2858 |
dt_from_string(); |
2859 |
} |
2859 |
$date_due = CalcDateDue($date_due, $itemtype, _GetCircControlBranch($item->unblessed(), $patron_unblessed), $patron_unblessed, 'is a renewal'); |
2860 |
|
2860 |
} |
2861 |
my $now = dt_from_string(); |
2861 |
my $now = dt_from_string(); |
2862 |
my $biblionumber = $item->biblionumber; |
2862 |
my $biblionumber = $item->biblionumber; |
2863 |
my $preventCheckoutOnSameReservePeriod = |
2863 |
my $reserves_on_same_period = |
2864 |
C4::Context->preference("PreventCheckoutOnSameReservePeriod"); |
2864 |
ReservesOnSamePeriod($biblionumber, $itemnumber, $now->ymd, $date_due->ymd); |
2865 |
my $reserves_on_same_period = |
2865 |
if ($reserves_on_same_period) { |
2866 |
ReservesOnSamePeriod($biblionumber, $itemnumber, $now->ymd, $date_due->ymd); |
2866 |
$resfound = 1; |
2867 |
if ($preventCheckoutOnSameReservePeriod && $reserves_on_same_period) { |
2867 |
} |
2868 |
$resfound = 1; |
|
|
2869 |
} |
2868 |
} |
2870 |
|
2869 |
|
2871 |
if( $cron ) { #The cron wants to return 'too_soon' over 'on_reserve' |
2870 |
if( $cron ) { #The cron wants to return 'too_soon' over 'on_reserve' |