InitialClientSetupData[] dataCOA = null;
if (bCreateAccounting) {
dataCOA = InitialClientSetupData.selectCOAModules(this, strModules);
ModuleUtiltiy.orderModuleByDependency(this, dataCOA);
if (dataCOA != null && dataCOA.length != 0) {
DataImportService myData = DataImportService.getInstance();
for (int i = 0; i < dataCOA.length; i++) {
String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules" + dataCOA[i].path;
FileInputStream in = new FileInputStream(strPath);
AccountingValueData av = new AccountingValueData(vars, in, true, "C");
m_info.append(SALTO_LINEA).append(
Utility.messageBD(this, "StartingAccounting", vars.getLanguage())).append(
SALTO_LINEA);
if (!createAccounting(conn, vars, strCurrency, InitialClientSetupData.currency(this,
strCurrency), hasProduct, hasBPartner, hasProject, hasMCampaign, hasSRegion, av
.getFieldProvider())) {
releaseRollbackConnection(conn);
conn = this.getTransactionConnection();
m_info.append(SALTO_LINEA).append(
Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(
SALTO_LINEA);
} else {
if (!InitialClientSetupData
.existsClientModule(this, strClient, dataCOA[i].adModuleId)) {
InitialClientSetupData.insertClientModule(this, strClient, vars.getUser(),
dataCOA[i].adModuleId, dataCOA[i].version);
}
m_info.append(SALTO_LINEA).append(
Utility.messageBD(this, "CreateReferenceDataSuccess", vars.getLanguage()))
.append(SALTO_LINEA);
strSummary.append(SALTO_LINEA).append(
Utility.messageBD(this, "CreateReferenceDataSuccess", vars.getLanguage()))
.append(SALTO_LINEA);
}
}
}
}
// Import Reference data
InitialClientSetupData[] data = InitialClientSetupData.selectRDModules(this, strModules);
ModuleUtiltiy.orderModuleByDependency(this, data);
if (data != null && data.length != 0) {
DataImportService myData = DataImportService.getInstance();
StringBuffer strError = new StringBuffer("");
for (int j = 0; j < data.length; j++) {
String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules/" + data[j].javapackage
+ "/referencedata/standard";
File datasetFile = new File(strPath + "/" + Utility.wikifiedName(data[j].datasetname)
+ ".xml");
if (!datasetFile.exists()) {
continue;
}
String strXml = Utility.fileToString(datasetFile.getPath());
ImportResult myResult = myData.importDataFromXML((Client) OBDal.getInstance().get(
Client.class, strClient), (Organization) OBDal.getInstance().get(Organization.class,
"0"), strXml, (Module) OBDal.getInstance().get(Module.class, data[j].adModuleId));
m_info.append(SALTO_LINEA).append("File: ").append(datasetFile.getName()).append(":")
.append(SALTO_LINEA);
if (myResult.getLogMessages() != null && !myResult.getLogMessages().equals("")