Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No Standard Cost in stockmoves for type17 (Adjustment)
07-16-2014, 02:10 AM,
#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;
Reply
07-16-2014, 08:43 PM,
#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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)