Hi, joe
AFAIK there is simple way to do it in JS. Below are changes to pdf_report.inc which are simply and effective.
Regards
janusz
BTW. On the invoice printing there was reference text placed instead od invoice #. Below this mistake is removed too.
jd
--- /var/www/frontaccounting/reporting/includes/pdf_report.inc 2007-09-06 22:15:37.000000000 +0200
+++ /var/www/fa/reporting/includes/pdf_report.inc 2007-12-29 11:07:23.000000000 +0100
@@ -341,7 +341,7 @@
else if ($doctype == 9) // SO
$this->Text($mcol, $myrow['order_no'] ." ".$myrow['customer_ref'], $mcol + 90);
else // INV/CRE/STA
- $this->Text($mcol, $myrow['reference'], $mcol + 90);
+ $this->Text($mcol, $myrow['trans_no'], $mcol + 90);
$this->Text($mcol + 90, $myrow['debtor_no'], $mcol + 180);
if ($doctype == 8 || $doctype == 9)
$this->Text($mcol + 180, sql2date($myrow['ord_date']));
@@ -696,16 +696,13 @@
}
else
{
- echo '<html>
- <head>
- <SCRIPT LANGUAGE="JavaScript"><!--
- function go_now () { window.location.href = "'.$fname.'"; }
- //--></SCRIPT>
- </head>
- <body onLoad="go_now()"; >
- <a href="'.$fname.'">click here</a> if you are not re-directed.
- </body>
- </html>';
+
+ header('Content-type: application/pdf');
+ header('Content-Disposition: inline; filename=PriceListing.pdf');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Pragma: public');
+ $this->Stream();
}
// also have a look through the directory, and remove the files that are older than a week
// rather want to save 'em