|
|
|
@ -90,13 +90,13 @@ public class ATOReportServiceImpl implements ATOReportService {
|
|
|
|
|
DateTime startOfMon = new DateTime(fromDateTime);
|
|
|
|
|
DateTime endOfMon = new DateTime(fromDateTime.plusMonths(1).withDayOfMonth(1));
|
|
|
|
|
while (endOfMon.isBefore(toDateTime)) {
|
|
|
|
|
logger.debug("Exporting date range:" + startOfMon.toString("yyyy-MM-dd") + " ~ " + endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
logger.debug("Exporting date range:{} ~ {}", startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
loadMonthTransactions(reportingParty, startOfMon, endOfMon);
|
|
|
|
|
startOfMon = new DateTime(endOfMon);
|
|
|
|
|
endOfMon = new DateTime(endOfMon.plusMonths(1));
|
|
|
|
|
}
|
|
|
|
|
endOfMon = new DateTime(toDateTime);
|
|
|
|
|
logger.debug("Exporting date range:" + startOfMon.toString("yyyy-MM-dd") + " ~ " + endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
logger.debug("Exporting date range:{} ~ {}", startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
loadMonthTransactions(reportingParty, startOfMon, endOfMon);
|
|
|
|
|
logger.info("output BTTPS file");
|
|
|
|
|
return data.outputBTTPS();
|
|
|
|
@ -109,7 +109,7 @@ public class ATOReportServiceImpl implements ATOReportService {
|
|
|
|
|
|
|
|
|
|
private void loadClientMonthTransactions(ReportingPartyData reportingParty, Integer clientId, DateTime startOfMon, DateTime endOfMon) {
|
|
|
|
|
BusinessData biz = reportingParty.findBusiness(clientId);
|
|
|
|
|
logger.debug("Exporting date range for client[" + clientId + "]:" + startOfMon.toString("yyyy-MM-dd") + " ~ " + endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
logger.debug("Exporting date range for client[{}]:{} ~ {}",clientId,startOfMon.toString("yyyy-MM-dd"), endOfMon.toString("yyyy-MM-dd"));
|
|
|
|
|
if (biz == null) {
|
|
|
|
|
JSONObject cli = clientMapper.findClientIgnoreInvalid(clientId);
|
|
|
|
|
AddressInfo addr = new AddressInfo(cli.getString("address"), cli.getString("suburb"), cli.getString("state"), cli.getString("postcode"), cli.getString("country"));
|
|
|
|
|