diff --git a/base/src/org/compiere/acct/Doc_Allocation.java b/base/src/org/compiere/acct/Doc_Allocation.java index 5c08613024..57012fe8f2 100644 --- a/base/src/org/compiere/acct/Doc_Allocation.java +++ b/base/src/org/compiere/acct/Doc_Allocation.java @@ -31,6 +31,11 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: Doc_Allocation.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $ + * + * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual + * Avoid posting if Receipt and both accounts Unallocated Cash and Receivable are equal + * Avoid posting if Payment and both accounts Payment Select and Liability are equal + * */ public class Doc_Allocation extends Doc { @@ -209,22 +214,49 @@ public class Doc_Allocation extends Doc // Sales Invoice else if (invoice.isSOTrx()) { - // Payment/Cash DR + + // Avoid usage of clearing accounts + // If both accounts Unallocated Cash and Receivable are equal + // then don't post + + MAccount acct_unallocated_cash = null; if (line.getC_Payment_ID() != 0) - { - fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()), - getC_Currency_ID(), line.getAmtSource(), null); - if (fl != null && payment != null) - fl.setAD_Org_ID(payment.getAD_Org_ID()); - } + acct_unallocated_cash = getPaymentAcct(as, line.getC_Payment_ID()); else if (line.getC_CashLine_ID() != 0) - { - fl = fact.createLine (line, getCashAcct(as, line.getC_CashLine_ID()), - getC_Currency_ID(), line.getAmtSource(), null); - MCashLine cashLine = new MCashLine (getCtx(), line.getC_CashLine_ID(), getTrxName()); - if (fl != null && cashLine.get_ID() != 0) - fl.setAD_Org_ID(cashLine.getAD_Org_ID()); + acct_unallocated_cash = getCashAcct(as, line.getC_CashLine_ID()); + MAccount acct_receivable = getAccount(Doc.ACCTTYPE_C_Receivable, as); + + if ((!as.isPostIfClearingEqual()) && acct_unallocated_cash != null && acct_unallocated_cash.equals(acct_receivable)) { + + // if not using clearing accounts, then don't post amtsource + // change the allocationsource to be writeoff + discount + allocationSource = line.getDiscountAmt().add(line.getWriteOffAmt()); + + + } else { + + // Normal behavior -- unchanged if using clearing accounts + + // Payment/Cash DR + if (line.getC_Payment_ID() != 0) + { + fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()), + getC_Currency_ID(), line.getAmtSource(), null); + if (fl != null && payment != null) + fl.setAD_Org_ID(payment.getAD_Org_ID()); + } + else if (line.getC_CashLine_ID() != 0) + { + fl = fact.createLine (line, getCashAcct(as, line.getC_CashLine_ID()), + getC_Currency_ID(), line.getAmtSource(), null); + MCashLine cashLine = new MCashLine (getCtx(), line.getC_CashLine_ID(), getTrxName()); + if (fl != null && cashLine.get_ID() != 0) + fl.setAD_Org_ID(cashLine.getAD_Org_ID()); + } + } + // End Avoid usage of clearing accounts + // Discount DR if (Env.ZERO.compareTo(line.getDiscountAmt()) != 0) { @@ -262,6 +294,28 @@ public class Doc_Allocation extends Doc // Purchase Invoice else { + // Avoid usage of clearing accounts + // If both accounts Payment Select and Liability are equal + // then don't post + + MAccount acct_payment_select = null; + if (line.getC_Payment_ID() != 0) + acct_payment_select = getPaymentAcct(as, line.getC_Payment_ID()); + else if (line.getC_CashLine_ID() != 0) + acct_payment_select = getCashAcct(as, line.getC_CashLine_ID()); + MAccount acct_liability = getAccount(Doc.ACCTTYPE_V_Liability, as); + boolean isUsingClearing = true; + + if ((!as.isPostIfClearingEqual()) && acct_payment_select != null && acct_payment_select.equals(acct_liability)) { + + // if not using clearing accounts, then don't post amtsource + // change the allocationsource to be writeoff + discount + allocationSource = line.getDiscountAmt().add(line.getWriteOffAmt()); + isUsingClearing = false; + + } + // End Avoid usage of clearing accounts + allocationSource = allocationSource.negate(); // allocation is negative // AP Invoice Amount DR if (as.isAccrual()) @@ -297,14 +351,14 @@ public class Doc_Allocation extends Doc fl.setAD_Org_ID(payment.getAD_Org_ID()); } // Payment/Cash CR - if (line.getC_Payment_ID() != 0) + if (isUsingClearing && line.getC_Payment_ID() != 0) // Avoid usage of clearing accounts { fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()), getC_Currency_ID(), null, line.getAmtSource().negate()); if (fl != null && payment != null) fl.setAD_Org_ID(payment.getAD_Org_ID()); } - else if (line.getC_CashLine_ID() != 0) + else if (isUsingClearing && line.getC_CashLine_ID() != 0) // Avoid usage of clearing accounts { fl = fact.createLine (line, getCashAcct(as, line.getC_CashLine_ID()), getC_Currency_ID(), null, line.getAmtSource().negate()); diff --git a/base/src/org/compiere/acct/Doc_Bank.java b/base/src/org/compiere/acct/Doc_Bank.java index ee67d3b554..1b414ac3f2 100644 --- a/base/src/org/compiere/acct/Doc_Bank.java +++ b/base/src/org/compiere/acct/Doc_Bank.java @@ -31,6 +31,10 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: Doc_Bank.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ + * + * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual + * Avoid posting if both accounts BankAsset and BankInTransit are equal + * */ public class Doc_Bank extends Doc { @@ -158,28 +162,61 @@ public class Doc_Bank extends Doc DocLine_Bank line = (DocLine_Bank)p_lines[i]; int C_BPartner_ID = line.getC_BPartner_ID(); - // BankAsset DR CR (Statement) - fl = fact.createLine(line, - getAccount(Doc.ACCTTYPE_BankAsset, as), - line.getC_Currency_ID(), line.getStmtAmt()); - if (fl != null && AD_Org_ID != 0) - fl.setAD_Org_ID(AD_Org_ID); - if (fl != null && C_BPartner_ID != 0) - fl.setC_BPartner_ID(C_BPartner_ID); + // Avoid usage of clearing accounts + // If both accounts BankAsset and BankInTransit are equal + // then remove the posting - // BankInTransit DR CR (Payment) - fl = fact.createLine(line, - getAccount(Doc.ACCTTYPE_BankInTransit, as), - line.getC_Currency_ID(), line.getTrxAmt().negate()); - if (fl != null) - { - if (C_BPartner_ID != 0) - fl.setC_BPartner_ID(C_BPartner_ID); - if (AD_Org_ID != 0) + MAccount acct_bank_asset = getAccount(Doc.ACCTTYPE_BankAsset, as); + MAccount acct_bank_in_transit = getAccount(Doc.ACCTTYPE_BankInTransit, as); + + if ((!as.isPostIfClearingEqual()) && acct_bank_asset.equals(acct_bank_in_transit)) { + // Not using clearing accounts + // just post the difference (if any) + + BigDecimal amt_stmt_minus_trx = line.getStmtAmt().subtract(line.getTrxAmt()); + if (amt_stmt_minus_trx.compareTo(Env.ZERO) != 0) { + + // BankAsset DR CR (Statement minus Payment) + fl = fact.createLine(line, + getAccount(Doc.ACCTTYPE_BankAsset, as), + line.getC_Currency_ID(), amt_stmt_minus_trx); + if (fl != null && AD_Org_ID != 0) + fl.setAD_Org_ID(AD_Org_ID); + if (fl != null && C_BPartner_ID != 0) + fl.setC_BPartner_ID(C_BPartner_ID); + + } + + } else { + + // Normal Adempiere behavior -- unchanged if using clearing accounts + + // BankAsset DR CR (Statement) + fl = fact.createLine(line, + getAccount(Doc.ACCTTYPE_BankAsset, as), + line.getC_Currency_ID(), line.getStmtAmt()); + if (fl != null && AD_Org_ID != 0) fl.setAD_Org_ID(AD_Org_ID); - else - fl.setAD_Org_ID(line.getAD_Org_ID(true)); // from payment + if (fl != null && C_BPartner_ID != 0) + fl.setC_BPartner_ID(C_BPartner_ID); + + // BankInTransit DR CR (Payment) + fl = fact.createLine(line, + getAccount(Doc.ACCTTYPE_BankInTransit, as), + line.getC_Currency_ID(), line.getTrxAmt().negate()); + if (fl != null) + { + if (C_BPartner_ID != 0) + fl.setC_BPartner_ID(C_BPartner_ID); + if (AD_Org_ID != 0) + fl.setAD_Org_ID(AD_Org_ID); + else + fl.setAD_Org_ID(line.getAD_Org_ID(true)); // from payment + } + } + // End Avoid usage of clearing accounts + // Charge DR (Charge) fl = fact.createLine(line, line.getChargeAccount(as, line.getChargeAmt().negate()), diff --git a/base/src/org/compiere/acct/Doc_MatchInv.java b/base/src/org/compiere/acct/Doc_MatchInv.java index 158c88b6d1..7676580de9 100644 --- a/base/src/org/compiere/acct/Doc_MatchInv.java +++ b/base/src/org/compiere/acct/Doc_MatchInv.java @@ -31,6 +31,10 @@ import org.compiere.util.*; * Update Costing Records * @author Jorg Janke * @version $Id: Doc_MatchInv.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ + * + * FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual + * Avoid posting if both accounts Not Invoiced Receipts and Inventory Clearing are equal + * */ public class Doc_MatchInv extends Doc { @@ -221,6 +225,26 @@ public class Doc_MatchInv extends Doc cr.setUser1_ID(m_invoiceLine.getUser1_ID()); cr.setUser2_ID(m_invoiceLine.getUser2_ID()); + // Avoid usage of clearing accounts + // If both accounts Not Invoiced Receipts and Inventory Clearing are equal + // then remove the posting + + MAccount acct_db = dr.getAccount(); // not_invoiced_receipts + MAccount acct_cr = cr.getAccount(); // inventory_clearing + + if ((!as.isPostIfClearingEqual()) && acct_db.equals(acct_cr)) { + + BigDecimal debit = dr.getAmtSourceDr(); + BigDecimal credit = cr.getAmtSourceCr(); + + if (debit.compareTo(credit) == 0) { + fact.remove(dr); + fact.remove(cr); + } + + } + // End Avoid usage of clearing accounts + // Invoice Price Variance difference BigDecimal ipv = cr.getAcctBalance().add(dr.getAcctBalance()).negate(); diff --git a/base/src/org/compiere/model/I_C_AcctSchema.java b/base/src/org/compiere/model/I_C_AcctSchema.java index 6313e9a707..c805b7f54a 100644 --- a/base/src/org/compiere/model/I_C_AcctSchema.java +++ b/base/src/org/compiere/model/I_C_AcctSchema.java @@ -5,21 +5,21 @@ * Copyright (C) Trifon Trifonov. * * Copyright (C) Contributors * * * - * This program is free software; + * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; + * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; + * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * - * along with this program; + * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301, USA. * @@ -30,371 +30,382 @@ * Sponsors: * * - Company (http://www.site.com) * **********************************************************************/ -package org.compiere.model; - -import java.util.*; -import java.sql.Timestamp; -import java.math.*; -import org.compiere.util.*; +package org.compiere.model; - /** Generated Interface for C_AcctSchema - * @author Trifon Trifonov (generated) - * @version Release 3.3.0 - 2007-08-24 11:39:36.406 - */ - public interface I_C_AcctSchema -{ +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_AcctSchema + * @author Trifon Trifonov (generated) + * @version Release 3.3.0 + */ +public interface I_C_AcctSchema +{ /** TableName=C_AcctSchema */ - public static final String Table_Name = "C_AcctSchema"; + public static final String Table_Name = "C_AcctSchema"; /** AD_Table_ID=265 */ - public static final int Table_ID = MTable.getTable_ID(Table_Name); + public static final int Table_ID = MTable.getTable_ID(Table_Name); - KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); /** AccessLevel = 2 - Client */ - BigDecimal accessLevel = new BigDecimal(2); + BigDecimal accessLevel = BigDecimal.valueOf(2); /** Load Meta Data */ /** Column name AD_OrgOnly_ID */ - public static final String COLUMNNAME_AD_OrgOnly_ID = "AD_OrgOnly_ID"; + public static final String COLUMNNAME_AD_OrgOnly_ID = "AD_OrgOnly_ID"; /** Set Only Organization. - * Create posting entries only for this organization + * Create posting entries only for this organization */ - public void setAD_OrgOnly_ID (int AD_OrgOnly_ID); + public void setAD_OrgOnly_ID (int AD_OrgOnly_ID); /** Get Only Organization. - * Create posting entries only for this organization + * Create posting entries only for this organization */ - public int getAD_OrgOnly_ID(); + public int getAD_OrgOnly_ID(); /** Column name AutoPeriodControl */ - public static final String COLUMNNAME_AutoPeriodControl = "AutoPeriodControl"; + public static final String COLUMNNAME_AutoPeriodControl = "AutoPeriodControl"; /** Set Automatic Period Control. - * If selected, the periods are automatically opened and closed + * If selected, the periods are automatically opened and closed */ - public void setAutoPeriodControl (boolean AutoPeriodControl); + public void setAutoPeriodControl (boolean AutoPeriodControl); /** Get Automatic Period Control. - * If selected, the periods are automatically opened and closed + * If selected, the periods are automatically opened and closed */ - public boolean isAutoPeriodControl(); + public boolean isAutoPeriodControl(); /** Column name C_AcctSchema_ID */ - public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; + public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID"; /** Set Accounting Schema. - * Rules for accounting + * Rules for accounting */ - public void setC_AcctSchema_ID (int C_AcctSchema_ID); + public void setC_AcctSchema_ID (int C_AcctSchema_ID); /** Get Accounting Schema. - * Rules for accounting + * Rules for accounting */ - public int getC_AcctSchema_ID(); + public int getC_AcctSchema_ID(); /** Column name C_Currency_ID */ - public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; + public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; /** Set Currency. - * The Currency for this record + * The Currency for this record */ - public void setC_Currency_ID (int C_Currency_ID); + public void setC_Currency_ID (int C_Currency_ID); /** Get Currency. - * The Currency for this record + * The Currency for this record */ - public int getC_Currency_ID(); + public int getC_Currency_ID(); - public I_C_Currency getI_C_Currency() throws Exception; + public I_C_Currency getC_Currency() throws Exception; /** Column name C_Period_ID */ - public static final String COLUMNNAME_C_Period_ID = "C_Period_ID"; + public static final String COLUMNNAME_C_Period_ID = "C_Period_ID"; /** Set Period. - * Period of the Calendar + * Period of the Calendar */ - public void setC_Period_ID (int C_Period_ID); + public void setC_Period_ID (int C_Period_ID); /** Get Period. - * Period of the Calendar + * Period of the Calendar */ - public int getC_Period_ID(); + public int getC_Period_ID(); - public I_C_Period getI_C_Period() throws Exception; + public I_C_Period getC_Period() throws Exception; /** Column name CommitmentType */ - public static final String COLUMNNAME_CommitmentType = "CommitmentType"; + public static final String COLUMNNAME_CommitmentType = "CommitmentType"; /** Set Commitment Type. - * Create Commitment and/or Reservations for Budget Control + * Create Commitment and/or Reservations for Budget Control */ - public void setCommitmentType (String CommitmentType); + public void setCommitmentType (String CommitmentType); /** Get Commitment Type. - * Create Commitment and/or Reservations for Budget Control + * Create Commitment and/or Reservations for Budget Control */ - public String getCommitmentType(); + public String getCommitmentType(); /** Column name CostingLevel */ - public static final String COLUMNNAME_CostingLevel = "CostingLevel"; + public static final String COLUMNNAME_CostingLevel = "CostingLevel"; /** Set Costing Level. - * The lowest level to accumulate Costing Information + * The lowest level to accumulate Costing Information */ - public void setCostingLevel (String CostingLevel); + public void setCostingLevel (String CostingLevel); /** Get Costing Level. - * The lowest level to accumulate Costing Information + * The lowest level to accumulate Costing Information */ - public String getCostingLevel(); + public String getCostingLevel(); /** Column name CostingMethod */ - public static final String COLUMNNAME_CostingMethod = "CostingMethod"; + public static final String COLUMNNAME_CostingMethod = "CostingMethod"; /** Set Costing Method. - * Indicates how Costs will be calculated + * Indicates how Costs will be calculated */ - public void setCostingMethod (String CostingMethod); + public void setCostingMethod (String CostingMethod); /** Get Costing Method. - * Indicates how Costs will be calculated + * Indicates how Costs will be calculated */ - public String getCostingMethod(); + public String getCostingMethod(); /** Column name Description */ - public static final String COLUMNNAME_Description = "Description"; + public static final String COLUMNNAME_Description = "Description"; /** Set Description. - * Optional short description of the record + * Optional short description of the record */ - public void setDescription (String Description); + public void setDescription (String Description); /** Get Description. - * Optional short description of the record + * Optional short description of the record */ - public String getDescription(); + public String getDescription(); /** Column name GAAP */ - public static final String COLUMNNAME_GAAP = "GAAP"; + public static final String COLUMNNAME_GAAP = "GAAP"; /** Set GAAP. - * Generally Accepted Accounting Principles + * Generally Accepted Accounting Principles */ - public void setGAAP (String GAAP); + public void setGAAP (String GAAP); /** Get GAAP. - * Generally Accepted Accounting Principles + * Generally Accepted Accounting Principles */ - public String getGAAP(); + public String getGAAP(); /** Column name HasAlias */ - public static final String COLUMNNAME_HasAlias = "HasAlias"; + public static final String COLUMNNAME_HasAlias = "HasAlias"; /** Set Use Account Alias. - * Ability to select (partial) account combinations by an Alias + * Ability to select (partial) account combinations by an Alias */ - public void setHasAlias (boolean HasAlias); + public void setHasAlias (boolean HasAlias); /** Get Use Account Alias. - * Ability to select (partial) account combinations by an Alias + * Ability to select (partial) account combinations by an Alias */ - public boolean isHasAlias(); + public boolean isHasAlias(); /** Column name HasCombination */ - public static final String COLUMNNAME_HasCombination = "HasCombination"; + public static final String COLUMNNAME_HasCombination = "HasCombination"; /** Set Use Account Combination Control. - * Combination of account elements are checked + * Combination of account elements are checked */ - public void setHasCombination (boolean HasCombination); + public void setHasCombination (boolean HasCombination); /** Get Use Account Combination Control. - * Combination of account elements are checked + * Combination of account elements are checked */ - public boolean isHasCombination(); + public boolean isHasCombination(); /** Column name IsAccrual */ - public static final String COLUMNNAME_IsAccrual = "IsAccrual"; + public static final String COLUMNNAME_IsAccrual = "IsAccrual"; /** Set Accrual. - * Indicates if Accrual or Cash Based accounting will be used + * Indicates if Accrual or Cash Based accounting will be used */ - public void setIsAccrual (boolean IsAccrual); + public void setIsAccrual (boolean IsAccrual); /** Get Accrual. - * Indicates if Accrual or Cash Based accounting will be used + * Indicates if Accrual or Cash Based accounting will be used */ - public boolean isAccrual(); + public boolean isAccrual(); /** Column name IsAdjustCOGS */ - public static final String COLUMNNAME_IsAdjustCOGS = "IsAdjustCOGS"; + public static final String COLUMNNAME_IsAdjustCOGS = "IsAdjustCOGS"; /** Set Adjust COGS. - * Adjust Cost of Good Sold + * Adjust Cost of Good Sold */ - public void setIsAdjustCOGS (boolean IsAdjustCOGS); + public void setIsAdjustCOGS (boolean IsAdjustCOGS); /** Get Adjust COGS. - * Adjust Cost of Good Sold + * Adjust Cost of Good Sold */ - public boolean isAdjustCOGS(); + public boolean isAdjustCOGS(); /** Column name IsAllowNegativePosting */ - public static final String COLUMNNAME_IsAllowNegativePosting = "IsAllowNegativePosting"; + public static final String COLUMNNAME_IsAllowNegativePosting = "IsAllowNegativePosting"; /** Set Allow Negative Posting. - * Allow to post negative accounting values + * Allow to post negative accounting values */ - public void setIsAllowNegativePosting (boolean IsAllowNegativePosting); + public void setIsAllowNegativePosting (boolean IsAllowNegativePosting); /** Get Allow Negative Posting. - * Allow to post negative accounting values + * Allow to post negative accounting values */ - public boolean isAllowNegativePosting(); + public boolean isAllowNegativePosting(); /** Column name IsDiscountCorrectsTax */ - public static final String COLUMNNAME_IsDiscountCorrectsTax = "IsDiscountCorrectsTax"; + public static final String COLUMNNAME_IsDiscountCorrectsTax = "IsDiscountCorrectsTax"; /** Set Correct tax for Discounts/Charges. - * Correct the tax for payment discount and charges + * Correct the tax for payment discount and charges */ - public void setIsDiscountCorrectsTax (boolean IsDiscountCorrectsTax); + public void setIsDiscountCorrectsTax (boolean IsDiscountCorrectsTax); /** Get Correct tax for Discounts/Charges. - * Correct the tax for payment discount and charges + * Correct the tax for payment discount and charges */ - public boolean isDiscountCorrectsTax(); + public boolean isDiscountCorrectsTax(); /** Column name IsExplicitCostAdjustment */ - public static final String COLUMNNAME_IsExplicitCostAdjustment = "IsExplicitCostAdjustment"; + public static final String COLUMNNAME_IsExplicitCostAdjustment = "IsExplicitCostAdjustment"; /** Set Explicit Cost Adjustment. - * Post the cost adjustment explicitly + * Post the cost adjustment explicitly */ - public void setIsExplicitCostAdjustment (boolean IsExplicitCostAdjustment); + public void setIsExplicitCostAdjustment (boolean IsExplicitCostAdjustment); /** Get Explicit Cost Adjustment. - * Post the cost adjustment explicitly + * Post the cost adjustment explicitly */ - public boolean isExplicitCostAdjustment(); + public boolean isExplicitCostAdjustment(); + + /** Column name IsPostIfClearingEqual */ + public static final String COLUMNNAME_IsPostIfClearingEqual = "IsPostIfClearingEqual"; + + /** Set Post if Clearing Equal. + * This flag controls if Adempiere must post when clearing (transit) and final accounts are the same + */ + public void setIsPostIfClearingEqual (boolean IsPostIfClearingEqual); + + /** Get Post if Clearing Equal. + * This flag controls if Adempiere must post when clearing (transit) and final accounts are the same + */ + public boolean isPostIfClearingEqual(); /** Column name IsPostServices */ - public static final String COLUMNNAME_IsPostServices = "IsPostServices"; + public static final String COLUMNNAME_IsPostServices = "IsPostServices"; /** Set Post Services Separately. - * Differentiate between Services and Product Receivable/Payables + * Differentiate between Services and Product Receivable/Payables */ - public void setIsPostServices (boolean IsPostServices); + public void setIsPostServices (boolean IsPostServices); /** Get Post Services Separately. - * Differentiate between Services and Product Receivable/Payables + * Differentiate between Services and Product Receivable/Payables */ - public boolean isPostServices(); + public boolean isPostServices(); /** Column name IsTradeDiscountPosted */ - public static final String COLUMNNAME_IsTradeDiscountPosted = "IsTradeDiscountPosted"; + public static final String COLUMNNAME_IsTradeDiscountPosted = "IsTradeDiscountPosted"; /** Set Post Trade Discount. - * Generate postings for trade discounts + * Generate postings for trade discounts */ - public void setIsTradeDiscountPosted (boolean IsTradeDiscountPosted); + public void setIsTradeDiscountPosted (boolean IsTradeDiscountPosted); /** Get Post Trade Discount. - * Generate postings for trade discounts + * Generate postings for trade discounts */ - public boolean isTradeDiscountPosted(); + public boolean isTradeDiscountPosted(); /** Column name M_CostType_ID */ - public static final String COLUMNNAME_M_CostType_ID = "M_CostType_ID"; + public static final String COLUMNNAME_M_CostType_ID = "M_CostType_ID"; /** Set Cost Type. - * Type of Cost (e.g. Current, Plan, Future) + * Type of Cost (e.g. Current, Plan, Future) */ - public void setM_CostType_ID (int M_CostType_ID); + public void setM_CostType_ID (int M_CostType_ID); /** Get Cost Type. - * Type of Cost (e.g. Current, Plan, Future) + * Type of Cost (e.g. Current, Plan, Future) */ - public int getM_CostType_ID(); + public int getM_CostType_ID(); - public I_M_CostType getI_M_CostType() throws Exception; + public I_M_CostType getM_CostType() throws Exception; /** Column name Name */ - public static final String COLUMNNAME_Name = "Name"; + public static final String COLUMNNAME_Name = "Name"; /** Set Name. - * Alphanumeric identifier of the entity + * Alphanumeric identifier of the entity */ - public void setName (String Name); + public void setName (String Name); /** Get Name. - * Alphanumeric identifier of the entity + * Alphanumeric identifier of the entity */ - public String getName(); + public String getName(); /** Column name Period_OpenFuture */ - public static final String COLUMNNAME_Period_OpenFuture = "Period_OpenFuture"; + public static final String COLUMNNAME_Period_OpenFuture = "Period_OpenFuture"; /** Set Future Days. - * Number of days to be able to post to a future date (based on system date) + * Number of days to be able to post to a future date (based on system date) */ - public void setPeriod_OpenFuture (int Period_OpenFuture); + public void setPeriod_OpenFuture (int Period_OpenFuture); /** Get Future Days. - * Number of days to be able to post to a future date (based on system date) + * Number of days to be able to post to a future date (based on system date) */ - public int getPeriod_OpenFuture(); + public int getPeriod_OpenFuture(); /** Column name Period_OpenHistory */ - public static final String COLUMNNAME_Period_OpenHistory = "Period_OpenHistory"; + public static final String COLUMNNAME_Period_OpenHistory = "Period_OpenHistory"; /** Set History Days. - * Number of days to be able to post in the past (based on system date) + * Number of days to be able to post in the past (based on system date) */ - public void setPeriod_OpenHistory (int Period_OpenHistory); + public void setPeriod_OpenHistory (int Period_OpenHistory); /** Get History Days. - * Number of days to be able to post in the past (based on system date) + * Number of days to be able to post in the past (based on system date) */ - public int getPeriod_OpenHistory(); + public int getPeriod_OpenHistory(); /** Column name Processing */ - public static final String COLUMNNAME_Processing = "Processing"; + public static final String COLUMNNAME_Processing = "Processing"; /** Set Process Now */ - public void setProcessing (boolean Processing); + public void setProcessing (boolean Processing); /** Get Process Now */ - public boolean isProcessing(); + public boolean isProcessing(); /** Column name Separator */ - public static final String COLUMNNAME_Separator = "Separator"; + public static final String COLUMNNAME_Separator = "Separator"; /** Set Element Separator. - * Element Separator + * Element Separator */ - public void setSeparator (String Separator); + public void setSeparator (String Separator); /** Get Element Separator. - * Element Separator + * Element Separator */ - public String getSeparator(); + public String getSeparator(); /** Column name TaxCorrectionType */ - public static final String COLUMNNAME_TaxCorrectionType = "TaxCorrectionType"; + public static final String COLUMNNAME_TaxCorrectionType = "TaxCorrectionType"; /** Set Tax Correction. - * Type of Tax Correction + * Type of Tax Correction */ - public void setTaxCorrectionType (String TaxCorrectionType); + public void setTaxCorrectionType (String TaxCorrectionType); /** Get Tax Correction. - * Type of Tax Correction + * Type of Tax Correction */ - public String getTaxCorrectionType(); -} + public String getTaxCorrectionType(); +} diff --git a/base/src/org/compiere/model/X_C_AcctSchema.java b/base/src/org/compiere/model/X_C_AcctSchema.java index ea9a0d12a7..13d5af8e06 100644 --- a/base/src/org/compiere/model/X_C_AcctSchema.java +++ b/base/src/org/compiere/model/X_C_AcctSchema.java @@ -14,768 +14,832 @@ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -/** Generated Model - DO NOT CHANGE */ -package org.compiere.model; - -import java.util.*; -import java.sql.*; -import java.math.*; -import java.lang.reflect.Constructor; -import java.util.logging.Level; -import org.compiere.util.*; - -/** Generated Model for C_AcctSchema - * @author Adempiere (generated) - * @version Release 3.3.0 - $Id$ */ -public class X_C_AcctSchema extends PO implements I_C_AcctSchema, I_Persistent -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** Standard Constructor */ - public X_C_AcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName) - { - super (ctx, C_AcctSchema_ID, trxName); - /** if (C_AcctSchema_ID == 0) { setAutoPeriodControl (false); - setC_AcctSchema_ID (0); - setC_Currency_ID (0); - setCommitmentType (null); -// N - setCostingLevel (null); -// C - setCostingMethod (null); -// S - setGAAP (null); - setHasAlias (false); - setHasCombination (false); - setIsAccrual (true); -// Y - setIsAdjustCOGS (false); - setIsDiscountCorrectsTax (false); - setIsExplicitCostAdjustment (false); -// N - setIsPostServices (false); -// N - setIsTradeDiscountPosted (false); - setM_CostType_ID (0); - setName (null); - setSeparator (null); -// - - setTaxCorrectionType (null); -} */ - } - - /** Load Constructor */ - public X_C_AcctSchema (Properties ctx, ResultSet rs, String trxName) - { - super (ctx, rs, trxName); - } - - /** AccessLevel - * @return 2 - Client - */ - protected int get_AccessLevel() - { - return accessLevel.intValue(); - } - - /** Load Meta Data */ - protected POInfo initPO (Properties ctx) - { - POInfo poi = POInfo.getPOInfo (ctx, Table_ID); - return poi; - } - - public String toString() - { - StringBuffer sb = new StringBuffer ("X_C_AcctSchema[") - .append(get_ID()).append("]"); - return sb.toString(); - } +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; -/** AD_OrgOnly_ID AD_Reference_ID=322 */ -public static final int AD_ORGONLY_ID_AD_Reference_ID=322; - /** Set Only Organization. - @param AD_OrgOnly_ID - Create posting entries only for this organization - */ - public void setAD_OrgOnly_ID (int AD_OrgOnly_ID) - { - if (AD_OrgOnly_ID <= 0) set_Value (COLUMNNAME_AD_OrgOnly_ID, null); - else - set_Value (COLUMNNAME_AD_OrgOnly_ID, Integer.valueOf(AD_OrgOnly_ID)); - } - - /** Get Only Organization. - @return Create posting entries only for this organization - */ - public int getAD_OrgOnly_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgOnly_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Automatic Period Control. - @param AutoPeriodControl - If selected, the periods are automatically opened and closed - */ - public void setAutoPeriodControl (boolean AutoPeriodControl) - { - set_Value (COLUMNNAME_AutoPeriodControl, Boolean.valueOf(AutoPeriodControl)); - } - - /** Get Automatic Period Control. - @return If selected, the periods are automatically opened and closed - */ - public boolean isAutoPeriodControl () - { - Object oo = get_Value(COLUMNNAME_AutoPeriodControl); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Accounting Schema. - @param C_AcctSchema_ID - Rules for accounting - */ - public void setC_AcctSchema_ID (int C_AcctSchema_ID) - { - if (C_AcctSchema_ID < 1) - throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); - set_ValueNoCheck (COLUMNNAME_C_AcctSchema_ID, Integer.valueOf(C_AcctSchema_ID)); - } - - /** Get Accounting Schema. - @return Rules for accounting - */ - public int getC_AcctSchema_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_AcctSchema_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_Currency getI_C_Currency() throws Exception - { - Class clazz = MTable.getClass(I_C_Currency.Table_Name); - I_C_Currency result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); - } catch (Exception e) { - log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); - log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); - throw e; - } - return result; - } - - /** Set Currency. - @param C_Currency_ID - The Currency for this record - */ - public void setC_Currency_ID (int C_Currency_ID) - { - if (C_Currency_ID < 1) - throw new IllegalArgumentException ("C_Currency_ID is mandatory."); - set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); - } - - /** Get Currency. - @return The Currency for this record - */ - public int getC_Currency_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_Period getI_C_Period() throws Exception - { - Class clazz = MTable.getClass(I_C_Period.Table_Name); - I_C_Period result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_Period)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Period_ID()), get_TrxName()}); - } catch (Exception e) { - log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); - log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); - throw e; - } - return result; - } - - /** Set Period. - @param C_Period_ID - Period of the Calendar - */ - public void setC_Period_ID (int C_Period_ID) - { - if (C_Period_ID <= 0) set_ValueNoCheck (COLUMNNAME_C_Period_ID, null); - else - set_ValueNoCheck (COLUMNNAME_C_Period_ID, Integer.valueOf(C_Period_ID)); - } - - /** Get Period. - @return Period of the Calendar - */ - public int getC_Period_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Period_ID); - if (ii == null) - return 0; - return ii.intValue(); - } +import java.lang.reflect.Constructor; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.KeyNamePair; -/** CommitmentType AD_Reference_ID=359 */ -public static final int COMMITMENTTYPE_AD_Reference_ID=359;/** Commitment & Reservation = B */ -public static final String COMMITMENTTYPE_CommitmentReservation = "B";/** Commitment only = C */ -public static final String COMMITMENTTYPE_CommitmentOnly = "C";/** None = N */ -public static final String COMMITMENTTYPE_None = "N"; - /** Set Commitment Type. - @param CommitmentType - Create Commitment and/or Reservations for Budget Control - */ - public void setCommitmentType (String CommitmentType) - { -if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory");if (CommitmentType.equals("B") || CommitmentType.equals("C") || CommitmentType.equals("N")); else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - B - C - N"); if (CommitmentType.length() > 1) - { - log.warning("Length > 1 - truncated"); - CommitmentType = CommitmentType.substring(0, 0); - } - set_Value (COLUMNNAME_CommitmentType, CommitmentType); - } - - /** Get Commitment Type. - @return Create Commitment and/or Reservations for Budget Control - */ - public String getCommitmentType () - { - return (String)get_Value(COLUMNNAME_CommitmentType); - } +/** Generated Model for C_AcctSchema + * @author Adempiere (generated) + * @version Release 3.3.0 - $Id$ */ +public class X_C_AcctSchema extends PO implements I_C_AcctSchema, I_Persistent +{ -/** CostingLevel AD_Reference_ID=355 */ -public static final int COSTINGLEVEL_AD_Reference_ID=355;/** Batch/Lot = B */ -public static final String COSTINGLEVEL_BatchLot = "B";/** Client = C */ -public static final String COSTINGLEVEL_Client = "C";/** Organization = O */ -public static final String COSTINGLEVEL_Organization = "O"; - /** Set Costing Level. - @param CostingLevel - The lowest level to accumulate Costing Information - */ - public void setCostingLevel (String CostingLevel) - { -if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory");if (CostingLevel.equals("B") || CostingLevel.equals("C") || CostingLevel.equals("O")); else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - B - C - O"); if (CostingLevel.length() > 1) - { - log.warning("Length > 1 - truncated"); - CostingLevel = CostingLevel.substring(0, 0); - } - set_Value (COLUMNNAME_CostingLevel, CostingLevel); - } - - /** Get Costing Level. - @return The lowest level to accumulate Costing Information - */ - public String getCostingLevel () - { - return (String)get_Value(COLUMNNAME_CostingLevel); - } + /** + * + */ + private static final long serialVersionUID = 1L; -/** CostingMethod AD_Reference_ID=122 */ -public static final int COSTINGMETHOD_AD_Reference_ID=122;/** Average PO = A */ -public static final String COSTINGMETHOD_AveragePO = "A";/** Fifo = F */ -public static final String COSTINGMETHOD_Fifo = "F";/** Average Invoice = I */ -public static final String COSTINGMETHOD_AverageInvoice = "I";/** Lifo = L */ -public static final String COSTINGMETHOD_Lifo = "L";/** Standard Costing = S */ -public static final String COSTINGMETHOD_StandardCosting = "S";/** User Defined = U */ -public static final String COSTINGMETHOD_UserDefined = "U";/** Last Invoice = i */ -public static final String COSTINGMETHOD_LastInvoice = "i";/** Last PO Price = p */ -public static final String COSTINGMETHOD_LastPOPrice = "p";/** _ = x */ -public static final String COSTINGMETHOD__ = "x"; - /** Set Costing Method. - @param CostingMethod - Indicates how Costs will be calculated - */ - public void setCostingMethod (String CostingMethod) - { -if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory");if (CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); if (CostingMethod.length() > 1) - { - log.warning("Length > 1 - truncated"); - CostingMethod = CostingMethod.substring(0, 0); - } - set_Value (COLUMNNAME_CostingMethod, CostingMethod); - } - - /** Get Costing Method. - @return Indicates how Costs will be calculated - */ - public String getCostingMethod () - { - return (String)get_Value(COLUMNNAME_CostingMethod); - } - - /** Set Description. - @param Description - Optional short description of the record - */ - public void setDescription (String Description) - { - if (Description != null && Description.length() > 255) - { - log.warning("Length > 255 - truncated"); - Description = Description.substring(0, 254); - } - set_Value (COLUMNNAME_Description, Description); - } - - /** Get Description. - @return Optional short description of the record - */ - public String getDescription () - { - return (String)get_Value(COLUMNNAME_Description); - } + /** Standard Constructor */ + public X_C_AcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName) + { + super (ctx, C_AcctSchema_ID, trxName); + /** if (C_AcctSchema_ID == 0) + { + setAutoPeriodControl (false); + setC_AcctSchema_ID (0); + setC_Currency_ID (0); + setCommitmentType (null); +// N + setCostingLevel (null); +// C + setCostingMethod (null); +// S + setGAAP (null); + setHasAlias (false); + setHasCombination (false); + setIsAccrual (true); +// Y + setIsAdjustCOGS (false); + setIsDiscountCorrectsTax (false); + setIsExplicitCostAdjustment (false); +// N + setIsPostServices (false); +// N + setIsTradeDiscountPosted (false); + setM_CostType_ID (0); + setName (null); + setSeparator (null); +// - + setTaxCorrectionType (null); + } */ + } + + /** Load Constructor */ + public X_C_AcctSchema (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 2 - Client + */ + protected int get_AccessLevel() + { + return accessLevel.intValue(); + } + + /** Load Meta Data */ + protected POInfo initPO (Properties ctx) + { + POInfo poi = POInfo.getPOInfo (ctx, Table_ID); + return poi; + } + + public String toString() + { + StringBuffer sb = new StringBuffer ("X_C_AcctSchema[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** AD_OrgOnly_ID AD_Reference_ID=322 */ + public static final int AD_ORGONLY_ID_AD_Reference_ID=322; + /** Set Only Organization. + @param AD_OrgOnly_ID + Create posting entries only for this organization + */ + public void setAD_OrgOnly_ID (int AD_OrgOnly_ID) + { + if (AD_OrgOnly_ID <= 0) + set_Value (COLUMNNAME_AD_OrgOnly_ID, null); + else + set_Value (COLUMNNAME_AD_OrgOnly_ID, Integer.valueOf(AD_OrgOnly_ID)); + } + + /** Get Only Organization. + @return Create posting entries only for this organization + */ + public int getAD_OrgOnly_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgOnly_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Automatic Period Control. + @param AutoPeriodControl + If selected, the periods are automatically opened and closed + */ + public void setAutoPeriodControl (boolean AutoPeriodControl) + { + set_Value (COLUMNNAME_AutoPeriodControl, Boolean.valueOf(AutoPeriodControl)); + } + + /** Get Automatic Period Control. + @return If selected, the periods are automatically opened and closed + */ + public boolean isAutoPeriodControl () + { + Object oo = get_Value(COLUMNNAME_AutoPeriodControl); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Accounting Schema. + @param C_AcctSchema_ID + Rules for accounting + */ + public void setC_AcctSchema_ID (int C_AcctSchema_ID) + { + if (C_AcctSchema_ID < 1) + throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_AcctSchema_ID, Integer.valueOf(C_AcctSchema_ID)); + } + + /** Get Accounting Schema. + @return Rules for accounting + */ + public int getC_AcctSchema_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_AcctSchema_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Currency getC_Currency() throws Exception + { + Class clazz = MTable.getClass(I_C_Currency.Table_Name); + I_C_Currency result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Currency)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Currency_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Currency. + @param C_Currency_ID + The Currency for this record + */ + public void setC_Currency_ID (int C_Currency_ID) + { + if (C_Currency_ID < 1) + throw new IllegalArgumentException ("C_Currency_ID is mandatory."); + set_Value (COLUMNNAME_C_Currency_ID, Integer.valueOf(C_Currency_ID)); + } + + /** Get Currency. + @return The Currency for this record + */ + public int getC_Currency_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Period getC_Period() throws Exception + { + Class clazz = MTable.getClass(I_C_Period.Table_Name); + I_C_Period result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Period)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Period_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Period. + @param C_Period_ID + Period of the Calendar + */ + public void setC_Period_ID (int C_Period_ID) + { + if (C_Period_ID <= 0) + set_ValueNoCheck (COLUMNNAME_C_Period_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Period_ID, Integer.valueOf(C_Period_ID)); + } + + /** Get Period. + @return Period of the Calendar + */ + public int getC_Period_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Period_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** CommitmentType AD_Reference_ID=359 */ + public static final int COMMITMENTTYPE_AD_Reference_ID=359; + /** Commitment only = C */ + public static final String COMMITMENTTYPE_CommitmentOnly = "C"; + /** Commitment & Reservation = B */ + public static final String COMMITMENTTYPE_CommitmentReservation = "B"; + /** None = N */ + public static final String COMMITMENTTYPE_None = "N"; + /** Set Commitment Type. + @param CommitmentType + Create Commitment and/or Reservations for Budget Control + */ + public void setCommitmentType (String CommitmentType) + { + if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory"); + if (CommitmentType.equals("C") || CommitmentType.equals("B") || CommitmentType.equals("N")); else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - C - B - N"); + if (CommitmentType.length() > 1) + { + log.warning("Length > 1 - truncated"); + CommitmentType = CommitmentType.substring(0, 1); + } + set_Value (COLUMNNAME_CommitmentType, CommitmentType); + } + + /** Get Commitment Type. + @return Create Commitment and/or Reservations for Budget Control + */ + public String getCommitmentType () + { + return (String)get_Value(COLUMNNAME_CommitmentType); + } + + /** CostingLevel AD_Reference_ID=355 */ + public static final int COSTINGLEVEL_AD_Reference_ID=355; + /** Client = C */ + public static final String COSTINGLEVEL_Client = "C"; + /** Organization = O */ + public static final String COSTINGLEVEL_Organization = "O"; + /** Batch/Lot = B */ + public static final String COSTINGLEVEL_BatchLot = "B"; + /** Set Costing Level. + @param CostingLevel + The lowest level to accumulate Costing Information + */ + public void setCostingLevel (String CostingLevel) + { + if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory"); + if (CostingLevel.equals("C") || CostingLevel.equals("O") || CostingLevel.equals("B")); else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - C - O - B"); + if (CostingLevel.length() > 1) + { + log.warning("Length > 1 - truncated"); + CostingLevel = CostingLevel.substring(0, 1); + } + set_Value (COLUMNNAME_CostingLevel, CostingLevel); + } + + /** Get Costing Level. + @return The lowest level to accumulate Costing Information + */ + public String getCostingLevel () + { + return (String)get_Value(COLUMNNAME_CostingLevel); + } + + /** CostingMethod AD_Reference_ID=122 */ + public static final int COSTINGMETHOD_AD_Reference_ID=122; + /** Standard Costing = S */ + public static final String COSTINGMETHOD_StandardCosting = "S"; + /** Average PO = A */ + public static final String COSTINGMETHOD_AveragePO = "A"; + /** Lifo = L */ + public static final String COSTINGMETHOD_Lifo = "L"; + /** Fifo = F */ + public static final String COSTINGMETHOD_Fifo = "F"; + /** Last PO Price = p */ + public static final String COSTINGMETHOD_LastPOPrice = "p"; + /** Average Invoice = I */ + public static final String COSTINGMETHOD_AverageInvoice = "I"; + /** Last Invoice = i */ + public static final String COSTINGMETHOD_LastInvoice = "i"; + /** User Defined = U */ + public static final String COSTINGMETHOD_UserDefined = "U"; + /** _ = x */ + public static final String COSTINGMETHOD__ = "x"; + /** Set Costing Method. + @param CostingMethod + Indicates how Costs will be calculated + */ + public void setCostingMethod (String CostingMethod) + { + if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory"); + if (CostingMethod.equals("S") || CostingMethod.equals("A") || CostingMethod.equals("L") || CostingMethod.equals("F") || CostingMethod.equals("p") || CostingMethod.equals("I") || CostingMethod.equals("i") || CostingMethod.equals("U") || CostingMethod.equals("x")); else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - S - A - L - F - p - I - i - U - x"); + if (CostingMethod.length() > 1) + { + log.warning("Length > 1 - truncated"); + CostingMethod = CostingMethod.substring(0, 1); + } + set_Value (COLUMNNAME_CostingMethod, CostingMethod); + } + + /** Get Costing Method. + @return Indicates how Costs will be calculated + */ + public String getCostingMethod () + { + return (String)get_Value(COLUMNNAME_CostingMethod); + } + + /** Set Description. + @param Description + Optional short description of the record + */ + public void setDescription (String Description) + { + + if (Description != null && Description.length() > 255) + { + log.warning("Length > 255 - truncated"); + Description = Description.substring(0, 255); + } + set_Value (COLUMNNAME_Description, Description); + } + + /** Get Description. + @return Optional short description of the record + */ + public String getDescription () + { + return (String)get_Value(COLUMNNAME_Description); + } + + /** GAAP AD_Reference_ID=123 */ + public static final int GAAP_AD_Reference_ID=123; + /** International GAAP = UN */ + public static final String GAAP_InternationalGAAP = "UN"; + /** US GAAP = US */ + public static final String GAAP_USGAAP = "US"; + /** German HGB = DE */ + public static final String GAAP_GermanHGB = "DE"; + /** French Accounting Standard = FR */ + public static final String GAAP_FrenchAccountingStandard = "FR"; + /** Custom Accounting Rules = XX */ + public static final String GAAP_CustomAccountingRules = "XX"; + /** Set GAAP. + @param GAAP + Generally Accepted Accounting Principles + */ + public void setGAAP (String GAAP) + { + if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory"); + if (GAAP.equals("UN") || GAAP.equals("US") || GAAP.equals("DE") || GAAP.equals("FR") || GAAP.equals("XX")); else throw new IllegalArgumentException ("GAAP Invalid value - " + GAAP + " - Reference_ID=123 - UN - US - DE - FR - XX"); + if (GAAP.length() > 2) + { + log.warning("Length > 2 - truncated"); + GAAP = GAAP.substring(0, 2); + } + set_Value (COLUMNNAME_GAAP, GAAP); + } + + /** Get GAAP. + @return Generally Accepted Accounting Principles + */ + public String getGAAP () + { + return (String)get_Value(COLUMNNAME_GAAP); + } + + /** Set Use Account Alias. + @param HasAlias + Ability to select (partial) account combinations by an Alias + */ + public void setHasAlias (boolean HasAlias) + { + set_Value (COLUMNNAME_HasAlias, Boolean.valueOf(HasAlias)); + } + + /** Get Use Account Alias. + @return Ability to select (partial) account combinations by an Alias + */ + public boolean isHasAlias () + { + Object oo = get_Value(COLUMNNAME_HasAlias); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Use Account Combination Control. + @param HasCombination + Combination of account elements are checked + */ + public void setHasCombination (boolean HasCombination) + { + set_Value (COLUMNNAME_HasCombination, Boolean.valueOf(HasCombination)); + } + + /** Get Use Account Combination Control. + @return Combination of account elements are checked + */ + public boolean isHasCombination () + { + Object oo = get_Value(COLUMNNAME_HasCombination); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Accrual. + @param IsAccrual + Indicates if Accrual or Cash Based accounting will be used + */ + public void setIsAccrual (boolean IsAccrual) + { + set_Value (COLUMNNAME_IsAccrual, Boolean.valueOf(IsAccrual)); + } + + /** Get Accrual. + @return Indicates if Accrual or Cash Based accounting will be used + */ + public boolean isAccrual () + { + Object oo = get_Value(COLUMNNAME_IsAccrual); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Adjust COGS. + @param IsAdjustCOGS + Adjust Cost of Good Sold + */ + public void setIsAdjustCOGS (boolean IsAdjustCOGS) + { + set_Value (COLUMNNAME_IsAdjustCOGS, Boolean.valueOf(IsAdjustCOGS)); + } + + /** Get Adjust COGS. + @return Adjust Cost of Good Sold + */ + public boolean isAdjustCOGS () + { + Object oo = get_Value(COLUMNNAME_IsAdjustCOGS); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Negative Posting. + @param IsAllowNegativePosting + Allow to post negative accounting values + */ + public void setIsAllowNegativePosting (boolean IsAllowNegativePosting) + { + set_Value (COLUMNNAME_IsAllowNegativePosting, Boolean.valueOf(IsAllowNegativePosting)); + } + + /** Get Allow Negative Posting. + @return Allow to post negative accounting values + */ + public boolean isAllowNegativePosting () + { + Object oo = get_Value(COLUMNNAME_IsAllowNegativePosting); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Correct tax for Discounts/Charges. + @param IsDiscountCorrectsTax + Correct the tax for payment discount and charges + */ + public void setIsDiscountCorrectsTax (boolean IsDiscountCorrectsTax) + { + set_Value (COLUMNNAME_IsDiscountCorrectsTax, Boolean.valueOf(IsDiscountCorrectsTax)); + } + + /** Get Correct tax for Discounts/Charges. + @return Correct the tax for payment discount and charges + */ + public boolean isDiscountCorrectsTax () + { + Object oo = get_Value(COLUMNNAME_IsDiscountCorrectsTax); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Explicit Cost Adjustment. + @param IsExplicitCostAdjustment + Post the cost adjustment explicitly + */ + public void setIsExplicitCostAdjustment (boolean IsExplicitCostAdjustment) + { + set_Value (COLUMNNAME_IsExplicitCostAdjustment, Boolean.valueOf(IsExplicitCostAdjustment)); + } + + /** Get Explicit Cost Adjustment. + @return Post the cost adjustment explicitly + */ + public boolean isExplicitCostAdjustment () + { + Object oo = get_Value(COLUMNNAME_IsExplicitCostAdjustment); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Post if Clearing Equal. + @param IsPostIfClearingEqual + This flag controls if Adempiere must post when clearing (transit) and final accounts are the same + */ + public void setIsPostIfClearingEqual (boolean IsPostIfClearingEqual) + { + set_Value (COLUMNNAME_IsPostIfClearingEqual, Boolean.valueOf(IsPostIfClearingEqual)); + } + + /** Get Post if Clearing Equal. + @return This flag controls if Adempiere must post when clearing (transit) and final accounts are the same + */ + public boolean isPostIfClearingEqual () + { + Object oo = get_Value(COLUMNNAME_IsPostIfClearingEqual); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Post Services Separately. + @param IsPostServices + Differentiate between Services and Product Receivable/Payables + */ + public void setIsPostServices (boolean IsPostServices) + { + set_Value (COLUMNNAME_IsPostServices, Boolean.valueOf(IsPostServices)); + } + + /** Get Post Services Separately. + @return Differentiate between Services and Product Receivable/Payables + */ + public boolean isPostServices () + { + Object oo = get_Value(COLUMNNAME_IsPostServices); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Post Trade Discount. + @param IsTradeDiscountPosted + Generate postings for trade discounts + */ + public void setIsTradeDiscountPosted (boolean IsTradeDiscountPosted) + { + set_Value (COLUMNNAME_IsTradeDiscountPosted, Boolean.valueOf(IsTradeDiscountPosted)); + } + + /** Get Post Trade Discount. + @return Generate postings for trade discounts + */ + public boolean isTradeDiscountPosted () + { + Object oo = get_Value(COLUMNNAME_IsTradeDiscountPosted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + public I_M_CostType getM_CostType() throws Exception + { + Class clazz = MTable.getClass(I_M_CostType.Table_Name); + I_M_CostType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_CostType)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_CostType_ID()), get_TrxName()}); + } catch (Exception e) { + log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); + log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); + throw e; + } + return result; + } + + /** Set Cost Type. + @param M_CostType_ID + Type of Cost (e.g. Current, Plan, Future) + */ + public void setM_CostType_ID (int M_CostType_ID) + { + if (M_CostType_ID < 1) + throw new IllegalArgumentException ("M_CostType_ID is mandatory."); + set_Value (COLUMNNAME_M_CostType_ID, Integer.valueOf(M_CostType_ID)); + } + + /** Get Cost Type. + @return Type of Cost (e.g. Current, Plan, Future) + */ + public int getM_CostType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_CostType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Name. + @param Name + Alphanumeric identifier of the entity + */ + public void setName (String Name) + { + if (Name == null) + throw new IllegalArgumentException ("Name is mandatory."); + + if (Name.length() > 60) + { + log.warning("Length > 60 - truncated"); + Name = Name.substring(0, 60); + } + set_Value (COLUMNNAME_Name, Name); + } + + /** Get Name. + @return Alphanumeric identifier of the entity + */ + public String getName () + { + return (String)get_Value(COLUMNNAME_Name); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getName()); + } + + /** Set Future Days. + @param Period_OpenFuture + Number of days to be able to post to a future date (based on system date) + */ + public void setPeriod_OpenFuture (int Period_OpenFuture) + { + set_Value (COLUMNNAME_Period_OpenFuture, Integer.valueOf(Period_OpenFuture)); + } + + /** Get Future Days. + @return Number of days to be able to post to a future date (based on system date) + */ + public int getPeriod_OpenFuture () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Period_OpenFuture); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set History Days. + @param Period_OpenHistory + Number of days to be able to post in the past (based on system date) + */ + public void setPeriod_OpenHistory (int Period_OpenHistory) + { + set_Value (COLUMNNAME_Period_OpenHistory, Integer.valueOf(Period_OpenHistory)); + } + + /** Get History Days. + @return Number of days to be able to post in the past (based on system date) + */ + public int getPeriod_OpenHistory () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Period_OpenHistory); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } -/** GAAP AD_Reference_ID=123 */ -public static final int GAAP_AD_Reference_ID=123;/** German HGB = DE */ -public static final String GAAP_GermanHGB = "DE";/** French Accounting Standard = FR */ -public static final String GAAP_FrenchAccountingStandard = "FR";/** International GAAP = UN */ -public static final String GAAP_InternationalGAAP = "UN";/** US GAAP = US */ -public static final String GAAP_USGAAP = "US";/** Custom Accounting Rules = XX */ -public static final String GAAP_CustomAccountingRules = "XX"; - /** Set GAAP. - @param GAAP - Generally Accepted Accounting Principles - */ - public void setGAAP (String GAAP) - { -if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (GAAP.equals("DE") || GAAP.equals("FR") || GAAP.equals("UN") || GAAP.equals("US") || GAAP.equals("XX")); else throw new IllegalArgumentException ("GAAP Invalid value - " + GAAP + " - Reference_ID=123 - DE - FR - UN - US - XX"); if (GAAP.length() > 2) - { - log.warning("Length > 2 - truncated"); - GAAP = GAAP.substring(0, 1); - } - set_Value (COLUMNNAME_GAAP, GAAP); - } - - /** Get GAAP. - @return Generally Accepted Accounting Principles - */ - public String getGAAP () - { - return (String)get_Value(COLUMNNAME_GAAP); - } - - /** Set Use Account Alias. - @param HasAlias - Ability to select (partial) account combinations by an Alias - */ - public void setHasAlias (boolean HasAlias) - { - set_Value (COLUMNNAME_HasAlias, Boolean.valueOf(HasAlias)); - } - - /** Get Use Account Alias. - @return Ability to select (partial) account combinations by an Alias - */ - public boolean isHasAlias () - { - Object oo = get_Value(COLUMNNAME_HasAlias); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Use Account Combination Control. - @param HasCombination - Combination of account elements are checked - */ - public void setHasCombination (boolean HasCombination) - { - set_Value (COLUMNNAME_HasCombination, Boolean.valueOf(HasCombination)); - } - - /** Get Use Account Combination Control. - @return Combination of account elements are checked - */ - public boolean isHasCombination () - { - Object oo = get_Value(COLUMNNAME_HasCombination); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Accrual. - @param IsAccrual - Indicates if Accrual or Cash Based accounting will be used - */ - public void setIsAccrual (boolean IsAccrual) - { - set_Value (COLUMNNAME_IsAccrual, Boolean.valueOf(IsAccrual)); - } - - /** Get Accrual. - @return Indicates if Accrual or Cash Based accounting will be used - */ - public boolean isAccrual () - { - Object oo = get_Value(COLUMNNAME_IsAccrual); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Adjust COGS. - @param IsAdjustCOGS - Adjust Cost of Good Sold - */ - public void setIsAdjustCOGS (boolean IsAdjustCOGS) - { - set_Value (COLUMNNAME_IsAdjustCOGS, Boolean.valueOf(IsAdjustCOGS)); - } - - /** Get Adjust COGS. - @return Adjust Cost of Good Sold - */ - public boolean isAdjustCOGS () - { - Object oo = get_Value(COLUMNNAME_IsAdjustCOGS); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Allow Negative Posting. - @param IsAllowNegativePosting - Allow to post negative accounting values - */ - public void setIsAllowNegativePosting (boolean IsAllowNegativePosting) - { - set_Value (COLUMNNAME_IsAllowNegativePosting, Boolean.valueOf(IsAllowNegativePosting)); - } - - /** Get Allow Negative Posting. - @return Allow to post negative accounting values - */ - public boolean isAllowNegativePosting () - { - Object oo = get_Value(COLUMNNAME_IsAllowNegativePosting); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Correct tax for Discounts/Charges. - @param IsDiscountCorrectsTax - Correct the tax for payment discount and charges - */ - public void setIsDiscountCorrectsTax (boolean IsDiscountCorrectsTax) - { - set_Value (COLUMNNAME_IsDiscountCorrectsTax, Boolean.valueOf(IsDiscountCorrectsTax)); - } - - /** Get Correct tax for Discounts/Charges. - @return Correct the tax for payment discount and charges - */ - public boolean isDiscountCorrectsTax () - { - Object oo = get_Value(COLUMNNAME_IsDiscountCorrectsTax); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Explicit Cost Adjustment. - @param IsExplicitCostAdjustment - Post the cost adjustment explicitly - */ - public void setIsExplicitCostAdjustment (boolean IsExplicitCostAdjustment) - { - set_Value (COLUMNNAME_IsExplicitCostAdjustment, Boolean.valueOf(IsExplicitCostAdjustment)); - } - - /** Get Explicit Cost Adjustment. - @return Post the cost adjustment explicitly - */ - public boolean isExplicitCostAdjustment () - { - Object oo = get_Value(COLUMNNAME_IsExplicitCostAdjustment); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Post Services Separately. - @param IsPostServices - Differentiate between Services and Product Receivable/Payables - */ - public void setIsPostServices (boolean IsPostServices) - { - set_Value (COLUMNNAME_IsPostServices, Boolean.valueOf(IsPostServices)); - } - - /** Get Post Services Separately. - @return Differentiate between Services and Product Receivable/Payables - */ - public boolean isPostServices () - { - Object oo = get_Value(COLUMNNAME_IsPostServices); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Post Trade Discount. - @param IsTradeDiscountPosted - Generate postings for trade discounts - */ - public void setIsTradeDiscountPosted (boolean IsTradeDiscountPosted) - { - set_Value (COLUMNNAME_IsTradeDiscountPosted, Boolean.valueOf(IsTradeDiscountPosted)); - } - - /** Get Post Trade Discount. - @return Generate postings for trade discounts - */ - public boolean isTradeDiscountPosted () - { - Object oo = get_Value(COLUMNNAME_IsTradeDiscountPosted); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - public I_M_CostType getI_M_CostType() throws Exception - { - Class clazz = MTable.getClass(I_M_CostType.Table_Name); - I_M_CostType result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_M_CostType)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_CostType_ID()), get_TrxName()}); - } catch (Exception e) { - log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); - log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); - throw e; - } - return result; - } - - /** Set Cost Type. - @param M_CostType_ID - Type of Cost (e.g. Current, Plan, Future) - */ - public void setM_CostType_ID (int M_CostType_ID) - { - if (M_CostType_ID < 1) - throw new IllegalArgumentException ("M_CostType_ID is mandatory."); - set_Value (COLUMNNAME_M_CostType_ID, Integer.valueOf(M_CostType_ID)); - } - - /** Get Cost Type. - @return Type of Cost (e.g. Current, Plan, Future) - */ - public int getM_CostType_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_M_CostType_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Name. - @param Name - Alphanumeric identifier of the entity - */ - public void setName (String Name) - { - if (Name == null) - throw new IllegalArgumentException ("Name is mandatory."); - if (Name.length() > 60) - { - log.warning("Length > 60 - truncated"); - Name = Name.substring(0, 59); - } - set_Value (COLUMNNAME_Name, Name); - } - - /** Get Name. - @return Alphanumeric identifier of the entity - */ - public String getName () - { - return (String)get_Value(COLUMNNAME_Name); - } - - /** Get Record ID/ColumnName - @return ID/ColumnName pair - */ - public KeyNamePair getKeyNamePair() - { - return new KeyNamePair(get_ID(), getName()); - } - - /** Set Future Days. - @param Period_OpenFuture - Number of days to be able to post to a future date (based on system date) - */ - public void setPeriod_OpenFuture (int Period_OpenFuture) - { - set_Value (COLUMNNAME_Period_OpenFuture, Integer.valueOf(Period_OpenFuture)); - } - - /** Get Future Days. - @return Number of days to be able to post to a future date (based on system date) - */ - public int getPeriod_OpenFuture () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Period_OpenFuture); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set History Days. - @param Period_OpenHistory - Number of days to be able to post in the past (based on system date) - */ - public void setPeriod_OpenHistory (int Period_OpenHistory) - { - set_Value (COLUMNNAME_Period_OpenHistory, Integer.valueOf(Period_OpenHistory)); - } - - /** Get History Days. - @return Number of days to be able to post in the past (based on system date) - */ - public int getPeriod_OpenHistory () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Period_OpenHistory); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Process Now. - @param Processing Process Now */ - public void setProcessing (boolean Processing) - { - set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); - } - /** Get Process Now. -@return Process Now */ - public boolean isProcessing () - { - Object oo = get_Value(COLUMNNAME_Processing); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Element Separator. - @param Separator - Element Separator - */ - public void setSeparator (String Separator) - { - if (Separator == null) - throw new IllegalArgumentException ("Separator is mandatory."); - if (Separator.length() > 1) - { - log.warning("Length > 1 - truncated"); - Separator = Separator.substring(0, 0); - } - set_Value (COLUMNNAME_Separator, Separator); - } - - /** Get Element Separator. - @return Element Separator - */ - public String getSeparator () - { - return (String)get_Value(COLUMNNAME_Separator); - } + @return Process Now */ + public boolean isProcessing () + { + Object oo = get_Value(COLUMNNAME_Processing); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } -/** TaxCorrectionType AD_Reference_ID=392 */ -public static final int TAXCORRECTIONTYPE_AD_Reference_ID=392;/** Write-off and Discount = B */ -public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B";/** Discount only = D */ -public static final String TAXCORRECTIONTYPE_DiscountOnly = "D";/** None = N */ -public static final String TAXCORRECTIONTYPE_None = "N";/** Write-off only = W */ -public static final String TAXCORRECTIONTYPE_Write_OffOnly = "W"; - /** Set Tax Correction. - @param TaxCorrectionType - Type of Tax Correction - */ - public void setTaxCorrectionType (String TaxCorrectionType) - { -if (TaxCorrectionType == null) throw new IllegalArgumentException ("TaxCorrectionType is mandatory");if (TaxCorrectionType.equals("B") || TaxCorrectionType.equals("D") || TaxCorrectionType.equals("N") || TaxCorrectionType.equals("W")); else throw new IllegalArgumentException ("TaxCorrectionType Invalid value - " + TaxCorrectionType + " - Reference_ID=392 - B - D - N - W"); if (TaxCorrectionType.length() > 1) - { - log.warning("Length > 1 - truncated"); - TaxCorrectionType = TaxCorrectionType.substring(0, 0); - } - set_Value (COLUMNNAME_TaxCorrectionType, TaxCorrectionType); - } - - /** Get Tax Correction. - @return Type of Tax Correction - */ - public String getTaxCorrectionType () - { - return (String)get_Value(COLUMNNAME_TaxCorrectionType); - } + /** Set Element Separator. + @param Separator + Element Separator + */ + public void setSeparator (String Separator) + { + if (Separator == null) + throw new IllegalArgumentException ("Separator is mandatory."); + + if (Separator.length() > 1) + { + log.warning("Length > 1 - truncated"); + Separator = Separator.substring(0, 1); + } + set_Value (COLUMNNAME_Separator, Separator); + } + + /** Get Element Separator. + @return Element Separator + */ + public String getSeparator () + { + return (String)get_Value(COLUMNNAME_Separator); + } + + /** TaxCorrectionType AD_Reference_ID=392 */ + public static final int TAXCORRECTIONTYPE_AD_Reference_ID=392; + /** None = N */ + public static final String TAXCORRECTIONTYPE_None = "N"; + /** Write-off only = W */ + public static final String TAXCORRECTIONTYPE_Write_OffOnly = "W"; + /** Discount only = D */ + public static final String TAXCORRECTIONTYPE_DiscountOnly = "D"; + /** Write-off and Discount = B */ + public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B"; + /** Set Tax Correction. + @param TaxCorrectionType + Type of Tax Correction + */ + public void setTaxCorrectionType (String TaxCorrectionType) + { + if (TaxCorrectionType == null) throw new IllegalArgumentException ("TaxCorrectionType is mandatory"); + if (TaxCorrectionType.equals("N") || TaxCorrectionType.equals("W") || TaxCorrectionType.equals("D") || TaxCorrectionType.equals("B")); else throw new IllegalArgumentException ("TaxCorrectionType Invalid value - " + TaxCorrectionType + " - Reference_ID=392 - N - W - D - B"); + if (TaxCorrectionType.length() > 1) + { + log.warning("Length > 1 - truncated"); + TaxCorrectionType = TaxCorrectionType.substring(0, 1); + } + set_Value (COLUMNNAME_TaxCorrectionType, TaxCorrectionType); + } + + /** Get Tax Correction. + @return Type of Tax Correction + */ + public String getTaxCorrectionType () + { + return (String)get_Value(COLUMNNAME_TaxCorrectionType); + } } \ No newline at end of file diff --git a/migration/330-trunk/039_FR1840016.sql b/migration/330-trunk/039_FR1840016.sql new file mode 100644 index 0000000000..1db78bdd40 --- /dev/null +++ b/migration/330-trunk/039_FR1840016.sql @@ -0,0 +1,65 @@ +-- Nov 27, 2007 11:00:14 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53227,0,'IsPostIfClearingEqual',TO_DATE('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',NULL,'Y','Post if Clearing Equal','Post if Clearing Equal',TO_DATE('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100) +/ + +-- Nov 27, 2007 11:00:16 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53227 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Column SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Field SET Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53227) AND IsCentrallyMaintained='Y' +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL, AD_Element_ID=53227 WHERE UPPER(ColumnName)='ISPOSTIFCLEARINGEQUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 AND IsCentrallyMaintained='Y' +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_PrintFormatItem pi SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53227) +/ + +-- Nov 27, 2007 11:00:46 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_PrintFormatItem pi SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53227) +/ + +-- Nov 27, 2007 11:01:30 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,53266,53227,0,20,265,'IsPostIfClearingEqual',TO_DATE('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Post if Clearing Equal',0,TO_DATE('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,0) +/ + +-- Nov 27, 2007 11:01:30 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=53266 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +/ + +-- Nov 27, 2007 11:01:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +ALTER TABLE C_AcctSchema ADD IsPostIfClearingEqual CHAR(1) DEFAULT 'Y' CHECK (IsPostIfClearingEqual IN ('Y','N')) +/ + +-- Nov 27, 2007 11:07:24 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,53266,53281,0,199,TO_DATE('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same',1,'D','Y','Y','Y','N','N','N','N','Y','Post if Clearing Equal',270,TO_DATE('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100) +/ + +-- Nov 27, 2007 11:07:24 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=53281 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +/ + diff --git a/migration/330-trunk/postgresql/039_FR1840016.sql b/migration/330-trunk/postgresql/039_FR1840016.sql new file mode 100644 index 0000000000..45ac8afdfe --- /dev/null +++ b/migration/330-trunk/postgresql/039_FR1840016.sql @@ -0,0 +1,65 @@ +-- Nov 27, 2007 11:00:15 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53227,0,'IsPostIfClearingEqual',TO_TIMESTAMP('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',NULL,'Y','Post if Clearing Equal','Post if Clearing Equal',TO_TIMESTAMP('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100) +/ + +-- Nov 27, 2007 11:00:16 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53227 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Column SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Field SET Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53227) AND IsCentrallyMaintained='Y' +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL, AD_Element_ID=53227 WHERE UPPER(ColumnName)='ISPOSTIFCLEARINGEQUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 AND IsCentrallyMaintained='Y' +/ + +-- Nov 27, 2007 11:00:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_PrintFormatItem SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53227) +/ + +-- Nov 27, 2007 11:00:46 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +UPDATE AD_PrintFormatItem SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53227) +/ + +-- Nov 27, 2007 11:01:30 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,53266,53227,0,20,265,'IsPostIfClearingEqual',TO_TIMESTAMP('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Post if Clearing Equal',0,TO_TIMESTAMP('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,0) +/ + +-- Nov 27, 2007 11:01:30 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=53266 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +/ + +-- Nov 27, 2007 11:01:45 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +ALTER TABLE C_AcctSchema ADD COLUMN IsPostIfClearingEqual CHAR(1) DEFAULT 'Y' CHECK (IsPostIfClearingEqual IN ('Y','N')) +/ + +-- Nov 27, 2007 11:07:24 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,53266,53281,0,199,TO_TIMESTAMP('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same',1,'D','Y','Y','Y','N','N','N','N','Y','Post if Clearing Equal',270,TO_TIMESTAMP('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100) +/ + +-- Nov 27, 2007 11:07:24 PM COT +-- FR 1840016 - Avoid usage of clearing accounts +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=53281 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) +/ +