zero movement inventory

karuchua
karuchua Member Posts: 151
am trying to create to create a form to output for me inventory with zero movement.
am trying to filter for the items and also check in the item ledger entries the last posting date then compare against my calculated months and end date.

in the code below but not working,what am i missing?
IF GReportDate = 0D THEN
   GReportDate := WORKDATE;

GYearFormular := '-' + FORMAT(GNoOfMonths) + 'M';

GMonthDates[1] := CALCDATE('CM',GReportDate);
GMonthDates[1] := CALCDATE(GYearFormular,GMonthDates[1]);
GMonthDates[2] := CALCDATE('-CM',GMonthDates[1]);

IF GMonthDates[2] < 080809D THEN
   GMonthDates[2] := 080809D + 3;

LItemLedgEntriesREC.RESET;
LItemLedgEntriesREC.SETCURRENTKEY("Item No.","Posting Date");
LItemLedgEntriesREC.SETRANGE("Item No.","No.");
LItemLedgEntriesREC.SETRANGE("Posting Date",GMonthDates[2],GReportDate);

IF LItemLedgEntriesREC.FINDLAST THEN BEGIN
  SETFILTER("Date Filter",'%1',GMonthDates[2]);
END;

Comments