1 <% $exporttext %><%init>
3 #http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
4 http_header('Content-Type' => 'text/plain' ); # not necessarily correct...
7 if ( $cgi->param('batchnum') =~ /^(\d+)$/ ) {
10 die "No batch number (bad URL) \n";
14 if ( $cgi->param('gatewaynum') =~ /^(\d+)$/ ) {
15 my $gateway = FS::payment_gateway->by_key($1);
16 die "gatewaynum $1 not found" unless $gateway;
17 $opt{'gateway'} = $gateway;
19 elsif ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) {
23 my $pay_batch = qsearchs('pay_batch', { batchnum => $batchnum } );
24 die "Batch not found: '$batchnum'" if !$pay_batch;
26 my $exporttext = $pay_batch->export_batch(%opt);
27 unless ($exporttext) {
28 http_header('Content-Type' => 'text/html' );
31 alert('Batch was empty, and has been resolved');
32 window.top.location.href = '${p}search/pay_batch.cgi?magic=_date;open=1;intransit=1;resolved=1';