Billing_ThirdParty.pm, missing file
[freeside.git] / FS / FS / cust_svc.pm
index 6274107..6aa254f 100644 (file)
@@ -295,6 +295,17 @@ sub replace {
 #    }
 #  }
 
+  #trigger a pkg_change export on pkgnum changes
+  if ( $new->pkgnum != $old->pkgnum ) {
+    my $error = $new->svc_x->export('pkg_change', $new->cust_pkg,
+                                                  $old->cust_pkg,
+                                   );
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return $error if $error;
+    }
+  }
+
   #my $error = $new->SUPER::replace($old, @_);
   my $error = $new->SUPER::replace($old);
   if ( $error ) {
@@ -890,7 +901,8 @@ sub smart_search_param {
   (
     'table'     => 'cust_svc',
     'select'    => 'svc_all.svcnum AS svcnum, '.
-                   'COALESCE(svc_all.svcdb, part_svc.svcdb) AS svcdb',
+                   'COALESCE(svc_all.svcdb, part_svc.svcdb) AS svcdb, '.
+                   'cust_svc.*',
     'addl_from' => $addl_from,
     'hashref'   => {},
     'extra_sql' => $extra_sql,