fix invoice batch download, #13461
authormark <mark>
Wed, 13 Jul 2011 01:22:19 +0000 (01:22 +0000)
committermark <mark>
Wed, 13 Jul 2011 01:22:19 +0000 (01:22 +0000)
httemplate/elements/progress-popup.html
httemplate/view/bill_batch.cgi

index 42e4641..73440bb 100644 (file)
@@ -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');
index cfd44fe..c848664 100644 (file)
@@ -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') {