IDEMPIERE-2299 Material receipt confirmation fails

This commit is contained in:
Hesham S. Ahmed 2014-11-05 09:20:54 -05:00
parent ffc5bec7ad
commit f0f7ea0f02
1 changed files with 18 additions and 0 deletions

View File

@ -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