[freeside-commits] freeside/httemplate/graph cust_bill_pkg.cgi, 1.14, 1.15 report_cust_bill_pkg.html, 1.11, 1.12
Mark Wells
mark at wavetail.420.am
Mon Dec 26 12:24:19 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/graph
In directory wavetail.420.am:/tmp/cvs-serv14495/httemplate/graph
Modified Files:
cust_bill_pkg.cgi report_cust_bill_pkg.html
Log Message:
sales report improvements, #15393
Index: report_cust_bill_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/report_cust_bill_pkg.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -d -r1.11 -r1.12
--- report_cust_bill_pkg.html 21 May 2010 19:09:04 -0000 1.11
+++ report_cust_bill_pkg.html 26 Dec 2011 20:24:17 -0000 1.12
@@ -28,19 +28,28 @@
</TR>
-->
+% foreach ( qw(Setup Usage) ) {
+<& /elements/tr-select.html,
+ 'label' => "$_ fees",
+ 'field' => 'use_'.lc($_),
+ 'options' => [ 0, 1, 2 ],
+ 'labels' => { 0 => 'Combine', 1 => 'Separate', 2 => 'Do not show' },
+&>
+% }
+
<TR>
<TD ALIGN="right"><INPUT TYPE="checkbox" NAME="use_override" VALUE="1"></TD>
<TD>Separate sub-packages from parents</TD>
</TR>
<TR>
- <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="use_usage" VALUE="1"></TD>
- <TD>Separate rated usage from recurring fees</TD>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="average_per_cust_pkg" VALUE="1"></TD>
+ <TD>Average per customer package</TD>
</TR>
<TR>
- <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="average_per_cust_pkg" VALUE="1"></TD>
- <TD>Average per customer package</TD>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="distribute" VALUE="1"></TD>
+ <TD>Distribute recurring fees over billing period</TD>
</TR>
</TABLE>
Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/cust_bill_pkg.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -d -r1.14 -r1.15
--- cust_bill_pkg.cgi 29 Jun 2010 05:22:55 -0000 1.14
+++ cust_bill_pkg.cgi 26 Dec 2011 20:24:17 -0000 1.15
@@ -22,9 +22,19 @@
my $link = "${p}search/cust_bill_pkg.cgi?nottax=1";
my $bottom_link = "$link;";
+my $use_usage = $cgi->param('use_usage') || 0;
+my $use_setup = $cgi->param('use_setup') || 0;
my $use_override = $cgi->param('use_override') ? 1 : 0;
-my $use_usage = $cgi->param('use_usage') ? 1 : 0;
my $average_per_cust_pkg = $cgi->param('average_per_cust_pkg') ? 1 : 0;
+my $distribute = $cgi->param('distribute') ? 1 : 0;
+
+my %charge_labels = (
+ 'SR' => 'setup + recurring',
+ 'RU' => 'recurring',
+ 'S' => 'setup',
+ 'R' => 'recurring',
+ 'U' => 'usage',
+);
#XXX or virtual
my( $agentnum, $sel_agent, $all_agent ) = ('', '', '');
@@ -94,6 +104,21 @@
my @colors = ();
my @links = ();
+my @components = ( 'SRU' );
+# split/omit components as appropriate
+if ( $use_setup == 1 ) {
+ @components = ( 'S', 'RU' );
+}
+elsif ( $use_setup == 2 ) {
+ @components = ( 'RU' );
+}
+if ( $use_usage == 1 ) {
+ $components[-1] =~ s/U//; push @components, 'U';
+}
+elsif ( $use_usage == 2 ) {
+ $components[-1] =~ s/U//;
+}
+
foreach my $agent ( $all_agent || $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) {
my $col_scheme = Color::Scheme->new
@@ -108,7 +133,7 @@
my $n = 0;
foreach my $pkg_class ( @pkg_class ) {
- foreach my $component ( $use_usage ? ('recurring', 'usage') : ('') ) {
+ foreach my $component ( @components ) {
push @items, 'cust_bill_pkg';
@@ -118,20 +143,22 @@
? ( ref($pkg_class) ? $pkg_class->classname : $pkg_class )
: ''
).
- " $component";
+ ' '.$charge_labels{$component};
my $row_classnum = ref($pkg_class) ? $pkg_class->classnum : 0;
my $row_agentnum = $all_agent || $agent->agentnum;
push @params, [ ($all_class ? () : ('classnum' => $row_classnum) ),
($all_agent ? () : ('agentnum' => $row_agentnum) ),
'use_override' => $use_override,
- 'use_usage' => $component,
+ 'charges' => $component,
'average_per_cust_pkg' => $average_per_cust_pkg,
+ 'distribute' => $distribute,
];
push @links, "$link;".($all_agent ? '' : "agentnum=$row_agentnum;").
($all_class ? '' : "classnum=$row_classnum;").
- "use_override=$use_override;use_usage=$component;";
+ "distribute=$distribute;".
+ "use_override=$use_override;charges=$component;";
@recur_colors = ($col_scheme->colors)[0,4,8,1,5,9]
unless @recur_colors;
@@ -147,5 +174,7 @@
}
#use Data::Dumper;
-
+if ( $cgi->param('debug') == 1 ) {
+ $FS::Report::Table::DEBUG = 1;
+}
</%init>
More information about the freeside-commits
mailing list