From 14ffcb8bf00af54b60f402162793d68bcc0ae332 Mon Sep 17 00:00:00 2001 From: kthiemann Date: Thu, 1 Nov 2007 12:47:59 +0000 Subject: [PATCH] FR [ 1804068 ] Make Dunning (More) Usable FR [ 1799601 ] Dunning Block/Delay --- .../compiere/model/I_C_DunningRunLine.java | 197 +- base/src/org/compiere/model/I_C_Invoice.java | 624 ++-- .../compiere/model/X_C_DunningRunLine.java | 842 ++--- base/src/org/compiere/model/X_C_Invoice.java | 3160 +++++++++-------- .../org/compiere/process/DunningPrint.java | 40 +- .../compiere/process/DunningRunCreate.java | 600 ++-- migration/330-trunk/028_FR_1799601.sql | 176 + migration/330-trunk/029_FR_1804068.sql | 183 + .../postgresql/028_FR_1799601_PG.sql | 211 ++ .../postgresql/029_FR_1804068_PG.sql | 179 + 10 files changed, 3613 insertions(+), 2599 deletions(-) create mode 100644 migration/330-trunk/028_FR_1799601.sql create mode 100644 migration/330-trunk/029_FR_1804068.sql create mode 100644 migration/330-trunk/postgresql/028_FR_1799601_PG.sql create mode 100644 migration/330-trunk/postgresql/029_FR_1804068_PG.sql diff --git a/base/src/org/compiere/model/I_C_DunningRunLine.java b/base/src/org/compiere/model/I_C_DunningRunLine.java index 7e6b8f9ac9..0a2cd81d63 100644 --- a/base/src/org/compiere/model/I_C_DunningRunLine.java +++ b/base/src/org/compiere/model/I_C_DunningRunLine.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,215 +30,228 @@ * 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_DunningRunLine - * @author Trifon Trifonov (generated) - * @version Release 3.3.0 - 2007-08-24 11:39:40.156 - */ - public interface I_C_DunningRunLine -{ +import java.math.BigDecimal; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_DunningRunLine + * @author Trifon Trifonov (generated) + * @version Release 3.3.0 + */ +public interface I_C_DunningRunLine +{ /** TableName=C_DunningRunLine */ - public static final String Table_Name = "C_DunningRunLine"; + public static final String Table_Name = "C_DunningRunLine"; /** AD_Table_ID=524 */ - 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 = 3 - Client - Org */ - BigDecimal accessLevel = new BigDecimal(3); + BigDecimal accessLevel = BigDecimal.valueOf(3); /** Load Meta Data */ /** Column name Amt */ - public static final String COLUMNNAME_Amt = "Amt"; + public static final String COLUMNNAME_Amt = "Amt"; /** Set Amount. - * Amount + * Amount */ - public void setAmt (BigDecimal Amt); + public void setAmt (BigDecimal Amt); /** Get Amount. - * Amount + * Amount */ - public BigDecimal getAmt(); + public BigDecimal getAmt(); /** Column name C_DunningRunEntry_ID */ - public static final String COLUMNNAME_C_DunningRunEntry_ID = "C_DunningRunEntry_ID"; + public static final String COLUMNNAME_C_DunningRunEntry_ID = "C_DunningRunEntry_ID"; /** Set Dunning Run Entry. - * Dunning Run Entry + * Dunning Run Entry */ - public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID); + public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID); /** Get Dunning Run Entry. - * Dunning Run Entry + * Dunning Run Entry */ - public int getC_DunningRunEntry_ID(); + public int getC_DunningRunEntry_ID(); - public I_C_DunningRunEntry getI_C_DunningRunEntry() throws Exception; + public I_C_DunningRunEntry getC_DunningRunEntry() throws Exception; /** Column name C_DunningRunLine_ID */ - public static final String COLUMNNAME_C_DunningRunLine_ID = "C_DunningRunLine_ID"; + public static final String COLUMNNAME_C_DunningRunLine_ID = "C_DunningRunLine_ID"; /** Set Dunning Run Line. - * Dunning Run Line + * Dunning Run Line */ - public void setC_DunningRunLine_ID (int C_DunningRunLine_ID); + public void setC_DunningRunLine_ID (int C_DunningRunLine_ID); /** Get Dunning Run Line. - * Dunning Run Line + * Dunning Run Line */ - public int getC_DunningRunLine_ID(); + public int getC_DunningRunLine_ID(); + + /** Column name C_InvoicePaySchedule_ID */ + public static final String COLUMNNAME_C_InvoicePaySchedule_ID = "C_InvoicePaySchedule_ID"; + + /** Set Invoice Payment Schedule. + * Invoice Payment Schedule + */ + public void setC_InvoicePaySchedule_ID (int C_InvoicePaySchedule_ID); + + /** Get Invoice Payment Schedule. + * Invoice Payment Schedule + */ + public int getC_InvoicePaySchedule_ID(); + + public I_C_InvoicePaySchedule getC_InvoicePaySchedule() throws Exception; /** Column name C_Invoice_ID */ - public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; + public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; /** Set Invoice. - * Invoice Identifier + * Invoice Identifier */ - public void setC_Invoice_ID (int C_Invoice_ID); + public void setC_Invoice_ID (int C_Invoice_ID); /** Get Invoice. - * Invoice Identifier + * Invoice Identifier */ - public int getC_Invoice_ID(); + public int getC_Invoice_ID(); /** Column name C_Payment_ID */ - public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; /** Set Payment. - * Payment identifier + * Payment identifier */ - public void setC_Payment_ID (int C_Payment_ID); + public void setC_Payment_ID (int C_Payment_ID); /** Get Payment. - * Payment identifier + * Payment identifier */ - public int getC_Payment_ID(); + public int getC_Payment_ID(); /** Column name ConvertedAmt */ - public static final String COLUMNNAME_ConvertedAmt = "ConvertedAmt"; + public static final String COLUMNNAME_ConvertedAmt = "ConvertedAmt"; /** Set Converted Amount. - * Converted Amount + * Converted Amount */ - public void setConvertedAmt (BigDecimal ConvertedAmt); + public void setConvertedAmt (BigDecimal ConvertedAmt); /** Get Converted Amount. - * Converted Amount + * Converted Amount */ - public BigDecimal getConvertedAmt(); + public BigDecimal getConvertedAmt(); /** Column name DaysDue */ - public static final String COLUMNNAME_DaysDue = "DaysDue"; + public static final String COLUMNNAME_DaysDue = "DaysDue"; /** Set Days due. - * Number of days due (negative: due in number of days) + * Number of days due (negative: due in number of days) */ - public void setDaysDue (int DaysDue); + public void setDaysDue (int DaysDue); /** Get Days due. - * Number of days due (negative: due in number of days) + * Number of days due (negative: due in number of days) */ - public int getDaysDue(); + public int getDaysDue(); /** Column name FeeAmt */ - public static final String COLUMNNAME_FeeAmt = "FeeAmt"; + public static final String COLUMNNAME_FeeAmt = "FeeAmt"; /** Set Fee Amount. - * Fee amount in invoice currency + * Fee amount in invoice currency */ - public void setFeeAmt (BigDecimal FeeAmt); + public void setFeeAmt (BigDecimal FeeAmt); /** Get Fee Amount. - * Fee amount in invoice currency + * Fee amount in invoice currency */ - public BigDecimal getFeeAmt(); + public BigDecimal getFeeAmt(); /** Column name InterestAmt */ - public static final String COLUMNNAME_InterestAmt = "InterestAmt"; + public static final String COLUMNNAME_InterestAmt = "InterestAmt"; /** Set Interest Amount. - * Interest Amount + * Interest Amount */ - public void setInterestAmt (BigDecimal InterestAmt); + public void setInterestAmt (BigDecimal InterestAmt); /** Get Interest Amount. - * Interest Amount + * Interest Amount */ - public BigDecimal getInterestAmt(); + public BigDecimal getInterestAmt(); /** Column name IsInDispute */ - public static final String COLUMNNAME_IsInDispute = "IsInDispute"; + public static final String COLUMNNAME_IsInDispute = "IsInDispute"; /** Set In Dispute. - * Document is in dispute + * Document is in dispute */ - public void setIsInDispute (boolean IsInDispute); + public void setIsInDispute (boolean IsInDispute); /** Get In Dispute. - * Document is in dispute + * Document is in dispute */ - public boolean isInDispute(); + public boolean isInDispute(); /** Column name OpenAmt */ - public static final String COLUMNNAME_OpenAmt = "OpenAmt"; + public static final String COLUMNNAME_OpenAmt = "OpenAmt"; /** Set Open Amount. - * Open item amount + * Open item amount */ - public void setOpenAmt (BigDecimal OpenAmt); + public void setOpenAmt (BigDecimal OpenAmt); /** Get Open Amount. - * Open item amount + * Open item amount */ - public BigDecimal getOpenAmt(); + public BigDecimal getOpenAmt(); /** Column name Processed */ - public static final String COLUMNNAME_Processed = "Processed"; + public static final String COLUMNNAME_Processed = "Processed"; /** Set Processed. - * The document has been processed + * The document has been processed */ - public void setProcessed (boolean Processed); + public void setProcessed (boolean Processed); /** Get Processed. - * The document has been processed + * The document has been processed */ - public boolean isProcessed(); + public boolean isProcessed(); /** Column name TimesDunned */ - public static final String COLUMNNAME_TimesDunned = "TimesDunned"; + public static final String COLUMNNAME_TimesDunned = "TimesDunned"; /** Set Times Dunned. - * Number of times dunned previously + * Number of times dunned previously */ - public void setTimesDunned (int TimesDunned); + public void setTimesDunned (int TimesDunned); /** Get Times Dunned. - * Number of times dunned previously + * Number of times dunned previously */ - public int getTimesDunned(); + public int getTimesDunned(); /** Column name TotalAmt */ - public static final String COLUMNNAME_TotalAmt = "TotalAmt"; + public static final String COLUMNNAME_TotalAmt = "TotalAmt"; /** Set Total Amount. - * Total Amount + * Total Amount */ - public void setTotalAmt (BigDecimal TotalAmt); + public void setTotalAmt (BigDecimal TotalAmt); /** Get Total Amount. - * Total Amount + * Total Amount */ - public BigDecimal getTotalAmt(); -} + public BigDecimal getTotalAmt(); +} diff --git a/base/src/org/compiere/model/I_C_Invoice.java b/base/src/org/compiere/model/I_C_Invoice.java index bd96bae2c5..724f5986d8 100644 --- a/base/src/org/compiere/model/I_C_Invoice.java +++ b/base/src/org/compiere/model/I_C_Invoice.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,747 +30,775 @@ * 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_Invoice - * @author Trifon Trifonov (generated) - * @version Release 3.3.0 - 2007-08-24 11:39:40.375 - */ - public interface I_C_Invoice -{ +import java.math.BigDecimal; +import java.sql.Timestamp; +import org.compiere.util.KeyNamePair; + +/** Generated Interface for C_Invoice + * @author Trifon Trifonov (generated) + * @version Release 3.3.0 + */ +public interface I_C_Invoice +{ /** TableName=C_Invoice */ - public static final String Table_Name = "C_Invoice"; + public static final String Table_Name = "C_Invoice"; /** AD_Table_ID=318 */ - 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 = 1 - Org */ - BigDecimal accessLevel = new BigDecimal(1); + BigDecimal accessLevel = BigDecimal.valueOf(1); /** Load Meta Data */ /** Column name AD_OrgTrx_ID */ - public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; + public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; /** Set Trx Organization. - * Performing or initiating organization + * Performing or initiating organization */ - public void setAD_OrgTrx_ID (int AD_OrgTrx_ID); + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID); /** Get Trx Organization. - * Performing or initiating organization + * Performing or initiating organization */ - public int getAD_OrgTrx_ID(); + public int getAD_OrgTrx_ID(); /** Column name AD_User_ID */ - public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; + public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; /** Set User/Contact. - * User within the system - Internal or Business Partner Contact + * User within the system - Internal or Business Partner Contact */ - public void setAD_User_ID (int AD_User_ID); + public void setAD_User_ID (int AD_User_ID); /** Get User/Contact. - * User within the system - Internal or Business Partner Contact + * User within the system - Internal or Business Partner Contact */ - public int getAD_User_ID(); + public int getAD_User_ID(); - public I_AD_User getI_AD_User() throws Exception; + public I_AD_User getAD_User() throws Exception; /** Column name C_Activity_ID */ - public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; + public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; /** Set Activity. - * Business Activity + * Business Activity */ - public void setC_Activity_ID (int C_Activity_ID); + public void setC_Activity_ID (int C_Activity_ID); /** Get Activity. - * Business Activity + * Business Activity */ - public int getC_Activity_ID(); + public int getC_Activity_ID(); - public I_C_Activity getI_C_Activity() throws Exception; + public I_C_Activity getC_Activity() throws Exception; /** Column name C_BPartner_ID */ - public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; + public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; /** Set Business Partner . - * Identifies a Business Partner + * Identifies a Business Partner */ - public void setC_BPartner_ID (int C_BPartner_ID); + public void setC_BPartner_ID (int C_BPartner_ID); /** Get Business Partner . - * Identifies a Business Partner + * Identifies a Business Partner */ - public int getC_BPartner_ID(); + public int getC_BPartner_ID(); /** Column name C_BPartner_Location_ID */ - public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; + public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; /** Set Partner Location. - * Identifies the (ship to) address for this Business Partner + * Identifies the (ship to) address for this Business Partner */ - public void setC_BPartner_Location_ID (int C_BPartner_Location_ID); + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID); /** Get Partner Location. - * Identifies the (ship to) address for this Business Partner + * Identifies the (ship to) address for this Business Partner */ - public int getC_BPartner_Location_ID(); + public int getC_BPartner_Location_ID(); - public I_C_BPartner_Location getI_C_BPartner_Location() throws Exception; + public I_C_BPartner_Location getC_BPartner_Location() throws Exception; /** Column name C_Campaign_ID */ - public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; + public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; /** Set Campaign. - * Marketing Campaign + * Marketing Campaign */ - public void setC_Campaign_ID (int C_Campaign_ID); + public void setC_Campaign_ID (int C_Campaign_ID); /** Get Campaign. - * Marketing Campaign + * Marketing Campaign */ - public int getC_Campaign_ID(); + public int getC_Campaign_ID(); - public I_C_Campaign getI_C_Campaign() throws Exception; + public I_C_Campaign getC_Campaign() throws Exception; /** Column name C_CashLine_ID */ - public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; + public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; /** Set Cash Journal Line. - * Cash Journal Line + * Cash Journal Line */ - public void setC_CashLine_ID (int C_CashLine_ID); + public void setC_CashLine_ID (int C_CashLine_ID); /** Get Cash Journal Line. - * Cash Journal Line + * Cash Journal Line */ - public int getC_CashLine_ID(); + public int getC_CashLine_ID(); /** Column name C_Charge_ID */ - public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; + public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** Set Charge. - * Additional document charges + * Additional document charges */ - public void setC_Charge_ID (int C_Charge_ID); + public void setC_Charge_ID (int C_Charge_ID); /** Get Charge. - * Additional document charges + * Additional document charges */ - public int getC_Charge_ID(); + public int getC_Charge_ID(); /** Column name C_ConversionType_ID */ - public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; + public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; /** Set Currency Type. - * Currency Conversion Rate Type + * Currency Conversion Rate Type */ - public void setC_ConversionType_ID (int C_ConversionType_ID); + public void setC_ConversionType_ID (int C_ConversionType_ID); /** Get Currency Type. - * Currency Conversion Rate Type + * Currency Conversion Rate Type */ - public int getC_ConversionType_ID(); + public int getC_ConversionType_ID(); - public I_C_ConversionType getI_C_ConversionType() throws Exception; + public I_C_ConversionType getC_ConversionType() throws Exception; /** 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_DocTypeTarget_ID */ - public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; + public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; /** Set Target Document Type. - * Target document type for conversing documents + * Target document type for conversing documents */ - public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID); + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID); /** Get Target Document Type. - * Target document type for conversing documents + * Target document type for conversing documents */ - public int getC_DocTypeTarget_ID(); + public int getC_DocTypeTarget_ID(); /** Column name C_DocType_ID */ - public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; + public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; /** Set Document Type. - * Document type or rules + * Document type or rules */ - public void setC_DocType_ID (int C_DocType_ID); + public void setC_DocType_ID (int C_DocType_ID); /** Get Document Type. - * Document type or rules + * Document type or rules */ - public int getC_DocType_ID(); + public int getC_DocType_ID(); - public I_C_DocType getI_C_DocType() throws Exception; + public I_C_DocType getC_DocType() throws Exception; + + /** Column name C_DunningLevel_ID */ + public static final String COLUMNNAME_C_DunningLevel_ID = "C_DunningLevel_ID"; + + /** Set Dunning Level. + * Dunning Level + */ + public void setC_DunningLevel_ID (int C_DunningLevel_ID); + + /** Get Dunning Level. + * Dunning Level + */ + public int getC_DunningLevel_ID(); + + public I_C_DunningLevel getC_DunningLevel() throws Exception; /** Column name C_Invoice_ID */ - public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; + public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; /** Set Invoice. - * Invoice Identifier + * Invoice Identifier */ - public void setC_Invoice_ID (int C_Invoice_ID); + public void setC_Invoice_ID (int C_Invoice_ID); /** Get Invoice. - * Invoice Identifier + * Invoice Identifier */ - public int getC_Invoice_ID(); + public int getC_Invoice_ID(); /** Column name C_Order_ID */ - public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; + public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; /** Set Order. - * Order + * Order */ - public void setC_Order_ID (int C_Order_ID); + public void setC_Order_ID (int C_Order_ID); /** Get Order. - * Order + * Order */ - public int getC_Order_ID(); + public int getC_Order_ID(); /** Column name C_PaymentTerm_ID */ - public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; + public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; /** Set Payment Term. - * The terms of Payment (timing, discount) + * The terms of Payment (timing, discount) */ - public void setC_PaymentTerm_ID (int C_PaymentTerm_ID); + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID); /** Get Payment Term. - * The terms of Payment (timing, discount) + * The terms of Payment (timing, discount) */ - public int getC_PaymentTerm_ID(); + public int getC_PaymentTerm_ID(); - public I_C_PaymentTerm getI_C_PaymentTerm() throws Exception; + public I_C_PaymentTerm getC_PaymentTerm() throws Exception; /** Column name C_Payment_ID */ - public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; + public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; /** Set Payment. - * Payment identifier + * Payment identifier */ - public void setC_Payment_ID (int C_Payment_ID); + public void setC_Payment_ID (int C_Payment_ID); /** Get Payment. - * Payment identifier + * Payment identifier */ - public int getC_Payment_ID(); + public int getC_Payment_ID(); /** Column name C_Project_ID */ - public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; + public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; /** Set Project. - * Financial Project + * Financial Project */ - public void setC_Project_ID (int C_Project_ID); + public void setC_Project_ID (int C_Project_ID); /** Get Project. - * Financial Project + * Financial Project */ - public int getC_Project_ID(); + public int getC_Project_ID(); - public I_C_Project getI_C_Project() throws Exception; + public I_C_Project getC_Project() throws Exception; /** Column name ChargeAmt */ - public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; + public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; /** Set Charge amount. - * Charge Amount + * Charge Amount */ - public void setChargeAmt (BigDecimal ChargeAmt); + public void setChargeAmt (BigDecimal ChargeAmt); /** Get Charge amount. - * Charge Amount + * Charge Amount */ - public BigDecimal getChargeAmt(); + public BigDecimal getChargeAmt(); /** Column name CopyFrom */ - public static final String COLUMNNAME_CopyFrom = "CopyFrom"; + public static final String COLUMNNAME_CopyFrom = "CopyFrom"; /** Set Copy From. - * Copy From Record + * Copy From Record */ - public void setCopyFrom (String CopyFrom); + public void setCopyFrom (String CopyFrom); /** Get Copy From. - * Copy From Record + * Copy From Record */ - public String getCopyFrom(); + public String getCopyFrom(); /** Column name CreateFrom */ - public static final String COLUMNNAME_CreateFrom = "CreateFrom"; + public static final String COLUMNNAME_CreateFrom = "CreateFrom"; /** Set Create lines from. - * Process which will generate a new document lines based on an existing document + * Process which will generate a new document lines based on an existing document */ - public void setCreateFrom (String CreateFrom); + public void setCreateFrom (String CreateFrom); /** Get Create lines from. - * Process which will generate a new document lines based on an existing document + * Process which will generate a new document lines based on an existing document */ - public String getCreateFrom(); + public String getCreateFrom(); /** Column name DateAcct */ - public static final String COLUMNNAME_DateAcct = "DateAcct"; + public static final String COLUMNNAME_DateAcct = "DateAcct"; /** Set Account Date. - * Accounting Date + * Accounting Date */ - public void setDateAcct (Timestamp DateAcct); + public void setDateAcct (Timestamp DateAcct); /** Get Account Date. - * Accounting Date + * Accounting Date */ - public Timestamp getDateAcct(); + public Timestamp getDateAcct(); /** Column name DateInvoiced */ - public static final String COLUMNNAME_DateInvoiced = "DateInvoiced"; + public static final String COLUMNNAME_DateInvoiced = "DateInvoiced"; /** Set Date Invoiced. - * Date printed on Invoice + * Date printed on Invoice */ - public void setDateInvoiced (Timestamp DateInvoiced); + public void setDateInvoiced (Timestamp DateInvoiced); /** Get Date Invoiced. - * Date printed on Invoice + * Date printed on Invoice */ - public Timestamp getDateInvoiced(); + public Timestamp getDateInvoiced(); /** Column name DateOrdered */ - public static final String COLUMNNAME_DateOrdered = "DateOrdered"; + public static final String COLUMNNAME_DateOrdered = "DateOrdered"; /** Set Date Ordered. - * Date of Order + * Date of Order */ - public void setDateOrdered (Timestamp DateOrdered); + public void setDateOrdered (Timestamp DateOrdered); /** Get Date Ordered. - * Date of Order + * Date of Order */ - public Timestamp getDateOrdered(); + public Timestamp getDateOrdered(); /** Column name DatePrinted */ - public static final String COLUMNNAME_DatePrinted = "DatePrinted"; + public static final String COLUMNNAME_DatePrinted = "DatePrinted"; /** Set Date printed. - * Date the document was printed. + * Date the document was printed. */ - public void setDatePrinted (Timestamp DatePrinted); + public void setDatePrinted (Timestamp DatePrinted); /** Get Date printed. - * Date the document was printed. + * Date the document was printed. */ - public Timestamp getDatePrinted(); + public Timestamp getDatePrinted(); /** 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 DocAction */ - public static final String COLUMNNAME_DocAction = "DocAction"; + public static final String COLUMNNAME_DocAction = "DocAction"; /** Set Document Action. - * The targeted status of the document + * The targeted status of the document */ - public void setDocAction (String DocAction); + public void setDocAction (String DocAction); /** Get Document Action. - * The targeted status of the document + * The targeted status of the document */ - public String getDocAction(); + public String getDocAction(); /** Column name DocStatus */ - public static final String COLUMNNAME_DocStatus = "DocStatus"; + public static final String COLUMNNAME_DocStatus = "DocStatus"; /** Set Document Status. - * The current status of the document + * The current status of the document */ - public void setDocStatus (String DocStatus); + public void setDocStatus (String DocStatus); /** Get Document Status. - * The current status of the document + * The current status of the document */ - public String getDocStatus(); + public String getDocStatus(); /** Column name DocumentNo */ - public static final String COLUMNNAME_DocumentNo = "DocumentNo"; + public static final String COLUMNNAME_DocumentNo = "DocumentNo"; /** Set Document No. - * Document sequence number of the document + * Document sequence number of the document */ - public void setDocumentNo (String DocumentNo); + public void setDocumentNo (String DocumentNo); /** Get Document No. - * Document sequence number of the document + * Document sequence number of the document */ - public String getDocumentNo(); + public String getDocumentNo(); + + /** Column name DunningGrace */ + public static final String COLUMNNAME_DunningGrace = "DunningGrace"; + + /** Set Dunning Grace. + * Delay/block the dunning until this date is reached. + */ + public void setDunningGrace (Timestamp DunningGrace); + + /** Get Dunning Grace. + * Delay/block the dunning until this date is reached. + */ + public Timestamp getDunningGrace(); /** Column name GenerateTo */ - public static final String COLUMNNAME_GenerateTo = "GenerateTo"; + public static final String COLUMNNAME_GenerateTo = "GenerateTo"; /** Set Generate To. - * Generate To + * Generate To */ - public void setGenerateTo (String GenerateTo); + public void setGenerateTo (String GenerateTo); /** Get Generate To. - * Generate To + * Generate To */ - public String getGenerateTo(); + public String getGenerateTo(); /** Column name GrandTotal */ - public static final String COLUMNNAME_GrandTotal = "GrandTotal"; + public static final String COLUMNNAME_GrandTotal = "GrandTotal"; /** Set Grand Total. - * Total amount of document + * Total amount of document */ - public void setGrandTotal (BigDecimal GrandTotal); + public void setGrandTotal (BigDecimal GrandTotal); /** Get Grand Total. - * Total amount of document + * Total amount of document */ - public BigDecimal getGrandTotal(); + public BigDecimal getGrandTotal(); /** Column name InvoiceCollectionType */ - public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType"; + public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType"; /** Set Collection Status. - * Invoice Collection Status + * Invoice Collection Status */ - public void setInvoiceCollectionType (String InvoiceCollectionType); + public void setInvoiceCollectionType (String InvoiceCollectionType); /** Get Collection Status. - * Invoice Collection Status + * Invoice Collection Status */ - public String getInvoiceCollectionType(); + public String getInvoiceCollectionType(); /** Column name IsApproved */ - public static final String COLUMNNAME_IsApproved = "IsApproved"; + public static final String COLUMNNAME_IsApproved = "IsApproved"; /** Set Approved. - * Indicates if this document requires approval + * Indicates if this document requires approval */ - public void setIsApproved (boolean IsApproved); + public void setIsApproved (boolean IsApproved); /** Get Approved. - * Indicates if this document requires approval + * Indicates if this document requires approval */ - public boolean isApproved(); + public boolean isApproved(); /** Column name IsDiscountPrinted */ - public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; + public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; /** Set Discount Printed. - * Print Discount on Invoice and Order + * Print Discount on Invoice and Order */ - public void setIsDiscountPrinted (boolean IsDiscountPrinted); + public void setIsDiscountPrinted (boolean IsDiscountPrinted); /** Get Discount Printed. - * Print Discount on Invoice and Order + * Print Discount on Invoice and Order */ - public boolean isDiscountPrinted(); + public boolean isDiscountPrinted(); /** Column name IsInDispute */ - public static final String COLUMNNAME_IsInDispute = "IsInDispute"; + public static final String COLUMNNAME_IsInDispute = "IsInDispute"; /** Set In Dispute. - * Document is in dispute + * Document is in dispute */ - public void setIsInDispute (boolean IsInDispute); + public void setIsInDispute (boolean IsInDispute); /** Get In Dispute. - * Document is in dispute + * Document is in dispute */ - public boolean isInDispute(); + public boolean isInDispute(); /** Column name IsPaid */ - public static final String COLUMNNAME_IsPaid = "IsPaid"; + public static final String COLUMNNAME_IsPaid = "IsPaid"; /** Set Paid. - * The document is paid + * The document is paid */ - public void setIsPaid (boolean IsPaid); + public void setIsPaid (boolean IsPaid); /** Get Paid. - * The document is paid + * The document is paid */ - public boolean isPaid(); + public boolean isPaid(); /** Column name IsPayScheduleValid */ - public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid"; + public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid"; /** Set Pay Schedule valid. - * Is the Payment Schedule is valid + * Is the Payment Schedule is valid */ - public void setIsPayScheduleValid (boolean IsPayScheduleValid); + public void setIsPayScheduleValid (boolean IsPayScheduleValid); /** Get Pay Schedule valid. - * Is the Payment Schedule is valid + * Is the Payment Schedule is valid */ - public boolean isPayScheduleValid(); + public boolean isPayScheduleValid(); /** Column name IsPrinted */ - public static final String COLUMNNAME_IsPrinted = "IsPrinted"; + public static final String COLUMNNAME_IsPrinted = "IsPrinted"; /** Set Printed. - * Indicates if this document / line is printed + * Indicates if this document / line is printed */ - public void setIsPrinted (boolean IsPrinted); + public void setIsPrinted (boolean IsPrinted); /** Get Printed. - * Indicates if this document / line is printed + * Indicates if this document / line is printed */ - public boolean isPrinted(); + public boolean isPrinted(); /** Column name IsSOTrx */ - public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; + public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; /** Set Sales Transaction. - * This is a Sales Transaction + * This is a Sales Transaction */ - public void setIsSOTrx (boolean IsSOTrx); + public void setIsSOTrx (boolean IsSOTrx); /** Get Sales Transaction. - * This is a Sales Transaction + * This is a Sales Transaction */ - public boolean isSOTrx(); + public boolean isSOTrx(); /** Column name IsSelfService */ - public static final String COLUMNNAME_IsSelfService = "IsSelfService"; + public static final String COLUMNNAME_IsSelfService = "IsSelfService"; /** Set Self-Service. - * This is a Self-Service entry or this entry can be changed via Self-Service + * This is a Self-Service entry or this entry can be changed via Self-Service */ - public void setIsSelfService (boolean IsSelfService); + public void setIsSelfService (boolean IsSelfService); /** Get Self-Service. - * This is a Self-Service entry or this entry can be changed via Self-Service + * This is a Self-Service entry or this entry can be changed via Self-Service */ - public boolean isSelfService(); + public boolean isSelfService(); /** Column name IsTaxIncluded */ - public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; + public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; /** Set Price includes Tax. - * Tax is included in the price + * Tax is included in the price */ - public void setIsTaxIncluded (boolean IsTaxIncluded); + public void setIsTaxIncluded (boolean IsTaxIncluded); /** Get Price includes Tax. - * Tax is included in the price + * Tax is included in the price */ - public boolean isTaxIncluded(); + public boolean isTaxIncluded(); /** Column name IsTransferred */ - public static final String COLUMNNAME_IsTransferred = "IsTransferred"; + public static final String COLUMNNAME_IsTransferred = "IsTransferred"; /** Set Transferred. - * Transferred to General Ledger (i.e. accounted) + * Transferred to General Ledger (i.e. accounted) */ - public void setIsTransferred (boolean IsTransferred); + public void setIsTransferred (boolean IsTransferred); /** Get Transferred. - * Transferred to General Ledger (i.e. accounted) + * Transferred to General Ledger (i.e. accounted) */ - public boolean isTransferred(); + public boolean isTransferred(); /** Column name M_PriceList_ID */ - public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; + public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; /** Set Price List. - * Unique identifier of a Price List + * Unique identifier of a Price List */ - public void setM_PriceList_ID (int M_PriceList_ID); + public void setM_PriceList_ID (int M_PriceList_ID); /** Get Price List. - * Unique identifier of a Price List + * Unique identifier of a Price List */ - public int getM_PriceList_ID(); + public int getM_PriceList_ID(); - public I_M_PriceList getI_M_PriceList() throws Exception; + public I_M_PriceList getM_PriceList() throws Exception; /** Column name M_RMA_ID */ - public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; + public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; /** Set RMA. - * Return Material Authorization + * Return Material Authorization */ - public void setM_RMA_ID (int M_RMA_ID); + public void setM_RMA_ID (int M_RMA_ID); /** Get RMA. - * Return Material Authorization + * Return Material Authorization */ - public int getM_RMA_ID(); + public int getM_RMA_ID(); - public I_M_RMA getI_M_RMA() throws Exception; + public I_M_RMA getM_RMA() throws Exception; /** Column name POReference */ - public static final String COLUMNNAME_POReference = "POReference"; + public static final String COLUMNNAME_POReference = "POReference"; /** Set Order Reference. - * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ - public void setPOReference (String POReference); + public void setPOReference (String POReference); /** Get Order Reference. - * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + * Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ - public String getPOReference(); + public String getPOReference(); /** Column name PaymentRule */ - public static final String COLUMNNAME_PaymentRule = "PaymentRule"; + public static final String COLUMNNAME_PaymentRule = "PaymentRule"; /** Set Payment Rule. - * How you pay the invoice + * How you pay the invoice */ - public void setPaymentRule (String PaymentRule); + public void setPaymentRule (String PaymentRule); /** Get Payment Rule. - * How you pay the invoice + * How you pay the invoice */ - public String getPaymentRule(); + public String getPaymentRule(); /** Column name Posted */ - public static final String COLUMNNAME_Posted = "Posted"; + public static final String COLUMNNAME_Posted = "Posted"; /** Set Posted. - * Posting status + * Posting status */ - public void setPosted (boolean Posted); + public void setPosted (boolean Posted); /** Get Posted. - * Posting status + * Posting status */ - public boolean isPosted(); + public boolean isPosted(); /** Column name Processed */ - public static final String COLUMNNAME_Processed = "Processed"; + public static final String COLUMNNAME_Processed = "Processed"; /** Set Processed. - * The document has been processed + * The document has been processed */ - public void setProcessed (boolean Processed); + public void setProcessed (boolean Processed); /** Get Processed. - * The document has been processed + * The document has been processed */ - public boolean isProcessed(); + public boolean isProcessed(); /** 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 Ref_Invoice_ID */ - public static final String COLUMNNAME_Ref_Invoice_ID = "Ref_Invoice_ID"; + public static final String COLUMNNAME_Ref_Invoice_ID = "Ref_Invoice_ID"; /** Set Referenced Invoice */ - public void setRef_Invoice_ID (int Ref_Invoice_ID); + public void setRef_Invoice_ID (int Ref_Invoice_ID); /** Get Referenced Invoice */ - public int getRef_Invoice_ID(); + public int getRef_Invoice_ID(); /** Column name SalesRep_ID */ - public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; + public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; /** Set Sales Representative. - * Sales Representative or Company Agent + * Sales Representative or Company Agent */ - public void setSalesRep_ID (int SalesRep_ID); + public void setSalesRep_ID (int SalesRep_ID); /** Get Sales Representative. - * Sales Representative or Company Agent + * Sales Representative or Company Agent */ - public int getSalesRep_ID(); + public int getSalesRep_ID(); /** Column name SendEMail */ - public static final String COLUMNNAME_SendEMail = "SendEMail"; + public static final String COLUMNNAME_SendEMail = "SendEMail"; /** Set Send EMail. - * Enable sending Document EMail + * Enable sending Document EMail */ - public void setSendEMail (boolean SendEMail); + public void setSendEMail (boolean SendEMail); /** Get Send EMail. - * Enable sending Document EMail + * Enable sending Document EMail */ - public boolean isSendEMail(); + public boolean isSendEMail(); /** Column name TotalLines */ - public static final String COLUMNNAME_TotalLines = "TotalLines"; + public static final String COLUMNNAME_TotalLines = "TotalLines"; /** Set Total Lines. - * Total of all document lines + * Total of all document lines */ - public void setTotalLines (BigDecimal TotalLines); + public void setTotalLines (BigDecimal TotalLines); /** Get Total Lines. - * Total of all document lines + * Total of all document lines */ - public BigDecimal getTotalLines(); + public BigDecimal getTotalLines(); /** Column name User1_ID */ - public static final String COLUMNNAME_User1_ID = "User1_ID"; + public static final String COLUMNNAME_User1_ID = "User1_ID"; /** Set User List 1. - * User defined list element #1 + * User defined list element #1 */ - public void setUser1_ID (int User1_ID); + public void setUser1_ID (int User1_ID); /** Get User List 1. - * User defined list element #1 + * User defined list element #1 */ - public int getUser1_ID(); + public int getUser1_ID(); /** Column name User2_ID */ - public static final String COLUMNNAME_User2_ID = "User2_ID"; + public static final String COLUMNNAME_User2_ID = "User2_ID"; /** Set User List 2. - * User defined list element #2 + * User defined list element #2 */ - public void setUser2_ID (int User2_ID); + public void setUser2_ID (int User2_ID); /** Get User List 2. - * User defined list element #2 + * User defined list element #2 */ - public int getUser2_ID(); -} + public int getUser2_ID(); + +} diff --git a/base/src/org/compiere/model/X_C_DunningRunLine.java b/base/src/org/compiere/model/X_C_DunningRunLine.java index db4a6018da..9528ed50cb 100644 --- a/base/src/org/compiere/model/X_C_DunningRunLine.java +++ b/base/src/org/compiere/model/X_C_DunningRunLine.java @@ -14,403 +14,447 @@ * 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_DunningRunLine - * @author Adempiere (generated) - * @version Release 3.3.0 - $Id$ */ -public class X_C_DunningRunLine extends PO implements I_C_DunningRunLine, I_Persistent -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** Standard Constructor */ - public X_C_DunningRunLine (Properties ctx, int C_DunningRunLine_ID, String trxName) - { - super (ctx, C_DunningRunLine_ID, trxName); - /** if (C_DunningRunLine_ID == 0) { setAmt (Env.ZERO); - setC_DunningRunEntry_ID (0); - setC_DunningRunLine_ID (0); - setConvertedAmt (Env.ZERO); - setDaysDue (0); - setFeeAmt (Env.ZERO); - setInterestAmt (Env.ZERO); - setIsInDispute (false); - setOpenAmt (Env.ZERO); - setProcessed (false); - setTimesDunned (0); - setTotalAmt (Env.ZERO); -} */ - } - - /** Load Constructor */ - public X_C_DunningRunLine (Properties ctx, ResultSet rs, String trxName) - { - super (ctx, rs, trxName); - } - - /** AccessLevel - * @return 3 - Client - Org - */ - 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_DunningRunLine[") - .append(get_ID()).append("]"); - return sb.toString(); - } - - /** Set Amount. - @param Amt - Amount - */ - public void setAmt (BigDecimal Amt) - { - if (Amt == null) - throw new IllegalArgumentException ("Amt is mandatory."); - set_Value (COLUMNNAME_Amt, Amt); - } - - /** Get Amount. - @return Amount - */ - public BigDecimal getAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Amt); - if (bd == null) - return Env.ZERO; - return bd; - } - - public I_C_DunningRunEntry getI_C_DunningRunEntry() throws Exception - { - Class clazz = MTable.getClass(I_C_DunningRunEntry.Table_Name); - I_C_DunningRunEntry result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_DunningRunEntry)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DunningRunEntry_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 Dunning Run Entry. - @param C_DunningRunEntry_ID - Dunning Run Entry - */ - public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID) - { - if (C_DunningRunEntry_ID < 1) - throw new IllegalArgumentException ("C_DunningRunEntry_ID is mandatory."); - set_ValueNoCheck (COLUMNNAME_C_DunningRunEntry_ID, Integer.valueOf(C_DunningRunEntry_ID)); - } - - /** Get Dunning Run Entry. - @return Dunning Run Entry - */ - public int getC_DunningRunEntry_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningRunEntry_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Dunning Run Line. - @param C_DunningRunLine_ID - Dunning Run Line - */ - public void setC_DunningRunLine_ID (int C_DunningRunLine_ID) - { - if (C_DunningRunLine_ID < 1) - throw new IllegalArgumentException ("C_DunningRunLine_ID is mandatory."); - set_ValueNoCheck (COLUMNNAME_C_DunningRunLine_ID, Integer.valueOf(C_DunningRunLine_ID)); - } - - /** Get Dunning Run Line. - @return Dunning Run Line - */ - public int getC_DunningRunLine_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningRunLine_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Invoice. - @param C_Invoice_ID - Invoice Identifier - */ - public void setC_Invoice_ID (int C_Invoice_ID) - { - if (C_Invoice_ID <= 0) set_Value (COLUMNNAME_C_Invoice_ID, null); - else - set_Value (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); - } - - /** Get Invoice. - @return Invoice Identifier - */ - public int getC_Invoice_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Get Record ID/ColumnName - @return ID/ColumnName pair - */ - public KeyNamePair getKeyNamePair() - { - return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); - } - - /** Set Payment. - @param C_Payment_ID - Payment identifier - */ - public void setC_Payment_ID (int C_Payment_ID) - { - if (C_Payment_ID <= 0) set_Value (COLUMNNAME_C_Payment_ID, null); - else - set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); - } - - /** Get Payment. - @return Payment identifier - */ - public int getC_Payment_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Converted Amount. - @param ConvertedAmt - Converted Amount - */ - public void setConvertedAmt (BigDecimal ConvertedAmt) - { - if (ConvertedAmt == null) - throw new IllegalArgumentException ("ConvertedAmt is mandatory."); - set_Value (COLUMNNAME_ConvertedAmt, ConvertedAmt); - } - - /** Get Converted Amount. - @return Converted Amount - */ - public BigDecimal getConvertedAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConvertedAmt); - if (bd == null) - return Env.ZERO; - return bd; - } - - /** Set Days due. - @param DaysDue - Number of days due (negative: due in number of days) - */ - public void setDaysDue (int DaysDue) - { - set_Value (COLUMNNAME_DaysDue, Integer.valueOf(DaysDue)); - } - - /** Get Days due. - @return Number of days due (negative: due in number of days) - */ - public int getDaysDue () - { - Integer ii = (Integer)get_Value(COLUMNNAME_DaysDue); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Fee Amount. - @param FeeAmt - Fee amount in invoice currency - */ - public void setFeeAmt (BigDecimal FeeAmt) - { - if (FeeAmt == null) - throw new IllegalArgumentException ("FeeAmt is mandatory."); - set_Value (COLUMNNAME_FeeAmt, FeeAmt); - } - - /** Get Fee Amount. - @return Fee amount in invoice currency - */ - public BigDecimal getFeeAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_FeeAmt); - if (bd == null) - return Env.ZERO; - return bd; - } - - /** Set Interest Amount. - @param InterestAmt - Interest Amount - */ - public void setInterestAmt (BigDecimal InterestAmt) - { - if (InterestAmt == null) - throw new IllegalArgumentException ("InterestAmt is mandatory."); - set_Value (COLUMNNAME_InterestAmt, InterestAmt); - } - - /** Get Interest Amount. - @return Interest Amount - */ - public BigDecimal getInterestAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_InterestAmt); - if (bd == null) - return Env.ZERO; - return bd; - } - - /** Set In Dispute. - @param IsInDispute - Document is in dispute - */ - public void setIsInDispute (boolean IsInDispute) - { - set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); - } - - /** Get In Dispute. - @return Document is in dispute - */ - public boolean isInDispute () - { - Object oo = get_Value(COLUMNNAME_IsInDispute); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Open Amount. - @param OpenAmt - Open item amount - */ - public void setOpenAmt (BigDecimal OpenAmt) - { - if (OpenAmt == null) - throw new IllegalArgumentException ("OpenAmt is mandatory."); - set_Value (COLUMNNAME_OpenAmt, OpenAmt); - } - - /** Get Open Amount. - @return Open item amount - */ - public BigDecimal getOpenAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_OpenAmt); - if (bd == null) - return Env.ZERO; - return bd; - } - - /** Set Processed. - @param Processed - The document has been processed - */ - public void setProcessed (boolean Processed) - { - set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); - } - - /** Get Processed. - @return The document has been processed - */ - public boolean isProcessed () - { - Object oo = get_Value(COLUMNNAME_Processed); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Times Dunned. - @param TimesDunned - Number of times dunned previously - */ - public void setTimesDunned (int TimesDunned) - { - set_Value (COLUMNNAME_TimesDunned, Integer.valueOf(TimesDunned)); - } - - /** Get Times Dunned. - @return Number of times dunned previously - */ - public int getTimesDunned () - { - Integer ii = (Integer)get_Value(COLUMNNAME_TimesDunned); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Total Amount. - @param TotalAmt - Total Amount - */ - public void setTotalAmt (BigDecimal TotalAmt) - { - if (TotalAmt == null) - throw new IllegalArgumentException ("TotalAmt is mandatory."); - set_Value (COLUMNNAME_TotalAmt, TotalAmt); - } - - /** Get Total Amount. - @return Total Amount - */ - public BigDecimal getTotalAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalAmt); - if (bd == null) - return Env.ZERO; - return bd; - } +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; + +/** Generated Model for C_DunningRunLine + * @author Adempiere (generated) + * @version Release 3.3.0 - $Id$ */ +public class X_C_DunningRunLine extends PO implements I_C_DunningRunLine, I_Persistent +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** Standard Constructor */ + public X_C_DunningRunLine (Properties ctx, int C_DunningRunLine_ID, String trxName) + { + super (ctx, C_DunningRunLine_ID, trxName); + /** if (C_DunningRunLine_ID == 0) + { + setAmt (Env.ZERO); + setC_DunningRunEntry_ID (0); + setC_DunningRunLine_ID (0); + setConvertedAmt (Env.ZERO); + setDaysDue (0); + setFeeAmt (Env.ZERO); + setInterestAmt (Env.ZERO); + setIsInDispute (false); + setOpenAmt (Env.ZERO); + setProcessed (false); + setTimesDunned (0); + setTotalAmt (Env.ZERO); + } */ + } + + /** Load Constructor */ + public X_C_DunningRunLine (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } + + /** AccessLevel + * @return 3 - Client - Org + */ + 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_DunningRunLine[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** Set Amount. + @param Amt + Amount + */ + public void setAmt (BigDecimal Amt) + { + if (Amt == null) + throw new IllegalArgumentException ("Amt is mandatory."); + set_Value (COLUMNNAME_Amt, Amt); + } + + /** Get Amount. + @return Amount + */ + public BigDecimal getAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Amt); + if (bd == null) + return Env.ZERO; + return bd; + } + + public I_C_DunningRunEntry getC_DunningRunEntry() throws Exception + { + Class clazz = MTable.getClass(I_C_DunningRunEntry.Table_Name); + I_C_DunningRunEntry result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DunningRunEntry)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DunningRunEntry_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 Dunning Run Entry. + @param C_DunningRunEntry_ID + Dunning Run Entry + */ + public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID) + { + if (C_DunningRunEntry_ID < 1) + throw new IllegalArgumentException ("C_DunningRunEntry_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_DunningRunEntry_ID, Integer.valueOf(C_DunningRunEntry_ID)); + } + + /** Get Dunning Run Entry. + @return Dunning Run Entry + */ + public int getC_DunningRunEntry_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningRunEntry_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Dunning Run Line. + @param C_DunningRunLine_ID + Dunning Run Line + */ + public void setC_DunningRunLine_ID (int C_DunningRunLine_ID) + { + if (C_DunningRunLine_ID < 1) + throw new IllegalArgumentException ("C_DunningRunLine_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_DunningRunLine_ID, Integer.valueOf(C_DunningRunLine_ID)); + } + + /** Get Dunning Run Line. + @return Dunning Run Line + */ + public int getC_DunningRunLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningRunLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_InvoicePaySchedule getC_InvoicePaySchedule() throws Exception + { + Class clazz = MTable.getClass(I_C_InvoicePaySchedule.Table_Name); + I_C_InvoicePaySchedule result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_InvoicePaySchedule)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_InvoicePaySchedule_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 Invoice Payment Schedule. + @param C_InvoicePaySchedule_ID + Invoice Payment Schedule + */ + public void setC_InvoicePaySchedule_ID (int C_InvoicePaySchedule_ID) + { + if (C_InvoicePaySchedule_ID <= 0) + set_Value (COLUMNNAME_C_InvoicePaySchedule_ID, null); + else + set_Value (COLUMNNAME_C_InvoicePaySchedule_ID, Integer.valueOf(C_InvoicePaySchedule_ID)); + } + + /** Get Invoice Payment Schedule. + @return Invoice Payment Schedule + */ + public int getC_InvoicePaySchedule_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_InvoicePaySchedule_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Invoice. + @param C_Invoice_ID + Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID) + { + if (C_Invoice_ID <= 0) + set_Value (COLUMNNAME_C_Invoice_ID, null); + else + set_Value (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); + } + + /** Get Invoice. + @return Invoice Identifier + */ + public int getC_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID <= 0) + set_Value (COLUMNNAME_C_Payment_ID, null); + else + set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Converted Amount. + @param ConvertedAmt + Converted Amount + */ + public void setConvertedAmt (BigDecimal ConvertedAmt) + { + if (ConvertedAmt == null) + throw new IllegalArgumentException ("ConvertedAmt is mandatory."); + set_Value (COLUMNNAME_ConvertedAmt, ConvertedAmt); + } + + /** Get Converted Amount. + @return Converted Amount + */ + public BigDecimal getConvertedAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConvertedAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Days due. + @param DaysDue + Number of days due (negative: due in number of days) + */ + public void setDaysDue (int DaysDue) + { + set_Value (COLUMNNAME_DaysDue, Integer.valueOf(DaysDue)); + } + + /** Get Days due. + @return Number of days due (negative: due in number of days) + */ + public int getDaysDue () + { + Integer ii = (Integer)get_Value(COLUMNNAME_DaysDue); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Fee Amount. + @param FeeAmt + Fee amount in invoice currency + */ + public void setFeeAmt (BigDecimal FeeAmt) + { + if (FeeAmt == null) + throw new IllegalArgumentException ("FeeAmt is mandatory."); + set_Value (COLUMNNAME_FeeAmt, FeeAmt); + } + + /** Get Fee Amount. + @return Fee amount in invoice currency + */ + public BigDecimal getFeeAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_FeeAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Interest Amount. + @param InterestAmt + Interest Amount + */ + public void setInterestAmt (BigDecimal InterestAmt) + { + if (InterestAmt == null) + throw new IllegalArgumentException ("InterestAmt is mandatory."); + set_Value (COLUMNNAME_InterestAmt, InterestAmt); + } + + /** Get Interest Amount. + @return Interest Amount + */ + public BigDecimal getInterestAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_InterestAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set In Dispute. + @param IsInDispute + Document is in dispute + */ + public void setIsInDispute (boolean IsInDispute) + { + set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); + } + + /** Get In Dispute. + @return Document is in dispute + */ + public boolean isInDispute () + { + Object oo = get_Value(COLUMNNAME_IsInDispute); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Open Amount. + @param OpenAmt + Open item amount + */ + public void setOpenAmt (BigDecimal OpenAmt) + { + if (OpenAmt == null) + throw new IllegalArgumentException ("OpenAmt is mandatory."); + set_Value (COLUMNNAME_OpenAmt, OpenAmt); + } + + /** Get Open Amount. + @return Open item amount + */ + public BigDecimal getOpenAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_OpenAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Times Dunned. + @param TimesDunned + Number of times dunned previously + */ + public void setTimesDunned (int TimesDunned) + { + set_Value (COLUMNNAME_TimesDunned, Integer.valueOf(TimesDunned)); + } + + /** Get Times Dunned. + @return Number of times dunned previously + */ + public int getTimesDunned () + { + Integer ii = (Integer)get_Value(COLUMNNAME_TimesDunned); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Total Amount. + @param TotalAmt + Total Amount + */ + public void setTotalAmt (BigDecimal TotalAmt) + { + if (TotalAmt == null) + throw new IllegalArgumentException ("TotalAmt is mandatory."); + set_Value (COLUMNNAME_TotalAmt, TotalAmt); + } + + /** Get Total Amount. + @return Total Amount + */ + public BigDecimal getTotalAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalAmt); + if (bd == null) + return Env.ZERO; + return bd; + } } \ No newline at end of file diff --git a/base/src/org/compiere/model/X_C_Invoice.java b/base/src/org/compiere/model/X_C_Invoice.java index 8f8741e899..c433e7a896 100644 --- a/base/src/org/compiere/model/X_C_Invoice.java +++ b/base/src/org/compiere/model/X_C_Invoice.java @@ -14,1533 +14,1659 @@ * 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_Invoice - * @author Adempiere (generated) - * @version Release 3.3.0 - $Id$ */ -public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** Standard Constructor */ - public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) - { - super (ctx, C_Invoice_ID, trxName); - /** if (C_Invoice_ID == 0) { setC_BPartner_ID (0); - setC_BPartner_Location_ID (0); - setC_Currency_ID (0); -// @C_Currency_ID@ - setC_DocTypeTarget_ID (0); - setC_DocType_ID (0); -// 0 - setC_Invoice_ID (0); - setC_PaymentTerm_ID (0); - setDateAcct (new Timestamp(System.currentTimeMillis())); -// @#Date@ - setDateInvoiced (new Timestamp(System.currentTimeMillis())); -// @#Date@ - setDocAction (null); -// CO - setDocStatus (null); -// DR - setDocumentNo (null); - setGrandTotal (Env.ZERO); - setIsApproved (false); -// @IsApproved@ - setIsDiscountPrinted (false); - setIsInDispute (false); -// N - setIsPaid (false); - setIsPayScheduleValid (false); - setIsPrinted (false); - setIsSOTrx (false); -// @IsSOTrx@ - setIsSelfService (false); - setIsTaxIncluded (false); - setIsTransferred (false); - setM_PriceList_ID (0); - setPaymentRule (null); -// P - setPosted (false); -// N - setProcessed (false); - setSendEMail (false); - setTotalLines (Env.ZERO); -} */ - } - - /** Load Constructor */ - public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) - { - super (ctx, rs, trxName); - } - - /** AccessLevel - * @return 1 - Org - */ - 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_Invoice[") - .append(get_ID()).append("]"); - return sb.toString(); - } +/** Generated Model - DO NOT CHANGE */ +package org.compiere.model; -/** AD_OrgTrx_ID AD_Reference_ID=130 */ -public static final int AD_ORGTRX_ID_AD_Reference_ID=130; - /** Set Trx Organization. - @param AD_OrgTrx_ID - Performing or initiating organization - */ - public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) - { - if (AD_OrgTrx_ID <= 0) set_Value (COLUMNNAME_AD_OrgTrx_ID, null); - else - set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID)); - } - - /** Get Trx Organization. - @return Performing or initiating organization - */ - public int getAD_OrgTrx_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_AD_User getI_AD_User() throws Exception - { - Class clazz = MTable.getClass(I_AD_User.Table_Name); - I_AD_User result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_AD_User)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_User_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 User/Contact. - @param AD_User_ID - User within the system - Internal or Business Partner Contact - */ - public void setAD_User_ID (int AD_User_ID) - { - if (AD_User_ID <= 0) set_Value (COLUMNNAME_AD_User_ID, null); - else - set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); - } - - /** Get User/Contact. - @return User within the system - Internal or Business Partner Contact - */ - public int getAD_User_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_Activity getI_C_Activity() throws Exception - { - Class clazz = MTable.getClass(I_C_Activity.Table_Name); - I_C_Activity result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_Activity)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Activity_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 Activity. - @param C_Activity_ID - Business Activity - */ - public void setC_Activity_ID (int C_Activity_ID) - { - if (C_Activity_ID <= 0) set_Value (COLUMNNAME_C_Activity_ID, null); - else - set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID)); - } - - /** Get Activity. - @return Business Activity - */ - public int getC_Activity_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Business Partner . - @param C_BPartner_ID - Identifies a Business Partner - */ - public void setC_BPartner_ID (int C_BPartner_ID) - { - if (C_BPartner_ID < 1) - throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); - set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); - } - - /** Get Business Partner . - @return Identifies a Business Partner - */ - public int getC_BPartner_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_BPartner_Location getI_C_BPartner_Location() throws Exception - { - Class clazz = MTable.getClass(I_C_BPartner_Location.Table_Name); - I_C_BPartner_Location result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_BPartner_Location)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_Location_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 Partner Location. - @param C_BPartner_Location_ID - Identifies the (ship to) address for this Business Partner - */ - public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) - { - if (C_BPartner_Location_ID < 1) - throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); - set_Value (COLUMNNAME_C_BPartner_Location_ID, Integer.valueOf(C_BPartner_Location_ID)); - } - - /** Get Partner Location. - @return Identifies the (ship to) address for this Business Partner - */ - public int getC_BPartner_Location_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_Location_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_Campaign getI_C_Campaign() throws Exception - { - Class clazz = MTable.getClass(I_C_Campaign.Table_Name); - I_C_Campaign result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_Campaign)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Campaign_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 Campaign. - @param C_Campaign_ID - Marketing Campaign - */ - public void setC_Campaign_ID (int C_Campaign_ID) - { - if (C_Campaign_ID <= 0) set_Value (COLUMNNAME_C_Campaign_ID, null); - else - set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); - } - - /** Get Campaign. - @return Marketing Campaign - */ - public int getC_Campaign_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Cash Journal Line. - @param C_CashLine_ID - Cash Journal Line - */ - public void setC_CashLine_ID (int C_CashLine_ID) - { - if (C_CashLine_ID <= 0) set_Value (COLUMNNAME_C_CashLine_ID, null); - else - set_Value (COLUMNNAME_C_CashLine_ID, Integer.valueOf(C_CashLine_ID)); - } - - /** Get Cash Journal Line. - @return Cash Journal Line - */ - public int getC_CashLine_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_CashLine_ID); - if (ii == null) - return 0; - return ii.intValue(); - } +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Properties; +import java.util.logging.Level; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; -/** C_Charge_ID AD_Reference_ID=200 */ -public static final int C_CHARGE_ID_AD_Reference_ID=200; - /** Set Charge. - @param C_Charge_ID - Additional document charges - */ - public void setC_Charge_ID (int C_Charge_ID) - { - if (C_Charge_ID <= 0) set_Value (COLUMNNAME_C_Charge_ID, null); - else - set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); - } - - /** Get Charge. - @return Additional document charges - */ - public int getC_Charge_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_ConversionType getI_C_ConversionType() throws Exception - { - Class clazz = MTable.getClass(I_C_ConversionType.Table_Name); - I_C_ConversionType result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_ConversionType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_ConversionType_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 Type. - @param C_ConversionType_ID - Currency Conversion Rate Type - */ - public void setC_ConversionType_ID (int C_ConversionType_ID) - { - if (C_ConversionType_ID <= 0) set_Value (COLUMNNAME_C_ConversionType_ID, null); - else - set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); - } - - /** Get Currency Type. - @return Currency Conversion Rate Type - */ - public int getC_ConversionType_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_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(); - } +/** Generated Model for C_Invoice + * @author Adempiere (generated) + * @version Release 3.3.0 - $Id$ */ +public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent +{ -/** C_DocTypeTarget_ID AD_Reference_ID=170 */ -public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; - /** Set Target Document Type. - @param C_DocTypeTarget_ID - Target document type for conversing documents - */ - public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) - { - if (C_DocTypeTarget_ID < 1) - throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); - set_Value (COLUMNNAME_C_DocTypeTarget_ID, Integer.valueOf(C_DocTypeTarget_ID)); - } - - /** Get Target Document Type. - @return Target document type for conversing documents - */ - public int getC_DocTypeTarget_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_DocTypeTarget_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_DocType getI_C_DocType() throws Exception - { - Class clazz = MTable.getClass(I_C_DocType.Table_Name); - I_C_DocType result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_DocType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DocType_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 Document Type. - @param C_DocType_ID - Document type or rules - */ - public void setC_DocType_ID (int C_DocType_ID) - { - if (C_DocType_ID < 0) - throw new IllegalArgumentException ("C_DocType_ID is mandatory."); - set_ValueNoCheck (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); - } - - /** Get Document Type. - @return Document type or rules - */ - public int getC_DocType_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Invoice. - @param C_Invoice_ID - Invoice Identifier - */ - public void setC_Invoice_ID (int C_Invoice_ID) - { - if (C_Invoice_ID < 1) - throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); - set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); - } - - /** Get Invoice. - @return Invoice Identifier - */ - public int getC_Invoice_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Order. - @param C_Order_ID - Order - */ - public void setC_Order_ID (int C_Order_ID) - { - if (C_Order_ID <= 0) set_ValueNoCheck (COLUMNNAME_C_Order_ID, null); - else - set_ValueNoCheck (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID)); - } - - /** Get Order. - @return Order - */ - public int getC_Order_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_PaymentTerm getI_C_PaymentTerm() throws Exception - { - Class clazz = MTable.getClass(I_C_PaymentTerm.Table_Name); - I_C_PaymentTerm result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_PaymentTerm)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_PaymentTerm_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 Payment Term. - @param C_PaymentTerm_ID - The terms of Payment (timing, discount) - */ - public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) - { - if (C_PaymentTerm_ID < 1) - throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); - set_Value (COLUMNNAME_C_PaymentTerm_ID, Integer.valueOf(C_PaymentTerm_ID)); - } - - /** Get Payment Term. - @return The terms of Payment (timing, discount) - */ - public int getC_PaymentTerm_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentTerm_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Payment. - @param C_Payment_ID - Payment identifier - */ - public void setC_Payment_ID (int C_Payment_ID) - { - if (C_Payment_ID <= 0) set_Value (COLUMNNAME_C_Payment_ID, null); - else - set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); - } - - /** Get Payment. - @return Payment identifier - */ - public int getC_Payment_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_C_Project getI_C_Project() throws Exception - { - Class clazz = MTable.getClass(I_C_Project.Table_Name); - I_C_Project result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_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 Project. - @param C_Project_ID - Financial Project - */ - public void setC_Project_ID (int C_Project_ID) - { - if (C_Project_ID <= 0) set_Value (COLUMNNAME_C_Project_ID, null); - else - set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID)); - } - - /** Get Project. - @return Financial Project - */ - public int getC_Project_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Charge amount. - @param ChargeAmt - Charge Amount - */ - public void setChargeAmt (BigDecimal ChargeAmt) - { - set_Value (COLUMNNAME_ChargeAmt, ChargeAmt); - } - - /** Get Charge amount. - @return Charge Amount - */ - public BigDecimal getChargeAmt () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ChargeAmt); - if (bd == null) - return Env.ZERO; - return bd; - } - - /** Set Copy From. - @param CopyFrom - Copy From Record - */ - public void setCopyFrom (String CopyFrom) - { - if (CopyFrom != null && CopyFrom.length() > 1) - { - log.warning("Length > 1 - truncated"); - CopyFrom = CopyFrom.substring(0, 0); - } - set_Value (COLUMNNAME_CopyFrom, CopyFrom); - } - - /** Get Copy From. - @return Copy From Record - */ - public String getCopyFrom () - { - return (String)get_Value(COLUMNNAME_CopyFrom); - } - - /** Set Create lines from. - @param CreateFrom - Process which will generate a new document lines based on an existing document - */ - public void setCreateFrom (String CreateFrom) - { - if (CreateFrom != null && CreateFrom.length() > 1) - { - log.warning("Length > 1 - truncated"); - CreateFrom = CreateFrom.substring(0, 0); - } - set_Value (COLUMNNAME_CreateFrom, CreateFrom); - } - - /** Get Create lines from. - @return Process which will generate a new document lines based on an existing document - */ - public String getCreateFrom () - { - return (String)get_Value(COLUMNNAME_CreateFrom); - } - - /** Set Account Date. - @param DateAcct - Accounting Date - */ - public void setDateAcct (Timestamp DateAcct) - { - if (DateAcct == null) - throw new IllegalArgumentException ("DateAcct is mandatory."); - set_Value (COLUMNNAME_DateAcct, DateAcct); - } - - /** Get Account Date. - @return Accounting Date - */ - public Timestamp getDateAcct () - { - return (Timestamp)get_Value(COLUMNNAME_DateAcct); - } - - /** Set Date Invoiced. - @param DateInvoiced - Date printed on Invoice - */ - public void setDateInvoiced (Timestamp DateInvoiced) - { - if (DateInvoiced == null) - throw new IllegalArgumentException ("DateInvoiced is mandatory."); - set_Value (COLUMNNAME_DateInvoiced, DateInvoiced); - } - - /** Get Date Invoiced. - @return Date printed on Invoice - */ - public Timestamp getDateInvoiced () - { - return (Timestamp)get_Value(COLUMNNAME_DateInvoiced); - } - - /** Set Date Ordered. - @param DateOrdered - Date of Order - */ - public void setDateOrdered (Timestamp DateOrdered) - { - set_ValueNoCheck (COLUMNNAME_DateOrdered, DateOrdered); - } - - /** Get Date Ordered. - @return Date of Order - */ - public Timestamp getDateOrdered () - { - return (Timestamp)get_Value(COLUMNNAME_DateOrdered); - } - - /** Set Date printed. - @param DatePrinted - Date the document was printed. - */ - public void setDatePrinted (Timestamp DatePrinted) - { - set_Value (COLUMNNAME_DatePrinted, DatePrinted); - } - - /** Get Date printed. - @return Date the document was printed. - */ - public Timestamp getDatePrinted () - { - return (Timestamp)get_Value(COLUMNNAME_DatePrinted); - } - - /** 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); - } + /** + * + */ + private static final long serialVersionUID = 1L; -/** DocAction AD_Reference_ID=135 */ -public static final int DOCACTION_AD_Reference_ID=135;/** = -- */ -public static final String DOCACTION_None = "--";/** Approve = AP */ -public static final String DOCACTION_Approve = "AP";/** Close = CL */ -public static final String DOCACTION_Close = "CL";/** Complete = CO */ -public static final String DOCACTION_Complete = "CO";/** Invalidate = IN */ -public static final String DOCACTION_Invalidate = "IN";/** Post = PO */ -public static final String DOCACTION_Post = "PO";/** Prepare = PR */ -public static final String DOCACTION_Prepare = "PR";/** Reverse - Accrual = RA */ -public static final String DOCACTION_Reverse_Accrual = "RA";/** Reverse - Correct = RC */ -public static final String DOCACTION_Reverse_Correct = "RC";/** Re-activate = RE */ -public static final String DOCACTION_Re_Activate = "RE";/** Reject = RJ */ -public static final String DOCACTION_Reject = "RJ";/** Void = VO */ -public static final String DOCACTION_Void = "VO";/** Wait Complete = WC */ -public static final String DOCACTION_WaitComplete = "WC";/** Unlock = XL */ -public static final String DOCACTION_Unlock = "XL"; - /** Set Document Action. - @param DocAction - The targeted status of the document - */ - public void setDocAction (String DocAction) - { -if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory");if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); if (DocAction.length() > 2) - { - log.warning("Length > 2 - truncated"); - DocAction = DocAction.substring(0, 1); - } - set_Value (COLUMNNAME_DocAction, DocAction); - } - - /** Get Document Action. - @return The targeted status of the document - */ - public String getDocAction () - { - return (String)get_Value(COLUMNNAME_DocAction); - } + /** Standard Constructor */ + public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) + { + super (ctx, C_Invoice_ID, trxName); + /** if (C_Invoice_ID == 0) + { + setC_BPartner_ID (0); + setC_BPartner_Location_ID (0); + setC_Currency_ID (0); +// @C_Currency_ID@ + setC_DocTypeTarget_ID (0); + setC_DocType_ID (0); +// 0 + setC_Invoice_ID (0); + setC_PaymentTerm_ID (0); + setDateAcct (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDateInvoiced (new Timestamp(System.currentTimeMillis())); +// @#Date@ + setDocAction (null); +// CO + setDocStatus (null); +// DR + setDocumentNo (null); + setGrandTotal (Env.ZERO); + setIsApproved (false); +// @IsApproved@ + setIsDiscountPrinted (false); + setIsInDispute (false); +// N + setIsPaid (false); + setIsPayScheduleValid (false); + setIsPrinted (false); + setIsSOTrx (false); +// @IsSOTrx@ + setIsSelfService (false); + setIsTaxIncluded (false); + setIsTransferred (false); + setM_PriceList_ID (0); + setPaymentRule (null); +// P + setPosted (false); +// N + setProcessed (false); + setSendEMail (false); + setTotalLines (Env.ZERO); +// 'Y' + } */ + } -/** DocStatus AD_Reference_ID=131 */ -public static final int DOCSTATUS_AD_Reference_ID=131;/** Unknown = ?? */ -public static final String DOCSTATUS_Unknown = "??";/** Approved = AP */ -public static final String DOCSTATUS_Approved = "AP";/** Closed = CL */ -public static final String DOCSTATUS_Closed = "CL";/** Completed = CO */ -public static final String DOCSTATUS_Completed = "CO";/** Drafted = DR */ -public static final String DOCSTATUS_Drafted = "DR";/** Invalid = IN */ -public static final String DOCSTATUS_Invalid = "IN";/** In Progress = IP */ -public static final String DOCSTATUS_InProgress = "IP";/** Not Approved = NA */ -public static final String DOCSTATUS_NotApproved = "NA";/** Reversed = RE */ -public static final String DOCSTATUS_Reversed = "RE";/** Voided = VO */ -public static final String DOCSTATUS_Voided = "VO";/** Waiting Confirmation = WC */ -public static final String DOCSTATUS_WaitingConfirmation = "WC";/** Waiting Payment = WP */ -public static final String DOCSTATUS_WaitingPayment = "WP"; - /** Set Document Status. - @param DocStatus - The current status of the document - */ - public void setDocStatus (String DocStatus) - { -if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory");if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); if (DocStatus.length() > 2) - { - log.warning("Length > 2 - truncated"); - DocStatus = DocStatus.substring(0, 1); - } - set_Value (COLUMNNAME_DocStatus, DocStatus); - } - - /** Get Document Status. - @return The current status of the document - */ - public String getDocStatus () - { - return (String)get_Value(COLUMNNAME_DocStatus); - } - - /** Set Document No. - @param DocumentNo - Document sequence number of the document - */ - public void setDocumentNo (String DocumentNo) - { - if (DocumentNo == null) - throw new IllegalArgumentException ("DocumentNo is mandatory."); - if (DocumentNo.length() > 30) - { - log.warning("Length > 30 - truncated"); - DocumentNo = DocumentNo.substring(0, 29); - } - set_ValueNoCheck (COLUMNNAME_DocumentNo, DocumentNo); - } - - /** Get Document No. - @return Document sequence number of the document - */ - public String getDocumentNo () - { - return (String)get_Value(COLUMNNAME_DocumentNo); - } - - /** Get Record ID/ColumnName - @return ID/ColumnName pair - */ - public KeyNamePair getKeyNamePair() - { - return new KeyNamePair(get_ID(), getDocumentNo()); - } - - /** Set Generate To. - @param GenerateTo - Generate To - */ - public void setGenerateTo (String GenerateTo) - { - if (GenerateTo != null && GenerateTo.length() > 1) - { - log.warning("Length > 1 - truncated"); - GenerateTo = GenerateTo.substring(0, 0); - } - set_Value (COLUMNNAME_GenerateTo, GenerateTo); - } - - /** Get Generate To. - @return Generate To - */ - public String getGenerateTo () - { - return (String)get_Value(COLUMNNAME_GenerateTo); - } - - /** Set Grand Total. - @param GrandTotal - Total amount of document - */ - public void setGrandTotal (BigDecimal GrandTotal) - { - if (GrandTotal == null) - throw new IllegalArgumentException ("GrandTotal is mandatory."); - set_ValueNoCheck (COLUMNNAME_GrandTotal, GrandTotal); - } - - /** Get Grand Total. - @return Total amount of document - */ - public BigDecimal getGrandTotal () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_GrandTotal); - if (bd == null) - return Env.ZERO; - return bd; - } + /** Load Constructor */ + public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } -/** InvoiceCollectionType AD_Reference_ID=394 */ -public static final int INVOICECOLLECTIONTYPE_AD_Reference_ID=394;/** Collection Agency = C */ -public static final String INVOICECOLLECTIONTYPE_CollectionAgency = "C";/** Dunning = D */ -public static final String INVOICECOLLECTIONTYPE_Dunning = "D";/** Legal Procedure = L */ -public static final String INVOICECOLLECTIONTYPE_LegalProcedure = "L";/** Uncollectable = U */ -public static final String INVOICECOLLECTIONTYPE_Uncollectable = "U"; - /** Set Collection Status. - @param InvoiceCollectionType - Invoice Collection Status - */ - public void setInvoiceCollectionType (String InvoiceCollectionType) - { -if (InvoiceCollectionType == null || InvoiceCollectionType.equals("C") || InvoiceCollectionType.equals("D") || InvoiceCollectionType.equals("L") || InvoiceCollectionType.equals("U")); else throw new IllegalArgumentException ("InvoiceCollectionType Invalid value - " + InvoiceCollectionType + " - Reference_ID=394 - C - D - L - U"); if (InvoiceCollectionType != null && InvoiceCollectionType.length() > 1) - { - log.warning("Length > 1 - truncated"); - InvoiceCollectionType = InvoiceCollectionType.substring(0, 0); - } - set_Value (COLUMNNAME_InvoiceCollectionType, InvoiceCollectionType); - } - - /** Get Collection Status. - @return Invoice Collection Status - */ - public String getInvoiceCollectionType () - { - return (String)get_Value(COLUMNNAME_InvoiceCollectionType); - } - - /** Set Approved. - @param IsApproved - Indicates if this document requires approval - */ - public void setIsApproved (boolean IsApproved) - { - set_ValueNoCheck (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved)); - } - - /** Get Approved. - @return Indicates if this document requires approval - */ - public boolean isApproved () - { - Object oo = get_Value(COLUMNNAME_IsApproved); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Discount Printed. - @param IsDiscountPrinted - Print Discount on Invoice and Order - */ - public void setIsDiscountPrinted (boolean IsDiscountPrinted) - { - set_Value (COLUMNNAME_IsDiscountPrinted, Boolean.valueOf(IsDiscountPrinted)); - } - - /** Get Discount Printed. - @return Print Discount on Invoice and Order - */ - public boolean isDiscountPrinted () - { - Object oo = get_Value(COLUMNNAME_IsDiscountPrinted); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set In Dispute. - @param IsInDispute - Document is in dispute - */ - public void setIsInDispute (boolean IsInDispute) - { - set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); - } - - /** Get In Dispute. - @return Document is in dispute - */ - public boolean isInDispute () - { - Object oo = get_Value(COLUMNNAME_IsInDispute); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Paid. - @param IsPaid - The document is paid - */ - public void setIsPaid (boolean IsPaid) - { - set_Value (COLUMNNAME_IsPaid, Boolean.valueOf(IsPaid)); - } - - /** Get Paid. - @return The document is paid - */ - public boolean isPaid () - { - Object oo = get_Value(COLUMNNAME_IsPaid); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Pay Schedule valid. - @param IsPayScheduleValid - Is the Payment Schedule is valid - */ - public void setIsPayScheduleValid (boolean IsPayScheduleValid) - { - set_ValueNoCheck (COLUMNNAME_IsPayScheduleValid, Boolean.valueOf(IsPayScheduleValid)); - } - - /** Get Pay Schedule valid. - @return Is the Payment Schedule is valid - */ - public boolean isPayScheduleValid () - { - Object oo = get_Value(COLUMNNAME_IsPayScheduleValid); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Printed. - @param IsPrinted - Indicates if this document / line is printed - */ - public void setIsPrinted (boolean IsPrinted) - { - set_ValueNoCheck (COLUMNNAME_IsPrinted, Boolean.valueOf(IsPrinted)); - } - - /** Get Printed. - @return Indicates if this document / line is printed - */ - public boolean isPrinted () - { - Object oo = get_Value(COLUMNNAME_IsPrinted); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Sales Transaction. - @param IsSOTrx - This is a Sales Transaction - */ - public void setIsSOTrx (boolean IsSOTrx) - { - set_ValueNoCheck (COLUMNNAME_IsSOTrx, Boolean.valueOf(IsSOTrx)); - } - - /** Get Sales Transaction. - @return This is a Sales Transaction - */ - public boolean isSOTrx () - { - Object oo = get_Value(COLUMNNAME_IsSOTrx); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Self-Service. - @param IsSelfService - This is a Self-Service entry or this entry can be changed via Self-Service - */ - public void setIsSelfService (boolean IsSelfService) - { - set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); - } - - /** Get Self-Service. - @return This is a Self-Service entry or this entry can be changed via Self-Service - */ - public boolean isSelfService () - { - Object oo = get_Value(COLUMNNAME_IsSelfService); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Price includes Tax. - @param IsTaxIncluded - Tax is included in the price - */ - public void setIsTaxIncluded (boolean IsTaxIncluded) - { - set_Value (COLUMNNAME_IsTaxIncluded, Boolean.valueOf(IsTaxIncluded)); - } - - /** Get Price includes Tax. - @return Tax is included in the price - */ - public boolean isTaxIncluded () - { - Object oo = get_Value(COLUMNNAME_IsTaxIncluded); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Transferred. - @param IsTransferred - Transferred to General Ledger (i.e. accounted) - */ - public void setIsTransferred (boolean IsTransferred) - { - set_ValueNoCheck (COLUMNNAME_IsTransferred, Boolean.valueOf(IsTransferred)); - } - - /** Get Transferred. - @return Transferred to General Ledger (i.e. accounted) - */ - public boolean isTransferred () - { - Object oo = get_Value(COLUMNNAME_IsTransferred); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - public I_M_PriceList getI_M_PriceList() throws Exception - { - Class clazz = MTable.getClass(I_M_PriceList.Table_Name); - I_M_PriceList result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_M_PriceList)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_PriceList_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 Price List. - @param M_PriceList_ID - Unique identifier of a Price List - */ - public void setM_PriceList_ID (int M_PriceList_ID) - { - if (M_PriceList_ID < 1) - throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); - set_Value (COLUMNNAME_M_PriceList_ID, Integer.valueOf(M_PriceList_ID)); - } - - /** Get Price List. - @return Unique identifier of a Price List - */ - public int getM_PriceList_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_M_PriceList_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public I_M_RMA getI_M_RMA() throws Exception - { - Class clazz = MTable.getClass(I_M_RMA.Table_Name); - I_M_RMA result = null; - try { - Constructor constructor = null; - constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); - result = (I_M_RMA)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_RMA_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 RMA. - @param M_RMA_ID - Return Material Authorization - */ - public void setM_RMA_ID (int M_RMA_ID) - { - if (M_RMA_ID <= 0) set_Value (COLUMNNAME_M_RMA_ID, null); - else - set_Value (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID)); - } - - /** Get RMA. - @return Return Material Authorization - */ - public int getM_RMA_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Order Reference. - @param POReference - Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner - */ - public void setPOReference (String POReference) - { - if (POReference != null && POReference.length() > 20) - { - log.warning("Length > 20 - truncated"); - POReference = POReference.substring(0, 19); - } - set_Value (COLUMNNAME_POReference, POReference); - } - - /** Get Order Reference. - @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner - */ - public String getPOReference () - { - return (String)get_Value(COLUMNNAME_POReference); - } + /** AccessLevel + * @return 1 - Org + */ + 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_Invoice[") + .append(get_ID()).append("]"); + return sb.toString(); + } + + /** AD_OrgTrx_ID AD_Reference_ID=130 */ + public static final int AD_ORGTRX_ID_AD_Reference_ID=130; + /** Set Trx Organization. + @param AD_OrgTrx_ID + Performing or initiating organization + */ + public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) + { + if (AD_OrgTrx_ID <= 0) + set_Value (COLUMNNAME_AD_OrgTrx_ID, null); + else + set_Value (COLUMNNAME_AD_OrgTrx_ID, Integer.valueOf(AD_OrgTrx_ID)); + } + + /** Get Trx Organization. + @return Performing or initiating organization + */ + public int getAD_OrgTrx_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_OrgTrx_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_AD_User getAD_User() throws Exception + { + Class clazz = MTable.getClass(I_AD_User.Table_Name); + I_AD_User result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_AD_User)constructor.newInstance(new Object[] {getCtx(), new Integer(getAD_User_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 User/Contact. + @param AD_User_ID + User within the system - Internal or Business Partner Contact + */ + public void setAD_User_ID (int AD_User_ID) + { + if (AD_User_ID <= 0) + set_Value (COLUMNNAME_AD_User_ID, null); + else + set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); + } + + /** Get User/Contact. + @return User within the system - Internal or Business Partner Contact + */ + public int getAD_User_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Activity getC_Activity() throws Exception + { + Class clazz = MTable.getClass(I_C_Activity.Table_Name); + I_C_Activity result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Activity)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Activity_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 Activity. + @param C_Activity_ID + Business Activity + */ + public void setC_Activity_ID (int C_Activity_ID) + { + if (C_Activity_ID <= 0) + set_Value (COLUMNNAME_C_Activity_ID, null); + else + set_Value (COLUMNNAME_C_Activity_ID, Integer.valueOf(C_Activity_ID)); + } + + /** Get Activity. + @return Business Activity + */ + public int getC_Activity_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Activity_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Business Partner . + @param C_BPartner_ID + Identifies a Business Partner + */ + public void setC_BPartner_ID (int C_BPartner_ID) + { + if (C_BPartner_ID < 1) + throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); + } + + /** Get Business Partner . + @return Identifies a Business Partner + */ + public int getC_BPartner_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_BPartner_Location getC_BPartner_Location() throws Exception + { + Class clazz = MTable.getClass(I_C_BPartner_Location.Table_Name); + I_C_BPartner_Location result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_BPartner_Location)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_BPartner_Location_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 Partner Location. + @param C_BPartner_Location_ID + Identifies the (ship to) address for this Business Partner + */ + public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) + { + if (C_BPartner_Location_ID < 1) + throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); + set_Value (COLUMNNAME_C_BPartner_Location_ID, Integer.valueOf(C_BPartner_Location_ID)); + } + + /** Get Partner Location. + @return Identifies the (ship to) address for this Business Partner + */ + public int getC_BPartner_Location_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_Location_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Campaign getC_Campaign() throws Exception + { + Class clazz = MTable.getClass(I_C_Campaign.Table_Name); + I_C_Campaign result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Campaign)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Campaign_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 Campaign. + @param C_Campaign_ID + Marketing Campaign + */ + public void setC_Campaign_ID (int C_Campaign_ID) + { + if (C_Campaign_ID <= 0) + set_Value (COLUMNNAME_C_Campaign_ID, null); + else + set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); + } + + /** Get Campaign. + @return Marketing Campaign + */ + public int getC_Campaign_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Cash Journal Line. + @param C_CashLine_ID + Cash Journal Line + */ + public void setC_CashLine_ID (int C_CashLine_ID) + { + if (C_CashLine_ID <= 0) + set_Value (COLUMNNAME_C_CashLine_ID, null); + else + set_Value (COLUMNNAME_C_CashLine_ID, Integer.valueOf(C_CashLine_ID)); + } + + /** Get Cash Journal Line. + @return Cash Journal Line + */ + public int getC_CashLine_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_CashLine_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** C_Charge_ID AD_Reference_ID=200 */ + public static final int C_CHARGE_ID_AD_Reference_ID=200; + /** Set Charge. + @param C_Charge_ID + Additional document charges + */ + public void setC_Charge_ID (int C_Charge_ID) + { + if (C_Charge_ID <= 0) + set_Value (COLUMNNAME_C_Charge_ID, null); + else + set_Value (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); + } + + /** Get Charge. + @return Additional document charges + */ + public int getC_Charge_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_ConversionType getC_ConversionType() throws Exception + { + Class clazz = MTable.getClass(I_C_ConversionType.Table_Name); + I_C_ConversionType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_ConversionType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_ConversionType_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 Type. + @param C_ConversionType_ID + Currency Conversion Rate Type + */ + public void setC_ConversionType_ID (int C_ConversionType_ID) + { + if (C_ConversionType_ID <= 0) + set_Value (COLUMNNAME_C_ConversionType_ID, null); + else + set_Value (COLUMNNAME_C_ConversionType_ID, Integer.valueOf(C_ConversionType_ID)); + } + + /** Get Currency Type. + @return Currency Conversion Rate Type + */ + public int getC_ConversionType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_ConversionType_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(); + } + + /** C_DocTypeTarget_ID AD_Reference_ID=170 */ + public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; + /** Set Target Document Type. + @param C_DocTypeTarget_ID + Target document type for conversing documents + */ + public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) + { + if (C_DocTypeTarget_ID < 1) + throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); + set_Value (COLUMNNAME_C_DocTypeTarget_ID, Integer.valueOf(C_DocTypeTarget_ID)); + } + + /** Get Target Document Type. + @return Target document type for conversing documents + */ + public int getC_DocTypeTarget_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocTypeTarget_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_DocType getC_DocType() throws Exception + { + Class clazz = MTable.getClass(I_C_DocType.Table_Name); + I_C_DocType result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DocType)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DocType_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 Document Type. + @param C_DocType_ID + Document type or rules + */ + public void setC_DocType_ID (int C_DocType_ID) + { + if (C_DocType_ID < 0) + throw new IllegalArgumentException ("C_DocType_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID)); + } + + /** Get Document Type. + @return Document type or rules + */ + public int getC_DocType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_DunningLevel getC_DunningLevel() throws Exception + { + Class clazz = MTable.getClass(I_C_DunningLevel.Table_Name); + I_C_DunningLevel result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_DunningLevel)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_DunningLevel_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 Dunning Level. + @param C_DunningLevel_ID + Dunning Level + */ + public void setC_DunningLevel_ID (int C_DunningLevel_ID) + { + if (C_DunningLevel_ID <= 0) + set_Value (COLUMNNAME_C_DunningLevel_ID, null); + else + set_Value (COLUMNNAME_C_DunningLevel_ID, Integer.valueOf(C_DunningLevel_ID)); + } + + /** Get Dunning Level. + @return Dunning Level + */ + public int getC_DunningLevel_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_DunningLevel_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Invoice. + @param C_Invoice_ID + Invoice Identifier + */ + public void setC_Invoice_ID (int C_Invoice_ID) + { + if (C_Invoice_ID < 1) + throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); + set_ValueNoCheck (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); + } + + /** Get Invoice. + @return Invoice Identifier + */ + public int getC_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Order. + @param C_Order_ID + Order + */ + public void setC_Order_ID (int C_Order_ID) + { + if (C_Order_ID <= 0) + set_ValueNoCheck (COLUMNNAME_C_Order_ID, null); + else + set_ValueNoCheck (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID)); + } + + /** Get Order. + @return Order + */ + public int getC_Order_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_PaymentTerm getC_PaymentTerm() throws Exception + { + Class clazz = MTable.getClass(I_C_PaymentTerm.Table_Name); + I_C_PaymentTerm result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_PaymentTerm)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_PaymentTerm_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 Payment Term. + @param C_PaymentTerm_ID + The terms of Payment (timing, discount) + */ + public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) + { + if (C_PaymentTerm_ID < 1) + throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); + set_Value (COLUMNNAME_C_PaymentTerm_ID, Integer.valueOf(C_PaymentTerm_ID)); + } + + /** Get Payment Term. + @return The terms of Payment (timing, discount) + */ + public int getC_PaymentTerm_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentTerm_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Payment. + @param C_Payment_ID + Payment identifier + */ + public void setC_Payment_ID (int C_Payment_ID) + { + if (C_Payment_ID <= 0) + set_Value (COLUMNNAME_C_Payment_ID, null); + else + set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); + } + + /** Get Payment. + @return Payment identifier + */ + public int getC_Payment_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_C_Project getC_Project() throws Exception + { + Class clazz = MTable.getClass(I_C_Project.Table_Name); + I_C_Project result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_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 Project. + @param C_Project_ID + Financial Project + */ + public void setC_Project_ID (int C_Project_ID) + { + if (C_Project_ID <= 0) + set_Value (COLUMNNAME_C_Project_ID, null); + else + set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID)); + } + + /** Get Project. + @return Financial Project + */ + public int getC_Project_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Charge amount. + @param ChargeAmt + Charge Amount + */ + public void setChargeAmt (BigDecimal ChargeAmt) + { + set_Value (COLUMNNAME_ChargeAmt, ChargeAmt); + } + + /** Get Charge amount. + @return Charge Amount + */ + public BigDecimal getChargeAmt () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ChargeAmt); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** Set Copy From. + @param CopyFrom + Copy From Record + */ + public void setCopyFrom (String CopyFrom) + { + + if (CopyFrom != null && CopyFrom.length() > 1) + { + log.warning("Length > 1 - truncated"); + CopyFrom = CopyFrom.substring(0, 0); + } + set_Value (COLUMNNAME_CopyFrom, CopyFrom); + } + + /** Get Copy From. + @return Copy From Record + */ + public String getCopyFrom () + { + return (String)get_Value(COLUMNNAME_CopyFrom); + } + + /** Set Create lines from. + @param CreateFrom + Process which will generate a new document lines based on an existing document + */ + public void setCreateFrom (String CreateFrom) + { + + if (CreateFrom != null && CreateFrom.length() > 1) + { + log.warning("Length > 1 - truncated"); + CreateFrom = CreateFrom.substring(0, 0); + } + set_Value (COLUMNNAME_CreateFrom, CreateFrom); + } + + /** Get Create lines from. + @return Process which will generate a new document lines based on an existing document + */ + public String getCreateFrom () + { + return (String)get_Value(COLUMNNAME_CreateFrom); + } + + /** Set Account Date. + @param DateAcct + Accounting Date + */ + public void setDateAcct (Timestamp DateAcct) + { + if (DateAcct == null) + throw new IllegalArgumentException ("DateAcct is mandatory."); + set_Value (COLUMNNAME_DateAcct, DateAcct); + } + + /** Get Account Date. + @return Accounting Date + */ + public Timestamp getDateAcct () + { + return (Timestamp)get_Value(COLUMNNAME_DateAcct); + } + + /** Set Date Invoiced. + @param DateInvoiced + Date printed on Invoice + */ + public void setDateInvoiced (Timestamp DateInvoiced) + { + if (DateInvoiced == null) + throw new IllegalArgumentException ("DateInvoiced is mandatory."); + set_Value (COLUMNNAME_DateInvoiced, DateInvoiced); + } + + /** Get Date Invoiced. + @return Date printed on Invoice + */ + public Timestamp getDateInvoiced () + { + return (Timestamp)get_Value(COLUMNNAME_DateInvoiced); + } + + /** Set Date Ordered. + @param DateOrdered + Date of Order + */ + public void setDateOrdered (Timestamp DateOrdered) + { + set_ValueNoCheck (COLUMNNAME_DateOrdered, DateOrdered); + } + + /** Get Date Ordered. + @return Date of Order + */ + public Timestamp getDateOrdered () + { + return (Timestamp)get_Value(COLUMNNAME_DateOrdered); + } + + /** Set Date printed. + @param DatePrinted + Date the document was printed. + */ + public void setDatePrinted (Timestamp DatePrinted) + { + set_Value (COLUMNNAME_DatePrinted, DatePrinted); + } + + /** Get Date printed. + @return Date the document was printed. + */ + public Timestamp getDatePrinted () + { + return (Timestamp)get_Value(COLUMNNAME_DatePrinted); + } + + /** 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); + } + + /** DocAction AD_Reference_ID=135 */ + public static final int DOCACTION_AD_Reference_ID=135; + /** Complete = CO */ + public static final String DOCACTION_Complete = "CO"; + /** Approve = AP */ + public static final String DOCACTION_Approve = "AP"; + /** Reject = RJ */ + public static final String DOCACTION_Reject = "RJ"; + /** Post = PO */ + public static final String DOCACTION_Post = "PO"; + /** Void = VO */ + public static final String DOCACTION_Void = "VO"; + /** Close = CL */ + public static final String DOCACTION_Close = "CL"; + /** Reverse - Correct = RC */ + public static final String DOCACTION_Reverse_Correct = "RC"; + /** Reverse - Accrual = RA */ + public static final String DOCACTION_Reverse_Accrual = "RA"; + /** Invalidate = IN */ + public static final String DOCACTION_Invalidate = "IN"; + /** Re-activate = RE */ + public static final String DOCACTION_Re_Activate = "RE"; + /** = -- */ + public static final String DOCACTION_None = "--"; + /** Prepare = PR */ + public static final String DOCACTION_Prepare = "PR"; + /** Unlock = XL */ + public static final String DOCACTION_Unlock = "XL"; + /** Wait Complete = WC */ + public static final String DOCACTION_WaitComplete = "WC"; + /** Set Document Action. + @param DocAction + The targeted status of the document + */ + public void setDocAction (String DocAction) + { + if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); + if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("PR") || DocAction.equals("XL") || DocAction.equals("WC")); else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - PR - XL - WC"); + if (DocAction.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocAction = DocAction.substring(0, 1); + } + set_Value (COLUMNNAME_DocAction, DocAction); + } + + /** Get Document Action. + @return The targeted status of the document + */ + public String getDocAction () + { + return (String)get_Value(COLUMNNAME_DocAction); + } + + /** DocStatus AD_Reference_ID=131 */ + public static final int DOCSTATUS_AD_Reference_ID=131; + /** Drafted = DR */ + public static final String DOCSTATUS_Drafted = "DR"; + /** Completed = CO */ + public static final String DOCSTATUS_Completed = "CO"; + /** Approved = AP */ + public static final String DOCSTATUS_Approved = "AP"; + /** Not Approved = NA */ + public static final String DOCSTATUS_NotApproved = "NA"; + /** Voided = VO */ + public static final String DOCSTATUS_Voided = "VO"; + /** Invalid = IN */ + public static final String DOCSTATUS_Invalid = "IN"; + /** Reversed = RE */ + public static final String DOCSTATUS_Reversed = "RE"; + /** Closed = CL */ + public static final String DOCSTATUS_Closed = "CL"; + /** Unknown = ?? */ + public static final String DOCSTATUS_Unknown = "??"; + /** In Progress = IP */ + public static final String DOCSTATUS_InProgress = "IP"; + /** Waiting Payment = WP */ + public static final String DOCSTATUS_WaitingPayment = "WP"; + /** Waiting Confirmation = WC */ + public static final String DOCSTATUS_WaitingConfirmation = "WC"; + /** Set Document Status. + @param DocStatus + The current status of the document + */ + public void setDocStatus (String DocStatus) + { + if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); + if (DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("IP") || DocStatus.equals("WP") || DocStatus.equals("WC")); else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - DR - CO - AP - NA - VO - IN - RE - CL - ?? - IP - WP - WC"); + if (DocStatus.length() > 2) + { + log.warning("Length > 2 - truncated"); + DocStatus = DocStatus.substring(0, 1); + } + set_Value (COLUMNNAME_DocStatus, DocStatus); + } + + /** Get Document Status. + @return The current status of the document + */ + public String getDocStatus () + { + return (String)get_Value(COLUMNNAME_DocStatus); + } + + /** Set Document No. + @param DocumentNo + Document sequence number of the document + */ + public void setDocumentNo (String DocumentNo) + { + if (DocumentNo == null) + throw new IllegalArgumentException ("DocumentNo is mandatory."); + + if (DocumentNo.length() > 30) + { + log.warning("Length > 30 - truncated"); + DocumentNo = DocumentNo.substring(0, 29); + } + set_ValueNoCheck (COLUMNNAME_DocumentNo, DocumentNo); + } + + /** Get Document No. + @return Document sequence number of the document + */ + public String getDocumentNo () + { + return (String)get_Value(COLUMNNAME_DocumentNo); + } + + /** Get Record ID/ColumnName + @return ID/ColumnName pair + */ + public KeyNamePair getKeyNamePair() + { + return new KeyNamePair(get_ID(), getDocumentNo()); + } + + /** Set Dunning Grace. + @param DunningGrace + Delay/block the dunning until this date is reached. + */ + public void setDunningGrace (Timestamp DunningGrace) + { + set_Value (COLUMNNAME_DunningGrace, DunningGrace); + } + + /** Get Dunning Grace. + @return Delay/block the dunning until this date is reached. + */ + public Timestamp getDunningGrace () + { + return (Timestamp)get_Value(COLUMNNAME_DunningGrace); + } + + /** Set Generate To. + @param GenerateTo + Generate To + */ + public void setGenerateTo (String GenerateTo) + { + + if (GenerateTo != null && GenerateTo.length() > 1) + { + log.warning("Length > 1 - truncated"); + GenerateTo = GenerateTo.substring(0, 0); + } + set_Value (COLUMNNAME_GenerateTo, GenerateTo); + } + + /** Get Generate To. + @return Generate To + */ + public String getGenerateTo () + { + return (String)get_Value(COLUMNNAME_GenerateTo); + } + + /** Set Grand Total. + @param GrandTotal + Total amount of document + */ + public void setGrandTotal (BigDecimal GrandTotal) + { + if (GrandTotal == null) + throw new IllegalArgumentException ("GrandTotal is mandatory."); + set_ValueNoCheck (COLUMNNAME_GrandTotal, GrandTotal); + } + + /** Get Grand Total. + @return Total amount of document + */ + public BigDecimal getGrandTotal () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_GrandTotal); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** InvoiceCollectionType AD_Reference_ID=394 */ + public static final int INVOICECOLLECTIONTYPE_AD_Reference_ID=394; + /** Dunning = D */ + public static final String INVOICECOLLECTIONTYPE_Dunning = "D"; + /** Collection Agency = C */ + public static final String INVOICECOLLECTIONTYPE_CollectionAgency = "C"; + /** Legal Procedure = L */ + public static final String INVOICECOLLECTIONTYPE_LegalProcedure = "L"; + /** Uncollectable = U */ + public static final String INVOICECOLLECTIONTYPE_Uncollectable = "U"; + /** Set Collection Status. + @param InvoiceCollectionType + Invoice Collection Status + */ + public void setInvoiceCollectionType (String InvoiceCollectionType) + { + + if (InvoiceCollectionType == null || InvoiceCollectionType.equals("D") || InvoiceCollectionType.equals("C") || InvoiceCollectionType.equals("L") || InvoiceCollectionType.equals("U")); else throw new IllegalArgumentException ("InvoiceCollectionType Invalid value - " + InvoiceCollectionType + " - Reference_ID=394 - D - C - L - U"); + if (InvoiceCollectionType != null && InvoiceCollectionType.length() > 1) + { + log.warning("Length > 1 - truncated"); + InvoiceCollectionType = InvoiceCollectionType.substring(0, 0); + } + set_Value (COLUMNNAME_InvoiceCollectionType, InvoiceCollectionType); + } + + /** Get Collection Status. + @return Invoice Collection Status + */ + public String getInvoiceCollectionType () + { + return (String)get_Value(COLUMNNAME_InvoiceCollectionType); + } + + /** Set Approved. + @param IsApproved + Indicates if this document requires approval + */ + public void setIsApproved (boolean IsApproved) + { + set_ValueNoCheck (COLUMNNAME_IsApproved, Boolean.valueOf(IsApproved)); + } + + /** Get Approved. + @return Indicates if this document requires approval + */ + public boolean isApproved () + { + Object oo = get_Value(COLUMNNAME_IsApproved); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Discount Printed. + @param IsDiscountPrinted + Print Discount on Invoice and Order + */ + public void setIsDiscountPrinted (boolean IsDiscountPrinted) + { + set_Value (COLUMNNAME_IsDiscountPrinted, Boolean.valueOf(IsDiscountPrinted)); + } + + /** Get Discount Printed. + @return Print Discount on Invoice and Order + */ + public boolean isDiscountPrinted () + { + Object oo = get_Value(COLUMNNAME_IsDiscountPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set In Dispute. + @param IsInDispute + Document is in dispute + */ + public void setIsInDispute (boolean IsInDispute) + { + set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); + } + + /** Get In Dispute. + @return Document is in dispute + */ + public boolean isInDispute () + { + Object oo = get_Value(COLUMNNAME_IsInDispute); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Paid. + @param IsPaid + The document is paid + */ + public void setIsPaid (boolean IsPaid) + { + set_Value (COLUMNNAME_IsPaid, Boolean.valueOf(IsPaid)); + } + + /** Get Paid. + @return The document is paid + */ + public boolean isPaid () + { + Object oo = get_Value(COLUMNNAME_IsPaid); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Pay Schedule valid. + @param IsPayScheduleValid + Is the Payment Schedule is valid + */ + public void setIsPayScheduleValid (boolean IsPayScheduleValid) + { + set_ValueNoCheck (COLUMNNAME_IsPayScheduleValid, Boolean.valueOf(IsPayScheduleValid)); + } + + /** Get Pay Schedule valid. + @return Is the Payment Schedule is valid + */ + public boolean isPayScheduleValid () + { + Object oo = get_Value(COLUMNNAME_IsPayScheduleValid); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Printed. + @param IsPrinted + Indicates if this document / line is printed + */ + public void setIsPrinted (boolean IsPrinted) + { + set_ValueNoCheck (COLUMNNAME_IsPrinted, Boolean.valueOf(IsPrinted)); + } + + /** Get Printed. + @return Indicates if this document / line is printed + */ + public boolean isPrinted () + { + Object oo = get_Value(COLUMNNAME_IsPrinted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Sales Transaction. + @param IsSOTrx + This is a Sales Transaction + */ + public void setIsSOTrx (boolean IsSOTrx) + { + set_ValueNoCheck (COLUMNNAME_IsSOTrx, Boolean.valueOf(IsSOTrx)); + } + + /** Get Sales Transaction. + @return This is a Sales Transaction + */ + public boolean isSOTrx () + { + Object oo = get_Value(COLUMNNAME_IsSOTrx); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Self-Service. + @param IsSelfService + This is a Self-Service entry or this entry can be changed via Self-Service + */ + public void setIsSelfService (boolean IsSelfService) + { + set_Value (COLUMNNAME_IsSelfService, Boolean.valueOf(IsSelfService)); + } + + /** Get Self-Service. + @return This is a Self-Service entry or this entry can be changed via Self-Service + */ + public boolean isSelfService () + { + Object oo = get_Value(COLUMNNAME_IsSelfService); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Price includes Tax. + @param IsTaxIncluded + Tax is included in the price + */ + public void setIsTaxIncluded (boolean IsTaxIncluded) + { + set_Value (COLUMNNAME_IsTaxIncluded, Boolean.valueOf(IsTaxIncluded)); + } + + /** Get Price includes Tax. + @return Tax is included in the price + */ + public boolean isTaxIncluded () + { + Object oo = get_Value(COLUMNNAME_IsTaxIncluded); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Transferred. + @param IsTransferred + Transferred to General Ledger (i.e. accounted) + */ + public void setIsTransferred (boolean IsTransferred) + { + set_ValueNoCheck (COLUMNNAME_IsTransferred, Boolean.valueOf(IsTransferred)); + } + + /** Get Transferred. + @return Transferred to General Ledger (i.e. accounted) + */ + public boolean isTransferred () + { + Object oo = get_Value(COLUMNNAME_IsTransferred); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + public I_M_PriceList getM_PriceList() throws Exception + { + Class clazz = MTable.getClass(I_M_PriceList.Table_Name); + I_M_PriceList result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_PriceList)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_PriceList_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 Price List. + @param M_PriceList_ID + Unique identifier of a Price List + */ + public void setM_PriceList_ID (int M_PriceList_ID) + { + if (M_PriceList_ID < 1) + throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); + set_Value (COLUMNNAME_M_PriceList_ID, Integer.valueOf(M_PriceList_ID)); + } + + /** Get Price List. + @return Unique identifier of a Price List + */ + public int getM_PriceList_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_PriceList_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + public I_M_RMA getM_RMA() throws Exception + { + Class clazz = MTable.getClass(I_M_RMA.Table_Name); + I_M_RMA result = null; + try { + Constructor constructor = null; + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + result = (I_M_RMA)constructor.newInstance(new Object[] {getCtx(), new Integer(getM_RMA_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 RMA. + @param M_RMA_ID + Return Material Authorization + */ + public void setM_RMA_ID (int M_RMA_ID) + { + if (M_RMA_ID <= 0) + set_Value (COLUMNNAME_M_RMA_ID, null); + else + set_Value (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID)); + } + + /** Get RMA. + @return Return Material Authorization + */ + public int getM_RMA_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set Order Reference. + @param POReference + Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public void setPOReference (String POReference) + { + + if (POReference != null && POReference.length() > 20) + { + log.warning("Length > 20 - truncated"); + POReference = POReference.substring(0, 19); + } + set_Value (COLUMNNAME_POReference, POReference); + } + + /** Get Order Reference. + @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner + */ + public String getPOReference () + { + return (String)get_Value(COLUMNNAME_POReference); + } + + /** PaymentRule AD_Reference_ID=195 */ + public static final int PAYMENTRULE_AD_Reference_ID=195; + /** Cash = B */ + public static final String PAYMENTRULE_Cash = "B"; + /** Credit Card = K */ + public static final String PAYMENTRULE_CreditCard = "K"; + /** Direct Deposit = T */ + public static final String PAYMENTRULE_DirectDeposit = "T"; + /** Check = S */ + public static final String PAYMENTRULE_Check = "S"; + /** On Credit = P */ + public static final String PAYMENTRULE_OnCredit = "P"; + /** Direct Debit = D */ + public static final String PAYMENTRULE_DirectDebit = "D"; + /** Set Payment Rule. + @param PaymentRule + How you pay the invoice + */ + public void setPaymentRule (String PaymentRule) + { + if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); + if (PaymentRule.equals("B") || PaymentRule.equals("K") || PaymentRule.equals("T") || PaymentRule.equals("S") || PaymentRule.equals("P") || PaymentRule.equals("D")); else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - K - T - S - P - D"); + if (PaymentRule.length() > 1) + { + log.warning("Length > 1 - truncated"); + PaymentRule = PaymentRule.substring(0, 0); + } + set_Value (COLUMNNAME_PaymentRule, PaymentRule); + } + + /** Get Payment Rule. + @return How you pay the invoice + */ + public String getPaymentRule () + { + return (String)get_Value(COLUMNNAME_PaymentRule); + } + + /** Set Posted. + @param Posted + Posting status + */ + public void setPosted (boolean Posted) + { + set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted)); + } + + /** Get Posted. + @return Posting status + */ + public boolean isPosted () + { + Object oo = get_Value(COLUMNNAME_Posted); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Processed. + @param Processed + The document has been processed + */ + public void setProcessed (boolean Processed) + { + set_ValueNoCheck (COLUMNNAME_Processed, Boolean.valueOf(Processed)); + } + + /** Get Processed. + @return The document has been processed + */ + public boolean isProcessed () + { + Object oo = get_Value(COLUMNNAME_Processed); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Process Now. + @param Processing Process Now */ + public void setProcessing (boolean Processing) + { + set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); + } -/** PaymentRule AD_Reference_ID=195 */ -public static final int PAYMENTRULE_AD_Reference_ID=195;/** Cash = B */ -public static final String PAYMENTRULE_Cash = "B";/** Direct Debit = D */ -public static final String PAYMENTRULE_DirectDebit = "D";/** Credit Card = K */ -public static final String PAYMENTRULE_CreditCard = "K";/** On Credit = P */ -public static final String PAYMENTRULE_OnCredit = "P";/** Check = S */ -public static final String PAYMENTRULE_Check = "S";/** Direct Deposit = T */ -public static final String PAYMENTRULE_DirectDeposit = "T"; - /** Set Payment Rule. - @param PaymentRule - How you pay the invoice - */ - public void setPaymentRule (String PaymentRule) - { -if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory");if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); if (PaymentRule.length() > 1) - { - log.warning("Length > 1 - truncated"); - PaymentRule = PaymentRule.substring(0, 0); - } - set_Value (COLUMNNAME_PaymentRule, PaymentRule); - } - - /** Get Payment Rule. - @return How you pay the invoice - */ - public String getPaymentRule () - { - return (String)get_Value(COLUMNNAME_PaymentRule); - } - - /** Set Posted. - @param Posted - Posting status - */ - public void setPosted (boolean Posted) - { - set_Value (COLUMNNAME_Posted, Boolean.valueOf(Posted)); - } - - /** Get Posted. - @return Posting status - */ - public boolean isPosted () - { - Object oo = get_Value(COLUMNNAME_Posted); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Processed. - @param Processed - The document has been processed - */ - public void setProcessed (boolean Processed) - { - set_ValueNoCheck (COLUMNNAME_Processed, Boolean.valueOf(Processed)); - } - - /** Get Processed. - @return The document has been processed - */ - public boolean isProcessed () - { - Object oo = get_Value(COLUMNNAME_Processed); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** 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 Referenced Invoice. - @param Ref_Invoice_ID Referenced Invoice */ - public void setRef_Invoice_ID (int Ref_Invoice_ID) - { - if (Ref_Invoice_ID <= 0) set_Value (COLUMNNAME_Ref_Invoice_ID, null); - else - set_Value (COLUMNNAME_Ref_Invoice_ID, Integer.valueOf(Ref_Invoice_ID)); - } - + @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 Referenced Invoice. + @param Ref_Invoice_ID Referenced Invoice */ + public void setRef_Invoice_ID (int Ref_Invoice_ID) + { + if (Ref_Invoice_ID <= 0) + set_Value (COLUMNNAME_Ref_Invoice_ID, null); + else + set_Value (COLUMNNAME_Ref_Invoice_ID, Integer.valueOf(Ref_Invoice_ID)); + } + /** Get Referenced Invoice. -@return Referenced Invoice */ - public int getRef_Invoice_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_Ref_Invoice_ID); - if (ii == null) - return 0; - return ii.intValue(); - } + @return Referenced Invoice */ + public int getRef_Invoice_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_Ref_Invoice_ID); + if (ii == null) + return 0; + return ii.intValue(); + } -/** SalesRep_ID AD_Reference_ID=190 */ -public static final int SALESREP_ID_AD_Reference_ID=190; - /** Set Sales Representative. - @param SalesRep_ID - Sales Representative or Company Agent - */ - public void setSalesRep_ID (int SalesRep_ID) - { - if (SalesRep_ID <= 0) set_Value (COLUMNNAME_SalesRep_ID, null); - else - set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); - } - - /** Get Sales Representative. - @return Sales Representative or Company Agent - */ - public int getSalesRep_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - /** Set Send EMail. - @param SendEMail - Enable sending Document EMail - */ - public void setSendEMail (boolean SendEMail) - { - set_Value (COLUMNNAME_SendEMail, Boolean.valueOf(SendEMail)); - } - - /** Get Send EMail. - @return Enable sending Document EMail - */ - public boolean isSendEMail () - { - Object oo = get_Value(COLUMNNAME_SendEMail); - if (oo != null) - { - if (oo instanceof Boolean) - return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); - } - return false; - } - - /** Set Total Lines. - @param TotalLines - Total of all document lines - */ - public void setTotalLines (BigDecimal TotalLines) - { - if (TotalLines == null) - throw new IllegalArgumentException ("TotalLines is mandatory."); - set_ValueNoCheck (COLUMNNAME_TotalLines, TotalLines); - } - - /** Get Total Lines. - @return Total of all document lines - */ - public BigDecimal getTotalLines () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines); - if (bd == null) - return Env.ZERO; - return bd; - } + /** SalesRep_ID AD_Reference_ID=190 */ + public static final int SALESREP_ID_AD_Reference_ID=190; + /** Set Sales Representative. + @param SalesRep_ID + Sales Representative or Company Agent + */ + public void setSalesRep_ID (int SalesRep_ID) + { + if (SalesRep_ID <= 0) + set_Value (COLUMNNAME_SalesRep_ID, null); + else + set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); + } -/** User1_ID AD_Reference_ID=134 */ -public static final int USER1_ID_AD_Reference_ID=134; - /** Set User List 1. - @param User1_ID - User defined list element #1 - */ - public void setUser1_ID (int User1_ID) - { - if (User1_ID <= 0) set_Value (COLUMNNAME_User1_ID, null); - else - set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID)); - } - - /** Get User List 1. - @return User defined list element #1 - */ - public int getUser1_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID); - if (ii == null) - return 0; - return ii.intValue(); - } + /** Get Sales Representative. + @return Sales Representative or Company Agent + */ + public int getSalesRep_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); + if (ii == null) + return 0; + return ii.intValue(); + } -/** User2_ID AD_Reference_ID=137 */ -public static final int USER2_ID_AD_Reference_ID=137; - /** Set User List 2. - @param User2_ID - User defined list element #2 - */ - public void setUser2_ID (int User2_ID) - { - if (User2_ID <= 0) set_Value (COLUMNNAME_User2_ID, null); - else - set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID)); - } - - /** Get User List 2. - @return User defined list element #2 - */ - public int getUser2_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID); - if (ii == null) - return 0; - return ii.intValue(); - } + /** Set Send EMail. + @param SendEMail + Enable sending Document EMail + */ + public void setSendEMail (boolean SendEMail) + { + set_Value (COLUMNNAME_SendEMail, Boolean.valueOf(SendEMail)); + } + + /** Get Send EMail. + @return Enable sending Document EMail + */ + public boolean isSendEMail () + { + Object oo = get_Value(COLUMNNAME_SendEMail); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Total Lines. + @param TotalLines + Total of all document lines + */ + public void setTotalLines (BigDecimal TotalLines) + { + if (TotalLines == null) + throw new IllegalArgumentException ("TotalLines is mandatory."); + set_ValueNoCheck (COLUMNNAME_TotalLines, TotalLines); + } + + /** Get Total Lines. + @return Total of all document lines + */ + public BigDecimal getTotalLines () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines); + if (bd == null) + return Env.ZERO; + return bd; + } + + /** User1_ID AD_Reference_ID=134 */ + public static final int USER1_ID_AD_Reference_ID=134; + /** Set User List 1. + @param User1_ID + User defined list element #1 + */ + public void setUser1_ID (int User1_ID) + { + if (User1_ID <= 0) + set_Value (COLUMNNAME_User1_ID, null); + else + set_Value (COLUMNNAME_User1_ID, Integer.valueOf(User1_ID)); + } + + /** Get User List 1. + @return User defined list element #1 + */ + public int getUser1_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User1_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** User2_ID AD_Reference_ID=137 */ + public static final int USER2_ID_AD_Reference_ID=137; + /** Set User List 2. + @param User2_ID + User defined list element #2 + */ + public void setUser2_ID (int User2_ID) + { + if (User2_ID <= 0) + set_Value (COLUMNNAME_User2_ID, null); + else + set_Value (COLUMNNAME_User2_ID, Integer.valueOf(User2_ID)); + } + + /** Get User List 2. + @return User defined list element #2 + */ + public int getUser2_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_User2_ID); + if (ii == null) + return 0; + return ii.intValue(); + } } \ No newline at end of file diff --git a/base/src/org/compiere/process/DunningPrint.java b/base/src/org/compiere/process/DunningPrint.java index ea8213b2e6..16980cccd1 100644 --- a/base/src/org/compiere/process/DunningPrint.java +++ b/base/src/org/compiere/process/DunningPrint.java @@ -16,11 +16,24 @@ *****************************************************************************/ package org.compiere.process; -import java.io.*; -import java.util.logging.*; -import org.compiere.model.*; -import org.compiere.print.*; -import org.compiere.util.*; +import java.io.File; +import java.util.logging.Level; + +import org.compiere.model.MBPartner; +import org.compiere.model.MClient; +import org.compiere.model.MDunningLevel; +import org.compiere.model.MDunningRun; +import org.compiere.model.MDunningRunEntry; +import org.compiere.model.MMailText; +import org.compiere.model.MQuery; +import org.compiere.model.MUser; +import org.compiere.model.MUserMail; +import org.compiere.model.PrintInfo; +import org.compiere.model.X_C_DunningRunEntry; +import org.compiere.print.MPrintFormat; +import org.compiere.print.ReportEngine; +import org.compiere.util.AdempiereUserError; +import org.compiere.util.EMail; /** * Dunning Letter Print @@ -37,7 +50,9 @@ public class DunningPrint extends SvrProcess /** Dunning Run */ private int p_C_DunningRun_ID = 0; /** Print only Outstanding */ - private boolean p_IsOnlyIfBPBalance = true; + private boolean p_IsOnlyIfBPBalance = true; + /** Print only unprocessed lines */ + private boolean p_PrintUnprocessedOnly = true; /** @@ -58,7 +73,9 @@ public class DunningPrint extends SvrProcess else if (name.equals("C_DunningRun_ID")) p_C_DunningRun_ID = para[i].getParameterAsInt(); else if (name.equals("IsOnlyIfBPBalance")) - p_IsOnlyIfBPBalance = "Y".equals(para[i].getParameter()); + p_IsOnlyIfBPBalance = "Y".equals(para[i].getParameter()); + else if (name.equals("PrintUnprocessedOnly")) + p_PrintUnprocessedOnly = "Y".equals(para[i].getParameter()); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } @@ -72,7 +89,8 @@ public class DunningPrint extends SvrProcess protected String doIt () throws Exception { log.info("C_DunningRun_ID=" + p_C_DunningRun_ID + ",R_MailText_ID=" + p_R_MailText_ID - + ", EmailPDF=" + p_EMailPDF + ",IsOnlyIfBPBalance=" + p_IsOnlyIfBPBalance); + + ", EmailPDF=" + p_EMailPDF + ",IsOnlyIfBPBalance=" + p_IsOnlyIfBPBalance + + ",PrintUnprocessedOnly=" + p_PrintUnprocessedOnly); // Need to have Template if (p_EMailPDF && p_R_MailText_ID == 0) @@ -103,6 +121,8 @@ public class DunningPrint extends SvrProcess { MDunningRunEntry entry = entries[i]; if (p_IsOnlyIfBPBalance && entry.getAmt().signum() <= 0) + continue; + if (p_PrintUnprocessedOnly && entry.isProcessed()) continue; // To BPartner MBPartner bp = new MBPartner (getCtx(), entry.getC_BPartner_ID(), get_TrxName()); @@ -199,6 +219,10 @@ public class DunningPrint extends SvrProcess } } // for all dunning letters + if (errors==0) { + run.setProcessed(true); + run.save(); + } if (p_EMailPDF) return "@Sent@=" + count + " - @Errors@=" + errors; return "@Printed@=" + count; diff --git a/base/src/org/compiere/process/DunningRunCreate.java b/base/src/org/compiere/process/DunningRunCreate.java index 9d92653bed..5200d84ba3 100644 --- a/base/src/org/compiere/process/DunningRunCreate.java +++ b/base/src/org/compiere/process/DunningRunCreate.java @@ -3,33 +3,40 @@ * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, 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; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.process; - -import java.math.*; -import java.sql.*; -import java.util.logging.*; -import org.compiere.model.*; -import org.compiere.util.*; - - -/** - * Create Dunning Run Entries/Lines - * - * @author Jorg Janke - * @version $Id: DunningRunCreate.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ - */ -public class DunningRunCreate extends SvrProcess + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, 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; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.logging.Level; + +import org.compiere.model.MDunningLevel; +import org.compiere.model.MDunningRun; +import org.compiere.model.MDunningRunEntry; +import org.compiere.model.MDunningRunLine; +import org.compiere.model.MInvoice; +import org.compiere.util.DB; +import org.compiere.util.Env; + + +/** + * Create Dunning Run Entries/Lines + * + * @author Jorg Janke + * @version $Id: DunningRunCreate.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ + */ +public class DunningRunCreate extends SvrProcess { private boolean p_IncludeInDispute = false; private boolean p_OnlySOTrx = false; @@ -37,7 +44,7 @@ public class DunningRunCreate extends SvrProcess private int p_SalesRep_ID = 0; private int p_C_Currency_ID = 0; private int p_C_BPartner_ID = 0; - private int p_C_BP_Group_ID = 0; + private int p_C_BP_Group_ID = 0; private int p_C_DunningRun_ID = 0; private MDunningRun m_run = null; @@ -45,16 +52,16 @@ public class DunningRunCreate extends SvrProcess /** * Prepare - e.g., get Parameters. - */ - protected void prepare() - { - ProcessInfoParameter[] para = getParameter(); - for (int i = 0; i < para.length; i++) - { - String name = para[i].getParameterName(); - if (para[i].getParameter() == null) - ; - else if (name.equals("IncludeInDispute")) + */ + protected void prepare() + { + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + if (para[i].getParameter() == null) + ; + else if (name.equals("IncludeInDispute")) p_IncludeInDispute = "Y".equals(para[i].getParameter()); else if (name.equals("OnlySOTrx")) p_OnlySOTrx = "Y".equals(para[i].getParameter()); @@ -63,35 +70,35 @@ public class DunningRunCreate extends SvrProcess else if (name.equals("SalesRep_ID")) p_SalesRep_ID = para[i].getParameterAsInt(); else if (name.equals("C_Currency_ID")) - p_C_Currency_ID = para[i].getParameterAsInt(); - else if (name.equals("C_BPartner_ID")) - p_C_BPartner_ID = para[i].getParameterAsInt(); - else if (name.equals("C_BP_Group_ID")) - p_C_BP_Group_ID = para[i].getParameterAsInt(); - else - log.log(Level.SEVERE, "Unknown Parameter: " + name); - } - p_C_DunningRun_ID = getRecord_ID(); - } // prepare - - /** - * Process - * @return message - * @throws Exception - */ - protected String doIt () throws Exception - { - log.info("C_DunningRun_ID=" + p_C_DunningRun_ID - + ", Dispute=" + p_IncludeInDispute - + ", C_BP_Group_ID=" + p_C_BP_Group_ID - + ", C_BPartner_ID=" + p_C_BPartner_ID); - m_run = new MDunningRun (getCtx(),p_C_DunningRun_ID, get_TrxName()); - if (m_run.get_ID() == 0) - throw new IllegalArgumentException ("Not found MDunningRun"); - if (!m_run.deleteEntries(true)) - throw new IllegalArgumentException ("Cannot delete existing entries"); - if (p_SalesRep_ID == 0) - throw new IllegalArgumentException ("No SalesRep"); + p_C_Currency_ID = para[i].getParameterAsInt(); + else if (name.equals("C_BPartner_ID")) + p_C_BPartner_ID = para[i].getParameterAsInt(); + else if (name.equals("C_BP_Group_ID")) + p_C_BP_Group_ID = para[i].getParameterAsInt(); + else + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + p_C_DunningRun_ID = getRecord_ID(); + } // prepare + + /** + * Process + * @return message + * @throws Exception + */ + protected String doIt () throws Exception + { + log.info("C_DunningRun_ID=" + p_C_DunningRun_ID + + ", Dispute=" + p_IncludeInDispute + + ", C_BP_Group_ID=" + p_C_BP_Group_ID + + ", C_BPartner_ID=" + p_C_BPartner_ID); + m_run = new MDunningRun (getCtx(),p_C_DunningRun_ID, get_TrxName()); + if (m_run.get_ID() == 0) + throw new IllegalArgumentException ("Not found MDunningRun"); + if (!m_run.deleteEntries(true)) + throw new IllegalArgumentException ("Cannot delete existing entries"); + if (p_SalesRep_ID == 0) + throw new IllegalArgumentException ("No SalesRep"); if (p_C_Currency_ID == 0) throw new IllegalArgumentException ("No Currency"); // @@ -106,35 +113,37 @@ public class DunningRunCreate extends SvrProcess return "@C_Invoice_ID@ #" + inv + " - @C_Payment_ID@=" + pay; } // doIt - - /************************************************************************** - * Add Invoices to Run - * @return no of invoices - */ - private int addInvoices() - { - int count = 0; - String sql = "SELECT i.C_Invoice_ID, i.C_Currency_ID," - + " i.GrandTotal*i.MultiplierAP," - + " invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID)*MultiplierAP," - + " COALESCE(daysBetween(?,ips.DueDate),paymentTermDueDays(i.C_PaymentTerm_ID,i.DateInvoiced,?))," // ##1/2 - + " i.IsInDispute, i.C_BPartner_ID " - + "FROM C_Invoice_v i " - + " LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID) " - + "WHERE i.IsPaid='N' AND i.AD_Client_ID=?" // ##3 - + " AND i.DocStatus IN ('CO','CL')" - // Only BP(Group) with Dunning defined - + " AND EXISTS (SELECT * FROM C_DunningLevel dl " - + "WHERE dl.C_DunningLevel_ID=?" // // ##4 - + " AND dl.C_Dunning_ID IN " - + "(SELECT COALESCE(bp.C_Dunning_ID, bpg.C_Dunning_ID) " - + "FROM C_BPartner bp" - + " INNER JOIN C_BP_Group bpg ON (bp.C_BP_Group_ID=bpg.C_BP_Group_ID) " - + "WHERE i.C_BPartner_ID=bp.C_BPartner_ID))"; - if (p_C_BPartner_ID != 0) - sql += " AND i.C_BPartner_ID=?"; // ##5 - else if (p_C_BP_Group_ID != 0) - sql += " AND EXISTS (SELECT * FROM C_BPartner bp " + + /************************************************************************** + * Add Invoices to Run + * @return no of invoices + */ + private int addInvoices() + { + int count = 0; + String sql = "SELECT i.C_Invoice_ID, i.C_Currency_ID," + + " i.GrandTotal*i.MultiplierAP," + + " invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID)*MultiplierAP," + + " COALESCE(daysBetween(?,ips.DueDate),paymentTermDueDays(i.C_PaymentTerm_ID,i.DateInvoiced,?))," // ##1/2 + + " i.IsInDispute, i.C_BPartner_ID, i.C_InvoicePaySchedule_ID " + + "FROM C_Invoice_v i " + + " LEFT OUTER JOIN C_InvoicePaySchedule ips ON (i.C_InvoicePaySchedule_ID=ips.C_InvoicePaySchedule_ID) " + + "WHERE i.IsPaid='N' AND i.AD_Client_ID=?" // ##3 + + " AND i.DocStatus IN ('CO','CL')" + + " AND (i.DunningGrace IS NULL OR i.DunningGrace0) { String sqlAppend = ""; for (int i=0; ipreviousLevels.length + && !m_level.isShowAllDue() && !m_level.isShowNotDue()) { + continue; + } + log.fine(DaysBetweenDunning + " - " + DaysAfterLast); if (DaysBetweenDunning != 0 && DaysAfterLast < DaysBetweenDunning && !m_level.isShowAllDue () && !m_level.isShowNotDue ()) continue; // - createInvoiceLine (C_Invoice_ID, C_Currency_ID, GrandTotal, Open, - DaysDue, IsInDispute, C_BPartner_ID, - TimesDunned, DaysAfterLast); - count++; - } - rs.close (); - pstmt.close (); - pstmt = null; - pstmt2.close(); - pstmt2 = null; - } - catch (Exception e) - { - log.log(Level.SEVERE, "addInvoices", e); - } - try - { - if (pstmt != null) - pstmt.close (); - if (pstmt2 != null) - pstmt2.close (); - pstmt = null; - pstmt2 = null; - } - catch (Exception e) - { - pstmt = null; - pstmt2 = null; - } - return count; - } // addInvoices - - /** - * Create Invoice Line - * @param C_Invoice_ID - * @param C_Currency_ID - * @param GrandTotal - * @param Open - * @param DaysDue - * @param IsInDispute - * @param C_BPartner_ID - * @param TimesDunned - * @param DaysAfterLast - */ - private void createInvoiceLine (int C_Invoice_ID, int C_Currency_ID, - BigDecimal GrandTotal, BigDecimal Open, - int DaysDue, boolean IsInDispute, - int C_BPartner_ID, int TimesDunned, int DaysAfterLast) - { - MDunningRunEntry entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID); - if (entry.get_ID() == 0) - if (!entry.save()) - throw new IllegalStateException("Cannot save MDunningRunEntry"); + createInvoiceLine (C_Invoice_ID, C_InvoicePaySchedule_ID, C_Currency_ID, GrandTotal, Open, + DaysDue, IsInDispute, C_BPartner_ID, + TimesDunned, DaysAfterLast); + count++; + } + rs.close (); + pstmt.close (); + pstmt = null; + pstmt2.close(); + pstmt2 = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "addInvoices", e); + } + try + { + if (pstmt != null) + pstmt.close (); + if (pstmt2 != null) + pstmt2.close (); + pstmt = null; + pstmt2 = null; + } + catch (Exception e) + { + pstmt = null; + pstmt2 = null; + } + return count; + } // addInvoices + + /** + * Create Invoice Line + * @param C_Invoice_ID + * @param C_Currency_ID + * @param GrandTotal + * @param Open + * @param DaysDue + * @param IsInDispute + * @param C_BPartner_ID + * @param TimesDunned + * @param DaysAfterLast + */ + private void createInvoiceLine (int C_Invoice_ID, int C_InvoicePaySchedule_ID, int C_Currency_ID, + BigDecimal GrandTotal, BigDecimal Open, + int DaysDue, boolean IsInDispute, + int C_BPartner_ID, int TimesDunned, int DaysAfterLast) + { + MDunningRunEntry entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID); + if (entry.get_ID() == 0) + if (!entry.save()) + throw new IllegalStateException("Cannot save MDunningRunEntry"); // MDunningRunLine line = new MDunningRunLine (entry); line.setInvoice(C_Invoice_ID, C_Currency_ID, GrandTotal, Open, new BigDecimal(0), DaysDue, IsInDispute, TimesDunned, DaysAfterLast); + line.setC_InvoicePaySchedule_ID(C_InvoicePaySchedule_ID); if (!line.save()) throw new IllegalStateException("Cannot save MDunningRunLine"); + MInvoice invoice = new MInvoice(getCtx(),C_Invoice_ID, get_TrxName()); + invoice.setC_DunningLevel_ID(m_run.getC_DunningLevel_ID()); + if (!invoice.save()) + throw new IllegalStateException("Cannot update dunning level information in invoice"); } // createInvoiceLine - - - /************************************************************************** - * Add Payments to Run - * @return no of payments - */ - private int addPayments() - { - String sql = "SELECT C_Payment_ID, C_Currency_ID, PayAmt," - + " paymentAvailable(C_Payment_ID), C_BPartner_ID " - + "FROM C_Payment_v p " - + "WHERE AD_Client_ID=?" // ##1 - + " AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL" - + " AND C_Charge_ID IS NULL" - + " AND DocStatus IN ('CO','CL')" - // Only BP with Dunning defined - + " AND EXISTS (SELECT * FROM C_BPartner bp " - + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID" - + " AND bp.C_Dunning_ID=(SELECT C_Dunning_ID FROM C_DunningLevel WHERE C_DunningLevel_ID=?))"; // ##2 - if (p_C_BPartner_ID != 0) - sql += " AND C_BPartner_ID=?"; // ##3 - else if (p_C_BP_Group_ID != 0) - sql += " AND EXISTS (SELECT * FROM C_BPartner bp " - + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ##3 - if (p_OnlySOTrx) - sql += " AND IsReceipt='Y'"; - - int count = 0; - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement (sql, get_TrxName()); - pstmt.setInt (1, getAD_Client_ID()); - pstmt.setInt (2, m_run.getC_DunningLevel_ID()); - if (p_C_BPartner_ID != 0) - pstmt.setInt (3, p_C_BPartner_ID); - else if (p_C_BP_Group_ID != 0) - pstmt.setInt (3, p_C_BP_Group_ID); - - ResultSet rs = pstmt.executeQuery (); - while (rs.next ()) - { - int C_Payment_ID = rs.getInt(1); - int C_Currency_ID = rs.getInt(2); - BigDecimal PayAmt = rs.getBigDecimal(3).negate(); - BigDecimal OpenAmt = rs.getBigDecimal(4).negate(); - int C_BPartner_ID = rs.getInt(5); - // - if (Env.ZERO.compareTo(OpenAmt) == 0) - continue; - // - createPaymentLine (C_Payment_ID, C_Currency_ID, PayAmt, OpenAmt, - C_BPartner_ID); - count++; - } - rs.close (); - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - } - try - { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; - } - return count; - } // addPayments - - /** - * Create Payment Line - * @param C_Payment_ID - * @param C_Currency_ID - * @param PayAmt - * @param OpenAmt - * @param C_BPartner_ID - */ - private void createPaymentLine (int C_Payment_ID, int C_Currency_ID, - BigDecimal PayAmt, BigDecimal OpenAmt, int C_BPartner_ID) - { - MDunningRunEntry entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID); - if (entry.get_ID() == 0) - if (!entry.save()) - throw new IllegalStateException("Cannot save MDunningRunEntry"); - // - MDunningRunLine line = new MDunningRunLine (entry); - line.setPayment(C_Payment_ID, C_Currency_ID, PayAmt, OpenAmt); - if (!line.save()) + + + /************************************************************************** + * Add Payments to Run + * @return no of payments + */ + private int addPayments() + { + String sql = "SELECT C_Payment_ID, C_Currency_ID, PayAmt," + + " paymentAvailable(C_Payment_ID), C_BPartner_ID " + + "FROM C_Payment_v p " + + "WHERE AD_Client_ID=?" // ##1 + + " AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL" + + " AND C_Charge_ID IS NULL" + + " AND DocStatus IN ('CO','CL')" + // Only BP with Dunning defined + + " AND EXISTS (SELECT * FROM C_BPartner bp " + + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID" + + " AND bp.C_Dunning_ID=(SELECT C_Dunning_ID FROM C_DunningLevel WHERE C_DunningLevel_ID=?))"; // ##2 + if (p_C_BPartner_ID != 0) + sql += " AND C_BPartner_ID=?"; // ##3 + else if (p_C_BP_Group_ID != 0) + sql += " AND EXISTS (SELECT * FROM C_BPartner bp " + + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)"; // ##3 + if (p_OnlySOTrx) + sql += " AND IsReceipt='Y'"; + + int count = 0; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getAD_Client_ID()); + pstmt.setInt (2, m_run.getC_DunningLevel_ID()); + if (p_C_BPartner_ID != 0) + pstmt.setInt (3, p_C_BPartner_ID); + else if (p_C_BP_Group_ID != 0) + pstmt.setInt (3, p_C_BP_Group_ID); + + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + int C_Payment_ID = rs.getInt(1); + int C_Currency_ID = rs.getInt(2); + BigDecimal PayAmt = rs.getBigDecimal(3).negate(); + BigDecimal OpenAmt = rs.getBigDecimal(4).negate(); + int C_BPartner_ID = rs.getInt(5); + // + if (Env.ZERO.compareTo(OpenAmt) == 0) + continue; + // + createPaymentLine (C_Payment_ID, C_Currency_ID, PayAmt, OpenAmt, + C_BPartner_ID); + count++; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return count; + } // addPayments + + /** + * Create Payment Line + * @param C_Payment_ID + * @param C_Currency_ID + * @param PayAmt + * @param OpenAmt + * @param C_BPartner_ID + */ + private void createPaymentLine (int C_Payment_ID, int C_Currency_ID, + BigDecimal PayAmt, BigDecimal OpenAmt, int C_BPartner_ID) + { + MDunningRunEntry entry = m_run.getEntry (C_BPartner_ID, p_C_Currency_ID, p_SalesRep_ID); + if (entry.get_ID() == 0) + if (!entry.save()) + throw new IllegalStateException("Cannot save MDunningRunEntry"); + // + MDunningRunLine line = new MDunningRunLine (entry); + line.setPayment(C_Payment_ID, C_Currency_ID, PayAmt, OpenAmt); + if (!line.save()) throw new IllegalStateException("Cannot save MDunningRunLine"); } // createPaymentLine diff --git a/migration/330-trunk/028_FR_1799601.sql b/migration/330-trunk/028_FR_1799601.sql new file mode 100644 index 0000000000..d423e23ad0 --- /dev/null +++ b/migration/330-trunk/028_FR_1799601.sql @@ -0,0 +1,176 @@ +SET DEFINE OFF; + +INSERT INTO ad_element + (ad_element_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + columnname, entitytype, NAME, + printname + ) + VALUES (53223, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'DunningGrace', 'D', 'Dunning Grace', + 'Dunning Grace' + ); + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53246, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 100, 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', 1, + 'D', 'DunningGrace', 291, 15, + 7, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 53223, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype, + displaylogic + ) + VALUES (53256, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', + 'Y', 260 ,223, + 53246, 'Y', 14, 'N', + 'N', 'N', 'N', 'N', 'D', + '@IsCustomer@=Y' + ); + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53247, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 100, 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', 1, + 'D', 'DunningGrace', 318, 15, + 7, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 53223, 'N', + 'Y' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype + ) + VALUES (53257, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', + 'Y', 410 ,263, + 53247, 'Y', 14, 'N', + 'N', 'N', 'N', 'N', 'D' + ); + + + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_element_id) + 1 + FROM ad_element + WHERE ad_element_id < 1000000) + WHERE NAME = 'AD_Element'; + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_column_id) + 1 + FROM ad_column + WHERE ad_column_id < 1000000) + WHERE NAME = 'AD_Column'; + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_field_id) + 1 + FROM ad_field + WHERE ad_field_id < 1000000) + WHERE NAME = 'AD_Field'; + + + +ALTER TABLE C_BPartner ADD DunningGrace date NULL; +ALTER TABLE C_Invoice ADD DunningGrace date NULL; + + + CREATE OR REPLACE FORCE VIEW C_INVOICE_V AS + SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.CreatedBy, i.Updated, i.UpdatedBy, + i.IsSOTrx, i.DocumentNo, i.DocStatus, i.DocAction, i.Processing, i.Processed, i.C_DocType_ID, + i.C_DocTypeTarget_ID, i.C_Order_ID, i.Description, i.IsApproved, i.IsTransferred, + i.SalesRep_ID, i.DateInvoiced, i.DatePrinted, i.DateAcct, i.C_BPartner_ID, i.C_BPartner_Location_ID, + i.AD_User_ID, i.POReference, i.DateOrdered, i.C_Currency_ID, i.C_ConversionType_ID, i.PaymentRule, + i.C_PaymentTerm_ID, i.C_Charge_ID, i.M_PriceList_ID, i.C_Campaign_ID, i.C_Project_ID, + i.C_Activity_ID, i.IsPrinted, i.IsDiscountPrinted, i.IsPaid, i.IsInDispute, + i.IsPayScheduleValid, null AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType, + i.DunningGrace, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END AS ChargeAmt, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END AS TotalLines, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END AS GrandTotal, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END AS Multiplier, + CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS MultiplierAP, + d.DocBaseType +FROM C_Invoice i + INNER JOIN C_DocType d ON (i.C_DocType_ID=d.C_DocType_ID) +WHERE i.IsPayScheduleValid<>'Y' +UNION +SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.CreatedBy, i.Updated, i.UpdatedBy, + i.IsSOTrx, i.DocumentNo, i.DocStatus, i.DocAction, i.Processing, i.Processed, i.C_DocType_ID, + i.C_DocTypeTarget_ID, i.C_Order_ID, i.Description, i.IsApproved, i.IsTransferred, + i.SalesRep_ID, i.DateInvoiced, i.DatePrinted, i.DateAcct, i.C_BPartner_ID, i.C_BPartner_Location_ID, + i.AD_User_ID, i.POReference, i.DateOrdered, i.C_Currency_ID, i.C_ConversionType_ID, i.PaymentRule, + i.C_PaymentTerm_ID, i.C_Charge_ID, i.M_PriceList_ID, i.C_Campaign_ID, i.C_Project_ID, + i.C_Activity_ID, i.IsPrinted, i.IsDiscountPrinted, i.IsPaid, i.IsInDispute, + i.IsPayScheduleValid, ips.C_InvoicePaySchedule_ID, i.InvoiceCollectionType, + i.DunningGrace, + null AS ChargeAmt, + null AS TotalLines, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN ips.DueAmt*-1 ELSE ips.DueAmt END AS GrandTotal, + CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END AS Multiplier, + CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS MultiplierAP, + d.DocBaseType +FROM C_Invoice i + INNER JOIN C_DocType d ON (i.C_DocType_ID=d.C_DocType_ID) + INNER JOIN C_InvoicePaySchedule ips ON (i.C_Invoice_ID=ips.C_Invoice_ID) +WHERE i.IsPayScheduleValid='Y' + AND ips.IsValid='Y'; + +COMMIT ; \ No newline at end of file diff --git a/migration/330-trunk/029_FR_1804068.sql b/migration/330-trunk/029_FR_1804068.sql new file mode 100644 index 0000000000..fc61e03150 --- /dev/null +++ b/migration/330-trunk/029_FR_1804068.sql @@ -0,0 +1,183 @@ +SET DEFINE OFF; + +update AD_Column set IsAlwaysUpdateable='Y' where AD_Column_ID=12569; +update AD_Column set IsAlwaysUpdateable='Y' where AD_Column_ID=12566; + +INSERT INTO ad_element + (ad_element_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + columnname, entitytype, NAME, + printname + ) + VALUES (53224, 0, 0, 'Y', + TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, + TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, + 'PrintUnprocessedOnly', 'D', 'Print Unprocessed Entries Only', + 'Print Unprocessed Entries Only' + ); + + +INSERT INTO AD_Process_Para +(AD_Process_Para_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, +CreatedBy, Updated, UpdatedBy, Name, +Description, +Help, +AD_Process_ID, SeqNo, AD_Reference_ID, AD_Reference_Value_ID, +AD_Val_Rule_ID, ColumnName, IsCentrallyMaintained, FieldLength, +IsMandatory, DefaultValue, IsRange, AD_Element_ID, EntityType +) +VALUES +(53011 , 0, 0, 'Y', TO_DATE ('2007-09-28', 'YYYY-MM-DD'), +100, TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, 'Print Unprocessed Entries Only', +'Print the unprocessed (unprinted) entries of the dunning run only.', +'Print the unprocessed (unprinted) entries of the dunning run only. This allows you to reprint only certain dunning entries.', +312, 50, 20, NULL, +NULL, 'PrintUnprocessedOnly', 'N', 1, +'Y', 'Y', 'N', 53224, 'D' +); + +INSERT INTO AD_VAL_RULE( +AD_VAL_RULE_ID,AD_CLIENT_ID,AD_ORG_ID,ISACTIVE,CREATED,CREATEDBY, +UPDATED,UPDATEDBY, +NAME,DESCRIPTION, +TYPE,CODE,ENTITYTYPE) +values(51003,0,0,'Y',to_date('2007-09-28','RRRR-MM-DD'),100, +to_date('2007-09-28','RRRR-MM-DD'),100, +'C_DunningRun Unprocessed','Unprocessed Dunning Runs', +'S','C_DunningRun.Processed=''N''','D'); + +UPDATE AD_Process_Para SET AD_Val_Rule_ID=51003 WHERE AD_Process_Para_ID=578; + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53248, 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 100, 'Dunning Level', 'Dunning Level', + 'Dunning Level', 1, + 'D', 'C_DunningLevel_ID', 318, 19, + 22, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 1075, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype, + displaylogic + ) + VALUES (53258 , 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 'Dunning Level', 'Dunning Level', + 'Dunning Level', + 'Y', 420 ,263, + 53248, 'Y', 14, 'Y', + 'Y', 'N', 'N', 'N', 'D', + '@Processed@=Y' + ); + +ALTER TABLE C_Invoice ADD C_DunningLevel_ID NUMBER(10,0) NULL; + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53249, 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 100, 'Invoice Payment Schedule', 'Invoice Payment Schedule', + 'Invoice Payment Schedule', 1, + 'D', 'C_InvoicePaySchedule_ID', 524, 19, + 22, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 1995, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype + ) + VALUES (53259 , 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 'Invoice Payment Schedule', 'Invoice Payment Schedule', + 'Invoice Payment Schedule', + 'Y', 65 ,635, + 53249, 'Y', 26, 'Y', + 'N', 'N', 'N', 'N', 'D' + ); + +ALTER TABLE C_DunningRunLine ADD C_InvoicePaySchedule_ID NUMBER(10,0) NULL; + + + +COMMIT; + + +UPDATE AD_SEQUENCE +SET currentnextsys = (SELECT MAX (ad_process_para_id) + 1 +FROM AD_Process_Para +WHERE AD_Process_Para_ID < 1000000) +WHERE NAME = 'AD_Process_Para'; + +UPDATE AD_SEQUENCE +SET currentnextsys = (SELECT MAX (AD_Val_Rule_id) + 1 +FROM AD_Val_Rule +WHERE AD_Val_Rule_ID < 1000000) +WHERE NAME = 'AD_Val_Rule'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_element_id) + 1 +FROM ad_element +WHERE ad_element_id < 1000000) +WHERE NAME = 'AD_Element'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_column_id) + 1 +FROM ad_column +WHERE ad_column_id < 1000000) +WHERE NAME = 'AD_Column'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_field_id) + 1 +FROM ad_field +WHERE ad_field_id < 1000000) +WHERE NAME = 'AD_Field'; + +COMMIT; + diff --git a/migration/330-trunk/postgresql/028_FR_1799601_PG.sql b/migration/330-trunk/postgresql/028_FR_1799601_PG.sql new file mode 100644 index 0000000000..a7d5b8b5cd --- /dev/null +++ b/migration/330-trunk/postgresql/028_FR_1799601_PG.sql @@ -0,0 +1,211 @@ +INSERT INTO ad_element + (ad_element_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + columnname, entitytype, NAME, + printname + ) + VALUES (53223, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'DunningGrace', 'D', 'Dunning Grace', + 'Dunning Grace' + ); + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53246, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 100, 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', 1, + 'D', 'DunningGrace', 291, 15, + 7, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 53223, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype, + displaylogic + ) + VALUES (53256, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', + 'Y', 260 ,223, + 53246, 'Y', 14, 'N', + 'N', 'N', 'N', 'N', 'D', + '@IsCustomer@=Y' + ); + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53247, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 100, 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', 1, + 'D', 'DunningGrace', 318, 15, + 7, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 53223, 'N', + 'Y' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype + ) + VALUES (53257, 0, 0, 'Y', + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + TO_DATE ('09/21/2007 12:30:00', 'MM/DD/YYYY HH24:MI:SS'), 100, + 'Dunning Grace', 'Delay/block the dunning until this date is reached.', + 'Delay/block the dunning until this date is reached.', + 'Y', 410 ,263, + 53247, 'Y', 14, 'N', + 'N', 'N', 'N', 'N', 'D' + ); + + + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_element_id) + 1 + FROM ad_element + WHERE ad_element_id < 1000000) + WHERE NAME = 'AD_Element'; + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_column_id) + 1 + FROM ad_column + WHERE ad_column_id < 1000000) + WHERE NAME = 'AD_Column'; + +UPDATE ad_sequence + SET currentnextsys = (SELECT MAX (ad_field_id) + 1 + FROM ad_field + WHERE ad_field_id < 1000000) + WHERE NAME = 'AD_Field'; + + + +ALTER TABLE C_BPartner ADD DunningGrace date NULL; +ALTER TABLE C_Invoice ADD DunningGrace date NULL; + +DROP VIEW c_invoiceline_v; +DROP VIEW rv_bpartneropen; +DROP VIEW c_invoice_v; + +CREATE OR REPLACE VIEW c_invoice_v AS + SELECT i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, +i.description, i.isapproved, i.istransferred, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, i.poreference, i.dateordered, i.c_currency_id, i.c_conversiontype_id, i.paymentrule, +i.c_paymentterm_id, i.c_charge_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.isprinted, i.isdiscountprinted, i.ispaid, i.isindispute, i.ispayschedulevalid, NULL::numeric AS c_invoicepayschedule_id, i.invoicecollectiontype, i.dunninggrace, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN i.chargeamt * -1::numeric + ELSE i.chargeamt + END AS chargeamt, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN i.totallines * -1::numeric + ELSE i.totallines + END AS totallines, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN i.grandtotal * -1::numeric + ELSE i.grandtotal + END AS grandtotal, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN -1 + ELSE 1 + END::numeric AS multiplier, + CASE + WHEN charat(d.docbasetype::character varying, 2)::text = 'P'::text THEN -1 + ELSE 1 + END::numeric AS multiplierap, d.docbasetype + FROM c_invoice i + JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id + WHERE i.ispayschedulevalid <> 'Y'::bpchar +UNION + SELECT i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.processing, i.processed, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, +i.description, i.isapproved, i.istransferred, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, i.poreference, i.dateordered, i.c_currency_id, i.c_conversiontype_id, i.paymentrule, +i.c_paymentterm_id, i.c_charge_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.isprinted, i.isdiscountprinted, i.ispaid, i.isindispute, i.ispayschedulevalid, ips.c_invoicepayschedule_id, i.invoicecollectiontype, i.dunninggrace, +NULL::"unknown" AS chargeamt, NULL::"unknown" AS totallines, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN ips.dueamt * -1::numeric + ELSE ips.dueamt + END AS grandtotal, + CASE + WHEN charat(d.docbasetype::character varying, 3)::text = 'C'::text THEN -1 + ELSE 1 + END AS multiplier, + CASE + WHEN charat(d.docbasetype::character varying, 2)::text = 'P'::text THEN -1 + ELSE 1 + END AS multiplierap, d.docbasetype + FROM c_invoice i + JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id + JOIN c_invoicepayschedule ips ON i.c_invoice_id = ips.c_invoice_id + WHERE i.ispayschedulevalid = 'Y'::bpchar AND ips.isvalid = 'Y'::bpchar; + + +CREATE OR REPLACE VIEW c_invoiceline_v AS + SELECT il.ad_client_id, il.ad_org_id, il.c_invoiceline_id, i.c_invoice_id, i.salesrep_id, i.c_bpartner_id, il.m_product_id, i.documentno, i.dateinvoiced, i.dateacct, i.issotrx, i.docstatus, round(i.multiplier * il.linenetamt, 2) AS linenetamt, round(i.multiplier * il.pricelist * il.qtyinvoiced, 2) AS linelistamt, + CASE + WHEN COALESCE(il.pricelimit, 0::numeric) = 0::numeric THEN round(i.multiplier * il.linenetamt, 2) + ELSE round(i.multiplier * il.pricelimit * il.qtyinvoiced, 2) + END AS linelimitamt, round(i.multiplier * il.pricelist * il.qtyinvoiced - il.linenetamt, 2) AS linediscountamt, + CASE + WHEN COALESCE(il.pricelimit, 0::numeric) = 0::numeric THEN 0::numeric + ELSE round(i.multiplier * il.linenetamt - il.pricelimit * il.qtyinvoiced, 2) + END AS lineoverlimitamt, il.qtyinvoiced, il.qtyentered, il.line, il.c_orderline_id, il.c_uom_id, il.c_campaign_id, il.c_project_id, il.c_activity_id, il.c_projectphase_id, il.c_projecttask_id + FROM c_invoice_v i, c_invoiceline il + WHERE i.c_invoice_id = il.c_invoice_id; + + +CREATE OR REPLACE VIEW rv_bpartneropen AS + SELECT i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.c_bpartner_id, i.c_currency_id, i.grandtotal * i.multiplierap AS amt, invoiceopen(i.c_invoice_id, i.c_invoicepayschedule_id) * i.multiplierap AS openamt, i.dateinvoiced AS datedoc, COALESCE(daysbetween(getdate(), ips.duedate::timestamp with time zone), paymenttermduedays(i.c_paymentterm_id, i.dateinvoiced::timestamp with time zone, getdate())) AS daysdue, i.c_campaign_id, i.c_project_id, i.c_activity_id + FROM c_invoice_v i + LEFT JOIN c_invoicepayschedule ips ON i.c_invoicepayschedule_id = ips.c_invoicepayschedule_id + WHERE i.ispaid = 'N'::bpchar AND (i.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar])) +UNION + SELECT p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, p.c_bpartner_id, p.c_currency_id, p.payamt * p.multiplierap::numeric * -1::numeric AS amt, paymentavailable(p.c_payment_id) * p.multiplierap::numeric * -1::numeric AS openamt, p.datetrx AS datedoc, NULL::"unknown" AS daysdue, p.c_campaign_id, p.c_project_id, p.c_activity_id + FROM c_payment_v p + WHERE p.isallocated = 'N'::bpchar AND p.c_bpartner_id IS NOT NULL AND (p.docstatus = ANY (ARRAY['CO'::bpchar, 'CL'::bpchar])); + + +COMMIT ; diff --git a/migration/330-trunk/postgresql/029_FR_1804068_PG.sql b/migration/330-trunk/postgresql/029_FR_1804068_PG.sql new file mode 100644 index 0000000000..30abbd4ea8 --- /dev/null +++ b/migration/330-trunk/postgresql/029_FR_1804068_PG.sql @@ -0,0 +1,179 @@ +update AD_Column set IsAlwaysUpdateable='Y' where AD_Column_ID=12569; +update AD_Column set IsAlwaysUpdateable='Y' where AD_Column_ID=12566; + +INSERT INTO ad_element + (ad_element_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + columnname, entitytype, NAME, + printname + ) + VALUES (53224, 0, 0, 'Y', + TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, + TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, + 'PrintUnprocessedOnly', 'D', 'Print Unprocessed Entries Only', + 'Print Unprocessed Entries Only' + ); + + +INSERT INTO AD_Process_Para +(AD_Process_Para_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, +CreatedBy, Updated, UpdatedBy, Name, +Description, +Help, +AD_Process_ID, SeqNo, AD_Reference_ID, AD_Reference_Value_ID, +AD_Val_Rule_ID, ColumnName, IsCentrallyMaintained, FieldLength, +IsMandatory, DefaultValue, IsRange, AD_Element_ID, EntityType +) +VALUES +(53011 , 0, 0, 'Y', TO_DATE ('2007-09-28', 'YYYY-MM-DD'), +100, TO_DATE ('2007-09-28', 'YYYY-MM-DD'), 100, 'Print Unprocessed Entries Only', +'Print the unprocessed (unprinted) entries of the dunning run only.', +'Print the unprocessed (unprinted) entries of the dunning run only. This allows you to reprint only certain dunning entries.', +312, 50, 20, NULL, +NULL, 'PrintUnprocessedOnly', 'N', 1, +'Y', 'Y', 'N', 53224, 'D' +); + +INSERT INTO AD_VAL_RULE( +AD_VAL_RULE_ID,AD_CLIENT_ID,AD_ORG_ID,ISACTIVE,CREATED,CREATEDBY, +UPDATED,UPDATEDBY, +NAME,DESCRIPTION, +TYPE,CODE,ENTITYTYPE) +values(51003,0,0,'Y',to_date('2007-09-28','RRRR-MM-DD'),100, +to_date('2007-09-28','RRRR-MM-DD'),100, +'C_DunningRun Unprocessed','Unprocessed Dunning Runs', +'S','C_DunningRun.Processed=''N''','D'); + +UPDATE AD_Process_Para SET AD_Val_Rule_ID=51003 WHERE AD_Process_Para_ID=578; + + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53248, 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 100, 'Dunning Level', 'Dunning Level', + 'Dunning Level', 1, + 'D', 'C_DunningLevel_ID', 318, 19, + 22, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 1075, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype, + displaylogic + ) + VALUES (53258 , 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 'Dunning Level', 'Dunning Level', + 'Dunning Level', + 'Y', 420 ,263, + 53248, 'Y', 14, 'Y', + 'Y', 'N', 'N', 'N', 'D', + '@Processed@=Y' + ); + +ALTER TABLE C_Invoice ADD C_DunningLevel_ID NUMERIC(10) NULL; + +INSERT INTO ad_column + (ad_column_id, ad_client_id, ad_org_id, isactive, + created, + updated, createdby, + updatedby, NAME, description, + help, VERSION, + entitytype, columnname, ad_table_id, ad_reference_id, + fieldlength, iskey, isparent, ismandatory, isupdateable, + isidentifier, seqno, istranslated, isencrypted, + isselectioncolumn, ad_element_id, issyncdatabase, + isalwaysupdateable + ) + VALUES (53249, 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 100, 'Invoice Payment Schedule', 'Invoice Payment Schedule', + 'Invoice Payment Schedule', 1, + 'D', 'C_InvoicePaySchedule_ID', 524, 19, + 22, 'N', 'N', 'N', 'Y', + 'N', 0, 'N', 'N', + 'N', 1995, 'N', + 'N' + ); + +INSERT INTO ad_field + (ad_field_id, ad_client_id, ad_org_id, isactive, + created, createdby, + updated, updatedby, + NAME, description, + help, + iscentrallymaintained, seqno, ad_tab_id, + ad_column_id, isdisplayed, displaylength, isreadonly, + issameline, isheading, isfieldonly, isencrypted, entitytype + ) + VALUES (53259 , 0, 0, 'Y', + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + TO_DATE ('2007-09-28','RRRR-MM-DD'), 100, + 'Invoice Payment Schedule', 'Invoice Payment Schedule', + 'Invoice Payment Schedule', + 'Y', 65 ,635, + 53249, 'Y', 26, 'Y', + 'N', 'N', 'N', 'N', 'D' + ); + +ALTER TABLE C_DunningRunLine ADD C_InvoicePaySchedule_ID NUMERIC(10) NULL; + +COMMIT; + + +UPDATE AD_SEQUENCE +SET currentnextsys = (SELECT MAX (ad_process_para_id) + 1 +FROM AD_Process_Para +WHERE AD_Process_Para_ID < 1000000) +WHERE NAME = 'AD_Process_Para'; + +UPDATE AD_SEQUENCE +SET currentnextsys = (SELECT MAX (AD_Val_Rule_id) + 1 +FROM AD_Val_Rule +WHERE AD_Val_Rule_ID < 1000000) +WHERE NAME = 'AD_Val_Rule'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_element_id) + 1 +FROM ad_element +WHERE ad_element_id < 1000000) +WHERE NAME = 'AD_Element'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_column_id) + 1 +FROM ad_column +WHERE ad_column_id < 1000000) +WHERE NAME = 'AD_Column'; + +UPDATE ad_sequence +SET currentnextsys = (SELECT MAX (ad_field_id) + 1 +FROM ad_field +WHERE ad_field_id < 1000000) +WHERE NAME = 'AD_Field'; + +COMMIT; +