link new tax report to cust_credit_bill_pkg for credits, RT#12332
[freeside.git] / httemplate / search / report_receivables.html
index bb23f1f..e85d786 100755 (executable)
@@ -1,26 +1,62 @@
 <% include('/elements/header.html', 'Accounts Receivable Aging Summary' ) %>
 
-    <FORM ACTION="report_receivables.cgi" METHOD="GET">
+<FORM NAME="OneTrueForm" ACTION="report_receivables.cgi" METHOD="GET">
+
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+  <TR>
+    <TH CLASS="background" COLSPAN=2 ALIGN="left">
+      <FONT SIZE="+1">Search options</FONT>
+    </TH>
+  </TR>
+
+  <% include( '/elements/tr-select-agent.html', 'disable_empty'=>0 ) %>
+
+  <% include( '/elements/tr-select-cust_main-status.html',
+                'label' => 'Customer Status'
+            )
+  %>
+  
+  <TR>
+    <TD ALIGN="right">Customers</TD>
+    <TD>
+      <SCRIPT TYPE="text/javascript">
+function toggle(obj) {
+  var f = document.OneTrueForm;
+  var val = (obj.value == obj.checked);
+  f.days.disabled = val;
+  f.negative.disabled = val;
+  f.days.style.backgroundColor = val ? '#dddddd' : '#ffffff';
+}
+      </SCRIPT>
+      <TABLE STYLE="padding: 0px">
+        <TR><TD><INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="toggle(this)"></TD>
+        <TD>All customers (even those without an outstanding balance)</TD></TR>
+        <TR><TD><INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="toggle(this)"></TD>
+        <TD>Customers with a balance over <INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0"> days old</TD></TR>
+        <TR><TD></TD>
+        <TD><INPUT TYPE="checkbox" NAME="negative" VALUE="1">&nbsp;Including customers with credit balances</TD></TR>
+      </TABLE>
+    </TD>
+  </TR>
+  <% include( '/elements/tr-input-date-field.html', {
+                'name'      => 'as_of',
+                'value'     => time,
+                'label'     => 'As of date ',
+                'format'    => FS::Conf->new->config('date_format') || '%m/%d/%Y',
+  } ) %>
+
+</TABLE>
+
+<BR><INPUT TYPE="submit" VALUE="Get Report">
+</FORM>
+
+<% include('/elements/footer.html') %>
 
-    <TABLE>
-
-      <% include( '/elements/tr-select-agent.html' ) %>
-
-      <TR>
-        <TD ALIGN="right">Over </TD>
-        <TD><INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3> days</TD>
-      </TR>
-
-    </TABLE>
-
-    <BR><INPUT TYPE="submit" VALUE="Get Report">
-    </FORM>
-
-  </BODY>
-</HTML>
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+  unless $FS::CurrentUser::CurrentUser->access_right('Receivables report')
+      or $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
 </%init>