details: https://code.openbravo.com/erp/devel/pi/rev/3c8bdfba416c changeset: 26412:3c8bdfba416c user: Jorge Garcia <jorge.garcia <at> openbravo.com> date: Thu Apr 16 17:48:02 2015 +0200 summary: Fixed issue 29521: Storage Bin and UOM fields are not filled well
Storage Bin and UOM fields are not filled when posting Work Efforts and Bill of Material Productions. The problem was in the Production side of the ERP for both posts. The solution is to retrieve the UOM from the M_PRODUCTIONLINE table, and set the storage bin and the UOM in the fact lines. details: https://code.openbravo.com/erp/devel/pi/rev/cec0d8150e63 changeset: 26413:cec0d8150e63 user: Jorge Garcia <jorge.garcia <at> openbravo.com> date: Fri Apr 17 09:11:04 2015 +0200 summary: Related to issue 29521: Costing Test has change due to the new changes TestCosting must be changed to adapt to the new changes made in the BOM production and the Work Effort introduced by the issue 29521. details: https://code.openbravo.com/erp/devel/pi/rev/046dc0d08ef0 changeset: 26414:046dc0d08ef0 user: Sandra Huguet <sandra.huguet <at> openbravo.com> date: Tue May 05 10:57:48 2015 +0200 summary: related to issue 29521 update Copyright diffstat: src-test/src/org/openbravo/test/costing/TestCosting.java | 6 +- src/org/openbravo/erpCommon/ad_forms/DocLineProduction_data.xsql | 4 +- src/org/openbravo/erpCommon/ad_forms/DocProduction.java | 22 ++++++++- 3 files changed, 22 insertions(+), 10 deletions(-) diffs (99 lines): diff -r 53bbe0dda5a3 -r 046dc0d08ef0 src-test/src/org/openbravo/test/costing/TestCosting.java --- a/src-test/src/org/openbravo/test/costing/TestCosting.java Tue May 05 09:55:28 2015 +0200 +++ b/src-test/src/org/openbravo/test/costing/TestCosting.java Tue May 05 10:57:48 2015 +0200 @@ -12996,8 +12996,7 @@ } else { assertEquals(accountingFact.getProduct().getId(), productId); } - if (line.getEntity().getProperty("uOM", false) == null - || doc.getEntityName().equals(ProductionTransaction.ENTITY_NAME)) { + if (line.getEntity().getProperty("uOM", false) == null) { assertEquals(accountingFact.getUOM(), null); } else { assertEquals(accountingFact.getUOM(), line.get("uOM")); @@ -13030,8 +13029,7 @@ assertEquals(accountingFact.getPostingType(), "A"); - if (doc.getEntityName().equals(ReceiptInvoiceMatch.ENTITY_NAME) - || doc.getEntityName().equals(ProductionTransaction.ENTITY_NAME)) { + if (doc.getEntityName().equals(ReceiptInvoiceMatch.ENTITY_NAME)) { assertEquals(accountingFact.getStorageBin(), null); } else if (doc.getEntityName().equals(InternalMovement.ENTITY_NAME)) { if (i % 2 == 0) { diff -r 53bbe0dda5a3 -r 046dc0d08ef0 src/org/openbravo/erpCommon/ad_forms/DocLineProduction_data.xsql --- a/src/org/openbravo/erpCommon/ad_forms/DocLineProduction_data.xsql Tue May 05 09:55:28 2015 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocLineProduction_data.xsql Tue May 05 10:57:48 2015 +0200 @@ -12,7 +12,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2008-2014 Openbravo SLU + * All portions are Copyright (C) 2008-2015 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -28,7 +28,7 @@ <SqlMethodComment></SqlMethodComment> <Sql> <![CDATA[ - SELECT PL.AD_ORG_ID, PL.M_PRODUCTIONLINE_ID, PL.M_PRODUCT_ID, PL.MOVEMENTQTY, PL.PRODUCTIONTYPE, PL.M_LOCATOR_ID, W.M_WAREHOUSE_ID + SELECT PL.AD_ORG_ID, PL.M_PRODUCTIONLINE_ID, PL.M_PRODUCT_ID, PL.MOVEMENTQTY, PL.PRODUCTIONTYPE, PL.M_LOCATOR_ID, W.M_WAREHOUSE_ID, PL.C_UOM_ID FROM M_PRODUCTIONLINE PL, M_PRODUCTIONPLAN PP, M_LOCATOR L, M_WAREHOUSE W WHERE PL.M_PRODUCTIONPLAN_ID = PP.M_PRODUCTIONPLAN_ID AND PL.M_LOCATOR_ID = L.M_LOCATOR_ID diff -r 53bbe0dda5a3 -r 046dc0d08ef0 src/org/openbravo/erpCommon/ad_forms/DocProduction.java --- a/src/org/openbravo/erpCommon/ad_forms/DocProduction.java Tue May 05 09:55:28 2015 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocProduction.java Tue May 05 10:57:48 2015 +0200 @@ -103,6 +103,7 @@ // and // Storage // Qty + docLine.m_M_Locator_ID = data[i].getField("M_LOCATOR_ID"); docLine.m_Productiontype = data[i].getField("PRODUCTIONTYPE"); docLine.m_M_Warehouse_ID = data[i].getField("M_WAREHOUSE_ID"); OBContext.setAdminMode(false); @@ -163,6 +164,7 @@ log4jDocProduction.debug("createFact - Inicio"); // create Fact Header Fact fact = null; + FactLine factLine = null; String Fact_Acct_Group_ID = SequenceIdData.getUUID(); log4jDocProduction.debug("createFact - object created"); // Lines @@ -205,19 +207,31 @@ log4jDocProduction.debug("DocProduction - createFact - line.m_Productiontype - " + line.m_Productiontype); if (line.m_Productiontype.equals("+")) { - fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), + factLine = fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), costCurrency.getId(), costs, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn); - fact.createLine(line, getAccountWarehouse(line.m_M_Warehouse_ID, as, conn), + if (factLine != null) { + factLine.setM_Locator_ID(line.m_M_Locator_ID); + } + factLine = fact.createLine(line, getAccountWarehouse(line.m_M_Warehouse_ID, as, conn), costCurrency.getId(), "", costs, Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn); + if (factLine != null) { + factLine.setM_Locator_ID(line.m_M_Locator_ID); + } } else { - fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), + factLine = fact.createLine(line, line.getAccount(ProductInfo.ACCTTYPE_P_Asset, as, conn), costCurrency.getId(), "", costs, Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn); - fact.createLine(line, getAccountWarehouse(line.m_M_Warehouse_ID, as, conn), + if (factLine != null) { + factLine.setM_Locator_ID(line.m_M_Locator_ID); + } + factLine = fact.createLine(line, getAccountWarehouse(line.m_M_Warehouse_ID, as, conn), costCurrency.getId(), costs, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn); + if (factLine != null) { + factLine.setM_Locator_ID(line.m_M_Locator_ID); + } } } SeqNo = "0"; ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits