[PATCH] [bug #2770] fix the previous patch to add a syspref that permit to choose the renewal period(day or date_due).

Nahuel Angelinetti nahuel.angelinetti at biblibre.com
Wed Nov 12 10:16:22 CET 2008


This patch just check the syspref and use it as base date of renew.
---
 C4/Circulation.pm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 7a68d94..d83f688 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -1941,8 +1941,11 @@ sub AddRenewal {
 			$item->{homebranch}			# item's homebranch determines loanlength OR do we want the branch specified by the AddRenewal argument?
         );
 
+        $datedue = (C4::Context->preference('renewal_period') eq 'date_due') ?
+                                        C4::Dates->new($issuedata->{date_due}, 'iso') :
+                                        C4::Dates->new();
         #FIXME -- use circControl?
-        $datedue =  CalcDateDue(C4::Dates->new($issuedata->{date_due}, 'iso'),$loanlength,$branch);	# this branch is the transactional branch.
+        $datedue =  CalcDateDue($datedue,$loanlength,$branch);	# this branch is the transactional branch.
         # The question of whether to use item's homebranch calendar is open.
     }
 
-- 
1.5.6.3


--MP_/jD=qS.z.A4kFmQkUd9Bvi=W--


More information about the Koha-patches mailing list