add in access_right checks for sub menues, #17056
[freeside.git] / httemplate / misc / batch-cust_pay.html
index c5ed6d8..2e79865 100644 (file)
@@ -5,7 +5,7 @@
 <SCRIPT TYPE="text/javascript">
 function warnUnload() {
   if(document.getElementById("OneTrueTable").rows.length > 3 &&
-     !document.OneTrueForm.submit.disabled) {
+     !document.OneTrueForm.btnsubmit.disabled) {
     return "The current batch will be lost.";
   }
   else {
@@ -54,7 +54,7 @@ function select_discount_term(row, prefix) {
            )
 %>
 
-<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.submit.disabled=true;window.onbeforeunload = null;">
+<FORM ACTION="process/batch-cust_pay.cgi" NAME="OneTrueForm" METHOD="POST" onsubmit="document.OneTrueForm.btnsubmit.disabled=true;window.onbeforeunload = null;">
 
 <!-- <B>Batch</B> <INPUT TYPE="text" NAME="paybatch"><BR><BR> -->
 
@@ -62,10 +62,10 @@ function select_discount_term(row, prefix) {
               name_singular => 'payment',
               header  => \@header,
               fields  => \@fields,
-              types   => \@types,
+              type    => \@types,
               align   => \@align,
-              sizes   => \@sizes,
-              colors  => \@colors,
+              size    => \@sizes,
+              color   => \@colors,
               param   => \%param,
               footer  => \@footer,
               footer_align => \@footer_align,
@@ -73,11 +73,8 @@ function select_discount_term(row, prefix) {
           )
 %>
 
-<!-- <BR>
-<INPUT TYPE="button" VALUE="TEST addrow" onclick="addRow()"> -->
-
 <BR>
-<INPUT TYPE="submit" NAME="submit" VALUE="Post payment batch">
+<INPUT TYPE="button" VALUE="Post payment batch" name="btnsubmit" onclick="window.onbeforeunload = null; document.OneTrueForm.submit(); this.disabled = true;">
 
 </FORM>
 
@@ -96,18 +93,22 @@ function select_discount_term(row, prefix) {
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Post payment batch');
 
-my @header  = ( '', 'Amount', 'Check #' );
-my @fields  = ( sub {'$'}, 'paid', 'payinfo' );
-my @types   = ( 'immutable', '', '' );
-my @align   = ( 'c', 'r', 'r' );
-my @sizes   = ( 0, 8, 10 );
-my @colors  = ( '', '', '' );
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
+
+my @header  = ( 'Amount', 'Check #' );
+my @fields  = ( 'paid', 'payinfo' );
+my @types   = ( '', '' );
+my @align   = ( 'r', 'r' );
+my @sizes   = ( 8, 10 );
+my @colors  = ( '', '' );
 my %param   = ();
-my @footer  = ( '$', '_TOTAL', '' );
-my @footer_align = ( 'c', 'r', 'r' );
+my @footer  = ( '_TOTAL', '' );
+my @footer_align = ( 'r', 'r' );
 my $custnum_update_callback = '';
 
 if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) {
+  #push @header, 'Discount';
   push @header, '';
   push @fields, 'discount_term';
   push @types, 'immutable';
@@ -119,6 +120,7 @@ if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) {
   $custnum_update_callback = 'select_discount_term';
 }
 
+#push @header, 'Error';
 push @header, '';
 push @fields, 'error';
 push @types, 'immutable';