...
EndingBalanceToPrint := "Net Change (LCY)";
END;
// Delete the following line.
SETRANGE("Date Filter",0D,FromDate);
CALCFIELDS("Net Change (LCY)");
IF PrintAmountsInLocal THEN BEGIN
BalanceToPrint := 0;
IF TempCurrency.FIND('-') THEN
REPEAT
...
TotalCustomers := TotalCustomers + 1; // count if there are no ledger filters
CustLedgerEntry2.RESET;
CustLedgerEntry2.SETCURRENTKEY("Customer No.");
CustLedgerEntry2.SETRANGE("Posting Date",FromDate,ToDate);
CustLedgerEntry2.SETRANGE("Customer No.","No.");
// Delete the following line.
BalanceTotal := BalanceTotal + "Net Change (LCY)"; // report total will be in $
END;
IF ISSERVICETIER THEN BEGIN
CustLedgerEntry2_Temp:=CustLedgerEntry2.FIND('-');
END;
...
...
EndingBalanceToPrint := "Net Change (LCY)";
END;
// Add the following line.
SETRANGE("Date Filter",0D,FromDateToPrint);
CALCFIELDS("Net Change (LCY)");
IF PrintAmountsInLocal THEN BEGIN
BalanceToPrint := 0;
IF TempCurrency.FIND('-') THEN
REPEAT
...
TotalCustomers := TotalCustomers + 1; // count if there are no ledger filters
CustLedgerEntry2.RESET;
CustLedgerEntry2.SETCURRENTKEY("Customer No.");
CustLedgerEntry2.SETRANGE("Posting Date",FromDate,ToDate);
CustLedgerEntry2.SETRANGE("Customer No.","No.");
// Add the following lines.
Cust.GET("No.");
Cust.COPYFILTERS(Customer);
IF FromDate = ToDate THEN
Cust.SETFILTER("Date Filter",'..%1',FromDate)
ELSE
Cust.SETFILTER("Date Filter",'<%1',FromDate);
Cust.CALCFIELDS("Net Change (LCY)");
BalanceTotal := BalanceTotal + Cust."Net Change (LCY)";
// End of the lines.
END;
IF ISSERVICETIER THEN BEGIN
CustLedgerEntry2_Temp:=CustLedgerEntry2.FIND('-');
END;
...