DID inventory/import / bulk DID orders - phase 2, RT12754
[freeside.git] / bin / import-did-inventory
index 2ba4594..a0ffb81 100644 (file)
@@ -164,8 +164,7 @@ sub suffer {
 
     ### LATA ###
 
-    fatal("no lata found for latanum $latanum") unless exists($latas{$latanum}) 
-        || $latanum == 460;
+    fatal("no lata found for latanum $latanum") unless exists($latas{$latanum});
 
     # unsurprisingly, our idea of a LATA name doesn't always match their idea 
     # of the same. Specifically, they randomly expand the state portion and
@@ -180,7 +179,7 @@ sub suffer {
     $latadesc =~ s/\s\w+$// unless uc($ourdesc) eq uc($latadesc); # yeah...long story :(
 
     fatal("their LATA description '$latadesc' doesn't match our LATA description '$ourdesc'")
-        unless uc($ourdesc) eq uc($latadesc);
+        unless (uc($ourdesc) eq uc($latadesc) || $latanum == 460);
 
 
     ### MSA ###
@@ -357,11 +356,13 @@ sub order {
     my $o;
     if( exists $did_order{$vendor_order_id} ) {
         $o = $did_order{$vendor_order_id};
+#       warn "$submitted $confirmed $received $vendor_order_id".Dumper($o);
         fatal("vendor order #$vendor_order_id - order data differs from one item to another")
-            unless ( ($o->submitted == $submitted
+            unless ( ( abs($o->submitted-$submitted) < 5
                         || $o->vendor_order_id == 293011) # yet another bad data hack
-                    && $o->confirmed == $confirmed
-                    && $o->received == $received);
+                    && abs($o->confirmed-$confirmed) < 5
+                    && abs($o->received-$received) < 5 
+                   );
 #        fatal("customer mismatch for vendor order #$vendor_order_id")
 #           unless (    ($o->custnum && $cust{'custnum'} 
 #                        && ($o->custnum == $cust{'custnum'}