Set Proper Shipment Type: MM Shipment Indirect

This commit is contained in:
trifonnt 2008-11-23 15:47:01 +00:00
parent 1110811c71
commit fd70983c8c
2 changed files with 21 additions and 4 deletions

View File

@ -218,7 +218,13 @@ public class MenuManager
public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence, String category) throws OperationException public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence, String category) throws OperationException
{ {
MWebMenu menu = new MWebMenu(ctx, 0, null); MWebMenu menu;
try {
menu = new MWebMenu(ctx, getMenuId(ctx, menuName), null);
} catch (SystemException e)
{
menu = new MWebMenu(ctx, 0, null);
}
menu.setParentMenu_ID(parentId); menu.setParentMenu_ID(parentId);
if(!menuLink.contains("javascript")) if(!menuLink.contains("javascript"))

View File

@ -242,7 +242,7 @@ public class MinOutManager extends AbstractDocumentManager
MOrder salesOrder = new MOrder(ctx,salesOrderId,trxName); MOrder salesOrder = new MOrder(ctx,salesOrderId,trxName);
MInOut inOut = new MInOut(salesOrder,MDocType.C_DOCTYPESHIPMENT_ID_AD_Reference_ID,stamp); MInOut inOut = new MInOut(salesOrder, MDocType.C_DOCTYPESHIPMENT_ID_AD_Reference_ID, stamp);
try try
{ {
int [] invoiceIds = MInvoice.getAllIDs(MInvoice.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and c_order_id="+salesOrderId,trxName); int [] invoiceIds = MInvoice.getAllIDs(MInvoice.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and c_order_id="+salesOrderId,trxName);
@ -260,9 +260,20 @@ public class MinOutManager extends AbstractDocumentManager
inOut.setIsSOTrx(true); inOut.setIsSOTrx(true);
inOut.setDescription("Shipment"); inOut.setDescription("Shipment");
inOut.setC_DocType_ID(MDocType.DOCBASETYPE_MaterialDelivery); //inOut.setC_DocType_ID(MDocType.DOCBASETYPE_MaterialDelivery); // @Trifon
int [] docTypeShipmentIndirectId = MInvoice.getAllIDs(MDocType.Table_Name,
"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)
+ " AND DocBaseType='"+MDocType.DOCBASETYPE_MaterialDelivery+"' "
+ " AND IsActive='Y' "
+ " AND IsSOTrx='Y' "
+ " AND Name = 'MM Shipment Indirect'", trxName);
if (docTypeShipmentIndirectId.length > 0)
{
inOut.setC_DocType_ID( docTypeShipmentIndirectId[0] );
} else {
inOut.setC_DocType_ID(MDocType.DOCBASETYPE_MaterialDelivery); // @Trifon; old behavior
}
PoManager.save(inOut); PoManager.save(inOut);
MInOutLine [] line=new MInOutLine[salesOrderLineid.length]; MInOutLine [] line=new MInOutLine[salesOrderLineid.length];