Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MRP shortages includes "Service/Labour" items
06-29-2019, 01:08 AM, (This post was last modified: 06-29-2019, 01:13 AM by TimSchofield.)
#2
RE: MRP shortages includes "Service/Labour" items
Hi Alan, probably the easiest way of achieving this is to change the SQL at approx line 114 of MRPShortages.php to read:

PHP Code:
      $sql "SELECT stockmaster.stockid,
        stockmaster.description,
        stockmaster.mbflag,
        stockmaster.actualcost,
        stockmaster.decimalplaces,
        (stockmaster.materialcost + stockmaster.labourcost +
         stockmaster.overheadcost ) as computedcost,
        demandtotal.demand,
        supplytotal.supply,
       (demandtotal.demand - supplytotal.supply) *
       (stockmaster.materialcost + stockmaster.labourcost +
        stockmaster.overheadcost ) as extcost
           FROM stockmaster
             LEFT JOIN demandtotal ON stockmaster.stockid = demandtotal.part
             LEFT JOIN supplytotal ON stockmaster.stockid = supplytotal.part
             LEFT JOIN stockcategory ON stockmaster.categoryid = stockcategory.categoryid "
             
$SQLCategory .
            
"WHERE stockcategory.stocktype<>'L'
             GROUP BY stockmaster.stockid,
               stockmaster.description,
               stockmaster.mbflag,
               stockmaster.actualcost,
               stockmaster.decimalplaces,
               stockmaster.materialcost,
               stockmaster.labourcost,
               stockmaster.overheadcost,
               computedcost,
               supplytotal.supply,
               demandtotal.demand "
               
$SQLHaving .
               
" ORDER BY '" $_POST['Sort'] . "'"

Note the addition of the "WHERE" clause. We should also probably take out any categories from the drop down list where the stocktype is set to "L", (and possibly "D"??) Unless anybody knows of a use case where they should be included?

Tim
Reply


Messages In This Thread
RE: MRP shortages includes "Service/Labour" items - by TimSchofield - 06-29-2019, 01:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)