UI cleanup: hide new taxproduct selector when taxproducts are not in use
authorMark Wells <mark@freeside.biz>
Fri, 19 Jun 2015 00:16:33 +0000 (17:16 -0700)
committerMark Wells <mark@freeside.biz>
Fri, 19 Jun 2015 00:16:33 +0000 (17:16 -0700)
httemplate/edit/part_pkg.cgi

index bfa5d50..a90a625 100755 (executable)
                        include_opt_callback =>
                          sub { pkgpart => $_[0]->pkgpart },
                      },
-                      
 
                      { type  => 'tablebreak-tr-title',
                        value => 'Promotions', #better name?
@@ -1219,6 +1218,11 @@ my $field_callback = sub {
                            };
     $fieldref->{layer_fields} = \%taxproduct_fields;
     $fieldref->{layer_values_callback} = $taxproduct_values;
+  } elsif ($field eq 'taxproductnum') { # part_pkg-taxproduct, new style
+    if ( !$taxproducts ) {
+      # then make the widget go away
+      $fieldref->{type} = 'hidden';
+    }
   }
 };