summaryrefslogtreecommitdiff
path: root/httemplate/graph
diff options
context:
space:
mode:
authorivan <ivan>2004-04-23 12:19:40 +0000
committerivan <ivan>2004-04-23 12:19:40 +0000
commit87227cd405166484ca7b791b2bd3c8829ce8d969 (patch)
treeb838747ae5773879bb023b6b39ae904a3f29fefb /httemplate/graph
parent5cd995865b91204f7ce9233a8ba4d5eee62f9be4 (diff)
credit report, add some links to sales/credits/receipts summary, move payment search to template
Diffstat (limited to 'httemplate/graph')
-rwxr-xr-xhttemplate/graph/money_time-graph.cgi6
-rw-r--r--httemplate/graph/money_time.cgi20
2 files changed, 20 insertions, 6 deletions
diff --git a/httemplate/graph/money_time-graph.cgi b/httemplate/graph/money_time-graph.cgi
index 55e8982b4..bb3d23aae 100755
--- a/httemplate/graph/money_time-graph.cgi
+++ b/httemplate/graph/money_time-graph.cgi
@@ -15,17 +15,19 @@ my $emonth = $cgi->param('emonth') || $curmon+1;
#my @labels;
#my %data;
-my @items = qw( invoiced netsales credits receipts );
+my @items = qw( invoiced netsales credits payments receipts );
my %label = (
'invoiced' => 'Gross Sales (invoiced)',
'netsales' => 'Net Sales (invoiced - applied credits)',
'credits' => 'Credits',
- 'receipts' => 'Receipts/Cashflow (payments - refunds)',
+ 'payments' => 'Gross Receipts (payments)',
+ 'receipts' => 'Net Receipts/Cashflow (payments - refunds)',
);
my %color = (
'invoiced' => [ 153, 153, 255 ], #light blue
'netsales' => [ 0, 0, 204 ], #blue
'credits' => [ 204, 0, 0 ], #red
+ 'payments' => [ 153, 204, 153 ], #light green
'receipts' => [ 0, 204, 0 ], #green
);
diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi
index e5903168d..1c7d54266 100644
--- a/httemplate/graph/money_time.cgi
+++ b/httemplate/graph/money_time.cgi
@@ -25,19 +25,26 @@ my $emonth = $cgi->param('emonth') || $curmon+1;
<%= table('e8e8e8') %>
<%
-my @items = qw( invoiced netsales credits receipts );
+my @items = qw( invoiced netsales credits payments receipts );
my %label = (
'invoiced' => 'Gross Sales',
'netsales' => 'Net Sales',
'credits' => 'Credits',
- 'receipts' => 'Receipts',
+ 'payments' => 'Gross Receipts',
+ 'receipts' => 'Net Receipts',
);
my %color = (
'invoiced' => '9999ff', #light blue
'netsales' => '0000cc', #blue
'credits' => 'cc0000', #red
+ 'payments' => '99cc99', #light green
'receipts' => '00cc00', #green
);
+my %link = (
+ 'invoiced' => "${p}search/cust_bill.html?",
+ 'credits' => "${p}search/cust_credit.html?",
+ 'payments' => "${p}search/cust_pay.cgi?magic=_date;",
+);
my $report = new FS::Report::Table::Monthly (
'items' => \@items,
@@ -48,7 +55,6 @@ my $report = new FS::Report::Table::Monthly (
);
my $data = $report->data;
-
my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
%>
@@ -64,9 +70,15 @@ my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
<% foreach my $row (@items) { %>
<TR><TH><FONT COLOR="#<%= $color{$row} %>"><%= $label{$row} %></FONT></TH>
+ <% my $link = exists($link{$row})
+ ? qq(<A HREF="$link{$row})
+ : '';
+ my @speriod = @{$data->{speriod}};
+ my @eperiod = @{$data->{eperiod}};
+ %>
<% foreach my $column ( @{$data->{$row}} ) { %>
<TD ALIGN="right" BGCOLOR="#ffffff">
- <FONT COLOR="#<%= $color{$row} %>">$<%= sprintf("%.2f", $column) %></FONT>
+ <%= $link ? $link. 'begin='. shift(@speriod). ';end='. shift(@eperiod). '">' : '' %><FONT COLOR="#<%= $color{$row} %>">$<%= sprintf("%.2f", $column) %></FONT><%= $link ? '</A>' : '' %>
</TD>
<% } %>
</TR>