summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/misc/download-batch.cgi4
-rw-r--r--httemplate/misc/process/pay_batch-approve.cgi16
-rwxr-xr-xhttemplate/search/cust_pay_batch.cgi10
3 files changed, 25 insertions, 5 deletions
diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi
index 01bf5d25f..23deba712 100644
--- a/httemplate/misc/download-batch.cgi
+++ b/httemplate/misc/download-batch.cgi
@@ -1,6 +1,4 @@
-<% $pay_batch->export_batch($format) %>
-
-<%init>
+<% $pay_batch->export_batch($format) %><%init>
#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
http_header('Content-Type' => 'text/plain' ); # not necessarily correct...
diff --git a/httemplate/misc/process/pay_batch-approve.cgi b/httemplate/misc/process/pay_batch-approve.cgi
new file mode 100644
index 000000000..f857e2318
--- /dev/null
+++ b/httemplate/misc/process/pay_batch-approve.cgi
@@ -0,0 +1,16 @@
+% if ( $error ) {
+% $cgi->param('error', $error);
+% }
+<% $cgi->redirect(popurl(3)."search/cust_pay_batch.cgi?dcln=1;batchnum=$batchnum") %>
+<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Process batches');
+
+my $batchnum = $cgi->param('batchnum');
+# make a record in the paybatch of who did this
+my $paybatch = 'manual-'.$FS::CurrentUser::CurrentUser->username.
+ '-' . time2str('%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+my $pay_batch = qsearchs('pay_batch', { 'batchnum' => $batchnum })
+ or die "batchnum '$batchnum' not found";
+my $error = $pay_batch->manual_approve('paybatch' => $paybatch);
+</%init>
diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi
index df635ee8d..cb101d4db 100755
--- a/httemplate/search/cust_pay_batch.cgi
+++ b/httemplate/search/cust_pay_batch.cgi
@@ -193,13 +193,19 @@ if ( $pay_batch ) {
qq!<OPTION VALUE="ach-spiritone">Spiritone ACH batch</OPTION>!.
qq!<OPTION VALUE="paymentech">Chase Paymentech XML</OPTION>!.
qq!<OPTION VALUE="RBC">Royal Bank of Canada PDS</OPTION>!.
- qq!<OPTION VALUE="td_eft1464">TD Commercial Banking EFT 1464 byte</OPTION>!.
+ qq!<OPTION VALUE="td_eftack264">TD EFT Acknowledgement</OPTION>!.
+ qq!<OPTION VALUE="td_eftret80">TD EFT Returned Items</OPTION>!.
qq!</SELECT><BR></TR>!;
}
$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') {
+ $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>!
+ }
}
- $html_init .= '</TABLE>'
+ $html_init .= '</TABLE>';
}
if ($pay_batch) {