details: http://code.openbravo.com/erp/devel/pi/rev/2c19d1072ff9 changeset: 3347:2c19d1072ff9 user: Hennadzi Mackevich <hennadzi.mackevich <at> opensuite.com> date: Mon Mar 09 14:06:01 2009 +0200 summary: Fixed bug 0007834: Information wrongly appears under order and invoice columns in "Create line from Shipment"
details: http://code.openbravo.com/erp/devel/pi/rev/5ec864e7706f changeset: 3348:5ec864e7706f user: Hennadzi Mackevich <hennadzi.mackevich <at> opensuite.com> date: Mon Mar 09 14:11:44 2009 +0200 summary: merge diffstat: 4 files changed, 72 insertions(+), 14 deletions(-) src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html | 2 src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java | 57 +++++++++- src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java | 21 ++- src/org/openbravo/erpCommon/ad_forms/Translation.java | 6 - diffs (190 lines): diff -r 7c9f9d295428 -r 5ec864e7706f src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html --- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html Fri Mar 06 19:19:52 2009 +0100 +++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html Mon Mar 09 14:11:44 2009 +0200 @@ -403,7 +403,7 @@ <th width="97" class="DataGrid_Header_Cell">Quantity</th> <th width="185" class="DataGrid_Header_Cell">Unit</th> <th width="129" class="DataGrid_Header_Cell">Product</th> - <th width="127" class="DataGrid_Header_Cell">Order</th> + <th width="127" class="DataGrid_Header_Cell">Line No</th> <th width="124" class="DataGrid_Header_Cell">Shipment/Receipt</th> <th width="76" class="DataGrid_Header_Cell">Invoice</th> </tr> diff -r 7c9f9d295428 -r 5ec864e7706f src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java --- a/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java Fri Mar 06 19:19:52 2009 +0100 +++ b/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java Mon Mar 09 14:11:44 2009 +0200 @@ -1415,11 +1415,33 @@ return C_DocType_ID; } // createDocType + /** + * Returns the error. "" if there is no error + * + * @param conn + * @param vars + * @param strClient + * @param strModules + * @param strCurrency + * @param hasProduct + * @param hasBPartner + * @param hasProject + * @param hasMCampaign + * @param hasSRegion + * @param bCreateAccounting + * @return + */ + public String createReferenceData(Connection conn, VariablesSecureApp vars, String strClient, String strModules, String strCurrency, boolean hasProduct, boolean hasBPartner, boolean hasProject, boolean hasMCampaign, boolean hasSRegion, boolean bCreateAccounting) - throws ServletException, IOException { + throws ServletException, IOException, SQLException, NoConnectionAvailableException { if (strModules != null && !strModules.equals("")) { + // Remove ( ) characters from the In string as it causes a failure + if (strModules.charAt(0) == '(') + strModules = strModules.substring(1, strModules.length()); + if (strModules.charAt(strModules.length() - 1) == ')') + strModules = strModules.substring(0, strModules.length() - 1); InitialClientSetupData[] data = InitialClientSetupData.selectModules(this, strModules); data = orderModuleByDependency(data); if (data != null && data.length != 0) { @@ -1429,9 +1451,18 @@ String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules" + data[i].path; FileInputStream in = new FileInputStream(strPath); AccountingValueData av = new AccountingValueData(vars, in, true, "C"); - createAccounting(conn, vars, strCurrency, InitialClientSetupData.currency(this, + 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()); + .getFieldProvider())) { + releaseRollbackConnection(conn); + conn = this.getTransactionConnection(); + m_info.append(SALTO_LINEA).append( + Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append( + SALTO_LINEA); + } } String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules/" + data[i].javapackage + "/referencedata/standard"; @@ -1452,6 +1483,23 @@ Client.class, strClient), (Organization) OBDal.getInstance().get( Organization.class, "'0'"), strXml, (Module) OBDal.getInstance().get(Module.class, data[i].adModuleId)); + m_info.append(SALTO_LINEA).append("File: ").append(myFiles[j].getName()).append(":") + .append(SALTO_LINEA); + if (myResult.getLogMessages() != null && !myResult.getLogMessages().equals("") + && !myResult.getLogMessages().equals("null")) { + m_info.append(SALTO_LINEA).append("LOG:").append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append(myResult.getLogMessages()).append(SALTO_LINEA); + } + if (myResult.getWarningMessages() != null && !myResult.getWarningMessages().equals("") + && !myResult.getWarningMessages().equals("null")) { + m_info.append(SALTO_LINEA).append("WARNINGS:").append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append(myResult.getWarningMessages()).append(SALTO_LINEA); + } + if (myResult.getErrorMessages() != null && !myResult.getErrorMessages().equals("") + && !myResult.getErrorMessages().equals("null")) { + m_info.append(SALTO_LINEA).append("ERRORS:").append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append(myResult.getErrorMessages()).append(SALTO_LINEA); + } if (myResult.getErrorMessages() != null && !myResult.getErrorMessages().equals("")) strError = strError.append(myResult.getErrorMessages()); } @@ -1467,13 +1515,12 @@ Utility.messageBD(this, "CreateReferenceDataSuccess", vars.getLanguage())).append( SALTO_LINEA); } - return ""; } + return ""; } else return "WrongModules"; } else return "NoModules"; - return strError; } /** diff -r 7c9f9d295428 -r 5ec864e7706f src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java --- a/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java Fri Mar 06 19:19:52 2009 +0100 +++ b/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java Mon Mar 09 14:11:44 2009 +0200 @@ -1043,6 +1043,11 @@ boolean hasProject, boolean hasMCampaign, boolean hasSRegion, String strCreateAccounting) throws ServletException, IOException { if (strModules != null && !strModules.equals("")) { + // Remove ( ) characters from the In string as it causes a failure + if (strModules.charAt(0) == '(') + strModules = strModules.substring(1, strModules.length()); + if (strModules.charAt(strModules.length() - 1) == ')') + strModules = strModules.substring(0, strModules.length() - 1); InitialOrgSetupData[] data = InitialOrgSetupData.selectModules(this, strModules); data = orderModuleByDependency(data); if (data != null && data.length != 0) { @@ -1052,9 +1057,16 @@ final String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules" + data[i].path; final FileInputStream in = new FileInputStream(strPath); final AccountingValueData av = new AccountingValueData(vars, in, true, "C"); - createAccounting(vars, strOrganization, C_Currency_ID, InitialOrgSetupData.currency( - this, C_Currency_ID), hasProduct, hasBPartner, hasProject, hasMCampaign, - hasSRegion, av.getFieldProvider()); + m_info.append(SALTO_LINEA).append( + Utility.messageBD(this, "StartingAccounting", vars.getLanguage())).append( + SALTO_LINEA); + if (!createAccounting(vars, strOrganization, C_Currency_ID, InitialOrgSetupData + .currency(this, C_Currency_ID), hasProduct, hasBPartner, hasProject, hasMCampaign, + hasSRegion, av.getFieldProvider())) { + m_info.append(SALTO_LINEA).append( + Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append( + SALTO_LINEA); + } } final String strPath = vars.getSessionValue("#SOURCEPATH") + "/modules/" + data[i].javapackage + "/referencedata/standard"; @@ -1107,13 +1119,12 @@ Utility.messageBD(this, "CreateReferenceDataSuccess", vars.getLanguage())).append( SALTO_LINEA); } - return ""; } + return ""; } else return "WrongModules"; } else return "NoModules"; - return ""; } /** diff -r 7c9f9d295428 -r 5ec864e7706f src/org/openbravo/erpCommon/ad_forms/Translation.java --- a/src/org/openbravo/erpCommon/ad_forms/Translation.java Fri Mar 06 19:19:52 2009 +0100 +++ b/src/org/openbravo/erpCommon/ad_forms/Translation.java Mon Mar 09 14:11:44 2009 +0200 @@ -381,7 +381,7 @@ Statement st = null; try { String trlTable = table; - if (trl) + if (trl && !table.endsWith("_TRL")) trlTable = table + "_TRL"; final TranslationData[] trlColumns = getTrlColumns(table); final String keyColumn = table + "_ID"; @@ -493,7 +493,7 @@ if (!new File(directory).exists()) (new File(directory)).mkdir(); - String fileName = directory + trlTable + "_TRL" + "_" + AD_Language + ".xml"; + String fileName = directory + trlTable + "_" + AD_Language + ".xml"; log4j.info("exportTrl - " + fileName); out = new File(fileName); @@ -521,7 +521,7 @@ if (!new File(directory).exists()) (new File(directory)).mkdir(); - fileName = directory + trlTable + "_TRL" + "_" + AD_Language + ".xml"; + fileName = directory + trlTable + "_" + AD_Language + ".xml"; log4j.info("exportTrl - " + fileName); out = new File(fileName); } ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits