diff options
| author | Jonathan Prykop <jonathan@freeside.biz> | 2015-09-02 21:05:28 -0500 |
|---|---|---|
| committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-09-02 21:05:28 -0500 |
| commit | 5cbb1285d26ffe2f7fbf8aed14b5b3d7c037fe83 (patch) | |
| tree | a5f7d627fa7389775c422e4945167785b9163990 /httemplate/search | |
| parent | e0e76b55a2f83c19e4114eefe4dabcab092808b4 (diff) | |
RT#32892: Monthly Sales Tax Report [fixed names and colors]
Diffstat (limited to 'httemplate/search')
| -rw-r--r-- | httemplate/search/tax_sales.cgi (renamed from httemplate/search/report_tax_sales.cgi) | 24 | ||||
| -rwxr-xr-x | httemplate/search/tax_sales.html (renamed from httemplate/search/report_tax_sales.html) | 4 |
2 files changed, 21 insertions, 7 deletions
diff --git a/httemplate/search/report_tax_sales.cgi b/httemplate/search/tax_sales.cgi index 5c531c343..4b28c934a 100644 --- a/httemplate/search/report_tax_sales.cgi +++ b/httemplate/search/tax_sales.cgi @@ -1,11 +1,13 @@ <% include('/graph/elements/report.html', - 'title' => 'Monthly Sales Tax Report', - 'items' => \@row_labels, - 'data' => \@rowdata, + 'title' => 'Monthly Sales and Taxes Report', + 'items' => \@row_labels, + 'data' => \@rowdata, 'row_labels' => \@row_labels, - 'colors' => [], + 'colors' => \@rowcolors, + 'bgcolors' => \@rowbgcolors, 'col_labels' => \@col_labels, + 'graph_type' => 'none', ) %> <%init> @@ -139,20 +141,32 @@ while ($countdate < $enddate) { # put the data in the order we want it my @row_labels; my @rowdata; +my @rowcolors; +my @rowbgcolors; +my $pkgcount = 0; #for colors foreach my $classname (@pkg_classname,@taxnames) { + my $istax = ($pkgcount++ < @pkg_classname) ? 0 : 1; my @classlabels = (); my @classdata = (); + my @classcolors = (); + my @classbgcolors = (); my $hasdata = 0; foreach my $item ( qw( invoiced credited ) ) { my $rowlabel = $classname . ' ' . $item; - my $rowdata = $data->{$rowlabel}; + my $rowdata = $data->{$rowlabel}; + my $rowcolor = $istax ? '0000ff' : '000000'; + my $rowbgcolor = ($item eq 'credited') ? 'cccccc' : 'ffffff'; $hasdata = 1 if grep { $_ } @$rowdata; push(@classlabels,$rowlabel); push(@classdata,$rowdata); + push(@classcolors,$rowcolor); + push(@classbgcolors,$rowbgcolor); } next unless $hasdata; # don't include class if it has no data in time range push(@row_labels,@classlabels); push(@rowdata,@classdata); + push(@rowcolors,@classcolors); + push(@rowbgcolors,@classbgcolors); } </%init> diff --git a/httemplate/search/report_tax_sales.html b/httemplate/search/tax_sales.html index 374a15601..61cf86e2e 100755 --- a/httemplate/search/report_tax_sales.html +++ b/httemplate/search/tax_sales.html @@ -1,6 +1,6 @@ -<% include('/elements/header.html', 'Monthly Sales Tax Report' ) %> +<% include('/elements/header.html', 'Monthly Sales and Taxes Report' ) %> -<FORM ACTION="report_tax_sales.cgi" METHOD="GET"> +<FORM ACTION="tax_sales.cgi" METHOD="GET"> <TABLE> |
