diff options
author | ivan <ivan> | 2007-02-04 01:47:51 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-02-04 01:47:51 +0000 |
commit | 5d9a5e54a74950b0e62264abcd53e77607f04b48 (patch) | |
tree | 77765f619f02cbf035901732f4d046e5163f572d /httemplate/search | |
parent | d30b47bd6c6b3c93dab69ec054cafe59358f0b82 (diff) |
add link to some batched payment info to customer view
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/cust_pay_batch.cgi | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/httemplate/search/cust_pay_batch.cgi b/httemplate/search/cust_pay_batch.cgi index fec3dfdeb..e378ffae7 100755 --- a/httemplate/search/cust_pay_batch.cgi +++ b/httemplate/search/cust_pay_batch.cgi @@ -58,9 +58,15 @@ %> <%init> +my $conf = new FS::Conf; + die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports') - || $FS::CurrentUser::CurrentUser->access_right('Process batches'); + || $FS::CurrentUser::CurrentUser->access_right('Process batches') + || ( $cgi->param('custnum') + && $conf->exists('batch-enable') + #&& $FS::CurrentUser::CurrentUser->access_right('View customer batched payments') + ); my( $count_query, $sql_query ); my $hashref = {}; @@ -75,6 +81,14 @@ if ( $cgi->param('batchnum') && $cgi->param('batchnum') =~ /^(\d+)$/ ) { $batchnum = $pay_batch->batchnum; } +if ( $cgi->param('custnum') && $cgi->param('custnum') =~ /^(\d+)$/ ) { + push @search, "custnum = $1"; +} + +if ( $cgi->param('status') && $cgi->param('status') =~ /^(\w)$/ ) { + push @search, "pay_batch.status = '$1'"; +} + if ( $cgi->param('payby') ) { $cgi->param('payby') =~ /^(CARD|CHEK)$/ or die "illegal payby " . $cgi->param('payby'); @@ -111,7 +125,6 @@ $sql_query = "SELECT paybatchnum,invnum,custnum,cpb.last,cpb.first," . my $html_init = ''; if ( $pay_batch ) { - my $conf = new FS::Conf; my $fixed = $conf->config('batch-fixed_format-'. $pay_batch->payby); if ( $pay_batch->status eq 'O' |