From: <tim...@us...> - 2010-10-27 16:00:08
|
Revision: 4115 http://web-erp.svn.sourceforge.net/web-erp/?rev=4115&view=rev Author: tim_schofield Date: 2010-10-27 16:00:02 +0000 (Wed, 27 Oct 2010) Log Message: ----------- When the quantities are changed, then the correct quantities are updated, and the date picker chooses the correct date Modified Paths: -------------- trunk/WorkOrderEntry.php trunk/doc/Change.log.html trunk/javascripts/MiscFunctions.js Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2010-10-27 15:34:11 UTC (rev 4114) +++ trunk/WorkOrderEntry.php 2010-10-27 16:00:02 UTC (rev 4115) @@ -295,35 +295,35 @@ if (!isset($_POST['NextLotSNRef'.$i])) { $_POST['NextLotSNRef'.$i]=''; } - if (isset($_POST['QtyRecd'.$i]) and $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ - $_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced - } - if ($_POST['RecdQty'.$i]==0 AND (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false)){ - /* can only change location cost if QtyRecd=0 */ - $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost + if (isset($_POST['QtyRecd'.$i]) and $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ + $_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced + } + if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ + /* can only change location cost if QtyRecd=0 */ + $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); - $CostRow = DB_fetch_row($CostResult); - if (is_null($CostRow[0])){ - $Cost =0; - prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); - } else { - $Cost = $CostRow[0]; - } - $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', + $CostRow = DB_fetch_row($CostResult); + if (is_null($CostRow[0])){ + $Cost =0; + prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); + } else { + $Cost = $CostRow[0]; + } + $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."', stdcost ='" . $Cost . "' WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; - } elseif (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false) { - $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', + } elseif (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false) { + $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; - } + } } //run the SQL from either of the above possibilites @@ -479,7 +479,7 @@ } echo '<tr><td class="label">' . _('Required By') . ':</td> - <td><input type="textbox" name="RequiredBy" size=12 maxlength=12 value="' . $_POST['RequiredBy'] . + <td><input type="text" name="RequiredBy" size=12 maxlength=12 value="' . $_POST['RequiredBy'] . '" class="date" alt="'.$_SESSION['DefaultDateFormat'].'"></td></tr>'; if (isset($WOResult)){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-10-27 15:34:11 UTC (rev 4114) +++ trunk/doc/Change.log.html 2010-10-27 16:00:02 UTC (rev 4115) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/10/10 Tim: WorkOrderEntry.php - When the quantities are changed, then the correct quantities are updated, and the date picker chooses the correct date.</p> <p>27/10/10 Tim: header.inc - Correct for non ascii characters</p> <p>27/10/10 Tim: Corrections to display multi line invoice narratives correctly</p> <p>26/10/10 Tim: Discountmatrix.php - Fix discount category bug</p> Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2010-10-27 15:34:11 UTC (rev 4114) +++ trunk/javascripts/MiscFunctions.js 2010-10-27 16:00:02 UTC (rev 4115) @@ -153,11 +153,16 @@ else dA=dS.split("/"); switch (dF){ -case "d/m/Y","d.m.Y": +case "d/m/Y": d=parseInt(dA[0],10); m=parseInt(dA[1],10)-1; y=parseInt(dA[2],10); break; +case "d.m.Y": +d=parseInt(dA[0],10); +m=parseInt(dA[1],10)-1; +y=parseInt(dA[2],10); +break; case "Y/m/d": d=parseInt(dA[2],10); m=parseInt(dA[1],10)-1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |