Item Age Composition by Value

couberpu
Member Posts: 317
Good Morning,
Has anybody had problems with report 5808, Item age composition - value, using FIFO as costing method? My total inventoryvalue is much less than the total of invtvalue! :?:
I did a quick and dirty fix in CalcUnitCost function to produce the report for the bank. But I am not sure is this a existing Navision issue or something I did. Here is what I think went wrong:
then in function CalcUnitCost:
the last 2 line in function CalcUnitCost seems to be the problem. So I comment them out and make the change to Item Ledger Entry - AfterGetRecord
I knew this is not the correct way of fixing it. Can anyone help me with this?
Thanks a Million,
CouberPu :oops:
Has anybody had problems with report 5808, Item age composition - value, using FIFO as costing method? My total inventoryvalue is much less than the total of invtvalue! :?:
I did a quick and dirty fix in CalcUnitCost function to produce the report for the bank. But I am not sure is this a existing Navision issue or something I did. Here is what I think went wrong:
Item Ledger Entry - OnAfterGetRecord() ValueEntry.SETRANGE("Item Ledger Entry No.","Entry No."); CalcRemainingQty; IF "Remaining Quantity" <> 0 THEN BEGIN IF Item."Costing Method" = Item."Costing Method"::Average THEN TotalInvtValue := AverageCost * TotalInvtQty ELSE BEGIN CalcUnitCost; TotalInvtValue := UnitCost * TotalInvtQty; END; FOR i := 1 TO 5 DO IF ("Posting Date" > PeriodStartDate[i]) AND ("Posting Date" <= PeriodStartDate[i + 1]) THEN IF Item."Costing Method" = Item."Costing Method"::Average THEN InvtValue[i] := AverageCost * InvtQty[i]; END;
then in function CalcUnitCost:
CalcUnitCost() WITH ValueEntry DO BEGIN TotalInvoicedQty := 0; ExpectedUnitCost := 0; UnitCost := 0; FOR i := 1 TO 5 DO BEGIN InvtValue[i] := 0; ExpectedInvtValue[i] := 0; END; IF FIND('-') THEN BEGIN REPEAT TotalInvoicedQty := TotalInvoicedQty + "Invoiced Quantity"; FOR i := 1 TO 5 DO IF ("Posting Date" > PeriodStartDate[i]) AND ("Posting Date" <= PeriodStartDate[i + 1]) THEN BEGIN InvtValue[i] := InvtValue[i] + "Cost Amount (Actual)"; ExpectedInvtValue[i] := ExpectedInvtValue[i] + "Cost Amount (Expected)" END; ExpectedUnitCost := ExpectedUnitCost + "Cost Amount (Expected)"; UnitCost := UnitCost + "Cost Amount (Actual)"; UNTIL NEXT = 0; IF TotalInvoicedQty <> 0 THEN UnitCost := UnitCost / TotalInvoicedQty; ExpectedUnitCost := ExpectedUnitCost / "Item Ledger Entry".Quantity; END; IF TotalInvoicedQty <> "Item Ledger Entry".Quantity THEN BEGIN UnitCost := ExpectedUnitCost; FOR i := 1 TO 5 DO InvtValue[i] := ExpectedInvtValue[i]; END; END;
the last 2 line in function CalcUnitCost seems to be the problem. So I comment them out and make the change to Item Ledger Entry - AfterGetRecord
Item Ledger Entry - OnAfterGetRecord() ValueEntry.SETRANGE("Item Ledger Entry No.","Entry No."); CalcRemainingQty; IF "Remaining Quantity" <> 0 THEN BEGIN IF Item."Costing Method" = Item."Costing Method"::Average THEN TotalInvtValue := AverageCost * TotalInvtQty ELSE BEGIN CalcUnitCost; TotalInvtValue := UnitCost * TotalInvtQty; FOR i := 1 TO 5 DO InvtValue[i] := UnitCost * InvtQty[i]; END; FOR i := 1 TO 5 DO IF ("Posting Date" > PeriodStartDate[i]) AND ("Posting Date" <= PeriodStartDate[i + 1]) THEN IF Item."Costing Method" = Item."Costing Method"::Average THEN InvtValue[i] := AverageCost * InvtQty[i]; END;
I knew this is not the correct way of fixing it. Can anyone help me with this?
Thanks a Million,
CouberPu :oops:
0
Comments
-
Yeah, the item age composition report is only used as a reference. It's not meant to be tied to the G/L or the inventory valuation report.
In order to tie to the G/L and the actual inventory valuation, you'll need to copy and paste the AdjustItemLedgEntryToAsOfDate function from the Inventory Valuation report to this report.
Then you would call the function to backdate the item ledger to the As of Date.
Takes a bit of figuring out, but it's doable.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions