IDEMPIERE-4723 - Clean up MInOut*/MInterest* classes code (#632)
This commit is contained in:
parent
43cbc2f297
commit
86bbb08bff
|
@ -157,8 +157,7 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
line.saveEx(trxName);
|
||||
// Delivered everything ?
|
||||
qty = qty.subtract(lineQty);
|
||||
// storage[ll].changeQtyOnHand(lineQty, !order.isSOTrx()); // Credit Memo not considered
|
||||
// storage[ll].saveEx(get_TrxName());
|
||||
|
||||
if (qty.signum() == 0)
|
||||
break;
|
||||
}
|
||||
|
@ -312,15 +311,9 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
super (ctx, M_InOut_ID, trxName);
|
||||
if (M_InOut_ID == 0)
|
||||
{
|
||||
// setDocumentNo (null);
|
||||
// setC_BPartner_ID (0);
|
||||
// setC_BPartner_Location_ID (0);
|
||||
// setM_Warehouse_ID (0);
|
||||
// setC_DocType_ID (0);
|
||||
setIsSOTrx (false);
|
||||
setMovementDate (new Timestamp (System.currentTimeMillis ()));
|
||||
setDateAcct (getMovementDate());
|
||||
// setMovementType (MOVEMENTTYPE_CustomerShipment);
|
||||
setDeliveryRule (DELIVERYRULE_Availability);
|
||||
setDeliveryViaRule (DELIVERYVIARULE_Pickup);
|
||||
setFreightCostRule (FREIGHTCOSTRULE_FreightIncluded);
|
||||
|
@ -376,8 +369,6 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
}
|
||||
setC_DocType_ID (C_DocTypeShipment_ID);
|
||||
|
||||
// patch suggested by Armen
|
||||
// setMovementType (order.isSOTrx() ? MOVEMENTTYPE_CustomerShipment : MOVEMENTTYPE_VendorReceipts);
|
||||
String movementTypeShipment = null;
|
||||
MDocType dtShipment = new MDocType(order.getCtx(), C_DocTypeShipment_ID, order.get_TrxName());
|
||||
if (dtShipment.getDocBaseType().equals(MDocType.DOCBASETYPE_MaterialDelivery))
|
||||
|
@ -735,7 +726,7 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
}
|
||||
if (!counter)
|
||||
line.setM_AttributeSetInstance_ID(0);
|
||||
// line.setS_ResourceAssignment_ID(0);
|
||||
|
||||
line.setRef_InOutLine_ID(0);
|
||||
line.setIsInvoiced(false);
|
||||
//
|
||||
|
@ -1435,7 +1426,7 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
}
|
||||
|
||||
}
|
||||
// sLine.getM_AttributeSetInstance_ID() != 0
|
||||
|
||||
if (mtrx == null)
|
||||
{
|
||||
Timestamp dateMPolicy= null;
|
||||
|
@ -2455,7 +2446,6 @@ public class MInOut extends X_M_InOut implements DocAction
|
|||
sb.append(getDocumentNo());
|
||||
// : Total Lines = 123.00 (#1)
|
||||
sb.append(":")
|
||||
// .append(Msg.translate(getCtx(),"TotalLines")).append("=").append(getTotalLines())
|
||||
.append(" (#").append(getLines(false).length).append(")");
|
||||
// - Description
|
||||
if (getDescription() != null && getDescription().length() > 0)
|
||||
|
|
|
@ -104,7 +104,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
super (ctx, M_InOutConfirm_ID, trxName);
|
||||
if (M_InOutConfirm_ID == 0)
|
||||
{
|
||||
// setConfirmType (null);
|
||||
setDocAction (DOCACTION_Complete); // CO
|
||||
setDocStatus (DOCSTATUS_Drafted); // DR
|
||||
setIsApproved (false);
|
||||
|
@ -237,10 +236,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
*/
|
||||
public File createPDF (File file)
|
||||
{
|
||||
// ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID());
|
||||
// if (re == null)
|
||||
return null;
|
||||
// return re.getPDF(file);
|
||||
} // createPDF
|
||||
|
||||
/**
|
||||
|
@ -313,17 +309,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
if (m_processMsg != null)
|
||||
return DocAction.STATUS_Invalid;
|
||||
|
||||
/**
|
||||
MDocType dt = MDocType.get(getCtx(), getC_DocTypeTarget_ID());
|
||||
|
||||
// Std Period open?
|
||||
if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType()))
|
||||
{
|
||||
m_processMsg = "@PeriodClosed@";
|
||||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
**/
|
||||
|
||||
MInOutLineConfirm[] lines = getLines(true);
|
||||
if (lines.length == 0)
|
||||
{
|
||||
|
@ -453,11 +438,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
if (m_inventory != null)
|
||||
m_processMsg += " @M_Inventory_ID@=" + m_inventory.getDocumentNo();
|
||||
|
||||
|
||||
// Try to complete Shipment
|
||||
// if (inout.processIt(DocAction.ACTION_Complete))
|
||||
// m_processMsg = "@M_InOut_ID@ " + inout.getDocumentNo() + ": @Completed@";
|
||||
|
||||
// User Validation
|
||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||
if (valid != null)
|
||||
|
@ -549,7 +529,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
// Create Dispute Confirmation
|
||||
if (!split.processIt(DocAction.ACTION_Prepare))
|
||||
throw new AdempiereException(split.getProcessMsg());
|
||||
// split.createConfirmation();
|
||||
|
||||
split.saveEx();
|
||||
MInOutConfirm[] splitConfirms = split.getConfirmations(true);
|
||||
if (splitConfirms.length > 0)
|
||||
|
@ -859,8 +839,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
|||
*/
|
||||
public int getC_Currency_ID()
|
||||
{
|
||||
// MPriceList pl = MPriceList.get(getCtx(), getM_PriceList_ID());
|
||||
// return pl.getC_Currency_ID();
|
||||
return 0;
|
||||
} // getC_Currency_ID
|
||||
|
||||
|
|
|
@ -106,12 +106,7 @@ public class MInOutLine extends X_M_InOutLine
|
|||
super (ctx, M_InOutLine_ID, trxName);
|
||||
if (M_InOutLine_ID == 0)
|
||||
{
|
||||
// setLine (0);
|
||||
// setM_Locator_ID (0);
|
||||
// setC_UOM_ID (0);
|
||||
// setM_Product_ID (0);
|
||||
setM_AttributeSetInstance_ID(0);
|
||||
// setMovementQty (Env.ZERO);
|
||||
setConfirmedQty(Env.ZERO);
|
||||
setPickedQty(Env.ZERO);
|
||||
setScrappedQty(Env.ZERO);
|
||||
|
@ -616,37 +611,6 @@ public class MInOutLine extends X_M_InOutLine
|
|||
MAttributeSetInstance asi = MAttributeSetInstance.generateLot(getCtx(), (MProduct)getM_Product(), get_TrxName());
|
||||
setM_AttributeSetInstance_ID(asi.getM_AttributeSetInstance_ID());
|
||||
}
|
||||
// if (getC_Charge_ID() == 0 && getM_Product_ID() == 0)
|
||||
// ;
|
||||
|
||||
/** Qty on instance ASI
|
||||
if (getM_AttributeSetInstance_ID() != 0)
|
||||
{
|
||||
MProduct product = getProduct();
|
||||
int M_AttributeSet_ID = product.getM_AttributeSet_ID();
|
||||
boolean isInstance = M_AttributeSet_ID != 0;
|
||||
if (isInstance)
|
||||
{
|
||||
MAttributeSet mas = MAttributeSet.get(getCtx(), M_AttributeSet_ID);
|
||||
isInstance = mas.isInstanceAttribute();
|
||||
}
|
||||
// Max
|
||||
if (isInstance)
|
||||
{
|
||||
MStorage storage = MStorage.get(getCtx(), getM_Locator_ID(),
|
||||
getM_Product_ID(), getM_AttributeSetInstance_ID(), get_TrxName());
|
||||
if (storage != null)
|
||||
{
|
||||
BigDecimal qty = storage.getQtyOnHand();
|
||||
if (getMovementQty().compareTo(qty) > 0)
|
||||
{
|
||||
log.warning("Qty - Stock=" + qty + ", Movement=" + getMovementQty());
|
||||
log.saveError("QtyInsufficient", "=" + qty);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /**/
|
||||
|
||||
/* Carlos Ruiz - globalqss
|
||||
* IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge
|
||||
|
|
|
@ -47,10 +47,6 @@ public class MInOutLineConfirm extends X_M_InOutLineConfirm
|
|||
super (ctx, M_InOutLineConfirm_ID, trxName);
|
||||
if (M_InOutLineConfirm_ID == 0)
|
||||
{
|
||||
// setM_InOutConfirm_ID (0);
|
||||
// setM_InOutLine_ID (0);
|
||||
// setTargetQty (Env.ZERO);
|
||||
// setConfirmedQty (Env.ZERO);
|
||||
setDifferenceQty(Env.ZERO);
|
||||
setScrappedQty(Env.ZERO);
|
||||
setProcessed (false);
|
||||
|
|
|
@ -92,10 +92,6 @@ public class MInOutLineMA extends X_M_InOutLineMA
|
|||
return DB.executeUpdate(sql, M_InOutLine_ID, trxName);
|
||||
} // deleteInOutLineMA
|
||||
|
||||
|
||||
// /** Logger */
|
||||
// private static CLogger s_log = CLogger.getCLogger (MInOutLineMA.class);
|
||||
|
||||
/**************************************************************************
|
||||
* Standard Constructor
|
||||
* @param ctx context
|
||||
|
|
|
@ -130,8 +130,6 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor
|
|||
super (ctx, R_InterestArea_ID, trxName);
|
||||
if (R_InterestArea_ID == 0)
|
||||
{
|
||||
// setName (null);
|
||||
// setR_InterestArea_ID (0);
|
||||
setIsSelfService (false);
|
||||
}
|
||||
} // MInterestArea
|
||||
|
|
Loading…
Reference in New Issue