From d5845fcffee0cb6de5c7702fb886232ea0719c16 Mon Sep 17 00:00:00 2001 From: Diego Ruiz <12065321+d-ruiz@users.noreply.github.com> Date: Fri, 18 Jun 2021 04:34:11 +0200 Subject: [PATCH] IDEMPIERE-4723 - Clean up dead code -> MA*/MB* classes (#726) --- .../org/compiere/model/MAttachmentNote.java | 9 --------- .../src/org/compiere/model/MAttributeSet.java | 2 +- .../compiere/model/MAttributeSetInstance.java | 1 - .../org/compiere/model/MAttributeValue.java | 8 -------- .../src/org/compiere/model/MBOM.java | 2 -- .../src/org/compiere/model/MBOMProduct.java | 2 -- .../src/org/compiere/model/MBPBankAccount.java | 1 - .../src/org/compiere/model/MBPGroup.java | 2 -- .../src/org/compiere/model/MBPartner.java | 9 --------- .../org/compiere/model/MBPartnerLocation.java | 3 +-- .../src/org/compiere/model/MBankAccount.java | 2 -- .../src/org/compiere/model/MBankStatement.java | 18 +----------------- .../org/compiere/model/MBankStatementLine.java | 6 ------ 13 files changed, 3 insertions(+), 62 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java b/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java index 799082483e..559b4960e1 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachmentNote.java @@ -43,15 +43,6 @@ public class MAttachmentNote extends X_AD_AttachmentNote public MAttachmentNote (Properties ctx, int AD_AttachmentNote_ID, String trxName) { super (ctx, AD_AttachmentNote_ID, trxName); - /** - if (AD_AttachmentNote_ID == 0) - { - setAD_Attachment_ID (0); - setAD_User_ID (0); - setTextMsg (null); - setTitle (null); - } - /**/ } // MAttachmentNote /** diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java index 8de2c4d4c9..c2285e83ba 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSet.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSet.java @@ -168,7 +168,7 @@ public class MAttributeSet extends X_M_AttributeSet implements ImmutablePOSuppor /** Instance Attributes */ private MAttribute[] m_instanceAttributes = null; - /** Instance Attributes */ + /** Product Attributes */ private MAttribute[] m_productAttributes = null; /** Entry Exclude */ diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java index 07d2865f76..2a7b482a3b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java @@ -81,7 +81,6 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance if (rs.next()) { int M_AttributeSet_ID = rs.getInt(1); - // M_AttributeSetInstance_ID = rs.getInt(2); // needed ? // retValue = new MAttributeSetInstance (ctx, 0, M_AttributeSet_ID, null); } diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeValue.java b/org.adempiere.base/src/org/compiere/model/MAttributeValue.java index 620f2e30f6..e21eb8ece5 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeValue.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeValue.java @@ -43,14 +43,6 @@ public class MAttributeValue extends X_M_AttributeValue public MAttributeValue (Properties ctx, int M_AttributeValue_ID, String trxName) { super (ctx, M_AttributeValue_ID, trxName); - /** if (M_AttributeValue_ID == 0) - { - setM_AttributeValue_ID (0); - setM_Attribute_ID (0); - setName (null); - setValue (null); - } - **/ } // MAttributeValue /** diff --git a/org.adempiere.base/src/org/compiere/model/MBOM.java b/org.adempiere.base/src/org/compiere/model/MBOM.java index c8ff99a0ef..93ae623523 100644 --- a/org.adempiere.base/src/org/compiere/model/MBOM.java +++ b/org.adempiere.base/src/org/compiere/model/MBOM.java @@ -127,8 +127,6 @@ public class MBOM extends X_M_BOM implements ImmutablePOSupport super (ctx, M_BOM_ID, trxName); if (M_BOM_ID == 0) { - // setM_Product_ID (0); - // setName (null); setBOMType (BOMTYPE_CurrentActive); // A setBOMUse (BOMUSE_Master); // A } diff --git a/org.adempiere.base/src/org/compiere/model/MBOMProduct.java b/org.adempiere.base/src/org/compiere/model/MBOMProduct.java index 7a11eaad78..3a9ff0f71e 100644 --- a/org.adempiere.base/src/org/compiere/model/MBOMProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MBOMProduct.java @@ -72,12 +72,10 @@ public class MBOMProduct extends X_M_BOMProduct super (ctx, M_BOMProduct_ID, trxName); if (M_BOMProduct_ID == 0) { - // setM_BOM_ID (0); setBOMProductType (BOMPRODUCTTYPE_StandardProduct); // S setBOMQty (Env.ONE); setIsPhantom (false); setLeadTimeOffset (0); - // setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_BOMProduct WHERE M_BOM_ID=@M_BOM_ID@ } } // MBOMProduct diff --git a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java index bc1ffa62a9..0d12005408 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBPBankAccount.java @@ -74,7 +74,6 @@ public class MBPBankAccount extends X_C_BP_BankAccount super (ctx, C_BP_BankAccount_ID, trxName); if (C_BP_BankAccount_ID == 0) { - // setC_BPartner_ID (0); setIsACH (false); setBPBankAcctUse(BPBANKACCTUSE_Both); } diff --git a/org.adempiere.base/src/org/compiere/model/MBPGroup.java b/org.adempiere.base/src/org/compiere/model/MBPGroup.java index 6353b93838..14fe248b5e 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPGroup.java +++ b/org.adempiere.base/src/org/compiere/model/MBPGroup.java @@ -209,8 +209,6 @@ public class MBPGroup extends X_C_BP_Group implements ImmutablePOSupport super (ctx, C_BP_Group_ID, trxName); if (C_BP_Group_ID == 0) { - // setValue (null); - // setName (null); setIsConfidentialInfo (false); // N setIsDefault (false); setPriorityBase(PRIORITYBASE_Same); diff --git a/org.adempiere.base/src/org/compiere/model/MBPartner.java b/org.adempiere.base/src/org/compiere/model/MBPartner.java index 024c01599d..93d591d702 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartner.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartner.java @@ -78,7 +78,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport template.setSO_CreditLimit (Env.ZERO); template.setSO_CreditUsed (Env.ZERO); template.setTotalOpenBalance (Env.ZERO); - // s_template.setRating(null); // template.setActualLifeTimeValue(Env.ZERO); template.setPotentialLifeTimeValue(Env.ZERO); @@ -261,10 +260,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport } if (C_BPartner_ID == 0) { - // setValue (""); - // setName (""); - // setName2 (null); - // setDUNS(""); // setIsCustomer (true); setIsProspect (true); @@ -674,9 +669,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport if (m_primaryAD_User_ID == null) { MUser[] users = getContacts(false); - // for (int i = 0; i < users.length; i++) - // { - // } if (m_primaryAD_User_ID == null && users.length > 0) setPrimaryAD_User_ID(users[0].getAD_User_ID()); } @@ -995,7 +987,6 @@ public class MBPartner extends X_C_BPartner implements ImmutablePOSupport StringBuilder msgacc = new StringBuilder("p.C_BP_Group_ID=").append(getC_BP_Group_ID()); insert_Accounting("C_BP_Customer_Acct", "C_BP_Group_Acct", msgacc.toString()); insert_Accounting("C_BP_Vendor_Acct", "C_BP_Group_Acct",msgacc.toString()); - // insert_Accounting("C_BP_Employee_Acct", "C_AcctSchema_Default", null); } if (newRecord || is_ValueChanged(COLUMNNAME_Value)) update_Tree(MTree_Base.TREETYPE_BPartner); diff --git a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java index 8562d64405..b354299dbe 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartnerLocation.java @@ -269,7 +269,7 @@ public class MBPartnerLocation extends X_C_BPartner_Location { getAD_Client_ID(), getAD_Org_ID()); if (m_unique < 0 || m_unique > 4) m_unique = 0; - if (m_uniqueName != null) { // && m_uniqueName.equals(".")) { + if (m_uniqueName != null) { // default m_uniqueName = null; makeUnique(address); @@ -286,7 +286,6 @@ public class MBPartnerLocation extends X_C_BPartner_Location { if (location.getC_BPartner_Location_ID() == get_ID()) continue; if (m_uniqueName.equals(location.getName())) { - // m_uniqueName = null; m_unique++; makeUnique(address); unique = false; diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccount.java b/org.adempiere.base/src/org/compiere/model/MBankAccount.java index b6eaa53d0f..84d2d14a96 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccount.java @@ -104,9 +104,7 @@ public class MBankAccount extends X_C_BankAccount implements ImmutablePOSupport setIsDefault (false); setBankAccountType (BANKACCOUNTTYPE_Checking); setCurrentBalance (Env.ZERO); - // setC_Currency_ID (0); setCreditLimit (Env.ZERO); - // setC_BankAccount_ID (0); } } // MBankAccount diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index ccd1053237..995be5b05e 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -65,7 +65,6 @@ public class MBankStatement extends X_C_BankStatement implements DocAction super (ctx, C_BankStatement_ID, trxName); if (C_BankStatement_ID == 0) { - // setC_BankAccount_ID (0); // parent setStatementDate (new Timestamp(System.currentTimeMillis())); // @Date@ setDocAction (DOCACTION_Complete); // CO setDocStatus (DOCSTATUS_Drafted); // DR @@ -228,10 +227,7 @@ public class MBankStatement extends X_C_BankStatement 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); + return null; } // createPDF @@ -312,25 +308,15 @@ public class MBankStatement extends X_C_BankStatement implements DocAction } // Lines BigDecimal total = Env.ZERO; - // IDEMPIERE-480 changed the way accounting is posted, now lines post just with the accounting date of the statement header - // so, it is unnecessary to validate the period of lines - // Timestamp minDate = getStatementDate(); - // Timestamp maxDate = minDate; for (int i = 0; i < lines.length; i++) { MBankStatementLine line = lines[i]; if (!line.isActive()) continue; total = total.add(line.getStmtAmt()); - // if (line.getDateAcct().before(minDate)) - // minDate = line.getDateAcct(); - // if (line.getDateAcct().after(maxDate)) - // maxDate = line.getDateAcct(); } setStatementDifference(total); setEndingBalance(getBeginningBalance().add(total)); - // MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()); - // MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()); m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) @@ -644,8 +630,6 @@ public class MBankStatement extends X_C_BankStatement 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 diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java index 82a833088b..10ea776fec 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatementLine.java @@ -57,17 +57,11 @@ import org.compiere.util.Msg; super (ctx, C_BankStatementLine_ID, trxName); if (C_BankStatementLine_ID == 0) { - // setC_BankStatement_ID (0); // Parent - // setC_Charge_ID (0); - // setC_Currency_ID (0); // Bank Acct Currency - // setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_BankStatementLine WHERE C_BankStatement_ID=@C_BankStatement_ID@ setStmtAmt(Env.ZERO); setTrxAmt(Env.ZERO); setInterestAmt(Env.ZERO); setChargeAmt(Env.ZERO); setIsReversal (false); - // setValutaDate (new Timestamp(System.currentTimeMillis())); // @StatementDate@ - // setDateAcct (new Timestamp(System.currentTimeMillis())); // @StatementDate@ } } // MBankStatementLine