move a2billing tariff and prepaid options to package def, #24572, #24574
[freeside.git] / httemplate / edit / part_pkg.cgi
index 7e67c83..7f8a707 100755 (executable)
@@ -888,11 +888,16 @@ my $html_bottom = sub {
   
     foreach my $field ( grep $_ !~ /^(setup|recur)_fee$/, @fields ) {
   
-       if(!exists($href->{$field})) {
+      if(!exists($href->{$field})) {
         # shouldn't happen
         warn "nonexistent part_pkg option: '$field'\n";
         next;
       }
+      if ( exists($href->{$field}->{display_if}) ) {
+        my %args = ( 'plan' => $layer ); # anything else?
+        my $display = &{ $href->{$field}->{display_if} }(%args);
+        next if !$display;
+      }
 
       $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD>';