have prizm use service data rather than package data to select a profile RT#4853
authorjeff <jeff>
Mon, 16 Mar 2009 17:06:40 +0000 (17:06 +0000)
committerjeff <jeff>
Mon, 16 Mar 2009 17:06:40 +0000 (17:06 +0000)
FS/FS/Schema.pm
FS/FS/part_export/prizm.pm
httemplate/edit/svc_broadband.cgi

index 65f7a7f..4ffeaa2 100644 (file)
@@ -1666,6 +1666,7 @@ sub tables_hashref {
         'longitude', 'decimal', 'NULL', '', '', '', 
         'altitude', 'decimal', 'NULL', '', '', '', 
         'vlan_profile', 'varchar', 'NULL', $char_d, '', '', 
+        'performance_profile', 'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'svcnum',
       'unique'      => [ [ 'mac_addr' ] ],
index 2d4d858..9705440 100644 (file)
@@ -200,6 +200,9 @@ sub _export_insert {
 #    }
 #  }
 
+  my $performance_profile = $svc->performance_profile;
+  $performance_profile ||= $svc->cust_svc->cust_pkg->part_pkg->pkg;
+
   my $element_name_length = 50;
   $element_name_length = $1
     if $self->option('element_name_length') =~ /^\s*(\d+)\s*$/;
@@ -211,7 +214,7 @@ sub _export_insert {
                                       $location,
                                       $contact,
                                       sprintf("%032X", $svc->authkey),
-                                      $svc->cust_svc->cust_pkg->part_pkg->pkg,
+                                      $performance_profile,
                                       $svc->vlan_profile,
                                       ($self->option('ems') ? 1 : 0 ),
                                      );
@@ -256,7 +259,7 @@ sub _export_insert {
 
   $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet',
                                      [ $element ],
-                                     $svc->cust_svc->cust_pkg->part_pkg->pkg,
+                                     $performance_profile,
                                      0,
                                      1,
                                     );
@@ -395,9 +398,12 @@ sub _export_replace {
   return $err_or_som
     unless ref($err_or_som);
 
+  my $performance_profile = $new->performance_profile;
+  $performance_profile ||= $new->cust_svc->cust_pkg->part_pkg->pkg;
+
   $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet',
                                      [ $element ],
-                                     $new->cust_svc->cust_pkg->part_pkg->pkg,
+                                     $performance_profile,
                                      0,
                                      1,
                                     );
index e60c76c..01e58cd 100644 (file)
@@ -14,6 +14,7 @@
                                  'longitude'    => 'Longitude',
                                  'altitude'     => 'Altitude',
                                  'vlan_profile' => 'VLAN profile',
+                                 'performance_profile' => 'Performance profile',
                                  'authkey'      => 'Authentication key',
                                },
      'fields'               => \@fields, 
@@ -34,7 +35,7 @@ my $conf = new FS::Conf;
 my @fields = (
   qw( description ip_addr speed_down speed_up blocknum ),
   { field=>'block_label', type=>'fixed' },
-  qw( mac_addr latitude longitude altitude vlan_profile authkey )
+  qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey )
 );
 
 my $fixedblock = '';