summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_pay_batch.cgi
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-07-29 20:54:53 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-07-29 20:54:53 -0500
commit6821ffc8988f64ddeefe1219b32d00cc57c4ccde (patch)
tree4b8df87970b15cda83b2bb27da45d3f77b0d96c3 /httemplate/search/cust_pay_batch.cgi
parentee10b43452faa00be4ce3b06cac7596655fa5988 (diff)
RT#35100: how to void a payment in the cust_pay_batch before file has been uploaded to the bank
Diffstat (limited to 'httemplate/search/cust_pay_batch.cgi')
-rwxr-xr-xhttemplate/search/cust_pay_batch.cgi34
1 files changed, 33 insertions, 1 deletions
diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi
index c0f84ec87..cc958b96d 100755
--- a/httemplate/search/cust_pay_batch.cgi
+++ b/httemplate/search/cust_pay_batch.cgi
@@ -14,6 +14,7 @@
'Exp',
'Amount',
'Status',
+ '', # delete link
'', # error_message
],
'fields' => [ 'paybatchnum',
@@ -31,9 +32,10 @@
sprintf('%.02f', $_[0]->amount)
},
sub { $_[0]->display_status },
+ $sub_unbatch,
'error_message',
],
- 'align' => 'rrrlllcrlll',
+ 'align' => 'rrrlllcrllll',
'links' => [ '',
["${p}view/cust_bill.cgi?", 'invnum'],
(["${p}view/cust_main.cgi?", 'custnum']) x 2,
@@ -129,6 +131,36 @@ my $sub_receipt = sub {
);
};
+my $sub_unbatch = '';
+if ( ($pay_batch && ($pay_batch->status eq 'O'))
+ && ( $curuser->access_right('Process batches')
+ || $curuser->access_right('Process global batches') )
+) {
+ $sub_unbatch = sub {
+ my $self = shift;
+ return '' if $self->status; # sanity check, shouldn't happen
+ my $batchnum = $self->batchnum;
+ my $paybatchnum = $self->paybatchnum;
+ my $out = <<EOF;
+<FORM name="delete_cust_pay_batch_$paybatchnum">
+<INPUT TYPE="hidden" name="paybatchnum" value="$paybatchnum">
+</FORM>
+EOF
+ $out .= include('/elements/progress-init.html',
+ "delete_cust_pay_batch_$paybatchnum",
+ [ 'paybatchnum' ],
+ $p.'misc/process/delete-cust_pay_batch.cgi',
+ $p.'search/cust_pay_batch.cgi?' . $cgi->query_string,
+ "paybatchnum$paybatchnum",
+ );
+ my $onclick = 'if ( confirm(\'';
+ $onclick .= emt('Are you sure you want to delete batch payment ') . $self->paybatchnum;
+ $onclick .= emt(' from payment batch ') . $self->batchnum;
+ $onclick .= '\') ) { paybatchnum' . $paybatchnum . 'process() }';
+ return $out . '<A HREF="javascript:void(0)" ONCLICK="' . $onclick . '">delete</A>';
+ };
+}
+
my $html_init = '';
if ( $pay_batch ) {
$html_init = include('elements/cust_pay_batch_top.html',