Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No Standard Cost in stockmoves for type17 (Adjustment)
07-16-2014, 02:10 AM
Post: #1
No Standard Cost in stockmoves for type17 (Adjustment)
I noticed the field standard cost is always 0 in Stock Adjustments.
Here is a fix to the code in StockAdjustments.php.
Code:
$SQL = "INSERT INTO stockmoves (stockid,
                    type,
                    transno,
                    loccode,
                    trandate,
                    prd,
                    reference,
                    qty,
                    newqoh,
                    standardcost) //add this line
            VALUES (
            '" . $_SESSION['Adjustment' . $identifier]->StockID . "',
                    17,
            '" . $AdjustmentNumber . "',
            '" . $_SESSION['Adjustment' . $identifier]->StockLocation . "',
            '" . $SQLAdjustmentDate . "',
            '" . $PeriodNo . "',
            '" . $_SESSION['Adjustment' . $identifier]->Narrative ."',
            '" . $_SESSION['Adjustment' . $identifier]->Quantity . "',
            '" . ($QtyOnHandPrior + $_SESSION['Adjustment' . $identifier]->Quantity) . "',
            '" . $_SESSION['Adjustment' . $identifier]->StandardCost . "' //add this line
            )";
Also, here is a query to show those stockmoves that need to be updated by using he standard cost ast the time from the gltrans record (Either via a script or manually)
SELECT stockmoves.stockid, description, qty, transno, amount, stockmaster.materialcost, ABS( amount / qty ) AS estcost, stockmoves.standardcost, gltrans.narrative
FROM `stockmoves`
INNER JOIN stockmaster ON stockmaster.stockid = stockmoves.stockid
INNER JOIN gltrans ON gltrans.type = stockmoves.type
AND gltrans.typeno = stockmoves.transno
WHERE standardcost =0
AND stockmoves.type =17
AND amount IS NOT NULL
AND amount <0;
Find all posts by this user
Quote this message in a reply
07-16-2014, 08:43 PM
Post: #2
RE: No Standard Cost in stockmoves for type17 (Adjustment)
Thanks Andrew, I've applied your fix

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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