Lines 2458-2464
C<$borrower> is a hashref to borrower. Only {branchcode} is used.
Link Here
|
2458 |
=cut |
2458 |
=cut |
2459 |
|
2459 |
|
2460 |
sub _GetCircControlBranch { |
2460 |
sub _GetCircControlBranch { |
2461 |
my ($item, $borrower) = @_; |
2461 |
my ($item, $borrower) = @_; # Only branchcode is used for $borrower |
2462 |
my $circcontrol = C4::Context->preference('CircControl'); |
2462 |
my $circcontrol = C4::Context->preference('CircControl'); |
2463 |
my $branch; |
2463 |
my $branch; |
2464 |
|
2464 |
|
Lines 2967-2973
sub GetRenewCount {
Link Here
|
2967 |
|
2967 |
|
2968 |
=head2 GetSoonestRenewDate |
2968 |
=head2 GetSoonestRenewDate |
2969 |
|
2969 |
|
2970 |
$NoRenewalBeforeThisDate = &GetSoonestRenewDate( { patron => $patron, item => $item } ); |
2970 |
$NoRenewalBeforeThisDate = &GetSoonestRenewDate( { patron => $patron, checkout => $checkout, item => $item } ); |
2971 |
|
2971 |
|
2972 |
Find out the soonest possible renew date of a borrowed item. |
2972 |
Find out the soonest possible renew date of a borrowed item. |
2973 |
|
2973 |
|
Lines 2975-2981
C<$patron> is the patron who currently has the item on loan.
Link Here
|
2975 |
|
2975 |
|
2976 |
C<$item> is the item to renew. |
2976 |
C<$item> is the item to renew. |
2977 |
|
2977 |
|
2978 |
C<$issue> is the issue to renew. |
2978 |
C<$checkout> is the checkout to renew. |
2979 |
|
2979 |
|
2980 |
C<$GetSoonestRenewDate> returns the DateTime of the soonest possible |
2980 |
C<$GetSoonestRenewDate> returns the DateTime of the soonest possible |
2981 |
renew date, based on the value "No renewal before" of the applicable |
2981 |
renew date, based on the value "No renewal before" of the applicable |
Lines 2988-2998
cannot be found.
Link Here
|
2988 |
sub GetSoonestRenewDate { |
2988 |
sub GetSoonestRenewDate { |
2989 |
my ( $params ) = @_; |
2989 |
my ( $params ) = @_; |
2990 |
|
2990 |
|
2991 |
my $patron = $params->{patron} or return; |
2991 |
my $patron = $params->{patron} or return; |
2992 |
my $item = $params->{item} or return; |
2992 |
my $item = $params->{item} or return; |
2993 |
my $issue = $params->{issue} or return; |
2993 |
my $checkout = $params->{checkout} or return; |
2994 |
|
2994 |
|
2995 |
my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); |
2995 |
my $branchcode = _GetCircControlBranch( $item->unblessed, { branchcode => $patron->branchcode } ); |
2996 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2996 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( |
2997 |
{ categorycode => $patron->categorycode, |
2997 |
{ categorycode => $patron->categorycode, |
2998 |
itemtype => $item->effective_itemtype, |
2998 |
itemtype => $item->effective_itemtype, |
Lines 3007-3013
sub GetSoonestRenewDate {
Link Here
|
3007 |
and $issuing_rule->norenewalbefore ne "" ) |
3007 |
and $issuing_rule->norenewalbefore ne "" ) |
3008 |
{ |
3008 |
{ |
3009 |
my $soonestrenewal = |
3009 |
my $soonestrenewal = |
3010 |
dt_from_string( $itemissue->date_due )->subtract( |
3010 |
dt_from_string( $checkout->date_due )->subtract( |
3011 |
$issuing_rule->lengthunit => $issuing_rule->norenewalbefore ); |
3011 |
$issuing_rule->lengthunit => $issuing_rule->norenewalbefore ); |
3012 |
|
3012 |
|
3013 |
if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date' |
3013 |
if ( C4::Context->preference('NoRenewalBeforePrecision') eq 'date' |