IDEMPIERE-4723 - Clean up MInOut*/MInterest* classes code (#632)

This commit is contained in:
Diego Ruiz 2021-03-16 01:30:23 +01:00 committed by GitHub
parent 43cbc2f297
commit 86bbb08bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 82 deletions

View File

@ -157,8 +157,7 @@ public class MInOut extends X_M_InOut implements DocAction
line.saveEx(trxName); line.saveEx(trxName);
// Delivered everything ? // Delivered everything ?
qty = qty.subtract(lineQty); qty = qty.subtract(lineQty);
// storage[ll].changeQtyOnHand(lineQty, !order.isSOTrx()); // Credit Memo not considered
// storage[ll].saveEx(get_TrxName());
if (qty.signum() == 0) if (qty.signum() == 0)
break; break;
} }
@ -312,15 +311,9 @@ public class MInOut extends X_M_InOut implements DocAction
super (ctx, M_InOut_ID, trxName); super (ctx, M_InOut_ID, trxName);
if (M_InOut_ID == 0) 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); setIsSOTrx (false);
setMovementDate (new Timestamp (System.currentTimeMillis ())); setMovementDate (new Timestamp (System.currentTimeMillis ()));
setDateAcct (getMovementDate()); setDateAcct (getMovementDate());
// setMovementType (MOVEMENTTYPE_CustomerShipment);
setDeliveryRule (DELIVERYRULE_Availability); setDeliveryRule (DELIVERYRULE_Availability);
setDeliveryViaRule (DELIVERYVIARULE_Pickup); setDeliveryViaRule (DELIVERYVIARULE_Pickup);
setFreightCostRule (FREIGHTCOSTRULE_FreightIncluded); setFreightCostRule (FREIGHTCOSTRULE_FreightIncluded);
@ -376,8 +369,6 @@ public class MInOut extends X_M_InOut implements DocAction
} }
setC_DocType_ID (C_DocTypeShipment_ID); setC_DocType_ID (C_DocTypeShipment_ID);
// patch suggested by Armen
// setMovementType (order.isSOTrx() ? MOVEMENTTYPE_CustomerShipment : MOVEMENTTYPE_VendorReceipts);
String movementTypeShipment = null; String movementTypeShipment = null;
MDocType dtShipment = new MDocType(order.getCtx(), C_DocTypeShipment_ID, order.get_TrxName()); MDocType dtShipment = new MDocType(order.getCtx(), C_DocTypeShipment_ID, order.get_TrxName());
if (dtShipment.getDocBaseType().equals(MDocType.DOCBASETYPE_MaterialDelivery)) if (dtShipment.getDocBaseType().equals(MDocType.DOCBASETYPE_MaterialDelivery))
@ -735,7 +726,7 @@ public class MInOut extends X_M_InOut implements DocAction
} }
if (!counter) if (!counter)
line.setM_AttributeSetInstance_ID(0); line.setM_AttributeSetInstance_ID(0);
// line.setS_ResourceAssignment_ID(0);
line.setRef_InOutLine_ID(0); line.setRef_InOutLine_ID(0);
line.setIsInvoiced(false); line.setIsInvoiced(false);
// //
@ -1435,7 +1426,7 @@ public class MInOut extends X_M_InOut implements DocAction
} }
} }
// sLine.getM_AttributeSetInstance_ID() != 0
if (mtrx == null) if (mtrx == null)
{ {
Timestamp dateMPolicy= null; Timestamp dateMPolicy= null;
@ -2455,7 +2446,6 @@ public class MInOut extends X_M_InOut implements DocAction
sb.append(getDocumentNo()); sb.append(getDocumentNo());
// : Total Lines = 123.00 (#1) // : Total Lines = 123.00 (#1)
sb.append(":") sb.append(":")
// .append(Msg.translate(getCtx(),"TotalLines")).append("=").append(getTotalLines())
.append(" (#").append(getLines(false).length).append(")"); .append(" (#").append(getLines(false).length).append(")");
// - Description // - Description
if (getDescription() != null && getDescription().length() > 0) if (getDescription() != null && getDescription().length() > 0)

View File

@ -104,7 +104,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
super (ctx, M_InOutConfirm_ID, trxName); super (ctx, M_InOutConfirm_ID, trxName);
if (M_InOutConfirm_ID == 0) if (M_InOutConfirm_ID == 0)
{ {
// setConfirmType (null);
setDocAction (DOCACTION_Complete); // CO setDocAction (DOCACTION_Complete); // CO
setDocStatus (DOCSTATUS_Drafted); // DR setDocStatus (DOCSTATUS_Drafted); // DR
setIsApproved (false); setIsApproved (false);
@ -237,10 +236,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
*/ */
public File createPDF (File file) public File createPDF (File file)
{ {
// ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID());
// if (re == null)
return null; return null;
// return re.getPDF(file);
} // createPDF } // createPDF
/** /**
@ -313,17 +309,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
if (m_processMsg != null) if (m_processMsg != null)
return DocAction.STATUS_Invalid; 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); MInOutLineConfirm[] lines = getLines(true);
if (lines.length == 0) if (lines.length == 0)
{ {
@ -453,11 +438,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
if (m_inventory != null) if (m_inventory != null)
m_processMsg += " @M_Inventory_ID@=" + m_inventory.getDocumentNo(); 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 // User Validation
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
if (valid != null) if (valid != null)
@ -549,7 +529,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
// Create Dispute Confirmation // Create Dispute Confirmation
if (!split.processIt(DocAction.ACTION_Prepare)) if (!split.processIt(DocAction.ACTION_Prepare))
throw new AdempiereException(split.getProcessMsg()); throw new AdempiereException(split.getProcessMsg());
// split.createConfirmation();
split.saveEx(); split.saveEx();
MInOutConfirm[] splitConfirms = split.getConfirmations(true); MInOutConfirm[] splitConfirms = split.getConfirmations(true);
if (splitConfirms.length > 0) if (splitConfirms.length > 0)
@ -859,8 +839,6 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
*/ */
public int getC_Currency_ID() public int getC_Currency_ID()
{ {
// MPriceList pl = MPriceList.get(getCtx(), getM_PriceList_ID());
// return pl.getC_Currency_ID();
return 0; return 0;
} // getC_Currency_ID } // getC_Currency_ID

View File

@ -106,12 +106,7 @@ public class MInOutLine extends X_M_InOutLine
super (ctx, M_InOutLine_ID, trxName); super (ctx, M_InOutLine_ID, trxName);
if (M_InOutLine_ID == 0) if (M_InOutLine_ID == 0)
{ {
// setLine (0);
// setM_Locator_ID (0);
// setC_UOM_ID (0);
// setM_Product_ID (0);
setM_AttributeSetInstance_ID(0); setM_AttributeSetInstance_ID(0);
// setMovementQty (Env.ZERO);
setConfirmedQty(Env.ZERO); setConfirmedQty(Env.ZERO);
setPickedQty(Env.ZERO); setPickedQty(Env.ZERO);
setScrappedQty(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()); MAttributeSetInstance asi = MAttributeSetInstance.generateLot(getCtx(), (MProduct)getM_Product(), get_TrxName());
setM_AttributeSetInstance_ID(asi.getM_AttributeSetInstance_ID()); 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 /* Carlos Ruiz - globalqss
* IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge * IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge

View File

@ -47,10 +47,6 @@ public class MInOutLineConfirm extends X_M_InOutLineConfirm
super (ctx, M_InOutLineConfirm_ID, trxName); super (ctx, M_InOutLineConfirm_ID, trxName);
if (M_InOutLineConfirm_ID == 0) if (M_InOutLineConfirm_ID == 0)
{ {
// setM_InOutConfirm_ID (0);
// setM_InOutLine_ID (0);
// setTargetQty (Env.ZERO);
// setConfirmedQty (Env.ZERO);
setDifferenceQty(Env.ZERO); setDifferenceQty(Env.ZERO);
setScrappedQty(Env.ZERO); setScrappedQty(Env.ZERO);
setProcessed (false); setProcessed (false);

View File

@ -92,10 +92,6 @@ public class MInOutLineMA extends X_M_InOutLineMA
return DB.executeUpdate(sql, M_InOutLine_ID, trxName); return DB.executeUpdate(sql, M_InOutLine_ID, trxName);
} // deleteInOutLineMA } // deleteInOutLineMA
// /** Logger */
// private static CLogger s_log = CLogger.getCLogger (MInOutLineMA.class);
/************************************************************************** /**************************************************************************
* Standard Constructor * Standard Constructor
* @param ctx context * @param ctx context

View File

@ -130,8 +130,6 @@ public class MInterestArea extends X_R_InterestArea implements ImmutablePOSuppor
super (ctx, R_InterestArea_ID, trxName); super (ctx, R_InterestArea_ID, trxName);
if (R_InterestArea_ID == 0) if (R_InterestArea_ID == 0)
{ {
// setName (null);
// setR_InterestArea_ID (0);
setIsSelfService (false); setIsSelfService (false);
} }
} // MInterestArea } // MInterestArea