X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fbill_batch.cgi;h=b740bdc68ac9517e3c856b7f9a79cd725efff352;hb=e3050e0b56e4745cfcf6b9330812ead3e9e2a7bb;hp=cbd7f270a3800c33bd40b45ee5864e5574363375;hpb=007fd3026ade508a9d88b436575a4797d003280a;p=freeside.git
diff --git a/httemplate/search/bill_batch.cgi b/httemplate/search/bill_batch.cgi
index cbd7f270a..b740bdc68 100755
--- a/httemplate/search/bill_batch.cgi
+++ b/httemplate/search/bill_batch.cgi
@@ -1,19 +1,32 @@
% my $batchnum = $cgi->param('download');
% if ( $batchnum =~ /^\d+$/ ) {
-% $cgi->delete('download');
+% my $download = $p."misc/download-bill_batch.html?$batchnum";
Starting download...
-
+
+
+
+
<& /elements/footer.html &>
% }
% else {
-<% include( 'elements/search.html',
+%# delete existing download cookie
+% my $cookie = CGI::Cookie->new(
+% -name => 'bill_batch_download',
+% -value => 0,
+% -expires => '-1d',
+% );
+% $r->headers_out->add( 'Set-Cookie' => $cookie->as_string );
+<& elements/search.html,
'title' => 'Invoice Batches',
'name_singular' => 'batch',
'query' => { 'table' => 'bill_batch',
@@ -52,11 +65,28 @@ function refreshParent() {
'agent_virt' => 1,
'agent_null_right' => [ 'Process global invoice batches', 'Configuration' ],
'agent_pos' => 1,
+ 'html_foot' => include('.foot'),
- )
-
-%>
+&>
%}
+<%def .foot>
+
+%def>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -76,8 +106,6 @@ my $count_query = "SELECT COUNT(*) FROM bill_batch WHERE". # $extra_sql AND "
#my $extra_sql = ''; # may add something here later
my $link = [ "${p}view/bill_batch.cgi?batchnum=", 'batchnum' ];
-my $download_id = int(rand(1000000));
-
sub download_link {
my $batch = shift;
my $batchnum = $batch->batchnum;
@@ -90,10 +118,10 @@ sub download_link {
"Download$batchnum",
[ 'batchnum', 'close' ],
$p.'misc/process/bill_batch-print.html',
- { url => $p."search/bill_batch.cgi?download=$batchnum" },
+ { popup_url => $p."search/bill_batch.cgi?download=$batchnum" },
"batch$batchnum" #key
);
- $html .= '' .
+ $html .= '' .
($batch->status eq 'O' ? 'Download and close' : 'Download');
$html .= '';
return $html;