From: <tim...@us...> - 2010-06-06 08:33:38
|
Revision: 3481 http://web-erp.svn.sourceforge.net/web-erp/?rev=3481&view=rev Author: tim_schofield Date: 2010-06-06 08:33:32 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Zhiguo Yuan: WorkOrderReceive.php - Change to make rollup costs change when more labour or overheadcosts change Modified Paths: -------------- trunk/WorkOrderReceive.php trunk/doc/Change.log.html Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2010-06-05 12:54:55 UTC (rev 3480) +++ trunk/WorkOrderReceive.php 2010-06-06 08:33:32 UTC (rev 3481) @@ -191,7 +191,9 @@ //Need to check this against the current standard cost and do a cost update if necessary $sql = "SELECT materialcost+labourcost+overheadcost AS cost, - sum(quantity) AS totalqoh + sum(quantity) AS totalqoh, + labourcost, + overheadcost FROM stockmaster INNER JOIN locstock ON stockmaster.stockid=locstock.stockid WHERE stockmaster.stockid='" . $_POST['StockID'] . "' @@ -202,14 +204,14 @@ $ItemResult = DB_query($sql,$db); $ItemCostRow = DB_fetch_array($ItemResult); - if ($Cost != $ItemCostRow['cost']){ //the cost roll-up cost <> standard cost + if (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) != $ItemCostRow['cost']){ //the cost roll-up cost <> standard cost if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $ItemCostRow['totalqoh']!=0){ $CostUpdateNo = GetNextTransNo(35, $db); $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - $ValueOfChange = $ItemCostRow['totalqoh'] * ($Cost - $ItemCostRow['cost']); + $ValueOfChange = $ItemCostRow['totalqoh'] * (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) - $ItemCostRow['cost']); $SQL = "INSERT INTO gltrans (type, typeno, @@ -252,8 +254,8 @@ $SQL = "UPDATE stockmaster SET materialcost=" . $Cost . ", - labourcost=0, - overheadcost=0, + labourcost=" . $ItemCostRow['labourcost'] . ", + overheadcost=" . $ItemCostRow['overheadcost'] . ", lastcost=" . $ItemCostRow['cost'] . " WHERE stockid='" . $_POST['StockID'] . "'"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-06-05 12:54:55 UTC (rev 3480) +++ trunk/doc/Change.log.html 2010-06-06 08:33:32 UTC (rev 3481) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>06/06/10 Zhiguo Yuan: WorkOrderReceive.php - Change to make rollup costs change when more labour or overheadcosts change</p> <p>03/06/10 Phil: Added a bit of error trapping to ensure customer/branch set up when going into CounterSales.php</p> <p>03/06/10 Otandeka: Locations.php used explode function rather than substr function to split the cashsalecustomer to get Branch and Debtorno codes - also changed format to just a hypen between debtorno and branchcode</p> <p>03/06/10 Otandeka: CounterSales php changed to use explode to get branch and debtorno from cashsalecustomer - and changed format to debtorno-branchcode and rather than debtorno - branchcode (spaces removed)</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |