From b7134846827108855c27457bb3a13047eb4cc6a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 27 Nov 2009 22:50:16 +0100 Subject: [PATCH] Bug 3815: SIP2 Invalid Item Information Response 18 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 file changed, 9 insertions(+) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 6f005b4a8c..fa88699ae1 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(borrowernumber=>$issue->{'borrowernumber'}); $item->{patron} = $borrower->{'cardnumber'}; my ($whatever, $arrayref) = GetReservesFromBiblionumber($item->{biblionumber}); -- 2.39.5