merge NG auth, RT#21563
[freeside.git] / FS / FS / Upgrade.pm
index 7dd889f..cda3198 100644 (file)
@@ -71,14 +71,26 @@ sub upgrade_config {
       qw( quotation_html quotation_latex quotation_latexnotes );
 
   # change 'fslongtable' to 'longtable'
-  foreach my $name (qw(invoice_latex quotation_latex)) {
-    my $value = join("\n",$conf->config($name));
-    if (length($value)) {
+  # in invoice and quotation main templates, and also in all secondary 
+  # invoice templates
+  my @latex_confs =
+    qsearch('conf', { 'name' => {op=>'LIKE', value=>'%latex%'} });
+
+  foreach my $c (@latex_confs) {
+    my $value = $c->value;
+    if (length($value) and $value =~ /fslongtable/) {
       $value =~ s/fslongtable/longtable/g;
-      $conf->set($name, $value);
+      $conf->set($c->name, $value, $c->agentnum);
     }
   }
 
+  # if there's a USPS tools login, assume that's the standardization method
+  # you want to use
+  if ( length($conf->config('usps_webtools-userid')) > 0 and
+       !$conf->exists('address_standardize_method') ) {
+    $conf->set('address_standardize_method', 'usps');
+  }
+
 }
 
 sub upgrade_overlimit_groups {
@@ -282,6 +294,9 @@ sub upgrade_data {
     #insert default tower_sector if not present
     'tower' => [],
 
+    #repair improperly deleted services
+    'cust_svc' => [],
+
     #routernum/blocknum
     'svc_broadband' => [],
 
@@ -293,6 +308,9 @@ sub upgrade_data {
 
     #kick off tax location history upgrade
     'cust_bill_pkg' => [],
+
+    #fix taxable line item links
+    'cust_bill_pkg_tax_location' => [],
   ;
 
   \%hash;