updated due-dates format to conform with vendors - still need to decide if the hour...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 9 Oct 2006 16:32:56 +0000 (16:32 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 9 Oct 2006 16:32:56 +0000 (16:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6419 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/SIP.pm
Open-ILS/src/perlmods/OpenILS/SIP/Item.pm
Open-ILS/src/perlmods/OpenILS/SIP/Transaction/Checkout.pm

index 9b88a80..4dd40be 100644 (file)
@@ -107,6 +107,8 @@ sub make_editor {
 sub format_date {
        my $class = shift;
        my $date = shift;
+       my $type = shift || 'dob';
+
        return "" unless $date;
 
        $date = DateTime::Format::ISO8601->new->
@@ -120,7 +122,10 @@ sub format_date {
        $mon =~ s/^(\d)$/0$1/;
        $day =~ s/^(\d)$/0$1/;
        $date = "$year$mon$day";
-       syslog('LOG_DEBUG', "OILS: formatted date: $date");
+
+       $date = $year.'-'.$mon.'-'.$day .' 0:00:00' if $type eq 'due';
+
+       syslog('LOG_DEBUG', "OILS: formatted date [type=$type]: $date");
        return $date;
 }
 
index 2c26cee..a077786 100644 (file)
@@ -243,7 +243,7 @@ sub due_date {
                return 0;
        }
 
-       my $due = OpenILS::SIP->format_date($circ->due_date);
+       my $due = OpenILS::SIP->format_date($circ->due_date, 'due');
        syslog('LOG_DEBUG', "OILS: Found item due date = $due");
        return $due;
 }
index 5140fd7..d2ada4e 100644 (file)
@@ -126,7 +126,7 @@ sub do_checkout {
                syslog('LOG_INFO', "OILS: Checkout succeeded");
 
                my $circ = $resp->{payload}->{circ};
-               $self->{'due'} = OpenILS::SIP->format_date($circ->due_date);
+               $self->{'due'} = OpenILS::SIP->format_date($circ->due_date, 'due');
                $self->ok(1);
 
                return 1;