summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2011-07-13 01:22:19 +0000
committermark <mark>2011-07-13 01:22:19 +0000
commitea79c3b7eff3f274d9d7f923891853a72cc1474f (patch)
treecf3244c00d2f1c80aac5fec2cccad5bb6d678ded
parent077bb34b3467c3320440c49b76064f664c0eee98 (diff)
fix invoice batch download, #13461
-rw-r--r--httemplate/elements/progress-popup.html2
-rw-r--r--httemplate/view/bill_batch.cgi10
2 files changed, 7 insertions, 5 deletions
diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html
index 42e464115..73440bbc3 100644
--- a/httemplate/elements/progress-popup.html
+++ b/httemplate/elements/progress-popup.html
@@ -66,7 +66,7 @@ function updateStatus( status_statustext ) {
window.top.location.href = '<% $url %>';
% } elsif ( $popup_url ) {
- document.parentWindow.location.replace('<% $popup_url %>');
+ document.location.replace('<% $popup_url %>');
% } else {
alert('job done but no url or message specified');
diff --git a/httemplate/view/bill_batch.cgi b/httemplate/view/bill_batch.cgi
index cfd44fe50..c848664ac 100644
--- a/httemplate/view/bill_batch.cgi
+++ b/httemplate/view/bill_batch.cgi
@@ -1,11 +1,13 @@
% 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 %>
+% my $content = $batch->pdf;
% $batch->pdf('');
% my $error = $batch->replace;
% warn "error deleting cached PDF: '$error'\n" if $error;
+%
+% $m->clear_buffer;
+% $r->content_type('application/pdf');
+% $r->headers_out->add('Content-Disposition' => 'attachment;filename="invoice_batch_'.$batchnum.'.pdf"');
+<% $content %>
% }
%
% elsif ($magic eq 'download_popup') {