This could easily been done by changing the pdf output to something like this:
Code:
$pdf->Output(getcwd() . '/companies/' . $_SESSION['CompanyName'] . '/PDF/' . $_SESSION['CompanyName'] . '_PackingSlip_' .'OrdNo-'. $_GET['TransNo'] .'_'. date('Y-m-d') . '.pdf','FD');
This will both save the output to file (F) and let the user save it local as normal (D)
I must admit i prefer using 'FI' instead (I = inline) giving me a preview before printing (or save local)
The best would of course be to have a pre-configured path to PDFs (invoices, GRNs, packing slips etc) in config, but this example will work without.
One "problem" with this example is that the file could be overwritten by a dispatch the same day having the same order number.
The best would be to add InvoiceNo to the PrintCustOrder script to avoid this.
It would also be better to have reference to both OrderNo AND InvoiceNo in the filename.