[freeside-commits] freeside/httemplate/edit part_pkg_report_option.html, NONE, 1.1 part_pkg.cgi, 1.109, 1.110

Jeff Finucane,420,, jeff at wavetail.420.am
Mon Jun 29 06:53:26 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv21344/httemplate/edit

Modified Files:
	part_pkg.cgi 
Added Files:
	part_pkg_report_option.html 
Log Message:
FCC form 477 reporting #4912

--- NEW FILE: part_pkg_report_option.html ---
<% include( 'elements/edit.html',
              'name'   => 'Package optional report class',
              'table'  => 'part_pkg_report_option',
              'fields' => [
                            'name',
                            { field=>'num', type=>'hidden' },
                            { field=>'disabled', type=>'checkbox', value=>'Y', },
                          ],
              'labels' => { 
                            'num'      => 'Class number',
                            'name'     => 'Class name',
                            'disabled' => 'Disable class',
                          },
              'viewall_dir' => 'browse',
           )
          
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

</%init>

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- part_pkg.cgi	21 Jun 2009 15:21:31 -0000	1.109
+++ part_pkg.cgi	29 Jun 2009 13:53:24 -0000	1.110
@@ -46,6 +46,7 @@
                             'recur_fee'        => 'Recurring fee',
                             'bill_dst_pkgpart' => 'Include line item(s) from package',
                             'svc_dst_pkgpart'  => 'Include services of package',
+                            'report_option'    => 'Report classes',
                           },
 
               'fields' => [
@@ -161,6 +162,19 @@
 
                             { type => 'columnend' },
 
+                            { 'type'  => $census ? 'tablebreak-tr-title'
+                                                 : 'hidden',
+                              'value' => 'Optional report classes',
+                              'field' => 'census_title',
+                            },
+                            { 'field'    => 'report_option',
+                              'type'     => $census ? 'select-table' : 'hidden',
+                              'table'    => 'part_pkg_report_option',
+                              'name_col' => 'name',
+                              'multiple' => 1,
+                            },
+
+
                             { 'type'  => 'tablebreak-tr-title',
                               'value' => 'Pricing add-ons',
                             },
@@ -224,6 +238,7 @@
 
 my $conf = new FS::Conf;
 my $taxproducts = $conf->exists('enable_taxproducts');
+my $census = scalar( qsearch( 'part_pkg_report_option', {} ) );
 
 #XXX
 # - tr-part_pkg_freq: month_increments_only (from price plans)
@@ -301,14 +316,27 @@
 
   (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{'pkgpart'=>$1});
 
+  my @report_option = ();
   foreach ($object->options) {
     /^usage_taxproductnum_(\d+)$/ && ($taxproductnums{$1} = 1);
+    /^report_option_(\d+)$/ && (push @report_option, $1);
   }
   foreach ($object->part_pkg_taxoverride) {
     $taxproductnums{$_->usage_class} = 1
       if $_->usage_class;
   }
 
+  $cgi->param('report_option', join(',', @report_option));
+  foreach my $field ( @$fields ) {
+    next unless ( 
+      ref($field) eq 'HASH' &&
+      $field->{field} &&
+      $field->{field} eq 'report_option'
+    );
+    #$field->{curr_value} = join(',', @report_option);
+    $field->{value} = join(',', @report_option);
+  }
+
   %options = $object->options;
 
   $object->set($_ => $object->option($_))



More information about the freeside-commits mailing list