X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_pay_batch.cgi;h=cb101d4dbacef2bf6a09134734f3982af343403a;hb=f7e5e7625b04164ce2e0aac77a85bc03a7d48a6f;hp=60dca8cbad1f39fa75643d0c48a20e5d537fe012;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi index 60dca8cba..cb101d4db 100755 --- a/httemplate/search/cust_pay_batch.cgi +++ b/httemplate/search/cust_pay_batch.cgi @@ -63,7 +63,9 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports') || $FS::CurrentUser::CurrentUser->access_right('Process batches') || ( $cgi->param('custnum') - && $conf->exists('batch-enable') + && ( $conf->exists('batch-enable') + || $conf->config('batch-enable_payby') + ) #&& $FS::CurrentUser::CurrentUser->access_right('View customer batched payments') ); @@ -122,7 +124,7 @@ $sql_query = "SELECT paybatchnum,invnum,custnum,cpb.last,cpb.first," . 'LEFT JOIN pay_batch USING ( batchnum ) ' . "$search ORDER BY $orderby"; -my $html_init = ''; +my $html_init = ''; if ( $pay_batch ) { my $fixed = $conf->config('batch-fixed_format-'. $pay_batch->payby); if ( @@ -130,21 +132,29 @@ if ( $pay_batch ) { || ( $pay_batch->status eq 'I' && $FS::CurrentUser::CurrentUser->access_right('Reprocess batches') ) + || ( $pay_batch->status eq 'R' + && $FS::CurrentUser::CurrentUser->access_right('Redownload resolved batches') + ) ) { - $html_init .= qq!!; + $html_init .= qq!!; if ( $fixed ) { $html_init .= qq!!; } else { - $html_init .= qq!Download batch in format !. qq!!. qq!!. qq!!. qq!!. qq!!. qq!!. + qq!!. + qq!!. + qq!!. + qq!!; } - $html_init .= qq!
!; + $html_init .= qq!

!; } if ( @@ -153,25 +163,49 @@ if ( $pay_batch ) { && $FS::CurrentUser::CurrentUser->access_right('Reprocess batches') ) ) { - $html_init .= qq!!. - qq!Upload results
!. - qq!Filename
!; + $html_init .= ''. + include('/elements/form-file_upload.html', + 'name' => 'FileUpload', + 'action' => "$p/misc/upload-batch.cgi", + 'num_files' => 1, + 'fields' => [ 'batchnum', 'format' ], + 'message' => 'Batch results uploaded.', + ) . + 'Upload results
'. + include('/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + 'no_table'=> 1 + ). + '
' + ; if ( $fixed ) { $html_init .= qq!!; } else { - $html_init .= qq!Format Format !. + qq!
!; + qq!!. + qq!!. + qq!!. + qq!!. + qq!
!; } $html_init .= qq!!; - $html_init .= '
'; + $html_init .= '
'; + if ( $conf->exists('batch-manual_approval') and $pay_batch->status eq 'I') { + $html_init .= qq!! + } } - + $html_init .= '
'; } if ($pay_batch) {