X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fimport-did-inventory;h=01fa2e8af8a1cc3d5930436b0f34c482268e2563;hp=f3646647eeb932c62ac0fc0b180a301d23f936bc;hb=a36e0f8a0f69349dafaa16d1d2d57dfb6e5dbc85;hpb=30aa93eea617fc2f4c30dfc6f608d32cb8fc38fd diff --git a/bin/import-did-inventory b/bin/import-did-inventory index f3646647e..01fa2e8af 100644 --- a/bin/import-did-inventory +++ b/bin/import-did-inventory @@ -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)"); @@ -164,8 +166,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 @@ -357,11 +358,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'}