invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / graph / report_money_time.html
index 6c7e427..aaaf01b 100644 (file)
@@ -1,24 +1,4 @@
-<%
-
-#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-my ($curmon,$curyear) = (localtime(time))[4,5];
-
-#find first month
-my $syear = 1899+$curyear;
-my $smonth = $curmon+1;
-
-#want 12 month by default, not 13
-$smonth++;
-if ( $smonth > 12 ) { $smonth-=12; $syear++ }
-
-#find last month
-my $eyear = 1900+$curyear;
-my $emonth = $curmon+1;
-
-my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
-
-%>
-<%= include('/elements/header.html', 'Sales, Credits and Receipts Summary' ) %>
+<% include('/elements/header.html', 'Sales, Credits and Receipts Summary' ) %>
 
 <FORM ACTION="money_time.cgi" METHOD="GET">
 
@@ -34,38 +14,59 @@ my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 <BR>
 -->
 
-From: <SELECT NAME="smonth">
-<% foreach my $mon ( 1..12 ) { %>
-<OPTION VALUE="<%= $mon %>"<%= $mon == $smonth ? ' SELECTED' : '' %>><%= $mon[$mon-1] %>
-<% } %>
-</SELECT>
-<SELECT NAME="syear">
-<% foreach my $y ( 1999 .. 2010 ) { %>
-<OPTION VALUE="<%= $y %>"<%= $y == $syear ? ' SELECTED' : '' %>><%= $y %>
-<% } %>
-</SELECT>
-<BR>
+<TABLE>
 
-To: <SELECT NAME="emonth">
-<% foreach my $mon ( 1..12 ) { %>
-<OPTION VALUE="<%= $mon %>"<%= $mon == $emonth ? ' SELECTED' : '' %>><%= $mon[$mon-1] %>
-<% } %>
-</SELECT>
-<SELECT NAME="eyear">
-<% foreach my $y ( 1999 .. 2010 ) { %>
-<OPTION VALUE="<%= $y %>"<%= $y == $eyear ? ' SELECTED' : '' %>><%= $y %>
-<% } %>
-</SELECT>
-<BR>
+<% include('/elements/tr-select-from_to.html' ) %>
 
-For agent: <%= include('/elements/select-agent.html' ) %>
-<BR>
+<% include('/elements/tr-select-agent.html',
+             'label'         => 'For agent: ',
+             'disable_empty' => 0,
+          )
+%>
 
-<INPUT TYPE="checkbox" NAME="12mo" VALUE="1"> Show 12 month totals instead of monthly values.
-<BR>
+<& /elements/tr-select-cust_class.html,
+    'field'    => 'cust_classnum', # to avoid ambiguity in FS::Report::Table
+    'multiple' => 1
+&>
+
+<% include('/elements/tr-select-part_referral.html',
+             'label'         => 'Advertising source ',
+             'disable_empty' => 0,
+             'empty_label'   => 'all',
+          )
+%>
+
+<tr>
+  <td />
+  <td>
+    <& /elements/checkbox.html,
+      field => '12mo',
+      value => 1,
+    &>
+    <% emt('Show 12 month totals instead of monthly values') %>
+  </td>
+</tr>
+<tr>
+  <td />
+  <td>
+    <& /elements/checkbox.html,
+      field => 'exclude_discount',
+      value => 1,
+      curr_value => 0,
+    &>
+    <% emt('Exclude discounts from total sales') %>
+  </td>
+</TR>
 
-<INPUT TYPE="submit" VALUE="Display">
+</TABLE>
+
+<BR><INPUT TYPE="submit" VALUE="Display">
 </FORM>
 
-<%= include('/elements/footer.html') %>
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
+</%init>