Hi all,
I have a task to customize Inventory Valuation report. There are some differences from original report:
.Date filter should affect on GL Entry (not on Item Ledger Entry and Value Entry table as original)
.From such data, we can find the Value Entry No. and find it on Value Entry table to reconcile.
Could you please help me code this customize?! Thanks in advance!
Best Regards,
0
Comments
http://www.BiloBeauty.com
http://www.autismspeaks.org
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I designed the Data Item structure:
.Item
.Value Entry (named InvoicedValueLedgerEntries)
And write on Value Entry - OnAfterGetRecord() following code:
/////////////////////////////////////////////////////////////////////////////
//Getting GLAccount for Inventory
AdjCost := 0;
InvPostSetup.SETRANGE("Invt. Posting Group Code", Item."Inventory Posting Group");
IF InvPostSetup.FINDFIRST THEN
InvAcc := InvPostSetup."Inventory Account";
//Filt Value Entry
InvoicedValueLedgerEntries.SETRANGE("Inventory Posting Group",Item."Inventory Posting Group");
InvoicedValueLedgerEntries.SETRANGE(InvoicedValueLedgerEntries."Item No.",Item."No.");
//Filt G/L Entry with Posting Date & G/L Account
GLEntry.SETRANGE("Posting Date",0D,EndingDate);
GLEntry.SETRANGE("G/L Account No.",InvAcc);
IF GLEntry.FINDSET THEN
REPEAT
InvoicedValueLedgerEntries.SETRANGE("Entry No.",GLEntry."Value Entry No.");
IF InvoicedValueLedgerEntries.FINDFIRST THEN
AdjCost := AdjCost + "Adjusted Cost";
UNTIL GLEntry.NEXT = 0;
TotalAdjCost := TotalAdjCost + AdjCost;
/////////////////////////////////////////////////////////////////////////////
It shows exactly result which I want but I think this code is not good performance and I should calculate much filed (quantity, amount at begin period, in period...). Any suggestion for improve performance or design? Thanks!
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
It's ok now. Thanks Alex!