Item Cost Calculation

akey
Member Posts: 5
NAV 5.0 SP1
This post will be probably interesting for those who uses method "FIFO",
"LIFO" or Average and there are lots with enough remaining quantity
in this case there is no sense to use "Adjust Cost - Item Entries" report
You'll need to insert into codeunit 22 (function "InsertValueEntry")
a following section of code:
before:
where:
Thus you are getting a real Cost right away after posting.
It's strictly recommended to make a preliminary testing
of amended code
This post will be probably interesting for those who uses method "FIFO",
"LIFO" or Average and there are lots with enough remaining quantity
in this case there is no sense to use "Adjust Cost - Item Entries" report
You'll need to insert into codeunit 22 (function "InsertValueEntry")
a following section of code:
IF ("Entry Type" = "Entry Type"::Sale) OR ("Entry Type" = "Entry Type"::"Negative Adjmt.") THEN BEGIN QtyLE := 0; CostLE := 0; ApplItemLERec.RESET; ApplItemLERec.SETCURRENTKEY("Item Ledger Entry No.","Output Completely Invd. Date"); ApplItemLERec.SETRANGE("Item Ledger Entry No.", ItemLedgEntry."Entry No."); IF ApplItemLERec.FIND('-') THEN REPEAT ItemLERec.GET(ApplItemLERec."Inbound Item Entry No."); ItemLERec.CALCFIELDS("Cost Amount (Actual)"); QtyLE += ApplItemLERec.Quantity; IF ItemLERec.Quantity <> 0 THEN CostLE += ApplItemLERec.Quantity * ItemLERec."Cost Amount (Actual)" / ItemLERec.Quantity; UNTIL ApplItemLERec.NEXT = 0; IF QtyLE <> 0 THEN BEGIN ValueEntry."Cost per Unit" := CostLE / QtyLE; ValueEntry."Cost Amount (Actual)" := ValueEntry."Invoiced Quantity" * ValueEntry."Cost per Unit"; END; END;
before:
IF InvtSetup."Automatic Cost Posting" AND ValueEntry.Inventoriable THEN IF PostEntry(ValueEntry,ItemJnlLine) THEN PostInventoryToGL(ValueEntry);
where:
ApplItemLERec Record Item Application Entry ItemLERec Record Item Ledger Entry VERec Record Value Entry CostLE Decimal QtyLE Decimal
Thus you are getting a real Cost right away after posting.
It's strictly recommended to make a preliminary testing
of amended code
0
Comments
-
I would like to bring up the subject if Alain Krikilion is not against
it's the Adjust Cost - Item Entries batch job (report ID 795)
By the way, I would like to know - whether there are remarks,
suggestions on previous post on Item Cost Calculation
Any posts are welcome.
So, let's get down to business
If you are not using the Adjust Cost - Item Entries batch job (report ID 795)
not regularly or with a large interval be carefull, as there can be such situation:
Imagine: A book-keeping closed a period and handed over declarations in a tax and etc
You start then the Adjust Cost - Item Entries batch job (report ID 795)
processing brings in the operations of correction in the closed period,
that can cause the change of amount of turns and balances exactly in this closed period.
And so what ya gonna do when they come for you. (c) Not mine
I am not quite sure, but if I do not wrong, the same situation is
possible with the Adjust Exchange Rates batch job (report ID 595), if you use a few currencies.
I didn't check this as currently we use only LCY.
At least in NAV 3.10 I rewrote the Adjust Exchange Rates batch job
Hope this post will be useful to somebody0
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