Question about codeunit 5895

Hi! I’ve a problem with codeunit 5895. In function ReCalcAverageCost system do not change InvoicedQty, I belive that it should. ValueEntry.CALCSUMS(“Invoiced Quantity”,“Cost Amount (Actual)”,“Cost Amount (Actual) (ACY)”); InvoicedQty := ValueEntry.“Invoiced Quantity”; AdjustedCost := ValueEntry.“Cost Amount (Actual)”; AdjustedCostACY := ValueEntry.“Cost Amount (Actual) (ACY)”; ValueEntry.SETRANGE(“Valuation Date”,ValuationDate); ValueEntry.SETFILTER(“Entry No.”,’>=%1’,NegEntryNo); IF ValueEntry.FIND(’-’) THEN REPEAT IF ValueEntry.“Partial Revaluation” AND (ValueEntry.“Entry No.” >= OutputEntryNo) THEN BEGIN AdjustedCost := AdjustedCost - ValueEntry.“Cost Amount (Actual)”; AdjustedCostACY := AdjustedCostACY - ValueEntry.“Cost Amount (Actual) (ACY)”; //!!! I think this string should be added: InvoicedQty := InvoicedQty - ValueEntry.“Invoiced Quantity”; //!!! END; IF ValueEntry.“Valued By Average Cost” AND (NOT ValueEntry.Adjustment OR (ValueEntry.“Applies-to Entry” >= NegEntryNo)) THEN BEGIN InvoicedQty := InvoicedQty - ValueEntry.“Invoiced Quantity”; AdjustedCost := AdjustedCost - ValueEntry.“Cost Amount (Actual)”; AdjustedCostACY := AdjustedCostACY - ValueEntry.“Cost Amount (Actual) (ACY)”; END; UNTIL ValueEntry.NEXT = 0; Thanks.

if you are right it should be this: REPEAT IF ValueEntry."Partial Revaluation" AND (ValueEntry."Entry No." >= OutputEntryNo) THEN BEGIN AdjustedCost := AdjustedCost - ValueEntry."Cost Amount (Actual)"; AdjustedCostACY := AdjustedCostACY - ValueEntry."Cost Amount (Actual) (ACY)"; END; IF ValueEntry."Valued By Average Cost" AND (NOT ValueEntry.Adjustment OR (ValueEntry."Applies-to Entry" >= NegEntryNo)) THEN BEGIN AdjustedCost := AdjustedCost - ValueEntry."Cost Amount (Actual)"; AdjustedCostACY := AdjustedCostACY - ValueEntry."Cost Amount (Actual) (ACY)"; END; InvoicedQty := InvoicedQty - ValueEntry."Invoiced Quantity"; UNTIL ValueEntry.NEXT = 0; But only if this is the right solution, I do not have the time to dive into you problem.

I find no information much about the average cost and its evaluation based on varoius transaction. Has somebody got material about the same, please do forward me. Even I found few problems on item average cost with 2.6 version database. padmanabh_hv@yahoo.com