webERP Forum

Full Version: Stock adjustement: newmoh calculation in stockmoves
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[attachment=1085]Hello webERP folks

Weberp 4.14.1

We recently discovered an inventory item with inaccurate values for the column newqoh in the stockmoves table after an inventory adjustment was made:

1219 + 16 should lead to 1235 instead of 1248. (see attachment )

Stock movements recorded from sales and purchases update the newqoh with: newqoh[i] =newqoh[i-1] + + (or -) quantity   

Looking at the code in StockAdjustments.php,  line 200:
Code:
// Need to get the current location quantity will need it later for the stock movement
        $SQL="SELECT locstock.quantity
            FROM locstock
            WHERE locstock.stockid='" . $_SESSION['Adjustment' . $identifier]->StockID . "'
            AND loccode= '" . $_SESSION['Adjustment' . $identifier]->StockLocation . "'";


it doesn't take the previous newmoh, but the full locstock.

So if an order is out of quotation with the item but not invoiced (qoh <> locstock) and someone makes an inventory adjustment during that time we have the problem leading to an inflated newmoh

Let me know what you think

Also, inventory adjustments are not displayed in StockMovements.php, any reason why?

Thanks!