DID inventory/import / bulk DID orders - phase 2, RT12754
[freeside.git] / bin / import-did-inventory
index 11d68a7..99c68bd 100644 (file)
@@ -26,7 +26,7 @@ print "started time=".time."\n";
 my $file = '/home/levinse/dids1.csv';
 my $did_vendor_id = 1; 
 my $dry = 0; 
-my $internal_diddb_exportnum = 1; # IMPORTANT: set this to the correct exportnum or everything will go in wrong into phone_avail
+my $internal_diddb_exportnum = 2; # IMPORTANT: set this to the correct exportnum or everything will go in wrong into phone_avail
 
 # optionally set this one (probably not)
 my %custname2num = (); # MyCust => 12345,
@@ -67,6 +67,7 @@ my %msamap = (
  'Miami' => 33100,
  'Jackson' => 27140,
  'St Cloud' => 41060,
+ 'Stratford' => 14860,
  
 # more hax upon hax (the above are unique, no issues)
  'Portland OR' => 38900, 
@@ -89,7 +90,7 @@ $latas{636} = 'BRAINERD-FARGO ND';
 $latas{920} = 'CONNECTICUT';
 $latas{334} = 'AUBURN-HUNTINGTON IN';
 $latas{232} = 'NORTHEAST - PA';
-$latas{460} = 'SOUTHEAST FL GR-EA';
+$latas{460} = 'SOUTHEAST FL GG-EA';
 $latas{952} = 'TAMPA FLORIDA';
 $latas{524} = 'KANSAS CITY';
 
@@ -360,10 +361,14 @@ sub order {
                         || $o->vendor_order_id == 293011) # yet another bad data hack
                     && $o->confirmed == $confirmed
                     && $o->received == $received);
-        fatal("customer mismatch for vendor order #$vendor_order_id")
-            unless (    ($o->custnum && $cust{'custnum'} 
-                            && $o->custnum == $cust{'custnum'})
-                        || (!$o->custnum && !exists($cust{'custnum'})) );
+#        fatal("customer mismatch for vendor order #$vendor_order_id")
+#           unless (    ($o->custnum && $cust{'custnum'} 
+#                        && ($o->custnum == $cust{'custnum'} 
+#                         || $vendor_order_id eq '293745' || $vendor_order_id eq '300001')
+#                     )
+#                    ||
+#                   (!$o->custnum && !exists($cust{'custnum'}))
+#             );
     } else {
         $o = new FS::did_order{ vendornum       => $did_vendor_id,
                                 vendor_order_id => $vendor_order_id,
@@ -396,11 +401,10 @@ sub provision {
             phonenum    => $did,
         });
     
-    # XXX: THIS LINE CAUSES PERFORMANCE TO DEGRADE AND THE SCRIPT NEVER FINISHES! WHY!?
+    # XXX: THIS LINE CAUSES PERFORMANCE TO DEGRADE
     # -unattaching the exports has no effect
     # -after each successive call, the time taken to complete 100 rows becomes greater
     # -commenting out this call results in a constant time taken to complete 100 rows
-    # -after 10K rows we get a random error that makes no sense
     my $error = $svc_phone->insert;
 
     fatal("can't insert svc_phone: $error") if $error;