[Weberp-svn] SF.net SVN: weberp:[8061] trunk/WorkOrderEntry.php
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-09-03 16:07:47
|
Revision: 8061 http://weberp.svn.sourceforge.net/weberp/?rev=8061&view=rev Author: tim_schofield Date: 2011-09-03 16:07:41 +0000 (Sat, 03 Sep 2011) Log Message: ----------- Code layout changes Modified Paths: -------------- trunk/WorkOrderEntry.php Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-09-03 16:07:31 UTC (rev 8060) +++ trunk/WorkOrderEntry.php 2011-09-03 16:07:41 UTC (rev 8061) @@ -174,43 +174,43 @@ if (isset($NewItem) AND isset($_POST['WO'])){ - $InputError=false; - $CheckItemResult = DB_query("SELECT mbflag, + $InputError=false; + $CheckItemResult = DB_query("SELECT mbflag, eoq, controlled - FROM stockmaster - WHERE stockid='" . $NewItem . "'", - $db); - if (DB_num_rows($CheckItemResult)==1){ - $CheckItemRow = DB_fetch_array($CheckItemResult); - if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity - $EOQ = 0; - } else { - if (!isset($ReqQty)) { - $ReqQty=$CheckItemRow['eoq']; - } - $EOQ = $ReqQty; + FROM stockmaster + WHERE stockid='" . $NewItem . "'", + $db); + if (DB_num_rows($CheckItemResult)==1){ + $CheckItemRow = DB_fetch_array($CheckItemResult); + if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity + $EOQ = 0; + } else { + if (!isset($ReqQty)) { + $ReqQty=$CheckItemRow['eoq']; } - if ($CheckItemRow['mbflag']!='M'){ - prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); - $InputError=true; - } - } else { - prnMsg(_('The item selected cannot be found in the database'),'error'); - $InputError = true; - } - $CheckItemResult = DB_query("SELECT stockid + $EOQ = $ReqQty; + } + if ($CheckItemRow['mbflag']!='M'){ + prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); + $InputError=true; + } + } else { + prnMsg(_('The item selected cannot be found in the database'),'error'); + $InputError = true; + } + $CheckItemResult = DB_query("SELECT stockid FROM woitems WHERE stockid='" . $NewItem . "' AND wo='" .$_POST['WO'] . "'", $db); - if (DB_num_rows($CheckItemResult)==1){ - prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); - $InputError=true; - } + if (DB_num_rows($CheckItemResult)==1){ + prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); + $InputError=true; + } - if ($InputError==false){ + if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |