diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /bin/follow-tax-rename | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/follow-tax-rename')
-rw-r--r-- | bin/follow-tax-rename | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/bin/follow-tax-rename b/bin/follow-tax-rename deleted file mode 100644 index b7536e815..000000000 --- a/bin/follow-tax-rename +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -use FS::UID qw( adminsuidsetup ); -use FS::Record qw( qsearch qsearchs ); -use FS::cust_bill_pkg; - -$FS::Record::nowarn_classload = 1; -$FS::Record::nowarn_classload = 1; - -adminsuidsetup shift; - -my $begin = 1231876106; - -my @old = qsearch('h_cust_main_county', { - 'history_action' => 'replace_old', - 'history_date' => { op=>'>=', value=>$begin, }, -} ); - -foreach my $old (@old) { - - my $new = qsearchs('h_cust_main_county', { - 'history_action' => 'replace_new', - 'history_date' => $old->history_date, - }); - - unless ( $new ) { - warn "huh? no corresponding new record found?"; - next; - } - - my $old_taxname = $old->taxname; - my $new_taxname = $new->taxname; - - my @cust_bill_pkg = qsearch('cust_bill_pkg', { - 'pkgnum' => 0, - 'itemdesc' => $old->taxname, - }); - - next unless @cust_bill_pkg; - - warn 'fixing '. scalar(@cust_bill_pkg). - " dangling line items for rename $old_taxname -> $new_taxname\n"; - - foreach my $cust_bill_pkg ( @cust_bill_pkg ) { - - $cust_bill_pkg->itemdesc( $new->taxname ); - my $error = $cust_bill_pkg->replace; - die $error if $error; - - } - -} |