communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / httemplate / misc / batch-cust_pay.html
index f2f4460..505f2d0 100644 (file)
@@ -1,25 +1,37 @@
-<% include("/elements/header.html", 'Quick payment entry',
-            menubar( 'Main Menu' => $p ),
-          )
-%>
-% if ( $cgi->param('error') ) { 
-
-  <FONT SIZE="+1" COLOR="#ff0000"><% $cgi->param('error') %></FONT><BR><BR>
-% } 
+<% include('/elements/header.html', 'Quick payment entry') %>
 
+<% include('/elements/error.html') %>
 
+<SCRIPT TYPE="text/javascript">
+function warnUnload() {
+  if(document.getElementById("OneTrueTable").rows.length > 3 &&
+     !document.OneTrueForm.submit.disabled) {
+    return "The current batch will be lost.";
+  }
+  else {
+    return null;
+  }
+}
+window.onbeforeunload = warnUnload;
+</SCRIPT>
 
-<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;">
+<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;window.onbeforeunload = null;">
 
 <!-- <B>Batch</B> <INPUT TYPE="text" NAME="paybatch"><BR><BR> -->
 
-<% include( "elements/customer-table.html",
-            header => [ '', 'Amount', 'Check #', '' ],
-            fields => [ sub {'$'}, 'paid', 'payinfo', 'error', ],
-            types  => [ 'immutable', '', '', 'immutable', ],
-            sizes  => [ 0, 8, 10, 0, ],
-            param  => { () },
-          ) %>
+<% include( "/elements/customer-table.html",
+              name_singular => 'payment',
+              header  => [ '', 'Amount', 'Check #', '' ],
+              fields  => [ sub {'$'}, 'paid', 'payinfo', 'error', ],
+              types   => [ 'immutable', '', '', 'immutable', ],
+              align   => [ 'c', 'r', 'r', 'l' ],
+              sizes   => [ 0, 8, 10, 0, ],
+              colors  => [ '', '', '', '#ff0000' ],
+              param   => { () },
+              footer  => [ '$', '_TOTAL', '', '' ],
+              footer_align => [ 'c', 'r', 'r', '' ],
+          )
+%>
 
 <!-- <BR>
 <INPUT TYPE="button" VALUE="TEST addrow" onclick="addRow()"> -->
 <INPUT TYPE="submit" NAME="submit" VALUE="Post payment batch">
 
 </FORM>
-</BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch');
+
+</%init>