|
From: <dai...@us...> - 2014-06-02 03:25:06
|
Revision: 6742
http://sourceforge.net/p/web-erp/reponame/6742
Author: daintree
Date: 2014-06-02 03:25:01 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
fix WO entry costing calculations to take into account BOM effectivity dates
Modified Paths:
--------------
trunk/WorkOrderEntry.php
trunk/doc/Change.log
Modified: trunk/WorkOrderEntry.php
===================================================================
--- trunk/WorkOrderEntry.php 2014-06-01 08:16:22 UTC (rev 6741)
+++ trunk/WorkOrderEntry.php 2014-06-02 03:25:01 UTC (rev 6742)
@@ -270,7 +270,9 @@
INNER JOIN bom
ON stockmaster.stockid=bom.component
WHERE bom.parent='" . $NewItem . "'
- AND bom.loccode='" . $_POST['StockLocation'] . "'",
+ AND bom.loccode='" . $_POST['StockLocation'] . "'
+ AND bom.effectivefrom<='" . Date('Y-m-d') . "'
+ AND bom.effectiveto>='" . Date('Y-m-d') . "'",
$db);
$CostRow = DB_fetch_array($CostResult);
if (is_null($CostRow['cost']) OR $CostRow['cost']==0){
@@ -369,11 +371,12 @@
/* 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
+ INNER JOIN bom ON stockmaster.stockid=bom.component
WHERE bom.parent='" . $_POST['OutputItem'.$i] . "'
- AND bom.loccode='" . $_POST['StockLocation'] . "'",
- $db);
+ AND bom.loccode='" . $_POST['StockLocation'] . "'
+ AND bom.effectivefrom<='" . Date('Y-m-d') . "'
+ AND bom.effectiveto>='" . Date('Y-m-d') . "'",
+ $db);
$CostRow = DB_fetch_array($CostResult);
if (is_null($CostRow['cost'])){
$Cost =0;
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2014-06-01 08:16:22 UTC (rev 6741)
+++ trunk/doc/Change.log 2014-06-02 03:25:01 UTC (rev 6742)
@@ -1,4 +1,5 @@
webERP Change Log
+2/6/14 Phil: Added bom effectivity dates into work order creation cost calculations - as spotted by Andrew Galuski
1/6/14 Phil: Fixed bug in POItems.php that resulted in an SQL error when the number of items from the search was zero after previous searches had returned records
27/05/14 RChacon: Add page title text and icon to import scripts. Page title text = menu option.
27/05/14 RChacon: Regroups the import scripts in the utility menu.
|