X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fimport-did-inventory;h=f3646647eeb932c62ac0fc0b180a301d23f936bc;hb=30aa93eea617fc2f4c30dfc6f608d32cb8fc38fd;hp=6122178633f7856ceea047d7213f2de9f9b77176;hpb=9a59cc9d51350d7eefb25697cd0d99188f686ea5;p=freeside.git diff --git a/bin/import-did-inventory b/bin/import-did-inventory index 612217863..f3646647e 100644 --- a/bin/import-did-inventory +++ b/bin/import-did-inventory @@ -23,7 +23,7 @@ use Time::HiRes qw(usleep ualarm gettimeofday tv_interval); print "started time=".time."\n"; #### SET THESE! ################################# -my $file = '/home/levinse/dids1.csv'; +my $file = '/home/levinse/dids4.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 @@ -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, @@ -163,7 +164,8 @@ sub suffer { ### LATA ### - fatal("no lata found for latanum $latanum") unless exists($latas{$latanum}); + fatal("no lata found for latanum $latanum") unless exists($latas{$latanum}) + || $latanum == 460; # unsurprisingly, our idea of a LATA name doesn't always match their idea # of the same. Specifically, they randomly expand the state portion and @@ -178,7 +180,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 ### @@ -360,14 +362,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'} - || $vendor_order_id eq '293745') - ) - || - (!$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, @@ -400,11 +402,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;