Option to ignore old CDRs, RT#81480
[freeside.git] / bin / import-did-inventory
index b05c33f..01fa2e8 100644 (file)
@@ -97,7 +97,9 @@ $latas{524} = 'KANSAS CITY';
 my $parser = new DateTime::Format::Natural( 'time_zone' => 'local' );
 sub parsedt {
     my ($dt,$min,$max) = (shift,shift,shift);
+    $dt = "$dt 00:00:00";
     my $epoch = $parser->parse_datetime($dt);
+    warn "dt='$dt' min=$min max=$max epoch=$epoch\n";
     return $epoch->epoch 
         if ($parser->success && $epoch->epoch >= $min && $epoch->epoch <= $max);
     fatal("invalid date $dt (min=$min, max=$max)");
@@ -361,7 +363,7 @@ sub order {
             unless ( ( abs($o->submitted-$submitted) < 5
                         || $o->vendor_order_id == 293011) # yet another bad data hack
                     && abs($o->confirmed-$confirmed) < 5
-                    && abs($o->received == $received) < 5 
+                    && abs($o->received-$received) < 5 
                    );
 #        fatal("customer mismatch for vendor order #$vendor_order_id")
 #           unless (    ($o->custnum && $cust{'custnum'}