From f0f7ea0f0236fb3387410f65ea969a71905b9009 Mon Sep 17 00:00:00 2001 From: "Hesham S. Ahmed" Date: Wed, 5 Nov 2014 09:20:54 -0500 Subject: [PATCH] IDEMPIERE-2299 Material receipt confirmation fails --- .../src/org/compiere/model/MInOutConfirm.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index e4ed865051..33c879a201 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -631,6 +631,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction m_inventory = new MInventory (wh, get_TrxName()); StringBuilder msgd = new StringBuilder().append(Msg.translate(getCtx(), "M_InOutConfirm_ID")).append(" ").append(getDocumentNo()); m_inventory.setDescription(msgd.toString()); + setInventoryDocType(m_inventory); m_inventory.saveEx(); setM_Inventory_ID(m_inventory.getM_Inventory_ID()); } @@ -655,6 +656,23 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction return true; } // createDifferenceDoc + + /** + * @param inventory + */ + private void setInventoryDocType(MInventory inventory) { + MDocType[] doctypes = MDocType.getOfDocBaseType(Env.getCtx(), X_C_DocType.DOCBASETYPE_MaterialPhysicalInventory); + for(MDocType doctype : doctypes) + { + if (X_C_DocType.DOCSUBTYPEINV_PhysicalInventory.equals(doctype.getDocSubTypeInv())) + { + inventory.setC_DocType_ID(doctype.getC_DocType_ID()); + break; + } + } + } + + /** * Void Document. * @return false