X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fbill_batch.cgi;h=55ee4be1c5750fb7138f3083232c6e8d00bbabc0;hb=5dabafc5e63ae7559ca6d2867e653660b981e639;hp=cfd44fe508ce1adaa67a0f33b1faf7166b942f8e;hpb=82879083dd2efddf02192ad48ad0e46e1a16662b;p=freeside.git diff --git a/httemplate/view/bill_batch.cgi b/httemplate/view/bill_batch.cgi index cfd44fe50..55ee4be1c 100644 --- a/httemplate/view/bill_batch.cgi +++ b/httemplate/view/bill_batch.cgi @@ -1,37 +1,8 @@ -% if($magic eq 'download') { -% $m->clear_buffer; -% $r->content_type('application/pdf'); -% $r->headers_out->add('Content-Disposition' => 'attachment;filename="invoice_batch_'.$batchnum.'.pdf"'); -<% $batch->pdf %> -% $batch->pdf(''); -% my $error = $batch->replace; -% warn "error deleting cached PDF: '$error'\n" if $error; -% } -% -% elsif ($magic eq 'download_popup') { -% -<& /elements/header-popup.html, - { 'etc' => 'BGCOLOR="#ccccff"' } &> - -
- -Download batch #<% $batchnum %> - -
-<& /elements/footer.html &> -% -% } -% -% else { <% include('/search/elements/search.html', 'title' => $close ? "Batch $batchnum closed." : "Invoice Batch $batchnum", + 'menubar' => ['All batches' => $p.'search/bill_batch.cgi'], 'name' => 'invoices', 'query' => { 'table' => 'cust_bill_batch', 'select' => join(', ', @@ -42,12 +13,11 @@ parent.nd(1); 'hashref' => { }, 'addl_from' => 'LEFT JOIN cust_bill USING ( invnum ) '. - 'LEFT JOIN cust_main USING ( custnum )', + FS::UI::Web::join_cust_main('cust_bill'), 'extra_sql' => " WHERE batchnum = $batchnum", }, 'count_query' => "SELECT COUNT(*) FROM cust_bill_batch WHERE batchnum = $batchnum", 'html_init' => $html_init, - 'html_foot' => $html_foot, 'header' => [ 'Invoice #', 'Amount', 'Date', @@ -65,7 +35,6 @@ parent.nd(1); ], 'really_disable_download' => 1, ) %> -% } <%init> die "access denied" @@ -78,38 +47,23 @@ my $batchnum = $cgi->param('batchnum'); $batch = FS::bill_batch->by_key($batchnum); die "Batch '$batchnum' not found!\n" if !$batch; -my $magic = $cgi->param('magic'); -$cgi->delete('magic'); - my $close = $cgi->param('close'); $batch->close if $close; -my $html_init = ''; -my $html_foot = ''; -if ( !$magic ) { - $html_init .= qq!
- !; - $html_init .= include('/elements/progress-init.html', - 'OneTrueForm', - [ 'batchnum' ], - $p.'misc/process/bill_batch-print.html', - { - 'popup_url' => $cgi->self_url . ';magic=download_popup', - }, - '', - ); - $html_init .= '
-Download this batch
'; - if ( $batch->status eq 'O' ) { - $cgi->param('close' => 1); - $html_init .= 'Close this batch
'; - } - $html_init .= '
'; - if ( $cgi->param('start_download') ) { - $cgi->delete('start_download'); - $html_foot = ''; - } +my $html_init = qq!
+ ! . + include('/elements/progress-init.html', + 'OneTrueForm', + [ 'batchnum' ], + $p.'misc/process/bill_batch-print.html', + { url => $p.'misc/download-bill_batch.html?'.$batchnum } + ) . + 'Download this batch

'; +if ( $batch->status eq 'O' ) { + $cgi->param('close' => 1); + $html_init .= 'Close this batch
'; } +$html_init .= '
'; my $link = [ "$p/view/cust_bill.cgi?", 'invnum' ]; my $clink = [ "$p/view/cust_main.cgi?", 'custnum' ];