- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / weberp / PDFStockLocTransfer.php
blob73534ab84c9aa6a79cf0cf2d4ab88d8fc184af29
1 <?php
2 /* $Revision: 1.8 $ */
4 $PageSecurity =1;
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');
13 echo '<P>';
14 prnMsg( _('This page must be called with a location transfer reference number'),'error' );
15 include ('includes/footer.inc');
16 exit;
19 $FontSize=10;
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,
26 loctransfers.stockid,
27 stockmaster.description,
28 loctransfers.shipqty,
29 loctransfers.shipdate,
30 loctransfers.shiploc,
31 locations.locationname as shiplocname,
32 loctransfers.recloc,
33 locationsrec.locationname as reclocname
34 FROM loctransfers
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');
47 exit;
50 $TransferRow = DB_fetch_array($result);
52 $PageNumber=1;
53 include ('includes/PDFStockLocTransferHeader.inc');
54 $line_height=30;
55 $FontSize=10;
57 do {
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) {
68 $PageNumber++;
69 include('includes/PDFStockLocTransferHeader.inc');
72 } while ($TransferRow = DB_fetch_array($result));
74 $pdfcode = $pdf->output();
75 $len = strlen($pdfcode);
78 if ($len<=20){
79 include('includes/header.inc');
80 echo '<p>';
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');
84 exit;
85 } else {
86 header('Content-type: application/pdf');
87 header('Content-Length: ' . $len);
88 header('Content-Disposition: inline; filename=StockLocTrfShipment.pdf');
89 header('Expires: 0');
90 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
91 header('Pragma: public');
93 $pdf->Stream();