From: Frédéric Demians Date: Fri, 27 Nov 2009 21:50:16 +0000 (+0100) Subject: Bug 3815: SIP2 Invalid Item Information Response 18 X-Git-Tag: v3.02.00-alpha~39^2 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=b7134846827108855c27457bb3a13047eb4cc6a5;p=koha.git 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. --- 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});