From 2046ece9853419dec1ab0cb4c030ef4adafdf475 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Sun, 7 Oct 2018 14:57:46 +0300 Subject: [PATCH] Bug 21512 - CalculateFinesOnReturn doesn't work without the syspref finesMode Fines are not created for checking in an Item, if the syspref 'CalculateFinesOnReturn' is enabled without the syspref finesMode being in the 'production' -mode (Calculate and charge). CalculateFinesOnReturn must work without the fines.pl -feature. The problem is with the subroutine C4::Circulation::_CalculateAndUpdateFine() Initially it looks like it must be invoked from the fines.pl as well. But that subroutine is only used within the C4::Circulation module for AddRenew and AddReturn. Hence the _CalculateAndUpdateFine() has nothing to do with fines.pl|finesMode. This patch replaces the finesMode-check with CalculateFinesOnReturn-check. I am not sure why there needs to be a specific syspref for the fines.pl, or why CalculateFinesOnReturn is needed, as the fine amounts can be tweaked using the circulation rules matrix and the fines.pl-cronjob can either be ran, or not, with an endless possibility of parameters that shouldn't be in the sysprefs. --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 9c8d5ba13e..25a0847cdb 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -4072,7 +4072,7 @@ sub _CalculateAndUpdateFine { $type ||= q{}; - if ( C4::Context->preference('finesMode') eq 'production' ) { + if ( C4::Context->preference('CalculateFinesOnReturn') ) { if ( $amount > 0 ) { C4::Overdues::UpdateFine({ issue_id => $issue->issue_id, -- 2.17.1