event refactor, landing on HEAD!
[freeside.git] / httemplate / search / report_cust_pay.html
index 8adf7dc..d7cb0ae 100644 (file)
@@ -1,4 +1,4 @@
-<%= include('/elements/header.html', 'Payment report' ) %>
+<% include('/elements/header.html', 'Payment report' ) %>
 
 <FORM ACTION="cust_pay.cgi" METHOD="GET">
 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
@@ -8,7 +8,7 @@
   <TR>
     <TD ALIGN="right">Payments of type: </TD>
     <TD>
-      <SELECT NAME="payby">
+      <SELECT NAME="payby" onChange="payby_changed(this)">
         <OPTION VALUE="">all</OPTION>
         <OPTION VALUE="CARD">credit card (all)</OPTION>
         <OPTION VALUE="CARD-VisaMC">credit card (Visa/MasterCard)</OPTION>
     </TD>
   </TR>
 
-  <%= include( '/elements/tr-select-agent.html',
-                 $cgi->param('agentnum'),
-                 'label' => 'for agent: ',
+  <SCRIPT TYPE="text/javascript">
+  
+    function payby_changed(what) {
+      if ( what.options[what.selectedIndex].value == 'BILL' ) {
+       document.getElementById('checkno_caption').style.color = '#000000';
+        what.form.payinfo.disabled = false;
+       what.form.payinfo.style.backgroundColor = '#ffffff';
+      } else {
+       document.getElementById('checkno_caption').style.color = '#bbbbbb';
+        what.form.payinfo.disabled = true;
+       what.form.payinfo.style.backgroundColor = '#dddddd';
+      }
+    }
+
+  </SCRIPT>
+
+  <TR>
+    <TD ALIGN="right"><FONT ID="checkno_caption" COLOR="#bbbbbb">Check #: </FONT></TD>
+    <TD>
+      <INPUT TYPE="text" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
+    </TD>
+  </TR>
+
+  <% include( '/elements/tr-select-agent.html',
+                 'curr_value' => scalar($cgi->param('agentnum')),
+                 'label'      => 'for agent: ',
              )
   %>
 
-  <%= include( '/elements/tr-input-beginning_ending.html' ) %>
+  <% include( '/elements/tr-input-beginning_ending.html' ) %>
+
+  <% include( '/elements/tr-input-lessthan_greaterthan.html',
+                'label' => 'Amount',
+               'field' => 'paid',
+            )
+  %>
 
 </TABLE>
 
 
 </FORM>
 
-<%= include('/elements/footer.html') %>
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
+</%init>