X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=65eca6cf406254c8de542d48c0d427c79737a19d;hb=7c370a4579d1ed8b81dba2fb5fae9978b283b49e;hp=3fee36b3629cb4d35b090f55a374d2ee23c9cd3d;hpb=4427ad71b12bf27eac2a05d88141a82f9372d03f;p=freeside.git diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 3fee36b36..65eca6cf4 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -48,6 +48,7 @@ 'recur_cost' => 'Recur cost', 'pay_weight' => 'Payment weight', 'credit_weight' => 'Credit weight', + 'agent_pkgpartid' => 'External ID', 'agentnum' => 'Agent', 'setup_fee' => 'Setup fee', 'setup_show_zero' => 'Show zero setup', @@ -199,8 +200,15 @@ { type => 'tablebreak-tr-title', value => 'Cost tracking', #better name? }, - { field=>'setup_cost', type=>'money', }, - { field=>'recur_cost', type=>'money', }, + + ( $curuser->access_right('Edit package definition costs') + ? ( { field=>'setup_cost', type=>'money', }, + { field=>'recur_cost', type=>'money', }, + ) + : ( { field=>'setup_cost', type=>'fixed', }, + { field=>'recur_cost', type=>'fixed', }, + ) + ), ( $conf->exists('part_pkg-delay_start') ? ( { type => 'tablebreak-tr-title', @@ -224,26 +232,38 @@ }, }, + ($fcc_opts ? ( + { type => 'tablebreak-tr-title', + value => 'FCC Form 477 information', + }, + { field => 'fcc_options_string', + type => 'input-fcc_options', + curr_value_callback => sub { + my ($cgi, $part_pkg, $fref) = @_; + if ( $cgi->param('fcc_options_string') ) { + # error redirect + return $cgi->param('fcc_options_string'); + } + my %hash; + %hash = $part_pkg->fcc_options + if ($part_pkg->pkgpart); + return encode_json(\%hash); + }, + }, + ) : () + ), + + { type => 'tablebreak-tr-title', + value => 'External Links', #better name? + }, + { field=>'agent_pkgpartid', type=>'text', size=>21 }, + { type => 'tablebreak-tr-title', value => 'Line-item revenue recogition', #better name? }, { field=>'pay_weight', type=>'text', size=>6 }, { field=>'credit_weight', type=>'text', size=>6 }, - ( $conf->exists('cust_pkg-show_fcc_voice_grade_equivalent') - ? ( - { 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 => 'tablebreak-tr-title', @@ -296,6 +316,7 @@ ? "AND pkgpart != $pkgpart" : '' }, + 'label_callback' => sub { shift->pkg_comment_only }, 'm2_label' => 'Include line item(s) from package', 'm2m_method' => 'bill_part_pkg_link', 'm2m_dstcol' => 'dst_pkgpart', @@ -322,6 +343,7 @@ ? "AND pkgpart != $pkgpart" : '' }, + 'label_callback' => sub { shift->pkg_comment_only }, 'm2_label' => 'Include services of package: ', 'm2m_method' => 'svc_part_pkg_link', 'm2m_dstcol' => 'dst_pkgpart', @@ -338,6 +360,7 @@ }, { 'field' => 'supp_dst_pkgpart', 'type' => 'select-part_pkg', + 'label_callback' => sub { shift->pkg_comment_only }, 'm2_label' => 'When ordering package, also order', 'm2m_method' => 'supp_part_pkg_link', 'm2m_dstcol' => 'dst_pkgpart', @@ -385,6 +408,8 @@ my $agent_clone_extra_sql = my $conf = new FS::Conf; my $taxproducts = $conf->exists('enable_taxproducts'); +my $fcc_opts = $conf->exists('part_pkg-show_fcc_options'); + my @locales = grep { ! /^en_/i } $conf->config('available-locales'); #should filter from the default locale lang instead of en_ my %locale_labels = map { ( $_ => 'Package -- '. FS::Locales->description($_) ) @@ -957,7 +982,17 @@ my $html_bottom = sub { ? ' CHECKED' : '' ). '>'; - + + } elsif ( $href->{$field}{'type'} eq 'select-rate' ) { + + $html .= include('/elements/select-rate.html', + 'field' => $layer.'__'.$field, + 'curr_value' => $options{$field}, + map { $_ => $href->{$field}{$_} } + grep { $_ !~ /^(name|type)$/ } + keys %{ $href->{$field} } + ); + } elsif ( $href->{$field}{'type'} =~ /^select/ ) { $html .= '