|
From: <ex...@us...> - 2014-04-20 02:49:39
|
Revision: 6688
http://sourceforge.net/p/web-erp/reponame/6688
Author: exsonqu
Date: 2014-04-20 02:49:36 +0000 (Sun, 20 Apr 2014)
Log Message:
-----------
20/04/14 Exson: Fixed undefined variable bugs in PDFWOPageHeader.inc and PDFWOPrint.php and remove some redundant codes in PDFWOPrint.php
Modified Paths:
--------------
trunk/PDFWOPrint.php
trunk/includes/PDFWOPageHeader.inc
Modified: trunk/PDFWOPrint.php
===================================================================
--- trunk/PDFWOPrint.php 2014-04-19 03:44:45 UTC (rev 6687)
+++ trunk/PDFWOPrint.php 2014-04-20 02:49:36 UTC (rev 6688)
@@ -1,7 +1,7 @@
<?php
/* $Id: PDFWOPrint.php 6146 $*/
-
+/* Currently this file only support one finished items produced work orders. Multiple items not supported yet */
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
if (isset($_GET['WO'])) {
@@ -22,70 +22,13 @@
if (isset($_GET['PrintLabels'])) {
$PrintLabels = $_GET['PrintLabels'];
} elseif (isset($_POST['PrintLabels'])){
- $PrintLabels = $_POST['LabelItem'];
-} else {
- unset($LabelItem);
-}
-
-if (isset($_GET['LabelItem'])) {
- $LabelItem = $_GET['LabelItem'];
-} elseif (isset($_POST['LabelItem'])){
- $LabelItem = $_POST['LabelItem'];
-} else {
- unset($LabelItem);
-}
-if (isset($_GET['LabelDesc'])) {
- $LabelDesc = $_GET['LabelDesc'];
-} elseif (isset($_POST['LabelDesc'])){
- $LabelDesc = $_POST['LabelDesc'];
-} else {
- unset($LabelDesc);
-}
-if (isset($_GET['LabelLot'])) {
- $LabelLot = $_GET['LabelLot'];
-} elseif (isset($_POST['LabelLot'])){
- $LabelLot = $_POST['LabelLot'];
-} else {
- unset($LabelLot);
-}
-if (isset($_GET['NoOfBoxes'])) {
- $NoOfBoxes = $_GET['NoOfBoxes'];
-} elseif (isset($_POST['NoOfBoxes'])){
- $NoOfBoxes = $_POST['NoOfBoxes'];
-} else {
- unset($NoOfBoxes);
-}
-if (isset($_GET['LabelsPerBox'])) {
- $LabelsPerBox = $_GET['LabelsPerBox'];
-} elseif (isset($_POST['LabelsPerBox'])){
- $LabelsPerBox = $_POST['LabelsPerBox'];
-} else {
- unset($LabelsPerBox);
-}
-if (isset($_GET['QtyPerBox'])) {
- $QtyPerBox = $_GET['QtyPerBox'];
-} elseif (isset($_POST['QtyPerBox'])){
- $QtyPerBox = $_POST['QtyPerBox'];
-} else {
- unset($QtyPerBox);
-}
-if (isset($_GET['LeftOverQty'])) {
- $LeftOverQty = $_GET['LeftOverQty'];
-} elseif (isset($_POST['LeftOverQty'])){
- $LeftOverQty = $_POST['LeftOverQty'];
-} else {
- unset($LeftOverQty);
-}
-if (isset($_GET['PrintLabels'])) {
- $PrintLabels = $_GET['PrintLabels'];
-} elseif (isset($_POST['PrintLabels'])){
$PrintLabels = $_POST['PrintLabels'];
} else {
$PrintLabels="Yes";
}
-
-if (!isset($_GET['WO']) AND !isset($_POST['WO'])) {
+
+if (!isset($SelectedWO)) {
$Title = _('Select a Work Order');
include('includes/header.inc');
echo '<div class="centre"><br /><br /><br />';
@@ -109,12 +52,7 @@
echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a></div>';
exit;
}
-if (isset($_GET['WO'])) {
- $SelectedWO = $_GET['WO'];
-}
-elseif (isset($_POST['WO'])) {
- $SelectedWO = $_POST['WO'];
-}
+
$Title = _('Print Work Order Number') . ' ' . $SelectedWO;
if (isset($_POST['PrintOrEmail']) AND isset($_POST['EmailTo'])) {
if ($_POST['PrintOrEmail'] == 'Email' AND !IsEmailAddress($_POST['EmailTo'])) {
@@ -241,6 +179,8 @@
$WOHeader['deladd6'] = str_pad('', 15, 'x');
$WOHeader['stockid'] = str_pad('', 15, 'x');
$WOHeader['description'] = str_pad('', 50, 'x');
+ $WOHeader['wo'] = '99999999';
+ $WOHeader['loccode'] = str_pad('',5,'x');
} // end of If we are previewing the order
@@ -340,7 +280,7 @@
$WOLine[$i]['issued'] = 9999999.99;
$WOLine[$i]['decimalplaces'] = 2;
}
- if ($WOLine['decimalplaces'] != NULL) {
+ if ($WOLine[$i]['decimalplaces'] != NULL) {
$DecimalPlaces = $WOLine[$i]['decimalplaces'];
}
else {
@@ -444,6 +384,7 @@
include('includes/PDFWOPageHeader.inc');
} //end if need a new page headed up
} /*end if there are order details to show on the order - or its a preview*/
+ $FooterPrintedInPage = 0;
if($FooterPrintedInPage == 0){
$LeftOvers = $pdf->addText($FormDesign->SignedDate->x,$Page_Height-$FormDesign->SignedDate->y,$FormDesign->SignedDate->FontSize, _('Date : ') . '______________');
$LeftOvers = $pdf->addText($FormDesign->SignedBy->x,$Page_Height-$FormDesign->SignedBy->y,$FormDesign->SignedBy->FontSize, _('Signed for: ').'____________________________________');
@@ -568,7 +509,7 @@
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- if ($ViewingOnly == 1) {
+ if (isset($ViewingOnly) and $ViewingOnly == 1) {
echo '<input type="hidden" name="ViewingOnly" value="1" />';
} //$ViewingOnly == 1
echo '<br /><br />';
@@ -582,7 +523,7 @@
if (!isset($_POST['PrintOrEmail'])) {
$_POST['PrintOrEmail'] = 'Print';
}
- if ($ViewingOnly != 0) {
+ if (isset($ViewingOnly) and $ViewingOnly != 0) {
echo '<option selected="selected" value="Print">' . _('Print') . '</option>';
}
else {
@@ -643,9 +584,12 @@
echo '<form action="PDFFGLabel.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- if ($ViewingOnly == 1) {
+ if (isset($ViewOnly) and $ViewingOnly == 1) {
echo '<input type="hidden" name="ViewingOnly" value="1" />';
} //$ViewingOnly == 1
+ if(!isset($EmailTo)){
+ $EmailTo='';
+ }
echo '<br /><br />';
echo '<input type="hidden" name="WO" value="' . $SelectedWO . '" />';
echo '<input type="hidden" name="StockID" value="' . $StockID . '" />';
@@ -665,7 +609,7 @@
if (!isset($_POST['PrintOrEmail'])) {
$_POST['PrintOrEmail'] = 'Print';
}
- if ($ViewingOnly != 0) {
+ if (isset($ViewingOnly) and $ViewingOnly != 0) {
echo '<option selected="selected" value="Print">' . _('Print') . '</option>';
}
else {
@@ -709,4 +653,4 @@
}
include('includes/footer.inc');
}
-?>
+?>
\ No newline at end of file
Modified: trunk/includes/PDFWOPageHeader.inc
===================================================================
--- trunk/includes/PDFWOPageHeader.inc 2014-04-19 03:44:45 UTC (rev 6687)
+++ trunk/includes/PDFWOPageHeader.inc 2014-04-20 02:49:36 UTC (rev 6688)
@@ -58,7 +58,7 @@
$pdf->addTextWrap($FormDesign->PackageQty->x,$Page_Height - $FormDesign->PackageQty->y, $FormDesign->PackageQty->Length, $FormDesign->PackageQty->FontSize, $PackQty,'right' );
$pdf->setFont('','');
-if ($PrintingComments ==true) {
+if (!empty($PrintingComments)) {
return;
}
$pdf->addText($FormDesign->MatReqTitle->x,$Page_Height - $FormDesign->MatReqTitle->y,$FormDesign->MatReqTitle->FontSize, _('Material Requirements for this Work Order'));
@@ -72,4 +72,4 @@
$pdf->addText($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y, $FormDesign->Headings->Column5->FontSize, _('Qty Issued') );
/*draw a rectangle to hold the data lines */
$pdf->Rectangle($FormDesign->DataRectangle->x, $Page_Height - $FormDesign->DataRectangle->y, $FormDesign->DataRectangle->width,$FormDesign->DataRectangle->height);
-?>
+?>
\ No newline at end of file
|