28. August 2009 14:25
IF CurrentDate <> WORKDATE THEN BEGIN
CurrentDate := WORKDATE;
DateFilterCalc.CreateAccountingPeriodFilter(CustDateFilter[1],CustDateName[1],CurrentDate,0);
DateFilterCalc.CreateFiscalYearFilter(CustDateFilter[2],CustDateName[2],CurrentDate,0);
DateFilterCalc.CreateFiscalYearFilter(CustDateFilter[3],CustDateName[3],CurrentDate,-1);
DateFilterCalc.CreateFiscalYearFilter(CustDateFilter[4],CustDateName[4],CurrentDate,-2);
END;
FOR i := 1 TO 4 DO BEGIN
"Value Entry".SETCURRENTKEY("Gen. Prod. Posting Group","Item Ledger Entry Type","Source No.","Posting Date");
"Value Entry".SETRANGE("Value Entry"."Item Ledger Entry Type",1);
SETFILTER("Value Entry"."Posting Date",CustDateFilter[i]);
"Value Entry".CALCSUMS("Value Entry"."Sales Amount (Actual)");
SalesAmount[i] := "Value Entry"."Sales Amount (Actual)";
END;
28. August 2009 14:54
"Value Entry".Setrange("Gen. Prod. Posting Group", "Gen. Prod. Posting Group");
28. August 2009 14:59
"Value Entry".SETCURRENTKEY("Gen. Prod. Posting Group","Item Ledger Entry Type","Source No.","Posting Date");
"Value Entry".SETRANGE("Value Entry"."Item Ledger Entry Type",1); // BTW: Es sollten immer die Namen verwendet werden ;-)
ValueEntry.SETRANGE(ValueEntry."Gen. Prod. Posting Group",ProduktBuchGprnFilter);
ValueEntry.SETFILTER("Value Entry"."Posting Date",CustDateFilter[i]);
"Value Entry".CALCSUMS("Value Entry"."Sales Amount (Actual)");
SalesAmount[i] := "Value Entry"."Sales Amount (Actual)";
28. August 2009 15:25
28. August 2009 15:49
Findlast; // (optional; s.o.)
"Value Entry".Setrange("Gen. Prod. Posting Group") // hiermit wird der Filter auf "Gen. Prod. Posting Group" wieder aufgehoben
28. August 2009 16:06