From 87dfc680265ccc56f14f85d4dbd58c0fc468e06a Mon Sep 17 00:00:00 2001 From: mxbeaulieu Date: Fri, 5 Jun 2015 14:17:41 -0400 Subject: [PATCH] Bug 12769 - Follow up to comments 14 & 15 The scripts now check if the variable is defined. As for 0 and NULL in the letter's fee column: If the fee is NULL, we use the default value stored in the system preference. If the syspref is 0 or NULL the patron is not charged. If the fee is 0, we use that value and the fine is not created. --- misc/cronjobs/advance_notices.pl | 2 +- misc/cronjobs/overdue_notices.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index 950bad0..c3e9c7e 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -526,7 +526,7 @@ sub noticefine { $sendfee = C4::Context->preference('DefaultNoticeFee'); } - if ($sendfee > 0){ + if (defined($sendfee) && $sendfee > 0){ C4::Accounts::manualinvoice($borrowernumber, "", "", "F", $sendfee, C4::Context->preference('NoticeFeeNote')); } } diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 5dc437c..6946165 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -463,7 +463,7 @@ END_SQL my $rqoverduerules = $dbh->prepare($query); $rqoverduerules->execute($branchcode, @myborcat, @myborcatout); - + # We get default rules is there is no rule for this branch if($rqoverduerules->rows == 0){ $query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = '' "; @@ -600,7 +600,7 @@ END_SQL $sendfee = C4::Context->preference('DefaultNoticeFee'); } - if ($sendfee > 0){ + if (defined($sendfee) && $sendfee > 0){ C4::Accounts::manualinvoice($borrowernumber, "", "", "F", $sendfee, C4::Context->preference('NoticeFeeNote')); } -- 1.7.9.5