From 351f323433b0f9d5b33798f7ad3a6f2297d76622 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Thu, 7 May 2015 11:20:50 -0400
Subject: [PATCH] Bug 14167 - [DO_NOT_PUSH] Renewal example patch for logging
Content-Type: text/plain; charset=utf-8

This patch adds logging to the renewal process to test the first patch.
Note to RM: Do not push this patch.

Test plan:
See the first patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the get call in light of the QA follow-up for category.
---
 C4/Circulation.pm |    8 +++++++-
 svc/renew         |    2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index f991680..452047e 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -50,6 +50,7 @@ use Koha::DateUtils;
 use Koha::Calendar;
 use Koha::Borrower::Debarments;
 use Koha::Database;
+use Koha::Logger;
 use Carp;
 use List::MoreUtils qw( uniq );
 use Date::Calc qw(
@@ -2787,6 +2788,9 @@ sub AddRenewal {
     my $datedue         = shift;
     my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd();
 
+    my $logger = Koha::Logger->get();
+    $logger->trace( "PARAMS: " . Dumper( { borrowernumber => $borrowernumber, itemnumber => $itemnumber, branch => $branch, datedue => $datedue, lastreneweddate => $lastreneweddate } ) );
+
     my $item   = GetItem($itemnumber) or return;
     my $biblio = GetBiblioFromItemNumber($itemnumber) or return;
 
@@ -2892,7 +2896,9 @@ sub AddRenewal {
                 borrowernumber => $borrowernumber,
                 ccode => $item->{'ccode'}}
                 );
-	return $datedue;
+
+    $logger->trace("RETURNING $datedue");
+    return $datedue;
 }
 
 sub GetRenewCount {
diff --git a/svc/renew b/svc/renew
index fa8475a..7c88f31 100755
--- a/svc/renew
+++ b/svc/renew
@@ -28,6 +28,8 @@ use C4::Auth qw(check_cookie_auth);
 
 use Koha::DateUtils qw(output_pref dt_from_string);
 
+C4::Context->interface('intranet');
+
 my $input = new CGI;
 
 my ( $auth_status, $sessionID ) =
-- 
1.7.10.4