'svc_dst_pkgpart' => 'Include services of package',
'report_option' => 'Report classes',
'fcc_ds0s' => 'Voice-grade equivalents',
+ 'fcc_voip_class' => 'Category',
+ 'delay_start' => 'Default delay (days)',
},
'fields' => [
{ field=>'setup_cost', type=>'money', },
{ field=>'recur_cost', type=>'money', },
+ ( $conf->exists('part_pkg-delay_start')
+ ? ( { type => 'tablebreak-tr-title',
+ value => 'Delayed start',
+ },
+ { field => 'delay_start',
+ type => 'text', size => 6 },
+ )
+ : ()
+ ),
+
{ type => 'columnnext' },
{ field => 'agent_type',
{ type => 'tablebreak-tr-title',
value => 'FCC Form 477 information',
},
+ { field=>'fcc_voip_class',
+ type=>'select-voip_class',
+ },
{ field=>'fcc_ds0s', type=>'text', size=>6 },
)
: ()
),
-
{ type => 'columnend' },
{ 'type' => $report_option ? 'tablebreak-tr-title'
};
-my $edit_callback = sub {
- my( $cgi, $object, $fields, $opt ) = @_;
-
- $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0;
-
- $recur_disabled = $object->freq ? 0 : 1;
-
- $recur_show_zero_disabled =
- $object->freq
- ? $object->option('recur_fee') > 0 ? 1 : 0
- : 1;
-
- (@agent_type) =
- map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } );
+sub set_report_option {
+ my($cgi, $object, $fields ) = @_; #, $opt
my @report_option = ();
foreach ($object->options) {
$field->{value} = join(',', @report_option);
}
+}
+
+my $edit_callback = sub {
+ my( $cgi, $object, $fields, $opt ) = @_;
+
+ $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0;
+
+ $recur_disabled = $object->freq ? 0 : 1;
+
+ $recur_show_zero_disabled =
+ $object->freq
+ ? $object->option('recur_fee') > 0 ? 1 : 0
+ : 1;
+
+ (@agent_type) =
+ map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } );
+
+ set_report_option( $cgi, $object, $fields);
+
%options = $object->options;
$object->set($_ => $object->option($_, 1))
$object->disabled('Y');
- } else { #not when cloning...
+ } else { #when explicitly cloning, not customizing
(@agent_type) =
map {$_->typenum} qsearch('type_pkgs',{ 'pkgpart' => $object->pkgpart } );
}
+ set_report_option( $cgi, $object, $fields);
+
%options = $object->options;
$object->set($_ => $options{$_})