...
StartBalance := "Net Change";
StartBalanceLCY := "Net Change (LCY)";
SETFILTER("Date Filter",BankAccDateFilter);
END;
...
...
StartBalance := "Net Change";
StartBalanceLCY := "Net Change (LCY)";
// Add the following lines.
IF NOT PrintReversedEntries THEN BEGIN
BankAccLedgEntry.SETCURRENTKEY("Bank Account No.","Posting Date",Reversed);
COPYFILTER("Date Filter",BankAccLedgEntry."Posting Date");
BankAccLedgEntry.SETRANGE("Bank Account No.","No.");
BankAccLedgEntry.SETRANGE(Reversed,TRUE);
BankAccLedgEntry.CALCSUMS(Amount,"Amount (LCY)");
StartBalance := StartBalance - BankAccLedgEntry.Amount;
StartBalanceLCY := "Net Change (LCY)" - BankAccLedgEntry."Amount (LCY)";
END;
// End of the added lines.
SETFILTER("Date Filter",BankAccDateFilter);
END;
...