From dbe330d5427dfc15bd597e718e4bb2739810c932 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 19 May 2010 06:36:44 +0200 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. Conflicts solved: C4/SIP/ILS/Item.pm Signed-off-by: Henri-Damien LAURENT --- 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 2a4f850653..62708a35d7 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -10,6 +10,7 @@ package ILS::Item; use strict; use warnings; +use DateTime; use Sys::Syslog qw(syslog); use ILS::Transaction; @@ -91,6 +92,14 @@ sub new { $item->{'id'} = $item->{'barcode'}; # 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 @reserves = (@{ GetReservesFromBiblionumber($item->{biblionumber}) }); -- 2.39.5