Post Reply 
Thread Rating:
  • 0 Votes - 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 falkoner.)
Post: #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.materialcost + stockmaster.labourcost +
         stockmaster.overheadcost ) as computedcost,
       (demandtotal.demand - *
       (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,
               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?

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

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

Forum Jump:

User(s) browsing this thread: 1 Guest(s)