Sales Price List Report

Hi EveryBody,

I am doing a report to get the price changes for the month. But cannot filter to get the price list. Here is a sample of my price list in NAV 2013

Item No Starting Date Ending Date Unit Price
FG1000 5/1/2021 20/01/2021             120,000
FG1000 21/01/2021               130,000
FG2000 5/1/2021               150,000
FG3000 5/1/2021 25/01/2021             125,000
FG3000 26/01/2021               135,000

GetUnitPrice() : Decimal
Item.SETFILTER("Item Category Code", "Product Group"."Item Category Code");
Item.SETFILTER("Product Group Code", "Product Group".Code);
Item.SETFILTER(Blocked,'%1',FALSE);
IF Item.FIND('-') THEN  BEGIN
REPEAT
    SalesPrice.SETRANGE("Sales Type",  SalesPrice."Sales Type"::"Customer Price Group");
    SalesPrice.SETRANGE("Sales Code", Area."List Price Group");
    SalesPrice.SETRANGE("Item No.", Item."No.");
    SalesPrice.SETFILTER("Ending Date",'%1|>=%2',0D,BeginMonth);
    SalesPrice.SETFILTER("Ending Date",'%1..|%2',EndMonth,0D);
     IF SalesPrice.FIND('-') THEN BEGIN
      UnitPrice:= SalesPrice."Unit Price";
      ItemCode:=SalesPrice."Item No.";
      IF NOT SalesPrice."Price Includes VAT" THEN UnitPrice := UnitPrice*1.1;
      EXIT(UnitPrice);
    END;
UNTIL Item.NEXT = 0;
END;


Please help me fix the code. Thanks so much

Related
Recommended