...
GLAccount.SETFILTER("Global Dimension 1 Filter",'');
GLAccount.SETFILTER("Global Dimension 2 Filter",'');
GLAccount.SETFILTER("Date Filter",AccountDateFilter);
// Delete the following lines.
GLAccount.CALCFIELDS("Net Change");
IF GLAccount."Net Change" <> 0 THEN
ExportFile.WRITE(STRSUBSTNO('#PSALDO %1 %2 %3 {} %4',0,FORMAT(FormatDate(GLAccount.GETRANGEMAX
(GLAccount."Date Filter")),6),GLAccount."No.",FormatAmount(GLAccount."Net Change")));
SetGLFilterPrev(GLAccount2);
GLAccount2.CALCFIELDS("Net Change");
IF GLAccount2."Net Change" <> 0 THEN
ExportFile.WRITE(STRSUBSTNO('#PSALDO %1 %2 %3 {} %4',-1,FORMAT(FormatDate(GLAccount2.GETRANGEMAX
(GLAccount2."Date Filter")),6),GLAccount2."No.",FormatAmount(GLAccount2."Net Change")));
// End of the lines.
IF AccountBudgetFilter <> '' THEN BEGIN
GLAccount.RESET;
GLAccount.SETFILTER("Global Dimension 1 Filter",'');
...
...
GLAccount.SETFILTER("Global Dimension 1 Filter",'');
GLAccount.SETFILTER("Global Dimension 2 Filter",'');
GLAccount.SETFILTER("Date Filter",AccountDateFilter);
// Add the following lines.
CurrMonthStartDate := GLAccount.GETRANGEMIN(GLAccount."Date Filter");
FilterEndDate := GLAccount.GETRANGEMAX(GLAccount."Date Filter");
REPEAT
CurrMonthEndDate := CALCDATE('<CM>',CurrMonthStartDate);
IF FilterEndDate < CurrMonthEndDate THEN
CurrMonthEndDate := FilterEndDate;
GLAccount.SETFILTER("Date Filter",'%1..%2',CurrMonthStartDate,CurrMonthEndDate);
GLAccount.CALCFIELDS("Net Change");
IF GLAccount."Net Change" <> 0 THEN
ExportFile.WRITE(
STRSUBSTNO('#PSALDO %1 %2 %3 {} %4',0,
FORMAT(FormatDate(GLAccount.GETRANGEMAX(GLAccount."Date Filter")),6),
GLAccount."No.",FormatAmount(GLAccount."Net Change")));
CurrMonthStartDate := CALCDATE('<CM+1D>',CurrMonthStartDate);
UNTIL CurrMonthEndDate >= FilterEndDate;
// End of the lines.
IF AccountBudgetFilter <> '' THEN BEGIN
GLAccount.RESET;
GLAccount.SETFILTER("Global Dimension 1 Filter",'');
...
...
GLAccount.SETFILTER("Global Dimension 2 Filter",'');
GLAccount.SETFILTER("Date Filter",AccountDateFilter);
GLAccount.SETFILTER("Budget Filter",AccountBudgetFilter);
// Delete the following lines.
GLAccount.CALCFIELDS("Budgeted Amount");
IF GLAccount."Budgeted Amount" <> 0 THEN
ExportFile.WRITE(STRSUBSTNO('#PBUDGET %1 %2 %3 {} %4',0,FORMAT(FormatDate(GLAccount.GETRANGEMAX
(GLAccount."Date Filter")),6),GLAccount."No.",FormatAmount(GLAccount."Budgeted Amount")));
SetGLFilterPrev(GLAccount2);
GLAccount2.CALCFIELDS("Budgeted Amount");
IF GLAccount2."Budgeted Amount" <> 0 THEN
ExportFile.WRITE(STRSUBSTNO('#PBUDGET %1 %2 %3 {} %4',-1,FORMAT(FormatDate(GLAccount2.GETRANGEMAX
(GLAccount2."Date Filter")),6),GLAccount2."No.",FormatAmount(GLAccount2."Budgeted Amount")));
// End of the lines.
END;
DialogWindow.UPDATE(7,GLAccount."No.");
DialogWindow.UPDATE(8,ROUND(Counter / CounterTotal*10000,1));
...
...
GLAccount.SETFILTER("Global Dimension 2 Filter",'');
GLAccount.SETFILTER("Date Filter",AccountDateFilter);
GLAccount.SETFILTER("Budget Filter",AccountBudgetFilter);
// Add the following lines.
CurrMonthStartDate := GLAccount.GETRANGEMIN(GLAccount."Date Filter");
FilterEndDate := GLAccount.GETRANGEMAX(GLAccount."Date Filter");
REPEAT
CurrMonthEndDate := CALCDATE('<CM>',CurrMonthStartDate);
IF CurrMonthEndDate > FilterEndDate THEN
CurrMonthEndDate := FilterEndDate;
GLAccount.SETFILTER("Date Filter",'%1..%2',CurrMonthStartDate,CurrMonthEndDate);
GLAccount.CALCFIELDS("Budgeted Amount");
IF GLAccount."Budgeted Amount" <> 0 THEN
ExportFile.WRITE(
STRSUBSTNO('#PBUDGET %1 %2 %3 {} %4',0,
FORMAT(FormatDate(GLAccount.GETRANGEMAX(GLAccount."Date Filter")),6),
GLAccount."No.",FormatAmount(GLAccount."Budgeted Amount")));
CurrMonthStartDate := CALCDATE('<CM+1D>',CurrMonthStartDate);
UNTIL CurrMonthEndDate >= FilterEndDate;
// End of the lines.
END;
DialogWindow.UPDATE(7,GLAccount."No.");
DialogWindow.UPDATE(8,ROUND(Counter / CounterTotal*10000,1));
...