Lines 426-431
sub get_onshelfholds_policy {
Link Here
|
426 |
return $rule ? $rule->rule_value : 0; |
426 |
return $rule ? $rule->rule_value : 0; |
427 |
} |
427 |
} |
428 |
|
428 |
|
|
|
429 |
=head3 get_lostreturn_policy |
430 |
|
431 |
my $refund = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } ); |
432 |
|
433 |
=cut |
434 |
|
435 |
sub get_lostreturn_policy { |
436 |
my ( $class, $params ) = @_; |
437 |
|
438 |
my $item = $params->{item}; |
439 |
|
440 |
my $behaviour = C4::Context->preference( 'RefundLostOnReturnControl' ) // 'CheckinLibrary'; |
441 |
my $behaviour_mapping = { |
442 |
CheckinLibrary => $params->{'return_branch'}, |
443 |
ItemHomeBranch => $item->homebranch, |
444 |
ItemHoldingBranch => $item->holdingbranch |
445 |
}; |
446 |
|
447 |
my $branch = $behaviour_mapping->{ $behaviour }; |
448 |
|
449 |
my $rule = Koha::CirculationRules->get_effective_rule( |
450 |
{ |
451 |
branchcode => $branch, |
452 |
rule_name => 'refund', |
453 |
} |
454 |
); |
455 |
|
456 |
return $rule ? $rule->rule_value : 1; |
457 |
} |
458 |
|
429 |
=head3 article_requestable_rules |
459 |
=head3 article_requestable_rules |
430 |
|
460 |
|
431 |
Return rules that allow article requests, optionally filtered by |
461 |
Return rules that allow article requests, optionally filtered by |
432 |
- |
|
|