5 include('includes/session.inc');
6 include('includes/PDFStarter.php');
8 $title = _('Stock Location Transfer Docket Error');
10 if (!isset($_GET['TransferNo'])){
12 include ('includes/header.inc');
14 prnMsg( _('This page must be called with a location transfer reference number'),'error' );
15 include ('includes/footer.inc');
20 $pdf->addinfo('Title', _('Inventory Location Transfer BOL') );
21 $pdf->addinfo('Subject', _('Inventory Location Transfer BOL') . ' # ' . $_GET['Trf_ID']);
23 $ErrMsg = _('An error occurred retrieving the items on the transfer'). '.' . '<P>'. _('This page must be called with a location transfer reference number').'.';
24 $DbgMsg = _('The SQL that failed while retrieving the items on the transfer was');
25 $sql = "SELECT loctransfers.reference,
27 stockmaster.description,
29 loctransfers.shipdate,
31 locations.locationname as shiplocname,
33 locationsrec.locationname as reclocname
35 INNER JOIN stockmaster ON loctransfers.stockid=stockmaster.stockid
36 INNER JOIN locations ON loctransfers.shiploc=locations.loccode
37 INNER JOIN locations AS locationsrec ON loctransfers.recloc = locationsrec.loccode
38 WHERE loctransfers.reference=" . $_GET['TransferNo'];
40 $result = DB_query($sql,$db, $ErrMsg, $DbgMsg);
42 If (DB_num_rows($result)==0){
44 include ('includes/header.inc');
45 prnMsg(_('The transfer reference selected does not appear to be set up') . ' - ' . _('enter the items to be transferred first'),'error');
46 include ('includes/footer.inc');
50 $TransferRow = DB_fetch_array($result);
53 include ('includes/PDFStockLocTransferHeader.inc');
59 $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize,$TransferRow['stockid'], 'left');
60 $LeftOvers = $pdf->addTextWrap(150,$YPos,200,$FontSize,$TransferRow['description'], 'left');
61 $LeftOvers = $pdf->addTextWrap(350,$YPos,60,$FontSize,$TransferRow['shipqty'], 'right');
63 $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2);
65 $YPos -= $line_height;
67 if ($YPos < $Bottom_Margin +
$line_height) {
69 include('includes/PDFStockLocTransferHeader.inc');
72 } while ($TransferRow = DB_fetch_array($result));
74 $pdfcode = $pdf->output();
75 $len = strlen($pdfcode);
79 include('includes/header.inc');
81 prnMsg( _('There was no stock location transfer to print out'), 'warn');
82 echo '<BR><A HREF="' . $rootpath. '/index.php?' . SID
. '">'. _('Back to the menu'). '</A>';
83 include('includes/footer.inc');
86 header('Content-type: application/pdf');
87 header('Content-Length: ' . $len);
88 header('Content-Disposition: inline; filename=StockLocTrfShipment.pdf');
90 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
91 header('Pragma: public');