Hi there,
I'm just checking the item revaluation for our year's end closing and I came across a possible bug. It concerns the entries allowed for revaluation. As it is now coded in R5899 "Calculate Inventory Value", not all item ledger entries are considered for the inventory value at date.
When calculated by item, the item ledger entries are traversed and written into a buffer:
InsertValJnlBuffer(
ItemLedgEntry."Item No.",ItemLedgEntry."Variant Code",
ItemLedgEntry."Location Code",RemQty,
ItemLedgEntry.CalculateRemInventoryValue(ItemLedgEntry."Entry No.",ItemLedgEntry.Quantity,RemQty,
IncludeExpectedCost AND NOT ItemLedgEntry."Completely Invoiced",PostingDate));
Function IncludeEntryInCalc(ItemLedgEntry : Record "Item Ledger Entry";PostingDate : Date;IncludeExpectedCost : Boolean) : Boolean
WITH ItemLedgEntry DO BEGIN
IF IncludeExpectedCost THEN
EXIT("Posting Date" IN [0D..PostingDate]);
EXIT("Completely Invoiced" AND ("Last Invoice Date" IN [0D..PostingDate]));
END;
And the function in Item Ledger Entry:
CalculateRemQuantity(ItemLedgEntryNo : Integer;PostingDate : Date) : Decimal
ItemApplnEntry.SETCURRENTKEY("Inbound Item Entry No.");
ItemApplnEntry.SETRANGE("Inbound Item Entry No.",ItemLedgEntryNo);
RemQty := 0;
IF ItemApplnEntry.FINDSET THEN
REPEAT
IF ItemApplnEntry."Posting Date" <= PostingDate THEN
RemQty += ItemApplnEntry.Quantity;
UNTIL ItemApplnEntry.NEXT = 0;
EXIT(RemQty);
Basically, what you can see is that the remaining quantity of the item ledger entry is calculated at valuation date by traversing the item application entries, regardless of the "open" flag of the item ledger entry. But it is not handled this way when the completely invoiced state is checked, or the last invoicing date. But these are also time-dependent. This leads to some questions:
- The quantity to be revalued differs from the physical inventory of this date. But why? Because you have entries not completely invoiced (what about partially invoiced?), so you can't touch them.
- If an item ledger entry gets completely invoiced at a later date and you want to revaluate at an earlier date (year's end closing), you can't do this. I have not understood why, since it's a valuation at date. Adjust Cost Item Entries would take care of subsequent invoices and adjust the changed cost accordingly.
It is pretty difficult to allocate a global revaluation to the items this way, since your base for the revaluation doesn't match with the physical inventory. and it prompts questions from auditors.
Can anybody shed some light on this? Thanks in advance.
with best regards
*This post is locked for comments