[Koha-patches] [PATCH] Bug 3815: SIP2 Invalid Item Information Response 18

Frédéric Demians f.demians at tamil.fr
Fri Nov 27 22:50:16 CET 2009


With this patch Koha SIP2 server send back a valid Item Information
Response for issued items: ie with due date in the response.
---
 C4/SIP/ILS/Item.pm |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm
index 2e02c63..f2c0636 100644
--- a/C4/SIP/ILS/Item.pm
+++ b/C4/SIP/ILS/Item.pm
@@ -9,6 +9,7 @@ package ILS::Item;
 use strict;
 use warnings;
 
+use DateTime;
 use Sys::Syslog qw(syslog);
 use Carp;
 
@@ -97,6 +98,14 @@ sub new {
 
 	# check if its on issue and if so get the borrower
 	my $issue = GetItemIssue($item->{'itemnumber'});
+    if ( $issue ) {
+        my $date = $issue->{ date_due };
+        my $dt = DateTime->new(
+            year  => substr($date, 0, 4),
+            month => substr($date,5,2),
+            day  => substr($date, 8, 2) );
+        $item->{ due_date } = $dt->epoch();
+    }
 	my $borrower = GetMember($issue->{'borrowernumber'},'borrowernumber');
 	$item->{patron} = $borrower->{'cardnumber'};
     my ($whatever, $arrayref) = GetReservesFromBiblionumber($item->{biblionumber});
-- 
1.6.4.3




More information about the Koha-patches mailing list