# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Carp qw(croak);
+use Carp qw( croak );
use Koha::Exceptions;
use Koha::CirculationRule;
=cut
our $RULE_KINDS = {
- refund => {
+ lostreturn => {
scope => [ 'branchcode' ],
},
renewalsallowed => {
scope => [ 'branchcode', 'categorycode', 'itemtype' ],
},
+ unseen_renewals_allowed => {
+ scope => [ 'branchcode', 'categorycode', 'itemtype' ],
+ },
rentaldiscount => {
scope => [ 'branchcode', 'categorycode', 'itemtype' ],
},
note => { # This is not really a rule. Maybe we will want to separate this later.
scope => [ 'branchcode', 'categorycode', 'itemtype' ],
},
+ decreaseloanholds => {
+ scope => [ 'branchcode', 'categorycode', 'itemtype' ],
+ },
# Not included (deprecated?):
# * accountsent
# * reservecharge
my $rule_name = $params->{rule_name};
my $rule_value = $params->{rule_value};
my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1;
- $rule_value = undef if $rule_value eq "" && !$can_be_blank;
+ $rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank;
for my $v ( $branchcode, $categorycode, $itemtype ) {
$v = undef if $v and $v eq '*';
=head3 get_lostreturn_policy
- my $refund = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );
+ my $lostrefund_policy = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );
+
+Return values are:
+
+=over 2
+
+=item '0' - Do not refund
+
+=item 'refund' - Refund the lost item charge
+
+=item 'restore' - Refund the lost item charge and restore the original overdue fine
+
+=item 'charge' - Refund the lost item charge and charge a new overdue fine
+
+=back
=cut
my $rule = Koha::CirculationRules->get_effective_rule(
{
branchcode => $branch,
- rule_name => 'refund',
+ rule_name => 'lostreturn',
}
);
- return $rule ? $rule->rule_value : 1;
+ return $rule ? $rule->rule_value : 'refund';
}
=head3 article_requestable_rules