diff options
Diffstat (limited to 'httemplate/graph')
| -rw-r--r-- | httemplate/graph/cust_bill_pkg.cgi | 18 | ||||
| -rw-r--r-- | httemplate/graph/elements/report.html | 6 | ||||
| -rw-r--r-- | httemplate/graph/report_cust_bill_pkg.html | 7 |
3 files changed, 24 insertions, 7 deletions
diff --git a/httemplate/graph/cust_bill_pkg.cgi b/httemplate/graph/cust_bill_pkg.cgi index b5486f4af..83eb0e837 100644 --- a/httemplate/graph/cust_bill_pkg.cgi +++ b/httemplate/graph/cust_bill_pkg.cgi @@ -1,5 +1,4 @@ <% include('elements/monthly.html', - #Dumper( 'title' => $title, 'graph_type' => $graph_type, 'items' => \@items, @@ -28,6 +27,7 @@ my $bottom_link = "$link;"; my $use_usage = $cgi->param('use_usage') || 0; my $use_setup = $cgi->param('use_setup') || 0; my $use_discount = $cgi->param('use_discount') || 2; +my $use_taxes = $cgi->param('use_taxes') || 0; my $use_override = $cgi->param('use_override') ? 1 : 0; my $average_per_cust_pkg = $cgi->param('average_per_cust_pkg') ? 1 : 0; @@ -50,6 +50,7 @@ my %charge_labels = ( 'R' => 'recurring', 'U' => 'usage', 'D' => 'discount', + 'T' => 'taxes', ); #XXX or virtual @@ -194,8 +195,14 @@ if ( $use_discount == 1 ) { push @components, 'D'; } # else leave discounts off entirely; never combine them with setup/recur +# could in theory combine with setup/recur/usage, +# but would require reverse engineering the tax calculation +if ( $use_taxes == 1 ) { + push @components, 'T'; +} + # Categorization of line items goes -# Agent -> Referral -> Package class -> Component (setup/recur/usage) +# Agent -> Referral -> Package class -> Component (setup/recur/usage/discount/taxes) # If per-agent totals are enabled, they go under the Agent level. # There aren't any other kinds of subtotals. @@ -255,6 +262,8 @@ foreach my $agent ( $all_agent || $sel_agent || $FS::CurrentUser::CurrentUser->a if ( $component eq 'D' ) { # discounts ignore 'charges' and 'distribute' $row_link = "${p}search/cust_bill_pkg_discount.html?"; + } elsif ( $component eq 'T' ) { + $row_link = "${p}search/cust_bill_pkg.cgi?istax=1;"; } $row_link .= ($all_agent ? '' : "agentnum=$row_agentnum;"). @@ -314,6 +323,8 @@ foreach my $agent ( $all_agent || $sel_agent || $FS::CurrentUser::CurrentUser->a if ( $component eq 'D' ) { # discounts ignore 'charges' and 'distribute' $row_link ="${p}search/cust_bill_pkg_discount.html?"; + } elsif ( $component eq 'T' ) { + $row_link = "${p}search/cust_bill_pkg.cgi?istax=1;"; } $row_link .= ($all_agent ? '' : "agentnum=$row_agentnum;"). @@ -386,9 +397,8 @@ foreach my $agent ( $all_agent || $sel_agent || $FS::CurrentUser::CurrentUser->a $anum++; -} +} # foreach $agent -#use Data::Dumper; if ( $cgi->param('debug') == 1 ) { $FS::Report::Table::DEBUG = 1; } diff --git a/httemplate/graph/elements/report.html b/httemplate/graph/elements/report.html index f1b0d166d..b5d214816 100644 --- a/httemplate/graph/elements/report.html +++ b/httemplate/graph/elements/report.html @@ -11,6 +11,7 @@ Example: #these run parallel to items, and can be given as hashes 'row_labels' => \@row_labels, #required 'colors' => \@colors, #required + 'bgcolors' => \@bgcolors, #optional 'graph_labels' => \@graph_labels, #defaults to row_labels 'links' => \@links, #optional @@ -22,7 +23,7 @@ Example: #optional 'nototal' => 1, - 'graph_type' => 'LinesPoints', + 'graph_type' => 'LinesPoints', #can be 'none' for no graph 'bottom_total' => 1, 'sprintf' => '%u', #sprintf format, overrides default %.2f 'disable_money' => 1, @@ -231,7 +232,8 @@ any delimiter and linked from the elements in @data. % foreach my $row ( @items ) { % #make a style % my $color = shift @{ $opt{'colors'} }; -% push @styles, ".i$i { text-align: right; color: #$color; }"; +% my $bgcolor = $opt{'bgcolors'} ? (shift @{ $opt{'bgcolors'} }) : 'ffffff'; +% push @styles, ".i$i { text-align: right; color: #$color; background: #$bgcolor; }"; % #create the data row % my $links = shift @{$opt{'links'}} || ['']; % my $link_prefix = shift @$links; diff --git a/httemplate/graph/report_cust_bill_pkg.html b/httemplate/graph/report_cust_bill_pkg.html index 1db86e393..96bfdc09a 100644 --- a/httemplate/graph/report_cust_bill_pkg.html +++ b/httemplate/graph/report_cust_bill_pkg.html @@ -165,7 +165,6 @@ window.onload = class_mode_changed; </TR> - <TR> <TH CLASS="background" COLSPAN=2> </TH> </TR> @@ -196,6 +195,12 @@ window.onload = class_mode_changed; 'options' => [ 1, 2 ], 'labels' => { 1 => 'Separate', 2 => 'Do not show' }, &> +<& /elements/tr-select.html, + 'label' => 'Taxes', + 'field' => 'use_taxes', + 'options' => [ 1, 2 ], + 'labels' => { 1 => 'Separate', 2 => 'Do not show' }, +&> <TR> <TD ALIGN="right">Colors</TD> |
