From 7c646bbaa6bd8fcb649c7059ce4373019b56d149 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 20 Aug 2008 19:21:08 -0500 Subject: [PATCH] bug 2503: fix call to AddIssue() The due date parameter must be a C4::Dates object, not a date string. Signed-off-by: Galen Charlton --- offline_circ/process_koc.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index 7e92937110..b281aaa6e5 100755 --- a/offline_circ/process_koc.pl +++ b/offline_circ/process_koc.pl @@ -210,7 +210,8 @@ warn "Date of this issue: $circ->{'date'}"; my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} ); if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue. - C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due ) unless ( DEBUG ); + my $date_due_object = C4::Dates->new($date_due ,'iso'); + C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG ); push( @output, { message => "Issued $item->{ 'title' } ( $item->{ 'barcode' } ) to $borrower->{ 'firstname' } $borrower->{ 'surename' } ( $borrower->{'cardnumber'} ) : $circ->{ 'datetime' }\n" } ); } else { ## Current issue is *newer* than this issue, write a 'returned' issue, as the item is most likely in the hands of someone else now. @@ -221,7 +222,8 @@ warn "Current issue to another member is newer. Doing nothing"; } } else { ## Item is not checked out to anyone at the moment, go ahead and issue it - C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due ) unless ( DEBUG ); + my $date_due_object = C4::Dates->new($date_due ,'iso'); + C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG ); push( @output, { message => "Issued $item->{ 'title' } ( $item->{ 'barcode' } ) to $borrower->{ 'firstname' } $borrower->{ 'surename' } ( $borrower->{'cardnumber'} ) : $circ->{ 'datetime' }\n" } ); } } -- 2.39.2