Navision 2017 - Inventory Valuation Report 1001

Hi All,

There is piece of code in report 1001:

Item - OnAfterGetRecord()

IsEmptyLine := TRUE;
ValueEntry.RESET;
ValueEntry.SETRANGE(“Item No.”,“No.”);
ValueEntry.SETFILTER(“Variant Code”,GETFILTER(“Variant Filter”));
ValueEntry.SETFILTER(“Location Code”,GETFILTER(“Location Filter”));
ValueEntry.SETFILTER(“Global Dimension 1 Code”,GETFILTER(“Global Dimension 1 Filter”));
ValueEntry.SETFILTER(“Global Dimension 2 Code”,GETFILTER(“Global Dimension 2 Filter”));

IF StartDate > 0D THEN BEGIN
ValueEntry.SETRANGE(“Posting Date”,0D,CALCDATE(’<-1D>’,StartDate));
ValueEntry.CALCSUMS(“Item Ledger Entry Quantity”,“Cost Amount (Actual)”,“Cost Amount (Expected)”,“Invoiced Quantity”);
AssignAmounts(ValueEntry,StartingInvoicedValue,StartingInvoicedQty,StartingExpectedValue,StartingExpectedQty,1);


LOCAL AssignAmounts(ValueEntry : Record “Value Entry”;VAR InvoicedValue : Decimal;VAR InvoicedQty : Decimal;VAR ExpectedValue : Decimal;VAR ExpectedQty : Decimal;Sign : Decimal)
InvoicedValue += ValueEntry.“Cost Amount (Actual)” * Sign;
InvoicedQty += ValueEntry.“Invoiced Quantity” * Sign;
ExpectedValue += ValueEntry.“Cost Amount (Expected)” * Sign;
ExpectedQty += ValueEntry.“Item Ledger Entry Quantity” * Sign;

What I am doing, in debugger I checked what filters are getting apply to Value Entry and then applying same filters on Value Entries page.

But in report InvoicedQty coming 8, while if i take data in excel from Value Entry and do total of Invoiced Quantity its coming 38.25

I am unable to understand. If someone explain will be helpfull.

If any other info required please tell.

Thanks in advance.

Set break-point here and check what filters do you have for ValueEntry.