4 #my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
5 my ($curmon,$curyear) = (localtime(time))[4,5];
8 my $syear = $cgi->param('syear') || 1899+$curyear;
9 my $smonth = $cgi->param('smonth') || $curmon+1;
12 my $eyear = $cgi->param('eyear') || 1900+$curyear;
13 my $emonth = $cgi->param('emonth') || $curmon+1;
19 <TITLE>Sales, Credits and Receipts Summary</TITLE>
21 <BODY BGCOLOR="#e8e8e8">
22 <IMG SRC="money_time-graph.cgi?<%= $cgi->query_string %>" WIDTH="976" HEIGHT="384">
25 <%= table('e8e8e8') %>
28 my @items = qw( invoiced netsales credits receipts );
30 'invoiced' => 'Gross Sales',
31 'netsales' => 'Net Sales',
32 'credits' => 'Credits',
33 'receipts' => 'Receipts',
36 'invoiced' => '9999ff', #light blue
37 'netsales' => '0000cc', #blue
38 'credits' => 'cc0000', #red
39 'receipts' => '00cc00', #green
42 my $report = new FS::Report::Table::Monthly (
44 'start_month' => $smonth,
45 'start_year' => $syear,
46 'end_month' => $emonth,
49 my $data = $report->data;
52 my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
57 <% foreach my $column ( @{$data->{label}} ) {
58 #$column =~ s/^(\d+)\//$mon[$1-1]<BR>/e;
59 $column =~ s/^(\d+)\//$mon[$1-1]<BR>/;
61 <TH><%= $column %></TH>
65 <% foreach my $row (@items) { %>
66 <TR><TH><FONT COLOR="#<%= $color{$row} %>"><%= $label{$row} %></FONT></TH>
67 <% foreach my $column ( @{$data->{$row}} ) { %>
68 <TD ALIGN="right" BGCOLOR="#ffffff">
69 <FONT COLOR="#<%= $color{$row} %>">$<%= sprintf("%.2f", $column) %></FONT>
79 <INPUT TYPE="checkbox" NAME="ar">
80 Accounts receivable (invoices - applied credits)<BR>
81 <INPUT TYPE="checkbox" NAME="charged">
83 <INPUT TYPE="checkbox" NAME="defer">
84 Accounts receivable, with deferred revenue (invoices - applied credits, with charges for annual/semi-annual/quarterly/etc. services deferred over applicable time period) (there has got to be a shorter description for this)<BR>
85 <INPUT TYPE="checkbox" NAME="cash">
86 Cashflow (payments - refunds)<BR>
89 From <SELECT NAME="smonth">
90 <% foreach my $mon ( 1..12 ) { %>
91 <OPTION VALUE="<%= $mon %>"<%= $mon == $smonth ? ' SELECTED' : '' %>><%= $mon[$mon-1] %>
95 <% foreach my $y ( 1999 .. 2010 ) { %>
96 <OPTION VALUE="<%= $y %>"<%= $y == $syear ? ' SELECTED' : '' %>><%= $y %>
99 to <SELECT NAME="emonth">
100 <% foreach my $mon ( 1..12 ) { %>
101 <OPTION VALUE="<%= $mon %>"<%= $mon == $emonth ? ' SELECTED' : '' %>><%= $mon[$mon-1] %>
104 <SELECT NAME="eyear">
105 <% foreach my $y ( 1999 .. 2010 ) { %>
106 <OPTION VALUE="<%= $y %>"<%= $y == $eyear ? ' SELECTED' : '' %>><%= $y %>
110 <INPUT TYPE="submit" VALUE="Redisplay">