@@ -, +, @@ Koha::RefundLostItemFeeRules->find --- Koha/RefundLostItemFeeRules.pm | 14 ++++++++++++++ admin/smart-rules.pl | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) --- a/Koha/RefundLostItemFeeRules.pm +++ a/Koha/RefundLostItemFeeRules.pm @@ -136,6 +136,20 @@ sub _choose_branch { return $branch; } +=head3 Koha::RefundLostItemFeeRules->find(); + +Inherit from Koha::Objects->find(), but forces rule_name => 'refund' + +=cut + +sub find { + my ( $self, @pars ) = @_; + + $pars[0]->{rule_name} = 'refund'; + + return $self->SUPER::find(@pars); +} + =head3 _default_rule (internal) This function returns the default rule defined for refunding lost --- a/admin/smart-rules.pl +++ a/admin/smart-rules.pl @@ -539,7 +539,8 @@ elsif ( $op eq 'mod-refund-lost-item-fee-rule' ) { } } -my $refundLostItemFeeRule = Koha::RefundLostItemFeeRules->find({ branchcode => $branch }); +my $refundLostItemFeeRule = Koha::RefundLostItemFeeRules->find({ branchcode => ($branch eq '*') ? undef:$branch }); + $template->param( refundLostItemFeeRule => $refundLostItemFeeRule, defaultRefundRule => Koha::RefundLostItemFeeRules->_default_rule --