Decimal overflow in Inventory...

Did anybody have Decimal overflow error message when performing Inventory => Periodic Activities => Adjust Cost - Item Entries? It crashes only on one Value Entry or Item Ledger Entry and I can’t understand why. Help![?]

Which version do do run?

Attain 3.10 with all Hotfixes!

Hi Arthur It seems this is a known issue.


  • Decimal overflow This error occurs in an endless loop. You can also search for decimal overflow in the NSS for code fixes and possible data corrections. Corrections for 3.10 should also be valid for 3.01. DE-690-496-RGXV can be helpful.

Is one reference, there are a couple of others if you can get onto the support system, simply because the cause and fixes differ depending upon the modules in use, although it seems the endless loop is always the cause. I cannot find any explicit fix to download, but they seem to talk around a fix being produced for 3.01 and the call for 3.10 is completed, so it would seem a fix has been issued.

The endless loop was fixed in 3.70. This is from the log refernced in the last post: The valuation date of transfer outbound value entry and transfer inbound value entry could differ. Therefore transfers could have impact on the average cost, which leaded to an endless loop. This has been changed. For average costed transfers the valuation date of the inbound transfer entry is now the valuation date of the outbound entry. The valuation date of consumptions was set to 31-12-9999, until the linked production order and output are finished and completely invoiced. The adjustment batch job calculated the correct valuation date and modified the consumption entries, but not entries with other entry types applied to a negative consumption. This has been changed. The valuation date of negative consumptions is now set during posting and not changed in the adjustment batch job. Codeunit 22: LOCAL PROCEDURE InsertApplEntry@12(ItemLedgEntryNo@1001 : Integer;InboundItemEntry@1002 : … ItemApplnEntry.Consumption := ItemJnlLine.“Entry Type” = ItemJnlLine.“Entry Type”::Consumption; IF NOT ItemApplnEntry.Consumption THEN BEGIN // delete line IF (NOT ItemApplnEntry.Consumption) OR (Quantity > 0) THEN BEGIN // add line ItemApplnEntry.“Output Is Adjusted” := TRUE; … LOCAL PROCEDURE InitValueEntry@5800(VAR ValueEntry@1000 : Record 5802;ItemLedgEntry@1001 : Record 32); … ValueEntry.“Valuation Date” := “Posting Date”; IF (“Entry Type” = “Entry Type”::Consumption) AND NOT Adjustment THEN // delete line IF (“Entry Type” = “Entry Type”::Consumption) AND (ItemLedgEntry.Quantity < 0) AND // add line NOT Adjustment // add line THEN // add line ValueEntry.“Valuation Date” := 31129999D; IF Description = Item.Description THEN ValueEntry.Description := ‘’ … LOCAL PROCEDURE InsertValueEntry@5801(VAR ValueEntry@1000 : Record 5802;VAR ItemLedgEntry@1001 … END; IF (“Entry Type” = “Entry Type”::Consumption) AND NOT Adjustment THEN // delete line IF (“Entry Type” = “Entry Type”::Consumption) AND (ItemLedgEntry.Quantity < 0) AND // add line NOT Adjustment // add line THEN // add line ValueEntry.“Valuation Date” := 31129999D; IF InvtSetup.“Automatic Cost Posting” AND ValueEntry.Inventoriable THEN PostInventoryToGL(ValueEntry); … LOCAL PROCEDURE InitTransValueEntry@5803(VAR ValueEntry@1000 : Record 5802;ItemLedgEntry@1001 : Record 32); … ValueEntry.“Invoiced Quantity” := ValueEntry.“Valued Quantity”; ValueEntry.“Location Code” := ItemLedgEntry.“Location Code”; ValueEntry.“Valuation Date” := ValueEntry.“Posting Date”; // delete line IF AverageTransfer THEN BEGIN ValueEntry.“Valuation Date” := GlobalValueEntry.“Valuation Date”; // add line ValuateAppliedAvgEntry(GlobalValueEntry,Item); ValueEntry.“Cost Amount (Actual)” := -“Cost Amount (Actual)”; ValueEntry.“Cost Amount (Actual) (ACY)” := -“Cost Amount (Actual) (ACY)”; ValueEntry.“Cost per Unit” := 0; ValueEntry.“Cost per Unit (ACY)” := 0; ValueEntry.“Valued By Average Cost” := TRUE; END ELSE BEGIN ValueEntry.“Valuation Date” := ValueEntry.“Posting Date”; // add line CalcAdjustedCost( OldItemLedgEntry,ValueEntry.“Valued Quantity”, AdjCostInvoicedLCY,AdjCostInvoicedACY,DiscountAmount); … Codeunit 5895: LOCAL PROCEDURE DistrMfgCost@23(ProdOrderLine@1000 : Record 5406;VAR ValueBuffer@1001 : … IF NOT IsReAdjmt THEN BEGIN NewValueEntry.FIND(’+’); SETRANGE(“Entry Type”,“Entry Type”::Consumption); IF FIND(’-’) THEN REPEAT IF Quantity < 0 THEN BEGIN // add line ConsumpValueEntry.SETCURRENTKEY(“Item Ledger Entry No.”); ConsumpValueEntry.SETRANGE(“Item Ledger Entry No.”,“Entry No.”); ConsumpValueEntry.SETRANGE(Inventoriable,TRUE); ConsumpValueEntry.FIND(’-’); SetValuationDate(ConsumpValueEntry); ConsumpValueEntry.MODIFYALL(“Valuation Date”,ConsumpValueEntry.“Valuation Date”); ItemApplnEntry.SETCURRENTKEY(“Item Ledger Entry No.”); ItemApplnEntry.SETRANGE(“Item Ledger Entry No.”,“Entry No.”); ItemApplnEntry.FIND(’-’); REPEAT ItemApplnEntry.“Output Is Adjusted” := TRUE; ItemApplnEntry.“Output Completely Invd. Date” := PostingDate; ItemApplnEntry.“Output Value Entry No.” := NewValueEntry.“Entry No.”; ItemApplnEntry.MODIFY; UNTIL ItemApplnEntry.NEXT = 0; END; // add line UNTIL NEXT = 0;