discard[0] = "reportAccountDate";
else
discard[0] = "reportAccount";
}
ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportCashflowForecast", false, "",
"", "", false, "ad_reports", strReplaceWith, false, true);
// ReportCashflowForecastData[] dataSummary =
// ReportCashflowForecastData.select(this,Utility.getContext(this, vars,
// "#User_Client", "ReportBank"), Utility.getContext(this, vars,
// "#AccessibleOrgTree", "ReportBank"));
ReportCashflowForecastData[] dataSummary = ReportCashflowForecastData.select(this, strDateMax,
"", Utility.getContext(this, vars, "#User_Client", "ReportBank"), Utility.getContext(this,
vars, "#AccessibleOrgTree", "ReportBank"));
if (!showDefault) {
ReportCashflowForecastData[][] data = null;
ReportCashflowForecastData[] dataAcct = null;
ReportCashflowForecastData[] dataDetail = null;
// dataAcct = ReportCashflowForecastData.select(this, strDateMax,
// strBankAccount);
dataAcct = ReportCashflowForecastData.select(this, strDateMax, strBankAccount, Utility
.getContext(this, vars, "#User_Client", "ReportBank"), Utility.getContext(this, vars,
"#AccessibleOrgTree", "ReportBank"));
data = new ReportCashflowForecastData[dataAcct.length][];
if (log4j.isDebugEnabled())
log4j.debug("length: " + dataAcct.length + " - bankaccount:" + strBankAccount);
if (dataAcct.length == 0) {
discard[0] = "reportAccountDate";
discard[1] = "reportAccount";
} else {
for (int i = 0; i < dataAcct.length; i++) {
if (strBreakDate.equals(""))
dataDetail = ReportCashflowForecastData.selectLines(this, vars.getSqlDateFormat(), vars
.getLanguage(), dataAcct[i].cBankaccountId, strDateMax, "2 DESC, 1");
else
dataDetail = ReportCashflowForecastData.selectLines(this, vars.getSqlDateFormat(), vars
.getLanguage(), dataAcct[i].cBankaccountId, strDateMax, "1,2 DESC");
if (log4j.isDebugEnabled())
log4j.debug("length: " + dataAcct.length + " bankacct:" + dataAcct[i].cBankaccountId
+ " lenght:" + dataDetail.length);
data[i] = dataDetail;
}
}
xmlDocument = xmlEngine.readXmlTemplate(
"org/openbravo/erpCommon/ad_reports/ReportCashflowForecast", discard).createXmlDocument();
xmlDocument.setData("structureDetail", dataAcct);
if (strBreakDate.equals(""))
xmlDocument.setDataArray("reportAcct", "structureAccount", data);
else
xmlDocument.setDataArray("reportAcctDate", "structureAccount", data);
} else
xmlDocument = xmlEngine.readXmlTemplate(
"org/openbravo/erpCommon/ad_reports/ReportCashflowForecast", discard).createXmlDocument();
// ReportCashflowForecastData.select(this,Utility.getContext(this, vars,
// "#User_Client", "ReportBank"), Utility.getContext(this, vars,
// "#AccessibleOrgTree", "ReportBank"));
toolbar.prepareSimpleToolBarTemplate();
xmlDocument.setParameter("toolbar", toolbar.toString());
xmlDocument.setData("reportC_ACCOUNTNUMBER", "liststructure", AccountNumberComboData.select(
this, Utility.getContext(this, vars, "#User_Client", "ReportCashflowForecast"), Utility
.getContext(this, vars, "#AccessibleOrgTree", "ReportCashflowForecast")));
xmlDocument.setParameter("cBankAccount", strBankAccount);
xmlDocument.setParameter("dateFrom", strDateMax);