From f05a59eeab741d99e3f2188e86c6caf09cc3b079 Mon Sep 17 00:00:00 2001 From: Dirk Niemeyer Date: Wed, 22 Jul 2015 08:39:32 -0500 Subject: [PATCH] IDEMPIERE-2731 Modify Access Modifiers of MInOut and MOrder properties and Methods --- .../src/org/compiere/model/MInOut.java | 35 +++++++++--------- .../src/org/compiere/model/MOrder.java | 36 +++++++++---------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index a45bcaf788..9e8bf47c4e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -63,8 +63,7 @@ public class MInOut extends X_M_InOut implements DocAction /** * */ - private static final long serialVersionUID = -239302197968535277L; - + private static final long serialVersionUID = 1226522383231204912L; /** * Create Shipment From Order @@ -541,11 +540,11 @@ public class MInOut extends X_M_InOut implements DocAction /** Lines */ - private MInOutLine[] m_lines = null; + protected MInOutLine[] m_lines = null; /** Confirmations */ - private MInOutConfirm[] m_confirms = null; + protected MInOutConfirm[] m_confirms = null; /** BPartner */ - private MBPartner m_partner = null; + protected MBPartner m_partner = null; /** @@ -781,13 +780,13 @@ public class MInOut extends X_M_InOut implements DocAction } // copyLinesFrom /** Reversal Flag */ - private boolean m_reversal = false; + protected boolean m_reversal = false; /** * Set Reversal * @param reversal reversal */ - private void setReversal(boolean reversal) + protected void setReversal(boolean reversal) { m_reversal = reversal; } // setReversal @@ -955,7 +954,7 @@ public class MInOut extends X_M_InOut implements DocAction MInOutConfirm.create (this, MInOutConfirm.CONFIRMTYPE_ShipReceiptConfirm, true); } // createConfirmation - private void voidConfirmations() + protected void voidConfirmations() { for(MInOutConfirm confirm : getConfirmations(true)) { @@ -1079,9 +1078,9 @@ public class MInOut extends X_M_InOut implements DocAction } // process /** Process Message */ - private String m_processMsg = null; + protected String m_processMsg = null; /** Just Prepared Flag */ - private boolean m_justPrepared = false; + protected boolean m_justPrepared = false; /** * Unlock Document. @@ -1664,7 +1663,7 @@ public class MInOut extends X_M_InOut implements DocAction /* Save array of documents to process AFTER completing this one */ ArrayList docsPostProcess = new ArrayList(); - private void addDocsPostProcess(PO doc) { + protected void addDocsPostProcess(PO doc) { docsPostProcess.add(doc); } @@ -1678,7 +1677,7 @@ public class MInOut extends X_M_InOut implements DocAction * Based on createCounterDoc() by JJ * @return shipment if created else null */ - private MInOut createDropShipment() { + protected MInOut createDropShipment() { if ( isSOTrx() || !isDropShip() || getC_Order_ID() == 0 ) return null; @@ -1748,7 +1747,7 @@ public class MInOut extends X_M_InOut implements DocAction /** * Set the definite document number after completed */ - private void setDefiniteDocumentNo() { + protected void setDefiniteDocumentNo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); if (dt.isOverwriteDateOnComplete()) { setMovementDate(new Timestamp (System.currentTimeMillis())); @@ -1768,7 +1767,7 @@ public class MInOut extends X_M_InOut implements DocAction * Check Material Policy * Sets line ASI */ - private void checkMaterialPolicy(MInOutLine line,BigDecimal qty) + protected void checkMaterialPolicy(MInOutLine line,BigDecimal qty) { int no = MInOutLineMA.deleteInOutLineMA(line.getM_InOutLine_ID(), get_TrxName()); @@ -1895,7 +1894,7 @@ public class MInOut extends X_M_InOut implements DocAction } } // checkMaterialPolicy - private BigDecimal autoBalanceNegative(MInOutLine line, MProduct product,BigDecimal qtyToReceive) { + protected BigDecimal autoBalanceNegative(MInOutLine line, MProduct product,BigDecimal qtyToReceive) { MStorageOnHand[] storages = MStorageOnHand.getWarehouseNegative(getCtx(), getM_Warehouse_ID(), line.getM_Product_ID(), 0, null, MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), line.getM_Locator_ID(), get_TrxName(), false); @@ -1924,7 +1923,7 @@ public class MInOut extends X_M_InOut implements DocAction * Create Counter Document * @return InOut */ - private MInOut createCounterDoc() + protected MInOut createCounterDoc() { // Is this a counter doc ? if (getRef_InOut_ID() != 0) @@ -2145,7 +2144,7 @@ public class MInOut extends X_M_InOut implements DocAction return true; } // reverseCorrectionIt - private MInOut reverse(boolean accrual) { + protected MInOut reverse(boolean accrual) { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); Timestamp reversalDate = accrual ? Env.getContextAsDate(getCtx(), "#Date") : getDateAcct(); if (reversalDate == null) { @@ -2251,7 +2250,7 @@ public class MInOut extends X_M_InOut implements DocAction return reversal; } - private boolean reverseMatching(Timestamp reversalDate) { + protected boolean reverseMatching(Timestamp reversalDate) { MMatchInv[] mInv = MMatchInv.getInOut(getCtx(), getM_InOut_ID(), get_TrxName()); for (MMatchInv mMatchInv : mInv) { diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 6ce5e93c99..6c0d4b7745 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -70,7 +70,7 @@ public class MOrder extends X_C_Order implements DocAction /** * */ - private static final long serialVersionUID = 6669447827539872218L; + private static final long serialVersionUID = -6750443365394535762L; /** * Create new Order by copying @@ -253,11 +253,11 @@ public class MOrder extends X_C_Order implements DocAction } // MOrder /** Order Lines */ - private MOrderLine[] m_lines = null; + protected MOrderLine[] m_lines = null; /** Tax Lines */ - private MOrderTax[] m_taxes = null; + protected MOrderTax[] m_taxes = null; /** Force Creation of order */ - private boolean m_forceCreation = false; + protected boolean m_forceCreation = false; /** * Overwrite Client/Org if required @@ -1204,9 +1204,9 @@ public class MOrder extends X_C_Order implements DocAction } // processIt /** Process Message */ - private String m_processMsg = null; + protected String m_processMsg = null; /** Just Prepared Flag */ - private boolean m_justPrepared = false; + protected boolean m_justPrepared = false; /** * Unlock Document. @@ -1434,7 +1434,7 @@ public class MOrder extends X_C_Order implements DocAction return DocAction.STATUS_InProgress; } // prepareIt - private boolean calculateFreightCharge() + protected boolean calculateFreightCharge() { MClientInfo ci = MClientInfo.get(getCtx(), getAD_Client_ID(), get_TrxName()); if (ci.getC_ChargeFreight_ID() == 0 && ci.getM_ProductFreight_ID() == 0) @@ -1574,7 +1574,7 @@ public class MOrder extends X_C_Order implements DocAction * Explode non stocked BOM. * @return true if bom exploded */ - private boolean explodeBOM() + protected boolean explodeBOM() { boolean retValue = false; String where = "AND IsActive='Y' AND EXISTS " @@ -1665,7 +1665,7 @@ public class MOrder extends X_C_Order implements DocAction * @param lines order lines (ordered by M_Product_ID for deadlock prevention) * @return true if (un) reserved */ - private boolean reserveStock (MDocType dt, MOrderLine[] lines) + protected boolean reserveStock (MDocType dt, MOrderLine[] lines) { if (dt == null) dt = MDocType.get(getCtx(), getC_DocType_ID()); @@ -1788,7 +1788,7 @@ public class MOrder extends X_C_Order implements DocAction * (Re) Create Pay Schedule * @return true if valid schedule */ - private boolean createPaySchedule() + protected boolean createPaySchedule() { if (getC_PaymentTerm_ID() == 0) return false; @@ -1981,7 +1981,7 @@ public class MOrder extends X_C_Order implements DocAction - private String landedCostAllocation() { + protected String landedCostAllocation() { MOrderLandedCost[] landedCosts = MOrderLandedCost.getOfOrder(getC_Order_ID(), get_TrxName()); for(MOrderLandedCost landedCost : landedCosts) { String error = landedCost.distributeLandedCost(); @@ -1992,7 +1992,7 @@ public class MOrder extends X_C_Order implements DocAction } - private String createPOSPayments() { + protected String createPOSPayments() { // Just for POS order with payment rule mixed if (! this.isSOTrx()) @@ -2104,7 +2104,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Set the definite document number after completed */ - private void setDefiniteDocumentNo() { + protected void setDefiniteDocumentNo() { MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); if (dt.isOverwriteDateOnComplete()) { /* a42niem - BF IDEMPIERE-63 - check if document has been completed before */ @@ -2132,7 +2132,7 @@ public class MOrder extends X_C_Order implements DocAction * @param movementDate optional movement date (default today) * @return shipment or null */ - private MInOut createShipment(MDocType dt, Timestamp movementDate) + protected MInOut createShipment(MDocType dt, Timestamp movementDate) { if (log.isLoggable(Level.INFO)) log.info("For " + dt); MInOut shipment = new MInOut (this, dt.getC_DocTypeShipment_ID(), movementDate); @@ -2193,7 +2193,7 @@ public class MOrder extends X_C_Order implements DocAction * @param invoiceDate invoice date * @return invoice or null */ - private MInvoice createInvoice (MDocType dt, MInOut shipment, Timestamp invoiceDate) + protected MInvoice createInvoice (MDocType dt, MInOut shipment, Timestamp invoiceDate) { if (log.isLoggable(Level.INFO)) log.info(dt.toString()); MInvoice invoice = new MInvoice (this, dt.getC_DocTypeInvoice_ID(), invoiceDate); @@ -2294,7 +2294,7 @@ public class MOrder extends X_C_Order implements DocAction * Create Counter Document * @return counter order */ - private MOrder createCounterDoc() + protected MOrder createCounterDoc() { // Is this itself a counter doc ? if (getRef_Order_ID() != 0) @@ -2456,7 +2456,7 @@ public class MOrder extends X_C_Order implements DocAction * Create Shipment/Invoice Reversals * @return true if success */ - private boolean createReversals() + protected boolean createReversals() { // Cancel only Sales if (!isSOTrx()) @@ -2787,7 +2787,7 @@ public class MOrder extends X_C_Order implements DocAction } // getApprovalAmt //AZ Goodwill - private String deleteMatchPOCostDetail(MOrderLine line) + protected String deleteMatchPOCostDetail(MOrderLine line) { // Get Account Schemas to delete MCostDetail MAcctSchema[] acctschemas = MAcctSchema.getClientAcctSchema(getCtx(), getAD_Client_ID());