Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / CirculationRules.pm
index c44ac85..f96df49 100644 (file)
@@ -51,7 +51,9 @@ our $RULE_KINDS = {
     lostreturn => {
         scope => [ 'branchcode' ],
     },
-
+    processingreturn => {
+        scope => [ 'branchcode' ],
+    },
     patron_maxissueqty => {
         scope => [ 'branchcode', 'categorycode' ],
     },
@@ -575,9 +577,9 @@ sub get_onshelfholds_policy {
 
 =head3 get_lostreturn_policy
 
-  my $lostrefund_policy = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );
+  my $lost_proc_refund_policy = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );
 
-Return values are:
+lostreturn return values are:
 
 =over 2
 
@@ -591,6 +593,21 @@ Return values are:
 
 =back
 
+processing return return values are:
+
+=over 2
+
+=item '0' - Do not refund
+
+=item 'refund' - Refund the lost item processing charge
+
+=item 'restore' - Refund the lost item processing charge and restore the original overdue fine
+
+=item 'charge' - Refund the lost item processing charge and charge a new overdue fine
+
+=back
+
+
 =cut
 
 sub get_lostreturn_policy {
@@ -607,14 +624,16 @@ sub get_lostreturn_policy {
 
     my $branch = $behaviour_mapping->{ $behaviour };
 
-    my $rule = Koha::CirculationRules->get_effective_rule(
+    my $rules = Koha::CirculationRules->get_effective_rules(
         {
             branchcode => $branch,
-            rule_name  => 'lostreturn',
+            rules  => ['lostreturn','processingreturn']
         }
     );
 
-    return $rule ? $rule->rule_value : 'refund';
+    $rules->{lostreturn} //= 'refund';
+    $rules->{processingreturn} //= 'refund';
+    return $rules;
 }
 
 =head3 article_requestable_rules