lock down manual batch approval
[freeside.git] / httemplate / search / cust_pay_batch.cgi
index cb101d4..4a22487 100755 (executable)
@@ -179,7 +179,15 @@ if ( $pay_batch ) {
                          ).
                   '<BR></TR>'
                   ;
-    if ( $fixed ) {
+    if ( $fixed and $fixed eq 'td_eft1464' ) {
+      # special case, this one has two upload formats
+      $html_init .= qq!<TR>Format !.
+                    qq!<SELECT NAME="format">!.
+                    qq!<OPTION VALUE="td_eftack264">TD EFT Acknowledgement</OPTION>!.
+                    qq!<OPTION VALUE="td_eftret80">TD EFT Returned Items</OPTION>!.
+                    qq!</SELECT><BR></TR>!;
+    }
+    elsif ( $fixed ) {
       $html_init .= qq!<INPUT TYPE="hidden" NAME="format" VALUE="$fixed">!;
     } else {
       # should pull this from %import_info
@@ -199,7 +207,10 @@ if ( $pay_batch ) {
     }
     $html_init .= qq!<INPUT TYPE="hidden" NAME="batchnum" VALUE="$batchnum">!;
     $html_init .= '<TR> <INPUT TYPE="submit" VALUE="Upload"></FORM><BR> </TR>';
-    if ( $conf->exists('batch-manual_approval') and $pay_batch->status eq 'I') {
+    if ( $conf->exists('batch-manual_approval') 
+          and $conf->config('batch-fixed_format-CHEK') eq 'td_eft1464'
+          and $pay_batch->status eq 'I'
+          and $pay_batch->payby eq 'CHEK' ) {
       $html_init .= qq!<TR><INPUT TYPE="button" VALUE="Manually approve" onclick="
 if ( confirm('Approve all remaining payments in this batch?') )
   window.location.href='${p}misc/process/pay_batch-approve.cgi?batchnum=$batchnum';"></TR>!