f857e23188fb4031857d1f9c38f5414b8e141791
[freeside.git] / httemplate / misc / process / pay_batch-approve.cgi
1 % if ( $error ) {
2 %   $cgi->param('error', $error);
3 % }
4 <% $cgi->redirect(popurl(3)."search/cust_pay_batch.cgi?dcln=1;batchnum=$batchnum") %>
5 <%init>
6 die "access denied"
7   unless $FS::CurrentUser::CurrentUser->access_right('Process batches');
8
9 my $batchnum = $cgi->param('batchnum');
10 # make a record in the paybatch of who did this
11 my $paybatch = 'manual-'.$FS::CurrentUser::CurrentUser->username.
12    '-' . time2str('%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
13 my $pay_batch = qsearchs('pay_batch', { 'batchnum' => $batchnum })
14   or die "batchnum '$batchnum' not found";
15 my $error = $pay_batch->manual_approve('paybatch' => $paybatch);
16 </%init>