Carlos Ruiz 2011-03-25 22:37:37 -05:00
parent a7d5781c17
commit 08419ea45f
18 changed files with 7945 additions and 72 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,343 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for C_CashPlan
* @author Adempiere (generated)
* @version Release 3.6.0LTS
*/
public interface I_C_CashPlan
{
/** TableName=C_CashPlan */
public static final String Table_Name = "C_CashPlan";
/** AD_Table_ID=53297 */
public static final int Table_ID = 53297;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 1 - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(1);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_OrgTrx_ID */
public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID";
/** Set Trx Organization.
* Performing or initiating organization
*/
public void setAD_OrgTrx_ID (int AD_OrgTrx_ID);
/** Get Trx Organization.
* Performing or initiating organization
*/
public int getAD_OrgTrx_ID();
/** Column name C_Activity_ID */
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
/** Set Activity.
* Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID);
/** Get Activity.
* Business Activity
*/
public int getC_Activity_ID();
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name CashFlowType */
public static final String COLUMNNAME_CashFlowType = "CashFlowType";
/** Set Cash Flow Type */
public void setCashFlowType (String CashFlowType);
/** Get Cash Flow Type */
public String getCashFlowType();
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_Campaign_ID */
public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID";
/** Set Campaign.
* Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID);
/** Get Campaign.
* Marketing Campaign
*/
public int getC_Campaign_ID();
public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
/** Column name C_CashPlan_ID */
public static final String COLUMNNAME_C_CashPlan_ID = "C_CashPlan_ID";
/** Set Cash Plan */
public void setC_CashPlan_ID (int C_CashPlan_ID);
/** Get Cash Plan */
public int getC_CashPlan_ID();
/** Column name CopyFrom */
public static final String COLUMNNAME_CopyFrom = "CopyFrom";
/** Set Copy From.
* Copy From Record
*/
public void setCopyFrom (String CopyFrom);
/** Get Copy From.
* Copy From Record
*/
public String getCopyFrom();
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name DateDoc */
public static final String COLUMNNAME_DateDoc = "DateDoc";
/** Set Document Date.
* Date of the Document
*/
public void setDateDoc (Timestamp DateDoc);
/** Get Document Date.
* Date of the Document
*/
public Timestamp getDateDoc();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name DocumentNo */
public static final String COLUMNNAME_DocumentNo = "DocumentNo";
/** Set Document No.
* Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo);
/** Get Document No.
* Document sequence number of the document
*/
public String getDocumentNo();
/** Column name GeneratePeriodic */
public static final String COLUMNNAME_GeneratePeriodic = "GeneratePeriodic";
/** Set Generate Periodic Plan */
public void setGeneratePeriodic (String GeneratePeriodic);
/** Get Generate Periodic Plan */
public String getGeneratePeriodic();
/** Column name GrandTotal */
public static final String COLUMNNAME_GrandTotal = "GrandTotal";
/** Set Grand Total.
* Total amount of document
*/
public void setGrandTotal (BigDecimal GrandTotal);
/** Get Grand Total.
* Total amount of document
*/
public BigDecimal getGrandTotal();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsApproved */
public static final String COLUMNNAME_IsApproved = "IsApproved";
/** Set Approved.
* Indicates if this document requires approval
*/
public void setIsApproved (boolean IsApproved);
/** Get Approved.
* Indicates if this document requires approval
*/
public boolean isApproved();
/** Column name IsSOTrx */
public static final String COLUMNNAME_IsSOTrx = "IsSOTrx";
/** Set Sales Transaction.
* This is a Sales Transaction
*/
public void setIsSOTrx (boolean IsSOTrx);
/** Get Sales Transaction.
* This is a Sales Transaction
*/
public boolean isSOTrx();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
/** Set Processed.
* The document has been processed
*/
public void setProcessed (boolean Processed);
/** Get Processed.
* The document has been processed
*/
public boolean isProcessed();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
/** Column name User1_ID */
public static final String COLUMNNAME_User1_ID = "User1_ID";
/** Set User List 1.
* User defined list element #1
*/
public void setUser1_ID (int User1_ID);
/** Get User List 1.
* User defined list element #1
*/
public int getUser1_ID();
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException;
/** Column name User2_ID */
public static final String COLUMNNAME_User2_ID = "User2_ID";
/** Set User List 2.
* User defined list element #2
*/
public void setUser2_ID (int User2_ID);
/** Get User List 2.
* User defined list element #2
*/
public int getUser2_ID();
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
}

View File

@ -0,0 +1,392 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for C_CashPlanLine
* @author Adempiere (generated)
* @version Release 3.6.0LTS
*/
public interface I_C_CashPlanLine
{
/** TableName=C_CashPlanLine */
public static final String Table_Name = "C_CashPlanLine";
/** AD_Table_ID=53298 */
public static final int Table_ID = 53298;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 1 - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(1);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_OrgTrx_ID */
public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID";
/** Set Trx Organization.
* Performing or initiating organization
*/
public void setAD_OrgTrx_ID (int AD_OrgTrx_ID);
/** Get Trx Organization.
* Performing or initiating organization
*/
public int getAD_OrgTrx_ID();
/** Column name C_Activity_ID */
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
/** Set Activity.
* Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID);
/** Get Activity.
* Business Activity
*/
public int getC_Activity_ID();
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_Campaign_ID */
public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID";
/** Set Campaign.
* Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID);
/** Get Campaign.
* Marketing Campaign
*/
public int getC_Campaign_ID();
public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
/** Column name C_CashPlan_ID */
public static final String COLUMNNAME_C_CashPlan_ID = "C_CashPlan_ID";
/** Set Cash Plan */
public void setC_CashPlan_ID (int C_CashPlan_ID);
/** Get Cash Plan */
public int getC_CashPlan_ID();
public org.compiere.model.I_C_CashPlan getC_CashPlan() throws RuntimeException;
/** Column name C_CashPlanLine_ID */
public static final String COLUMNNAME_C_CashPlanLine_ID = "C_CashPlanLine_ID";
/** Set Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID);
/** Get Cash Plan Line */
public int getC_CashPlanLine_ID();
/** Column name C_Charge_ID */
public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID";
/** Set Charge.
* Additional document charges
*/
public void setC_Charge_ID (int C_Charge_ID);
/** Get Charge.
* Additional document charges
*/
public int getC_Charge_ID();
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException;
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name C_ProjectPhase_ID */
public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID";
/** Set Project Phase.
* Phase of a Project
*/
public void setC_ProjectPhase_ID (int C_ProjectPhase_ID);
/** Get Project Phase.
* Phase of a Project
*/
public int getC_ProjectPhase_ID();
public org.compiere.model.I_C_ProjectPhase getC_ProjectPhase() throws RuntimeException;
/** Column name C_ProjectTask_ID */
public static final String COLUMNNAME_C_ProjectTask_ID = "C_ProjectTask_ID";
/** Set Project Task.
* Actual Project Task in a Phase
*/
public void setC_ProjectTask_ID (int C_ProjectTask_ID);
/** Get Project Task.
* Actual Project Task in a Phase
*/
public int getC_ProjectTask_ID();
public org.compiere.model.I_C_ProjectTask getC_ProjectTask() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name DateTrx */
public static final String COLUMNNAME_DateTrx = "DateTrx";
/** Set Transaction Date.
* Transaction Date
*/
public void setDateTrx (Timestamp DateTrx);
/** Get Transaction Date.
* Transaction Date
*/
public Timestamp getDateTrx();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name Line */
public static final String COLUMNNAME_Line = "Line";
/** Set Line No.
* Unique line for this document
*/
public void setLine (int Line);
/** Get Line No.
* Unique line for this document
*/
public int getLine();
/** Column name LineTotalAmt */
public static final String COLUMNNAME_LineTotalAmt = "LineTotalAmt";
/** Set Line Total.
* Total line amount incl. Tax
*/
public void setLineTotalAmt (BigDecimal LineTotalAmt);
/** Get Line Total.
* Total line amount incl. Tax
*/
public BigDecimal getLineTotalAmt();
/** Column name M_Product_ID */
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
/** Set Product.
* Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID);
/** Get Product.
* Product, Service, Item
*/
public int getM_Product_ID();
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Name.
* Alphanumeric identifier of the entity
*/
public void setName (String Name);
/** Get Name.
* Alphanumeric identifier of the entity
*/
public String getName();
/** Column name Probability */
public static final String COLUMNNAME_Probability = "Probability";
/** Set Probability */
public void setProbability (BigDecimal Probability);
/** Get Probability */
public BigDecimal getProbability();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
/** Set Processed.
* The document has been processed
*/
public void setProcessed (boolean Processed);
/** Get Processed.
* The document has been processed
*/
public boolean isProcessed();
/** Column name QtyEntered */
public static final String COLUMNNAME_QtyEntered = "QtyEntered";
/** Set Quantity.
* The Quantity Entered is based on the selected UoM
*/
public void setQtyEntered (BigDecimal QtyEntered);
/** Get Quantity.
* The Quantity Entered is based on the selected UoM
*/
public BigDecimal getQtyEntered();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
/** Column name User1_ID */
public static final String COLUMNNAME_User1_ID = "User1_ID";
/** Set User List 1.
* User defined list element #1
*/
public void setUser1_ID (int User1_ID);
/** Get User List 1.
* User defined list element #1
*/
public int getUser1_ID();
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException;
/** Column name User2_ID */
public static final String COLUMNNAME_User2_ID = "User2_ID";
/** Set User List 2.
* User defined list element #2
*/
public void setUser2_ID (int User2_ID);
/** Get User List 2.
* User defined list element #2
*/
public int getUser2_ID();
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
}

View File

@ -31,7 +31,7 @@ public interface I_C_Invoice
public static final String Table_Name = "C_Invoice"; public static final String Table_Name = "C_Invoice";
/** AD_Table_ID=318 */ /** AD_Table_ID=318 */
public static final int Table_ID = MTable.getTable_ID(Table_Name); public static final int Table_ID = 318;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
@ -78,17 +78,17 @@ public interface I_C_Invoice
/** Column name AD_User_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. /** Set Usuario.
* 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. /** Get Usuario.
* 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 getAD_User() throws RuntimeException; public org.compiere.model.I_AD_User getAD_User() throws RuntimeException;
/** Column name C_Activity_ID */ /** 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";
@ -103,7 +103,7 @@ public interface I_C_Invoice
*/ */
public int getC_Activity_ID(); public int getC_Activity_ID();
public I_C_Activity getC_Activity() throws RuntimeException; public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name C_BPartner_ID */ /** 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";
@ -118,7 +118,7 @@ public interface I_C_Invoice
*/ */
public int getC_BPartner_ID(); public int getC_BPartner_ID();
public I_C_BPartner getC_BPartner() throws RuntimeException; public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_BPartner_Location_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";
@ -133,7 +133,7 @@ public interface I_C_Invoice
*/ */
public int getC_BPartner_Location_ID(); public int getC_BPartner_Location_ID();
public I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException; public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
/** Column name C_Campaign_ID */ /** 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";
@ -148,7 +148,7 @@ public interface I_C_Invoice
*/ */
public int getC_Campaign_ID(); public int getC_Campaign_ID();
public I_C_Campaign getC_Campaign() throws RuntimeException; public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
/** Column name C_CashLine_ID */ /** 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";
@ -163,7 +163,18 @@ public interface I_C_Invoice
*/ */
public int getC_CashLine_ID(); public int getC_CashLine_ID();
public I_C_CashLine getC_CashLine() throws RuntimeException; public org.compiere.model.I_C_CashLine getC_CashLine() throws RuntimeException;
/** Column name C_CashPlanLine_ID */
public static final String COLUMNNAME_C_CashPlanLine_ID = "C_CashPlanLine_ID";
/** Set Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID);
/** Get Cash Plan Line */
public int getC_CashPlanLine_ID();
public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException;
/** Column name C_Charge_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";
@ -178,7 +189,7 @@ public interface I_C_Invoice
*/ */
public int getC_Charge_ID(); public int getC_Charge_ID();
public I_C_Charge getC_Charge() throws RuntimeException; public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException;
/** Column name C_ConversionType_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";
@ -193,7 +204,7 @@ public interface I_C_Invoice
*/ */
public int getC_ConversionType_ID(); public int getC_ConversionType_ID();
public I_C_ConversionType getC_ConversionType() throws RuntimeException; public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException;
/** Column name C_Currency_ID */ /** Column name C_Currency_ID */
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
@ -208,7 +219,7 @@ public interface I_C_Invoice
*/ */
public int getC_Currency_ID(); public int getC_Currency_ID();
public I_C_Currency getC_Currency() throws RuntimeException; public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_DocType_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";
@ -223,7 +234,7 @@ public interface I_C_Invoice
*/ */
public int getC_DocType_ID(); public int getC_DocType_ID();
public I_C_DocType getC_DocType() throws RuntimeException; public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException;
/** Column name C_DocTypeTarget_ID */ /** 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";
@ -238,7 +249,7 @@ public interface I_C_Invoice
*/ */
public int getC_DocTypeTarget_ID(); public int getC_DocTypeTarget_ID();
public I_C_DocType getC_DocTypeTarget() throws RuntimeException; public org.compiere.model.I_C_DocType getC_DocTypeTarget() throws RuntimeException;
/** Column name C_DunningLevel_ID */ /** Column name C_DunningLevel_ID */
public static final String COLUMNNAME_C_DunningLevel_ID = "C_DunningLevel_ID"; public static final String COLUMNNAME_C_DunningLevel_ID = "C_DunningLevel_ID";
@ -249,7 +260,7 @@ public interface I_C_Invoice
/** Get Dunning Level */ /** Get Dunning Level */
public int getC_DunningLevel_ID(); public int getC_DunningLevel_ID();
public I_C_DunningLevel getC_DunningLevel() throws RuntimeException; public org.compiere.model.I_C_DunningLevel getC_DunningLevel() throws RuntimeException;
/** Column name ChargeAmt */ /** Column name ChargeAmt */
public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; public static final String COLUMNNAME_ChargeAmt = "ChargeAmt";
@ -303,7 +314,7 @@ public interface I_C_Invoice
*/ */
public int getC_Order_ID(); public int getC_Order_ID();
public I_C_Order getC_Order() throws RuntimeException; public org.compiere.model.I_C_Order getC_Order() throws RuntimeException;
/** Column name C_Payment_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";
@ -318,7 +329,7 @@ public interface I_C_Invoice
*/ */
public int getC_Payment_ID(); public int getC_Payment_ID();
public I_C_Payment getC_Payment() throws RuntimeException; public org.compiere.model.I_C_Payment getC_Payment() throws RuntimeException;
/** Column name C_PaymentTerm_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";
@ -333,7 +344,7 @@ public interface I_C_Invoice
*/ */
public int getC_PaymentTerm_ID(); public int getC_PaymentTerm_ID();
public I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException; public org.compiere.model.I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException;
/** Column name C_Project_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";
@ -348,7 +359,7 @@ public interface I_C_Invoice
*/ */
public int getC_Project_ID(); public int getC_Project_ID();
public I_C_Project getC_Project() throws RuntimeException; public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name Created */ /** Column name Created */
public static final String COLUMNNAME_Created = "Created"; public static final String COLUMNNAME_Created = "Created";
@ -687,7 +698,7 @@ public interface I_C_Invoice
*/ */
public int getM_PriceList_ID(); public int getM_PriceList_ID();
public I_M_PriceList getM_PriceList() throws RuntimeException; public org.compiere.model.I_M_PriceList getM_PriceList() throws RuntimeException;
/** Column name M_RMA_ID */ /** 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";
@ -702,7 +713,7 @@ public interface I_C_Invoice
*/ */
public int getM_RMA_ID(); public int getM_RMA_ID();
public I_M_RMA getM_RMA() throws RuntimeException; public org.compiere.model.I_M_RMA getM_RMA() throws RuntimeException;
/** Column name PaymentRule */ /** Column name PaymentRule */
public static final String COLUMNNAME_PaymentRule = "PaymentRule"; public static final String COLUMNNAME_PaymentRule = "PaymentRule";
@ -800,7 +811,7 @@ public interface I_C_Invoice
*/ */
public int getReversal_ID(); public int getReversal_ID();
public I_C_Invoice getReversal() throws RuntimeException; public org.compiere.model.I_C_Invoice getReversal() throws RuntimeException;
/** Column name SalesRep_ID */ /** Column name SalesRep_ID */
public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID";
@ -815,7 +826,7 @@ public interface I_C_Invoice
*/ */
public int getSalesRep_ID(); public int getSalesRep_ID();
public I_AD_User getSalesRep() throws RuntimeException; public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;
/** Column name SendEMail */ /** Column name SendEMail */
public static final String COLUMNNAME_SendEMail = "SendEMail"; public static final String COLUMNNAME_SendEMail = "SendEMail";
@ -872,7 +883,7 @@ public interface I_C_Invoice
*/ */
public int getUser1_ID(); public int getUser1_ID();
public I_C_ElementValue getUser1() throws RuntimeException; public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException;
/** Column name User2_ID */ /** Column name User2_ID */
public static final String COLUMNNAME_User2_ID = "User2_ID"; public static final String COLUMNNAME_User2_ID = "User2_ID";
@ -887,5 +898,5 @@ public interface I_C_Invoice
*/ */
public int getUser2_ID(); public int getUser2_ID();
public I_C_ElementValue getUser2() throws RuntimeException; public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException;
} }

View File

@ -228,6 +228,17 @@ public interface I_C_Order
public org.compiere.model.I_C_CashLine getC_CashLine() throws RuntimeException; public org.compiere.model.I_C_CashLine getC_CashLine() throws RuntimeException;
/** Column name C_CashPlanLine_ID */
public static final String COLUMNNAME_C_CashPlanLine_ID = "C_CashPlanLine_ID";
/** Set Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID);
/** Get Cash Plan Line */
public int getC_CashPlanLine_ID();
public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException;
/** Column name C_Charge_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";

View File

@ -0,0 +1,399 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.util.KeyNamePair;
/** Generated Interface for T_CashFlow
* @author Adempiere (generated)
* @version Release 3.6.0LTS
*/
public interface I_T_CashFlow
{
/** TableName=T_CashFlow */
public static final String Table_Name = "T_CashFlow";
/** AD_Table_ID=53299 */
public static final int Table_ID = 53299;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 3 - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(3);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_PInstance_ID */
public static final String COLUMNNAME_AD_PInstance_ID = "AD_PInstance_ID";
/** Set Process Instance.
* Instance of the process
*/
public void setAD_PInstance_ID (int AD_PInstance_ID);
/** Get Process Instance.
* Instance of the process
*/
public int getAD_PInstance_ID();
public org.compiere.model.I_AD_PInstance getAD_PInstance() throws RuntimeException;
/** Column name C_AcctSchema_ID */
public static final String COLUMNNAME_C_AcctSchema_ID = "C_AcctSchema_ID";
/** Set Accounting Schema.
* Rules for accounting
*/
public void setC_AcctSchema_ID (int C_AcctSchema_ID);
/** Get Accounting Schema.
* Rules for accounting
*/
public int getC_AcctSchema_ID();
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException;
/** Column name C_Activity_ID */
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
/** Set Activity.
* Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID);
/** Get Activity.
* Business Activity
*/
public int getC_Activity_ID();
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name CashFlowSource */
public static final String COLUMNNAME_CashFlowSource = "CashFlowSource";
/** Set Cash Flow Source */
public void setCashFlowSource (String CashFlowSource);
/** Get Cash Flow Source */
public String getCashFlowSource();
/** Column name CashFlowType */
public static final String COLUMNNAME_CashFlowType = "CashFlowType";
/** Set Cash Flow Type */
public void setCashFlowType (String CashFlowType);
/** Get Cash Flow Type */
public String getCashFlowType();
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_Campaign_ID */
public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID";
/** Set Campaign.
* Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID);
/** Get Campaign.
* Marketing Campaign
*/
public int getC_Campaign_ID();
public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
/** Column name C_CashPlanLine_ID */
public static final String COLUMNNAME_C_CashPlanLine_ID = "C_CashPlanLine_ID";
/** Set Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID);
/** Get Cash Plan Line */
public int getC_CashPlanLine_ID();
public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException;
/** Column name C_Charge_ID */
public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID";
/** Set Charge.
* Additional document charges
*/
public void setC_Charge_ID (int C_Charge_ID);
/** Get Charge.
* Additional document charges
*/
public int getC_Charge_ID();
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException;
/** Column name C_ElementValue_ID */
public static final String COLUMNNAME_C_ElementValue_ID = "C_ElementValue_ID";
/** Set Account Element.
* Account Element
*/
public void setC_ElementValue_ID (int C_ElementValue_ID);
/** Get Account Element.
* Account Element
*/
public int getC_ElementValue_ID();
public org.compiere.model.I_C_ElementValue getC_ElementValue() throws RuntimeException;
/** Column name C_Invoice_ID */
public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID";
/** Set Invoice.
* Invoice Identifier
*/
public void setC_Invoice_ID (int C_Invoice_ID);
/** Get Invoice.
* Invoice Identifier
*/
public int getC_Invoice_ID();
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException;
/** Column name C_Order_ID */
public static final String COLUMNNAME_C_Order_ID = "C_Order_ID";
/** Set Order.
* Order
*/
public void setC_Order_ID (int C_Order_ID);
/** Get Order.
* Order
*/
public int getC_Order_ID();
public org.compiere.model.I_C_Order getC_Order() throws RuntimeException;
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name DateTo */
public static final String COLUMNNAME_DateTo = "DateTo";
/** Set Date To.
* End date of a date range
*/
public void setDateTo (Timestamp DateTo);
/** Get Date To.
* End date of a date range
*/
public Timestamp getDateTo();
/** Column name DateTrx */
public static final String COLUMNNAME_DateTrx = "DateTrx";
/** Set Transaction Date.
* Transaction Date
*/
public void setDateTrx (Timestamp DateTrx);
/** Get Transaction Date.
* Transaction Date
*/
public Timestamp getDateTrx();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsSOTrx */
public static final String COLUMNNAME_IsSOTrx = "IsSOTrx";
/** Set Sales Transaction.
* This is a Sales Transaction
*/
public void setIsSOTrx (boolean IsSOTrx);
/** Get Sales Transaction.
* This is a Sales Transaction
*/
public boolean isSOTrx();
/** Column name LineTotalAmt */
public static final String COLUMNNAME_LineTotalAmt = "LineTotalAmt";
/** Set Line Total.
* Total line amount incl. Tax
*/
public void setLineTotalAmt (BigDecimal LineTotalAmt);
/** Get Line Total.
* Total line amount incl. Tax
*/
public BigDecimal getLineTotalAmt();
/** Column name M_Product_ID */
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
/** Set Product.
* Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID);
/** Get Product.
* Product, Service, Item
*/
public int getM_Product_ID();
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Name.
* Alphanumeric identifier of the entity
*/
public void setName (String Name);
/** Get Name.
* Alphanumeric identifier of the entity
*/
public String getName();
/** Column name Probability */
public static final String COLUMNNAME_Probability = "Probability";
/** Set Probability */
public void setProbability (BigDecimal Probability);
/** Get Probability */
public BigDecimal getProbability();
/** Column name T_CashFlow_ID */
public static final String COLUMNNAME_T_CashFlow_ID = "T_CashFlow_ID";
/** Set T_CashFlow_ID */
public void setT_CashFlow_ID (int T_CashFlow_ID);
/** Get T_CashFlow_ID */
public int getT_CashFlow_ID();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,141 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* 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.model;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
/**
* Cash Plan model
*
* @author Carlos Ruiz - GlobalQSS
*/
public class MCashPlan extends X_C_CashPlan
{
/**
*
*/
private static final long serialVersionUID = -3068952163785661012L;
/** Logger */
private static CLogger s_log = CLogger.getCLogger(MCashPlan.class);
/**************************************************************************
* Standard Constructor
* @param ctx context
* @param C_CashPlan_ID id
* @param trxName transaction
*/
public MCashPlan (Properties ctx, int C_CashPlan_ID, String trxName)
{
super (ctx, C_CashPlan_ID, trxName);
/** if (C_CashPlan_ID == 0)
{
setC_Activity_ID (0);
setC_CashPlan_ID (0);
setC_Project_ID (0);
setDateDoc (new Timestamp(System.currentTimeMillis()));
// @#Date@
setDocumentNo (null);
setGrandTotal (Env.ZERO);
setIsApproved (false);
// @IsApproved@
setIsSOTrx (false);
setProcessed (false);
} */
} // MCashPlan
/**
* Load Constructor
* @param ctx ctx
* @param rs result set
* @param trxName transaction
*/
public MCashPlan (Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
} // MCashPlan
/**
* Before Delete
* @return true
*/
protected boolean beforeDelete ()
{
/*
// delete the lines using model classes
boolean success = true;
for (MCashPlanLine cpl : getLines()) {
success = cpl.delete(true, get_TrxName());
if (! success)
break;
}
return success;
*/
// delete the lines using direct SQL (to avoid logging and updating of header on every step) - same as cascade foreign key
int nodel = DB.executeUpdate("DELETE FROM C_CashPlanLine WHERE C_CashPlan_ID=?", getC_CashPlan_ID(), get_TrxName());
return (nodel >= 0);
} // beforeDelete
/**
* Get Cash Plan Lines of Cash Plan
* @return lines
*/
public MCashPlanLine[] getLines ()
{
ArrayList<MCashPlanLine> list = new ArrayList<MCashPlanLine>();
String sql = "SELECT * FROM C_CashPlanLine WHERE C_CashPlan_ID=? ORDER BY Line";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(sql, get_TrxName());
pstmt.setInt(1, getC_CashPlan_ID());
rs = pstmt.executeQuery();
while (rs.next())
{
MCashPlanLine il = new MCashPlanLine(getCtx(), rs, get_TrxName());
list.add(il);
}
rs.close();
pstmt.close();
pstmt = null;
}
catch (Exception e)
{
log.log(Level.SEVERE, "getLines", e);
}
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
//
MCashPlanLine[] lines = new MCashPlanLine[list.size()];
list.toArray(lines);
return lines;
} // getLines
} // MCashPlan

View File

@ -0,0 +1,126 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* 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.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
/**
* Cash Plan model
*
* @author Carlos Ruiz - GlobalQSS
*/
public class MCashPlanLine extends X_C_CashPlanLine
{
/**
*
*/
private static final long serialVersionUID = 3897658515979106674L;
/** Logger */
private static CLogger s_log = CLogger.getCLogger(MCashPlanLine.class);
/**************************************************************************
* Standard Constructor
* @param ctx context
* @param C_CashPlanLine_ID id
* @param trxName transaction
*/
public MCashPlanLine (Properties ctx, int C_CashPlanLine_ID, String trxName)
{
super (ctx, C_CashPlanLine_ID, trxName);
/** if (C_CashPlanLine_ID == 0)
{
setC_CashPlan_ID (0);
setC_CashPlanLine_ID (0);
setDateTrx (new Timestamp(System.currentTimeMillis()));
setLine (0);
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_CashPlanLine WHERE C_CashPlanLine_ID=@C_CashPlanLine_ID@
setProcessed (false);
setQtyEntered (Env.ZERO);
// 1
} */
} // MCashPlanLine
/**
* Load Constructor
* @param ctx ctx
* @param rs result set
* @param trxName transaction
*/
public MCashPlanLine (Properties ctx, ResultSet rs, String trxName)
{
super(ctx, rs, trxName);
} // MCashPlanLine
/**************************************************************************
* Before Save
* @param newRecord
* @return true if it can be sabed
*/
protected boolean beforeSave (boolean newRecord)
{
// Charge
if (getC_Charge_ID() != 0 && getM_Product_ID() != 0)
setM_Product_ID(0);
// Get Line No
if (getLine() == 0)
{
String sql = "SELECT COALESCE(MAX(Line),0)+10 FROM C_CashPlanLine WHERE C_CashPlan_ID=?";
int ii = DB.getSQLValue (get_TrxName(), sql, getC_CashPlan_ID());
setLine (ii);
}
return true;
} // beforeSave
/**
* After Save
* @param newRecord new
* @param success success
* @return saved
*/
protected boolean afterSave (boolean newRecord, boolean success)
{
if (!success)
return success;
return updateHeader();
} // afterSave
/**
* Update Header
* @return true if header updated
*/
private boolean updateHeader()
{
// Update Cash Plan Header
String sql = "UPDATE C_CashPlan "
+ " SET GrandTotal="
+ "(SELECT COALESCE(SUM(LineTotalAmt),0) FROM C_CashPlanLine WHERE C_CashPlan.C_CashPlan_ID=C_CashPlanLine.C_CashPlan_ID) "
+ "WHERE C_CashPlan_ID=" + getC_CashPlan_ID();
int no = DB.executeUpdate(sql, get_TrxName());
if (no != 1)
log.warning("(1) #" + no);
return no == 1;
} // updateHeaderTax
} // MCashPlanLine

View File

@ -942,6 +942,14 @@ public class MInvoice extends X_C_Invoice implements DocAction
setC_PaymentTerm_ID (ii); setC_PaymentTerm_ID (ii);
} }
} }
// assign cash plan line from order
if (getC_Order_ID() > 0 && getC_CashPlanLine_ID() <= 0) {
MOrder order = new MOrder(getCtx(), getC_Order_ID(), get_TrxName());
if (order.getC_CashPlanLine_ID() > 0)
setC_CashPlanLine_ID(order.getC_CashPlanLine_ID());
}
return true; return true;
} // beforeSave } // beforeSave

View File

@ -0,0 +1,499 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
/** Generated Model for C_CashPlan
* @author Adempiere (generated)
* @version Release 3.6.0LTS - $Id$ */
public class X_C_CashPlan extends PO implements I_C_CashPlan, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20110325L;
/** Standard Constructor */
public X_C_CashPlan (Properties ctx, int C_CashPlan_ID, String trxName)
{
super (ctx, C_CashPlan_ID, trxName);
/** if (C_CashPlan_ID == 0)
{
setC_CashPlan_ID (0);
setDateDoc (new Timestamp( System.currentTimeMillis() ));
// @#Date@
setDocumentNo (null);
setGrandTotal (Env.ZERO);
setIsApproved (false);
// @IsApproved@
setIsSOTrx (false);
setProcessed (false);
} */
}
/** Load Constructor */
public X_C_CashPlan (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, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_C_CashPlan[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Trx Organization.
@param AD_OrgTrx_ID
Performing or initiating organization
*/
public void setAD_OrgTrx_ID (int AD_OrgTrx_ID)
{
if (AD_OrgTrx_ID < 1)
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 org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException
{
return (org.compiere.model.I_C_Activity)MTable.get(getCtx(), org.compiere.model.I_C_Activity.Table_Name)
.getPO(getC_Activity_ID(), get_TrxName()); }
/** Set Activity.
@param C_Activity_ID
Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID)
{
if (C_Activity_ID < 1)
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();
}
/** CashFlowType AD_Reference_ID=53385 */
public static final int CASHFLOWTYPE_AD_Reference_ID=53385;
/** Financing = F */
public static final String CASHFLOWTYPE_Financing = "F";
/** Investment = I */
public static final String CASHFLOWTYPE_Investment = "I";
/** Operational = O */
public static final String CASHFLOWTYPE_Operational = "O";
/** Set Cash Flow Type.
@param CashFlowType Cash Flow Type */
public void setCashFlowType (String CashFlowType)
{
set_Value (COLUMNNAME_CashFlowType, CashFlowType);
}
/** Get Cash Flow Type.
@return Cash Flow Type */
public String getCashFlowType ()
{
return (String)get_Value(COLUMNNAME_CashFlowType);
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
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 org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException
{
return (org.compiere.model.I_C_Campaign)MTable.get(getCtx(), org.compiere.model.I_C_Campaign.Table_Name)
.getPO(getC_Campaign_ID(), get_TrxName()); }
/** Set Campaign.
@param C_Campaign_ID
Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID)
{
if (C_Campaign_ID < 1)
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 Plan.
@param C_CashPlan_ID Cash Plan */
public void setC_CashPlan_ID (int C_CashPlan_ID)
{
if (C_CashPlan_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_CashPlan_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_CashPlan_ID, Integer.valueOf(C_CashPlan_ID));
}
/** Get Cash Plan.
@return Cash Plan */
public int getC_CashPlan_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlan_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Copy From.
@param CopyFrom
Copy From Record
*/
public void setCopyFrom (String CopyFrom)
{
set_Value (COLUMNNAME_CopyFrom, CopyFrom);
}
/** Get Copy From.
@return Copy From Record
*/
public String getCopyFrom ()
{
return (String)get_Value(COLUMNNAME_CopyFrom);
}
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException
{
return (org.compiere.model.I_C_Project)MTable.get(getCtx(), org.compiere.model.I_C_Project.Table_Name)
.getPO(getC_Project_ID(), get_TrxName()); }
/** Set Project.
@param C_Project_ID
Financial Project
*/
public void setC_Project_ID (int C_Project_ID)
{
if (C_Project_ID < 1)
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 Document Date.
@param DateDoc
Date of the Document
*/
public void setDateDoc (Timestamp DateDoc)
{
set_Value (COLUMNNAME_DateDoc, DateDoc);
}
/** Get Document Date.
@return Date of the Document
*/
public Timestamp getDateDoc ()
{
return (Timestamp)get_Value(COLUMNNAME_DateDoc);
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Document No.
@param DocumentNo
Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo)
{
set_Value (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 Periodic Plan.
@param GeneratePeriodic Generate Periodic Plan */
public void setGeneratePeriodic (String GeneratePeriodic)
{
set_Value (COLUMNNAME_GeneratePeriodic, GeneratePeriodic);
}
/** Get Generate Periodic Plan.
@return Generate Periodic Plan */
public String getGeneratePeriodic ()
{
return (String)get_Value(COLUMNNAME_GeneratePeriodic);
}
/** Set Grand Total.
@param GrandTotal
Total amount of document
*/
public void setGrandTotal (BigDecimal GrandTotal)
{
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;
}
/** 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 Sales Transaction.
@param IsSOTrx
This is a Sales Transaction
*/
public void setIsSOTrx (boolean IsSOTrx)
{
set_Value (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 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;
}
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser1_ID(), get_TrxName()); }
/** Set User List 1.
@param User1_ID
User defined list element #1
*/
public void setUser1_ID (int User1_ID)
{
if (User1_ID < 1)
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();
}
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser2_ID(), get_TrxName()); }
/** Set User List 2.
@param User2_ID
User defined list element #2
*/
public void setUser2_ID (int User2_ID)
{
if (User2_ID < 1)
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();
}
}

View File

@ -0,0 +1,590 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
/** Generated Model for C_CashPlanLine
* @author Adempiere (generated)
* @version Release 3.6.0LTS - $Id$ */
public class X_C_CashPlanLine extends PO implements I_C_CashPlanLine, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20110325L;
/** Standard Constructor */
public X_C_CashPlanLine (Properties ctx, int C_CashPlanLine_ID, String trxName)
{
super (ctx, C_CashPlanLine_ID, trxName);
/** if (C_CashPlanLine_ID == 0)
{
setC_CashPlan_ID (0);
setC_CashPlanLine_ID (0);
setDateTrx (new Timestamp( System.currentTimeMillis() ));
setLine (0);
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_CashPlanLine WHERE C_CashPlanLine_ID=@C_CashPlanLine_ID@
setProcessed (false);
setQtyEntered (Env.ZERO);
// 1
} */
}
/** Load Constructor */
public X_C_CashPlanLine (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, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_C_CashPlanLine[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Trx Organization.
@param AD_OrgTrx_ID
Performing or initiating organization
*/
public void setAD_OrgTrx_ID (int AD_OrgTrx_ID)
{
if (AD_OrgTrx_ID < 1)
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 org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException
{
return (org.compiere.model.I_C_Activity)MTable.get(getCtx(), org.compiere.model.I_C_Activity.Table_Name)
.getPO(getC_Activity_ID(), get_TrxName()); }
/** Set Activity.
@param C_Activity_ID
Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID)
{
if (C_Activity_ID < 1)
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();
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
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 org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException
{
return (org.compiere.model.I_C_Campaign)MTable.get(getCtx(), org.compiere.model.I_C_Campaign.Table_Name)
.getPO(getC_Campaign_ID(), get_TrxName()); }
/** Set Campaign.
@param C_Campaign_ID
Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID)
{
if (C_Campaign_ID < 1)
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();
}
public org.compiere.model.I_C_CashPlan getC_CashPlan() throws RuntimeException
{
return (org.compiere.model.I_C_CashPlan)MTable.get(getCtx(), org.compiere.model.I_C_CashPlan.Table_Name)
.getPO(getC_CashPlan_ID(), get_TrxName()); }
/** Set Cash Plan.
@param C_CashPlan_ID Cash Plan */
public void setC_CashPlan_ID (int C_CashPlan_ID)
{
if (C_CashPlan_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_CashPlan_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_CashPlan_ID, Integer.valueOf(C_CashPlan_ID));
}
/** Get Cash Plan.
@return Cash Plan */
public int getC_CashPlan_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlan_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_CashPlan_ID()));
}
/** Set Cash Plan Line.
@param C_CashPlanLine_ID Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID)
{
if (C_CashPlanLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_CashPlanLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_CashPlanLine_ID, Integer.valueOf(C_CashPlanLine_ID));
}
/** Get Cash Plan Line.
@return Cash Plan Line */
public int getC_CashPlanLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlanLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException
{
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_Name)
.getPO(getC_Charge_ID(), get_TrxName()); }
/** Set Charge.
@param C_Charge_ID
Additional document charges
*/
public void setC_Charge_ID (int C_Charge_ID)
{
if (C_Charge_ID < 1)
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 org.compiere.model.I_C_Project getC_Project() throws RuntimeException
{
return (org.compiere.model.I_C_Project)MTable.get(getCtx(), org.compiere.model.I_C_Project.Table_Name)
.getPO(getC_Project_ID(), get_TrxName()); }
/** Set Project.
@param C_Project_ID
Financial Project
*/
public void setC_Project_ID (int C_Project_ID)
{
if (C_Project_ID < 1)
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();
}
public org.compiere.model.I_C_ProjectPhase getC_ProjectPhase() throws RuntimeException
{
return (org.compiere.model.I_C_ProjectPhase)MTable.get(getCtx(), org.compiere.model.I_C_ProjectPhase.Table_Name)
.getPO(getC_ProjectPhase_ID(), get_TrxName()); }
/** Set Project Phase.
@param C_ProjectPhase_ID
Phase of a Project
*/
public void setC_ProjectPhase_ID (int C_ProjectPhase_ID)
{
if (C_ProjectPhase_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_ProjectPhase_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_ProjectPhase_ID, Integer.valueOf(C_ProjectPhase_ID));
}
/** Get Project Phase.
@return Phase of a Project
*/
public int getC_ProjectPhase_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_ProjectPhase_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_ProjectTask getC_ProjectTask() throws RuntimeException
{
return (org.compiere.model.I_C_ProjectTask)MTable.get(getCtx(), org.compiere.model.I_C_ProjectTask.Table_Name)
.getPO(getC_ProjectTask_ID(), get_TrxName()); }
/** Set Project Task.
@param C_ProjectTask_ID
Actual Project Task in a Phase
*/
public void setC_ProjectTask_ID (int C_ProjectTask_ID)
{
if (C_ProjectTask_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_ProjectTask_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_ProjectTask_ID, Integer.valueOf(C_ProjectTask_ID));
}
/** Get Project Task.
@return Actual Project Task in a Phase
*/
public int getC_ProjectTask_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_ProjectTask_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Transaction Date.
@param DateTrx
Transaction Date
*/
public void setDateTrx (Timestamp DateTrx)
{
set_Value (COLUMNNAME_DateTrx, DateTrx);
}
/** Get Transaction Date.
@return Transaction Date
*/
public Timestamp getDateTrx ()
{
return (Timestamp)get_Value(COLUMNNAME_DateTrx);
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Line No.
@param Line
Unique line for this document
*/
public void setLine (int Line)
{
set_Value (COLUMNNAME_Line, Integer.valueOf(Line));
}
/** Get Line No.
@return Unique line for this document
*/
public int getLine ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Line);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Line Total.
@param LineTotalAmt
Total line amount incl. Tax
*/
public void setLineTotalAmt (BigDecimal LineTotalAmt)
{
set_Value (COLUMNNAME_LineTotalAmt, LineTotalAmt);
}
/** Get Line Total.
@return Total line amount incl. Tax
*/
public BigDecimal getLineTotalAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_LineTotalAmt);
if (bd == null)
return Env.ZERO;
return bd;
}
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException
{
return (org.compiere.model.I_M_Product)MTable.get(getCtx(), org.compiere.model.I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Set Probability.
@param Probability Probability */
public void setProbability (BigDecimal Probability)
{
set_Value (COLUMNNAME_Probability, Probability);
}
/** Get Probability.
@return Probability */
public BigDecimal getProbability ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Probability);
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 Quantity.
@param QtyEntered
The Quantity Entered is based on the selected UoM
*/
public void setQtyEntered (BigDecimal QtyEntered)
{
set_Value (COLUMNNAME_QtyEntered, QtyEntered);
}
/** Get Quantity.
@return The Quantity Entered is based on the selected UoM
*/
public BigDecimal getQtyEntered ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyEntered);
if (bd == null)
return Env.ZERO;
return bd;
}
public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser1_ID(), get_TrxName()); }
/** Set User List 1.
@param User1_ID
User defined list element #1
*/
public void setUser1_ID (int User1_ID)
{
if (User1_ID < 1)
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();
}
public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser2_ID(), get_TrxName()); }
/** Set User List 2.
@param User2_ID
User defined list element #2
*/
public void setUser2_ID (int User2_ID)
{
if (User2_ID < 1)
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();
}
}

View File

@ -33,7 +33,7 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20100614L; private static final long serialVersionUID = 20110325L;
/** Standard Constructor */ /** Standard Constructor */
public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName)
@ -135,12 +135,12 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_User getAD_User() throws RuntimeException public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
{ {
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getAD_User_ID(), get_TrxName()); } .getPO(getAD_User_ID(), get_TrxName()); }
/** Set User/Contact. /** Set Usuario.
@param AD_User_ID @param AD_User_ID
User within the system - Internal or Business Partner Contact User within the system - Internal or Business Partner Contact
*/ */
@ -152,7 +152,7 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
} }
/** Get User/Contact. /** Get Usuario.
@return User within the system - Internal or Business Partner Contact @return User within the system - Internal or Business Partner Contact
*/ */
public int getAD_User_ID () public int getAD_User_ID ()
@ -163,9 +163,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Activity getC_Activity() throws RuntimeException public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException
{ {
return (I_C_Activity)MTable.get(getCtx(), I_C_Activity.Table_Name) return (org.compiere.model.I_C_Activity)MTable.get(getCtx(), org.compiere.model.I_C_Activity.Table_Name)
.getPO(getC_Activity_ID(), get_TrxName()); } .getPO(getC_Activity_ID(), get_TrxName()); }
/** Set Activity. /** Set Activity.
@ -191,9 +191,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_BPartner getC_BPartner() throws RuntimeException public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{ {
return (I_C_BPartner)MTable.get(getCtx(), I_C_BPartner.Table_Name) return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); } .getPO(getC_BPartner_ID(), get_TrxName()); }
/** Set Business Partner . /** Set Business Partner .
@ -219,9 +219,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException
{ {
return (I_C_BPartner_Location)MTable.get(getCtx(), I_C_BPartner_Location.Table_Name) return (org.compiere.model.I_C_BPartner_Location)MTable.get(getCtx(), org.compiere.model.I_C_BPartner_Location.Table_Name)
.getPO(getC_BPartner_Location_ID(), get_TrxName()); } .getPO(getC_BPartner_Location_ID(), get_TrxName()); }
/** Set Partner Location. /** Set Partner Location.
@ -247,9 +247,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Campaign getC_Campaign() throws RuntimeException public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException
{ {
return (I_C_Campaign)MTable.get(getCtx(), I_C_Campaign.Table_Name) return (org.compiere.model.I_C_Campaign)MTable.get(getCtx(), org.compiere.model.I_C_Campaign.Table_Name)
.getPO(getC_Campaign_ID(), get_TrxName()); } .getPO(getC_Campaign_ID(), get_TrxName()); }
/** Set Campaign. /** Set Campaign.
@ -275,9 +275,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_CashLine getC_CashLine() throws RuntimeException public org.compiere.model.I_C_CashLine getC_CashLine() throws RuntimeException
{ {
return (I_C_CashLine)MTable.get(getCtx(), I_C_CashLine.Table_Name) return (org.compiere.model.I_C_CashLine)MTable.get(getCtx(), org.compiere.model.I_C_CashLine.Table_Name)
.getPO(getC_CashLine_ID(), get_TrxName()); } .getPO(getC_CashLine_ID(), get_TrxName()); }
/** Set Cash Journal Line. /** Set Cash Journal Line.
@ -303,9 +303,34 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Charge getC_Charge() throws RuntimeException public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException
{ {
return (I_C_Charge)MTable.get(getCtx(), I_C_Charge.Table_Name) return (org.compiere.model.I_C_CashPlanLine)MTable.get(getCtx(), org.compiere.model.I_C_CashPlanLine.Table_Name)
.getPO(getC_CashPlanLine_ID(), get_TrxName()); }
/** Set Cash Plan Line.
@param C_CashPlanLine_ID Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID)
{
if (C_CashPlanLine_ID < 1)
set_Value (COLUMNNAME_C_CashPlanLine_ID, null);
else
set_Value (COLUMNNAME_C_CashPlanLine_ID, Integer.valueOf(C_CashPlanLine_ID));
}
/** Get Cash Plan Line.
@return Cash Plan Line */
public int getC_CashPlanLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlanLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException
{
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_Name)
.getPO(getC_Charge_ID(), get_TrxName()); } .getPO(getC_Charge_ID(), get_TrxName()); }
/** Set Charge. /** Set Charge.
@ -331,9 +356,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_ConversionType getC_ConversionType() throws RuntimeException public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException
{ {
return (I_C_ConversionType)MTable.get(getCtx(), I_C_ConversionType.Table_Name) return (org.compiere.model.I_C_ConversionType)MTable.get(getCtx(), org.compiere.model.I_C_ConversionType.Table_Name)
.getPO(getC_ConversionType_ID(), get_TrxName()); } .getPO(getC_ConversionType_ID(), get_TrxName()); }
/** Set Currency Type. /** Set Currency Type.
@ -359,9 +384,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Currency getC_Currency() throws RuntimeException public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException
{ {
return (I_C_Currency)MTable.get(getCtx(), I_C_Currency.Table_Name) return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name)
.getPO(getC_Currency_ID(), get_TrxName()); } .getPO(getC_Currency_ID(), get_TrxName()); }
/** Set Currency. /** Set Currency.
@ -387,9 +412,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_DocType getC_DocType() throws RuntimeException public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException
{ {
return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name)
.getPO(getC_DocType_ID(), get_TrxName()); } .getPO(getC_DocType_ID(), get_TrxName()); }
/** Set Document Type. /** Set Document Type.
@ -415,9 +440,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_DocType getC_DocTypeTarget() throws RuntimeException public org.compiere.model.I_C_DocType getC_DocTypeTarget() throws RuntimeException
{ {
return (I_C_DocType)MTable.get(getCtx(), I_C_DocType.Table_Name) return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name)
.getPO(getC_DocTypeTarget_ID(), get_TrxName()); } .getPO(getC_DocTypeTarget_ID(), get_TrxName()); }
/** Set Target Document Type. /** Set Target Document Type.
@ -443,9 +468,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_DunningLevel getC_DunningLevel() throws RuntimeException public org.compiere.model.I_C_DunningLevel getC_DunningLevel() throws RuntimeException
{ {
return (I_C_DunningLevel)MTable.get(getCtx(), I_C_DunningLevel.Table_Name) return (org.compiere.model.I_C_DunningLevel)MTable.get(getCtx(), org.compiere.model.I_C_DunningLevel.Table_Name)
.getPO(getC_DunningLevel_ID(), get_TrxName()); } .getPO(getC_DunningLevel_ID(), get_TrxName()); }
/** Set Dunning Level. /** Set Dunning Level.
@ -528,9 +553,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return (String)get_Value(COLUMNNAME_CopyFrom); return (String)get_Value(COLUMNNAME_CopyFrom);
} }
public I_C_Order getC_Order() throws RuntimeException public org.compiere.model.I_C_Order getC_Order() throws RuntimeException
{ {
return (I_C_Order)MTable.get(getCtx(), I_C_Order.Table_Name) return (org.compiere.model.I_C_Order)MTable.get(getCtx(), org.compiere.model.I_C_Order.Table_Name)
.getPO(getC_Order_ID(), get_TrxName()); } .getPO(getC_Order_ID(), get_TrxName()); }
/** Set Order. /** Set Order.
@ -556,9 +581,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Payment getC_Payment() throws RuntimeException public org.compiere.model.I_C_Payment getC_Payment() throws RuntimeException
{ {
return (I_C_Payment)MTable.get(getCtx(), I_C_Payment.Table_Name) return (org.compiere.model.I_C_Payment)MTable.get(getCtx(), org.compiere.model.I_C_Payment.Table_Name)
.getPO(getC_Payment_ID(), get_TrxName()); } .getPO(getC_Payment_ID(), get_TrxName()); }
/** Set Payment. /** Set Payment.
@ -584,9 +609,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException public org.compiere.model.I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException
{ {
return (I_C_PaymentTerm)MTable.get(getCtx(), I_C_PaymentTerm.Table_Name) return (org.compiere.model.I_C_PaymentTerm)MTable.get(getCtx(), org.compiere.model.I_C_PaymentTerm.Table_Name)
.getPO(getC_PaymentTerm_ID(), get_TrxName()); } .getPO(getC_PaymentTerm_ID(), get_TrxName()); }
/** Set Payment Term. /** Set Payment Term.
@ -612,9 +637,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Project getC_Project() throws RuntimeException public org.compiere.model.I_C_Project getC_Project() throws RuntimeException
{ {
return (I_C_Project)MTable.get(getCtx(), I_C_Project.Table_Name) return (org.compiere.model.I_C_Project)MTable.get(getCtx(), org.compiere.model.I_C_Project.Table_Name)
.getPO(getC_Project_ID(), get_TrxName()); } .getPO(getC_Project_ID(), get_TrxName()); }
/** Set Project. /** Set Project.
@ -1178,9 +1203,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return false; return false;
} }
public I_M_PriceList getM_PriceList() throws RuntimeException public org.compiere.model.I_M_PriceList getM_PriceList() throws RuntimeException
{ {
return (I_M_PriceList)MTable.get(getCtx(), I_M_PriceList.Table_Name) return (org.compiere.model.I_M_PriceList)MTable.get(getCtx(), org.compiere.model.I_M_PriceList.Table_Name)
.getPO(getM_PriceList_ID(), get_TrxName()); } .getPO(getM_PriceList_ID(), get_TrxName()); }
/** Set Price List. /** Set Price List.
@ -1206,9 +1231,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_M_RMA getM_RMA() throws RuntimeException public org.compiere.model.I_M_RMA getM_RMA() throws RuntimeException
{ {
return (I_M_RMA)MTable.get(getCtx(), I_M_RMA.Table_Name) return (org.compiere.model.I_M_RMA)MTable.get(getCtx(), org.compiere.model.I_M_RMA.Table_Name)
.getPO(getM_RMA_ID(), get_TrxName()); } .getPO(getM_RMA_ID(), get_TrxName()); }
/** Set RMA. /** Set RMA.
@ -1394,9 +1419,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_Invoice getReversal() throws RuntimeException public org.compiere.model.I_C_Invoice getReversal() throws RuntimeException
{ {
return (I_C_Invoice)MTable.get(getCtx(), I_C_Invoice.Table_Name) return (org.compiere.model.I_C_Invoice)MTable.get(getCtx(), org.compiere.model.I_C_Invoice.Table_Name)
.getPO(getReversal_ID(), get_TrxName()); } .getPO(getReversal_ID(), get_TrxName()); }
/** Set Reversal ID. /** Set Reversal ID.
@ -1422,9 +1447,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_User getSalesRep() throws RuntimeException public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException
{ {
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name) return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getSalesRep_ID(), get_TrxName()); } .getPO(getSalesRep_ID(), get_TrxName()); }
/** Set Sales Representative. /** Set Sales Representative.
@ -1494,9 +1519,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return bd; return bd;
} }
public I_C_ElementValue getUser1() throws RuntimeException public org.compiere.model.I_C_ElementValue getUser1() throws RuntimeException
{ {
return (I_C_ElementValue)MTable.get(getCtx(), I_C_ElementValue.Table_Name) return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser1_ID(), get_TrxName()); } .getPO(getUser1_ID(), get_TrxName()); }
/** Set User List 1. /** Set User List 1.
@ -1522,9 +1547,9 @@ public class X_C_Invoice extends PO implements I_C_Invoice, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_C_ElementValue getUser2() throws RuntimeException public org.compiere.model.I_C_ElementValue getUser2() throws RuntimeException
{ {
return (I_C_ElementValue)MTable.get(getCtx(), I_C_ElementValue.Table_Name) return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getUser2_ID(), get_TrxName()); } .getPO(getUser2_ID(), get_TrxName()); }
/** Set User List 2. /** Set User List 2.

View File

@ -440,6 +440,31 @@ public class X_C_Order extends PO implements I_C_Order, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException
{
return (org.compiere.model.I_C_CashPlanLine)MTable.get(getCtx(), org.compiere.model.I_C_CashPlanLine.Table_Name)
.getPO(getC_CashPlanLine_ID(), get_TrxName()); }
/** Set Cash Plan Line.
@param C_CashPlanLine_ID Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID)
{
if (C_CashPlanLine_ID < 1)
set_Value (COLUMNNAME_C_CashPlanLine_ID, null);
else
set_Value (COLUMNNAME_C_CashPlanLine_ID, Integer.valueOf(C_CashPlanLine_ID));
}
/** Get Cash Plan Line.
@return Cash Plan Line */
public int getC_CashPlanLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlanLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException
{ {
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_Name) return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_Name)

View File

@ -0,0 +1,606 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;
/** Generated Model for T_CashFlow
* @author Adempiere (generated)
* @version Release 3.6.0LTS - $Id$ */
public class X_T_CashFlow extends PO implements I_T_CashFlow, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20110325L;
/** Standard Constructor */
public X_T_CashFlow (Properties ctx, int T_CashFlow_ID, String trxName)
{
super (ctx, T_CashFlow_ID, trxName);
/** if (T_CashFlow_ID == 0)
{
setAD_PInstance_ID (0);
setDateTrx (new Timestamp( System.currentTimeMillis() ));
setIsSOTrx (false);
} */
}
/** Load Constructor */
public X_T_CashFlow (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, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_T_CashFlow[")
.append(get_ID()).append("]");
return sb.toString();
}
public org.compiere.model.I_AD_PInstance getAD_PInstance() throws RuntimeException
{
return (org.compiere.model.I_AD_PInstance)MTable.get(getCtx(), org.compiere.model.I_AD_PInstance.Table_Name)
.getPO(getAD_PInstance_ID(), get_TrxName()); }
/** Set Process Instance.
@param AD_PInstance_ID
Instance of the process
*/
public void setAD_PInstance_ID (int AD_PInstance_ID)
{
if (AD_PInstance_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_PInstance_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_PInstance_ID, Integer.valueOf(AD_PInstance_ID));
}
/** Get Process Instance.
@return Instance of the process
*/
public int getAD_PInstance_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_PInstance_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_AcctSchema getC_AcctSchema() throws RuntimeException
{
return (org.compiere.model.I_C_AcctSchema)MTable.get(getCtx(), org.compiere.model.I_C_AcctSchema.Table_Name)
.getPO(getC_AcctSchema_ID(), get_TrxName()); }
/** Set Accounting Schema.
@param C_AcctSchema_ID
Rules for accounting
*/
public void setC_AcctSchema_ID (int C_AcctSchema_ID)
{
if (C_AcctSchema_ID < 1)
set_Value (COLUMNNAME_C_AcctSchema_ID, null);
else
set_Value (COLUMNNAME_C_AcctSchema_ID, Integer.valueOf(C_AcctSchema_ID));
}
/** Get Accounting Schema.
@return Rules for accounting
*/
public int getC_AcctSchema_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_AcctSchema_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException
{
return (org.compiere.model.I_C_Activity)MTable.get(getCtx(), org.compiere.model.I_C_Activity.Table_Name)
.getPO(getC_Activity_ID(), get_TrxName()); }
/** Set Activity.
@param C_Activity_ID
Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID)
{
if (C_Activity_ID < 1)
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();
}
/** CashFlowSource AD_Reference_ID=53387 */
public static final int CASHFLOWSOURCE_AD_Reference_ID=53387;
/** 1_Initial Balance = 1 */
public static final String CASHFLOWSOURCE_1_InitialBalance = "1";
/** 2_Plan = 2 */
public static final String CASHFLOWSOURCE_2_Plan = "2";
/** 3_Commitments (Orders) = 3 */
public static final String CASHFLOWSOURCE_3_CommitmentsOrders = "3";
/** 4_Actual Debt (Invoices) = 4 */
public static final String CASHFLOWSOURCE_4_ActualDebtInvoices = "4";
/** Set Cash Flow Source.
@param CashFlowSource Cash Flow Source */
public void setCashFlowSource (String CashFlowSource)
{
set_Value (COLUMNNAME_CashFlowSource, CashFlowSource);
}
/** Get Cash Flow Source.
@return Cash Flow Source */
public String getCashFlowSource ()
{
return (String)get_Value(COLUMNNAME_CashFlowSource);
}
/** CashFlowType AD_Reference_ID=53385 */
public static final int CASHFLOWTYPE_AD_Reference_ID=53385;
/** Financing = F */
public static final String CASHFLOWTYPE_Financing = "F";
/** Investment = I */
public static final String CASHFLOWTYPE_Investment = "I";
/** Operational = O */
public static final String CASHFLOWTYPE_Operational = "O";
/** Set Cash Flow Type.
@param CashFlowType Cash Flow Type */
public void setCashFlowType (String CashFlowType)
{
set_Value (COLUMNNAME_CashFlowType, CashFlowType);
}
/** Get Cash Flow Type.
@return Cash Flow Type */
public String getCashFlowType ()
{
return (String)get_Value(COLUMNNAME_CashFlowType);
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
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 org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException
{
return (org.compiere.model.I_C_Campaign)MTable.get(getCtx(), org.compiere.model.I_C_Campaign.Table_Name)
.getPO(getC_Campaign_ID(), get_TrxName()); }
/** Set Campaign.
@param C_Campaign_ID
Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID)
{
if (C_Campaign_ID < 1)
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();
}
public org.compiere.model.I_C_CashPlanLine getC_CashPlanLine() throws RuntimeException
{
return (org.compiere.model.I_C_CashPlanLine)MTable.get(getCtx(), org.compiere.model.I_C_CashPlanLine.Table_Name)
.getPO(getC_CashPlanLine_ID(), get_TrxName()); }
/** Set Cash Plan Line.
@param C_CashPlanLine_ID Cash Plan Line */
public void setC_CashPlanLine_ID (int C_CashPlanLine_ID)
{
if (C_CashPlanLine_ID < 1)
set_Value (COLUMNNAME_C_CashPlanLine_ID, null);
else
set_Value (COLUMNNAME_C_CashPlanLine_ID, Integer.valueOf(C_CashPlanLine_ID));
}
/** Get Cash Plan Line.
@return Cash Plan Line */
public int getC_CashPlanLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CashPlanLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Charge getC_Charge() throws RuntimeException
{
return (org.compiere.model.I_C_Charge)MTable.get(getCtx(), org.compiere.model.I_C_Charge.Table_Name)
.getPO(getC_Charge_ID(), get_TrxName()); }
/** Set Charge.
@param C_Charge_ID
Additional document charges
*/
public void setC_Charge_ID (int C_Charge_ID)
{
if (C_Charge_ID < 1)
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 org.compiere.model.I_C_ElementValue getC_ElementValue() throws RuntimeException
{
return (org.compiere.model.I_C_ElementValue)MTable.get(getCtx(), org.compiere.model.I_C_ElementValue.Table_Name)
.getPO(getC_ElementValue_ID(), get_TrxName()); }
/** Set Account Element.
@param C_ElementValue_ID
Account Element
*/
public void setC_ElementValue_ID (int C_ElementValue_ID)
{
if (C_ElementValue_ID < 1)
set_Value (COLUMNNAME_C_ElementValue_ID, null);
else
set_Value (COLUMNNAME_C_ElementValue_ID, Integer.valueOf(C_ElementValue_ID));
}
/** Get Account Element.
@return Account Element
*/
public int getC_ElementValue_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_ElementValue_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException
{
return (org.compiere.model.I_C_Invoice)MTable.get(getCtx(), org.compiere.model.I_C_Invoice.Table_Name)
.getPO(getC_Invoice_ID(), get_TrxName()); }
/** Set Invoice.
@param C_Invoice_ID
Invoice Identifier
*/
public void setC_Invoice_ID (int C_Invoice_ID)
{
if (C_Invoice_ID < 1)
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();
}
public org.compiere.model.I_C_Order getC_Order() throws RuntimeException
{
return (org.compiere.model.I_C_Order)MTable.get(getCtx(), org.compiere.model.I_C_Order.Table_Name)
.getPO(getC_Order_ID(), get_TrxName()); }
/** Set Order.
@param C_Order_ID
Order
*/
public void setC_Order_ID (int C_Order_ID)
{
if (C_Order_ID < 1)
set_Value (COLUMNNAME_C_Order_ID, null);
else
set_Value (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 org.compiere.model.I_C_Project getC_Project() throws RuntimeException
{
return (org.compiere.model.I_C_Project)MTable.get(getCtx(), org.compiere.model.I_C_Project.Table_Name)
.getPO(getC_Project_ID(), get_TrxName()); }
/** Set Project.
@param C_Project_ID
Financial Project
*/
public void setC_Project_ID (int C_Project_ID)
{
if (C_Project_ID < 1)
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 Date To.
@param DateTo
End date of a date range
*/
public void setDateTo (Timestamp DateTo)
{
set_Value (COLUMNNAME_DateTo, DateTo);
}
/** Get Date To.
@return End date of a date range
*/
public Timestamp getDateTo ()
{
return (Timestamp)get_Value(COLUMNNAME_DateTo);
}
/** Set Transaction Date.
@param DateTrx
Transaction Date
*/
public void setDateTrx (Timestamp DateTrx)
{
set_Value (COLUMNNAME_DateTrx, DateTrx);
}
/** Get Transaction Date.
@return Transaction Date
*/
public Timestamp getDateTrx ()
{
return (Timestamp)get_Value(COLUMNNAME_DateTrx);
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Sales Transaction.
@param IsSOTrx
This is a Sales Transaction
*/
public void setIsSOTrx (boolean IsSOTrx)
{
set_Value (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 Line Total.
@param LineTotalAmt
Total line amount incl. Tax
*/
public void setLineTotalAmt (BigDecimal LineTotalAmt)
{
set_Value (COLUMNNAME_LineTotalAmt, LineTotalAmt);
}
/** Get Line Total.
@return Total line amount incl. Tax
*/
public BigDecimal getLineTotalAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_LineTotalAmt);
if (bd == null)
return Env.ZERO;
return bd;
}
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException
{
return (org.compiere.model.I_M_Product)MTable.get(getCtx(), org.compiere.model.I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Set Probability.
@param Probability Probability */
public void setProbability (BigDecimal Probability)
{
set_Value (COLUMNNAME_Probability, Probability);
}
/** Get Probability.
@return Probability */
public BigDecimal getProbability ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Probability);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set T_CashFlow_ID.
@param T_CashFlow_ID T_CashFlow_ID */
public void setT_CashFlow_ID (int T_CashFlow_ID)
{
if (T_CashFlow_ID < 1)
set_ValueNoCheck (COLUMNNAME_T_CashFlow_ID, null);
else
set_ValueNoCheck (COLUMNNAME_T_CashFlow_ID, Integer.valueOf(T_CashFlow_ID));
}
/** Get T_CashFlow_ID.
@return T_CashFlow_ID */
public int getT_CashFlow_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_T_CashFlow_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}

View File

@ -0,0 +1,429 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* 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.globalqss.process;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.logging.Level;
import org.compiere.model.MAcctSchemaElement;
import org.compiere.model.MCurrency;
import org.compiere.model.MFactAcct;
import org.compiere.model.MInvoice;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderPaySchedule;
import org.compiere.model.X_T_CashFlow;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.report.MReportTree;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.DB;
import org.compiere.util.Env;
/**
* Cash Flow Report Generator - fill table T_CashFlow
*
* @author Carlos Ruiz - globalqss - Quality Systems & Solutions - http://globalqss.com
* @version $Id: CashFlow
*/
public class CashFlow extends SvrProcess {
private Timestamp p_dateFrom;
private Timestamp p_dateTo;
private int p_C_AcctSchema_ID;
private int p_C_ElementValue_ID;
/**
* 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("DateTo"))
p_dateTo = (Timestamp) para[i].getParameter();
else if (name.equals("C_AcctSchema_ID"))
p_C_AcctSchema_ID = para[i].getParameterAsInt();
else if (name.equals("C_ElementValue_ID"))
p_C_ElementValue_ID = para[i].getParameterAsInt();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
} // prepare
/**
* Process
* @return message
* @throws Exception
*/
protected String doIt() throws Exception {
p_dateFrom = new Timestamp(System.currentTimeMillis());
p_dateFrom.setHours(0);
p_dateFrom.setMinutes(0);
p_dateFrom.setSeconds(0);
p_dateFrom.setNanos(0);
log.info("Calculating initial balance");
/* initial balance */
StringBuffer sqlIni = new StringBuffer ("SELECT SUM(acctBalance(Account_ID,AmtAcctDr,AmtAcctCr)) FROM Fact_Acct WHERE DateAcct<=");
sqlIni.append(DB.TO_DATE(p_dateFrom)).append(" AND PostingType='").append(MFactAcct.POSTINGTYPE_Actual).append("' AND ");
// initial balance - the balance of selected account on selected schema on default hierarchy
String whereClause = MReportTree.getWhereClause(getCtx(), 0, MAcctSchemaElement.ELEMENTTYPE_Account, p_C_ElementValue_ID);
sqlIni.append(whereClause);
BigDecimal initialBalance = DB.getSQLValueBD(get_TrxName(), sqlIni.toString(), new Object[] {});
X_T_CashFlow cfini = new X_T_CashFlow(getCtx(), 0, get_TrxName());
cfini.setAD_Org_ID(0);
cfini.setAD_PInstance_ID(getAD_PInstance_ID());
cfini.setCashFlowSource(X_T_CashFlow.CASHFLOWSOURCE_1_InitialBalance);
cfini.setCashFlowType(X_T_CashFlow.CASHFLOWTYPE_Operational);
cfini.setDateTrx(p_dateFrom);
cfini.setIsActive(true);
cfini.setIsSOTrx(true);
cfini.setLineTotalAmt(initialBalance);
cfini.setProbability(Env.ONEHUNDRED);
cfini.setDateTo(p_dateTo);
cfini.setC_AcctSchema_ID(p_C_AcctSchema_ID);
cfini.setC_ElementValue_ID(p_C_ElementValue_ID);
if (!cfini.save())
throw new AdempiereSystemError("Error saving cash flow ini");
log.info("Initial balance calculated = " + initialBalance);
/* plan records */
String sqlPlan = "SELECT cpl.AD_Org_ID, " +
"COALESCE(cpl.C_Activity_ID, cp.C_Activity_ID) AS C_Activity_ID, " +
"cp.CashFlowType, " +
"COALESCE(cpl.C_BPartner_ID, cp.C_BPartner_ID) AS C_BPartner_ID, " +
"COALESCE(cpl.C_Campaign_ID, cp.C_Campaign_ID) AS C_Campaign_ID, " +
"cpl.C_Charge_ID, " +
"COALESCE(cpl.C_Project_ID, cp.C_Project_ID) AS C_Project_ID, " +
"cpl.DateTrx, " +
"cpl.Description, " +
"cp.IsSOTrx, " +
"cpl.LineTotalAmt, " +
"cpl.M_Product_ID, " +
"cpl.Name, " +
"cpl.Probability, " +
"cpl.C_CashPlanLine_ID, " +
"cp.C_CashPlan_ID " +
"FROM C_CashPlanLine cpl " +
"JOIN C_CashPlan cp ON (cp.C_CashPlan_ID=cpl.C_CashPlan_ID) " +
"WHERE cp.AD_Client_ID=? AND cp.IsActive='Y' AND cpl.IsActive='Y' AND cpl.DateTrx BETWEEN ? AND ?";
PreparedStatement pstmtPlan = null;
ResultSet rsPlan = null;
try
{
pstmtPlan = DB.prepareStatement(sqlPlan, get_TrxName());
pstmtPlan.setInt(1, getAD_Client_ID());
pstmtPlan.setTimestamp(2, p_dateFrom);
pstmtPlan.setTimestamp(3, p_dateTo);
rsPlan = pstmtPlan.executeQuery();
int noPlan = 0;
while (rsPlan.next())
{
noPlan++;
boolean issotrx = "Y".equals(rsPlan.getString("IsSOTrx"));
BigDecimal total = rsPlan.getBigDecimal("LineTotalAmt");
if (!issotrx)
total = total.negate();
X_T_CashFlow cfplan = new X_T_CashFlow(getCtx(), 0, get_TrxName());
cfplan.setAD_Org_ID(rsPlan.getInt("AD_Org_ID"));
cfplan.setAD_PInstance_ID(getAD_PInstance_ID());
cfplan.setC_Activity_ID(rsPlan.getInt("C_Activity_ID"));
cfplan.setCashFlowSource(X_T_CashFlow.CASHFLOWSOURCE_2_Plan);
cfplan.setCashFlowType(rsPlan.getString("CashFlowType"));
cfplan.setC_BPartner_ID(rsPlan.getInt("C_BPartner_ID"));
cfplan.setC_Campaign_ID(rsPlan.getInt("C_Campaign_ID"));
cfplan.setC_Charge_ID(rsPlan.getInt("C_Charge_ID"));
cfplan.setC_Project_ID(rsPlan.getInt("C_Project_ID"));
cfplan.setDateTrx(rsPlan.getTimestamp("DateTrx"));
cfplan.setDescription(rsPlan.getString("Description"));
cfplan.setIsActive(true);
cfplan.setIsSOTrx(issotrx);
cfplan.setLineTotalAmt(total);
cfplan.setM_Product_ID(rsPlan.getInt("M_Product_ID"));
cfplan.setName(rsPlan.getString("Name"));
cfplan.setProbability(rsPlan.getBigDecimal("Probability"));
cfplan.setDateTo(p_dateTo);
cfplan.setC_AcctSchema_ID(p_C_AcctSchema_ID);
cfplan.setC_ElementValue_ID(p_C_ElementValue_ID);
cfplan.setC_CashPlanLine_ID(rsPlan.getInt("C_CashPlanLine_ID"));
if (!cfplan.save())
throw new AdempiereSystemError("Error saving cash flow plan");
}
log.info(noPlan + " plan inserted");
}
catch (Exception e)
{
log.log(Level.SEVERE, sqlPlan, e);
}
finally
{
DB.close(rsPlan, pstmtPlan);
rsPlan = null; pstmtPlan = null;
}
/* commitment records */
String sqlOpenOrders = "SELECT o.C_Order_ID, o.IsPayScheduleValid, " +
"SUM((ol.QtyOrdered-ol.QtyInvoiced)*ol.PriceActual)/o.TotalLines as Pending " +
"FROM C_Order o JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) " +
"WHERE o.AD_Client_ID=? AND o.TotalLines != 0 AND o.DocStatus IN ('CO') AND ol.QtyInvoiced<ol.QtyOrdered " +
"GROUP BY o.C_Order_ID, o.IsPayScheduleValid, o.TotalLines";
PreparedStatement pstmtOpenOrders = null;
ResultSet rsOpenOrders = null;
try
{
pstmtOpenOrders = DB.prepareStatement(sqlOpenOrders, get_TrxName());
pstmtOpenOrders.setInt(1, getAD_Client_ID());
rsOpenOrders = pstmtOpenOrders.executeQuery();
int noOrders = 0;
int noOrdIns = 0;
int noOrdSchIns = 0;
while (rsOpenOrders.next())
{
noOrders++;
if ((noOrders % 100) == 0)
log.info(noOrders + " orders processed");
int order_id = rsOpenOrders.getInt("C_Order_ID");
boolean isPaySchedule = ("Y".equals(rsOpenOrders.getString("IsPayScheduleValid")));
BigDecimal pending = rsOpenOrders.getBigDecimal("Pending");
MOrder order = new MOrder(getCtx(), order_id, get_TrxName());
MCurrency curr = MCurrency.get(getCtx(), order.getC_Currency_ID());
BigDecimal open = order.getGrandTotal().multiply(pending);
// subtract payments done directly to order still not allocated to an invoice
// TODO: review if is possible to check just the balance for partially allocated payments
// TODO: currency convert of payment if different currency from order
BigDecimal paid = DB.getSQLValueBD(get_TrxName(),
"SELECT SUM(CASE WHEN IsReceipt='Y' THEN PayAmt ELSE -PayAmt END) FROM C_Payment WHERE DocStatus IN ('CO','CL') AND C_Order_ID=? AND C_Invoice_ID IS NULL AND IsAllocated='N'",
order_id);
if (paid != null) {
if (!order.isSOTrx())
paid = paid.negate();
open = open.subtract(paid);
}
if (open.scale() > curr.getStdPrecision())
open.setScale(curr.getStdPrecision(), BigDecimal.ROUND_HALF_UP);
BigDecimal invoiced = order.getGrandTotal().subtract(open);
if (isPaySchedule) {
MOrderPaySchedule[] schedule = MOrderPaySchedule.getOrderPaySchedule(getCtx(), order_id, 0, get_TrxName());
BigDecimal accum = Env.ZERO;
for (MOrderPaySchedule ops : schedule) {
accum = accum.add(ops.getDueAmt());
if (invoiced.compareTo(accum) > 0)
continue;
if (ops.getDueDate().compareTo(p_dateTo) <=0) {
BigDecimal opensch;
if (accum.subtract(invoiced).compareTo(ops.getDueAmt()) > 0)
opensch = ops.getDueAmt();
else
opensch = accum.subtract(invoiced);
if (!order.isSOTrx())
opensch = opensch.negate();
noOrdSchIns++;
X_T_CashFlow cforderps = new X_T_CashFlow(getCtx(), 0, get_TrxName());
cforderps.setAD_Org_ID(order.getAD_Org_ID());
cforderps.setAD_PInstance_ID(getAD_PInstance_ID());
cforderps.setC_Activity_ID(order.getC_Activity_ID());
cforderps.setCashFlowSource(X_T_CashFlow.CASHFLOWSOURCE_3_CommitmentsOrders);
// cforder.setCashFlowType(X_T_CashFlow.CASHFLOWTYPE_Operational);
cforderps.setC_BPartner_ID(order.getC_BPartner_ID());
cforderps.setC_Campaign_ID(order.getC_Campaign_ID());
cforderps.setC_Project_ID(order.getC_Project_ID());
cforderps.setDateTrx(ops.getDueDate());
cforderps.setDescription(order.getDescription());
cforderps.setIsActive(true);
cforderps.setIsSOTrx(order.isSOTrx());
cforderps.setLineTotalAmt(opensch);
cforderps.setProbability(Env.ONEHUNDRED);
cforderps.setDateTo(p_dateTo);
cforderps.setC_AcctSchema_ID(p_C_AcctSchema_ID);
cforderps.setC_ElementValue_ID(p_C_ElementValue_ID);
cforderps.setC_CashPlanLine_ID(order.getC_CashPlanLine_ID());
cforderps.setC_Order_ID(order_id);
if (!cforderps.save())
throw new AdempiereSystemError("Error saving cash flow order pay schedule");
}
}
} else {
Timestamp dueDate = DB.getSQLValueTS(get_TrxName(), "SELECT paymentTermDueDate(?, ?) FROM Dual",
new Object[] {order.getC_PaymentTerm_ID(), order.getDateOrdered()});
if (dueDate.compareTo(p_dateTo) <=0) {
if (!order.isSOTrx())
open = open.negate();
noOrdIns++;
X_T_CashFlow cforder = new X_T_CashFlow(getCtx(), 0, get_TrxName());
cforder.setAD_Org_ID(order.getAD_Org_ID());
cforder.setAD_PInstance_ID(getAD_PInstance_ID());
cforder.setC_Activity_ID(order.getC_Activity_ID());
cforder.setCashFlowSource(X_T_CashFlow.CASHFLOWSOURCE_3_CommitmentsOrders);
// cforder.setCashFlowType(X_T_CashFlow.CASHFLOWTYPE_Operational);
cforder.setC_BPartner_ID(order.getC_BPartner_ID());
cforder.setC_Campaign_ID(order.getC_Campaign_ID());
cforder.setC_Project_ID(order.getC_Project_ID());
cforder.setDateTrx(dueDate);
cforder.setDescription(order.getDescription());
cforder.setIsActive(true);
cforder.setIsSOTrx(order.isSOTrx());
cforder.setLineTotalAmt(open);
cforder.setProbability(Env.ONEHUNDRED);
cforder.setDateTo(p_dateTo);
cforder.setC_AcctSchema_ID(p_C_AcctSchema_ID);
cforder.setC_ElementValue_ID(p_C_ElementValue_ID);
cforder.setC_CashPlanLine_ID(order.getC_CashPlanLine_ID());
cforder.setC_Order_ID(order_id);
if (!cforder.save())
throw new AdempiereSystemError("Error saving cash flow order");
}
}
}
log.info(noOrders + " orders processed, " + noOrdIns + " orders inserted, " + noOrdSchIns + " schedule inserted");
}
catch (Exception e)
{
log.log(Level.SEVERE, sqlOpenOrders, e);
}
finally
{
DB.close(rsOpenOrders, pstmtOpenOrders);
rsOpenOrders = null; pstmtOpenOrders = null;
}
/* actual records */
String sqlActual = "SELECT oi.AD_Org_ID, oi.C_Invoice_ID, oi.C_BPartner_ID, oi.IsSOTrx, oi.DueDate, oi.OpenAmt, oi.C_Campaign_ID, oi.C_Project_ID, oi.C_Activity_ID " +
"FROM RV_OpenItem oi " +
"WHERE oi.AD_Client_ID=? AND oi.DueDate <= ?";
PreparedStatement pstmtActual = null;
ResultSet rsActual = null;
try
{
pstmtActual = DB.prepareStatement(sqlActual, get_TrxName());
pstmtActual.setInt(1, getAD_Client_ID());
pstmtActual.setTimestamp(2, p_dateTo);
rsActual = pstmtActual.executeQuery();
int noInv = 0;
while (rsActual.next())
{
boolean issotrx = "Y".equals(rsActual.getString("IsSOTrx"));
BigDecimal openamt = rsActual.getBigDecimal("OpenAmt");
if (!issotrx)
openamt = openamt.negate();
MInvoice invoice = new MInvoice(getCtx(), rsActual.getInt("C_Invoice_ID"), get_TrxName());
noInv++;
X_T_CashFlow cfactual = new X_T_CashFlow(getCtx(), 0, get_TrxName());
cfactual.setAD_Org_ID(rsActual.getInt("AD_Org_ID"));
cfactual.setAD_PInstance_ID(getAD_PInstance_ID());
cfactual.setC_Activity_ID(rsActual.getInt("C_Activity_ID"));
cfactual.setCashFlowSource(X_T_CashFlow.CASHFLOWSOURCE_4_ActualDebtInvoices);
// cfactual.setCashFlowType(X_T_CashFlow.CASHFLOWTYPE_Operational);
cfactual.setC_BPartner_ID(rsActual.getInt("C_BPartner_ID"));
cfactual.setC_Campaign_ID(rsActual.getInt("C_Campaign_ID"));
cfactual.setC_Project_ID(rsActual.getInt("C_Project_ID"));
cfactual.setDateTrx(rsActual.getTimestamp("DueDate"));
cfactual.setDescription(invoice.getDescription());
cfactual.setIsActive(true);
cfactual.setIsSOTrx(issotrx);
cfactual.setLineTotalAmt(openamt);
cfactual.setProbability(Env.ONEHUNDRED);
cfactual.setDateTo(p_dateTo);
cfactual.setC_AcctSchema_ID(p_C_AcctSchema_ID);
cfactual.setC_ElementValue_ID(p_C_ElementValue_ID);
cfactual.setC_CashPlanLine_ID(invoice.getC_CashPlanLine_ID());
cfactual.setC_Invoice_ID(rsActual.getInt("C_Invoice_ID"));
if (!cfactual.save())
throw new AdempiereSystemError("Error saving cash flow actual");
}
log.info(noInv + " invoices inserted");
}
catch (Exception e)
{
log.log(Level.SEVERE, sqlActual, e);
}
finally
{
DB.close(rsActual, pstmtActual);
rsActual = null; pstmtActual = null;
}
/* subtract from plan lines the related orders */
String sqlupdord = "UPDATE T_CashFlow " +
"SET LineTotalAmt = LineTotalAmt - " +
"(SELECT COALESCE(SUM(LineTotalAmt),0) " +
"FROM T_CashFlow cf " +
"WHERE cf.AD_PInstance_ID = T_CashFlow.AD_Pinstance_ID " +
"AND cf.C_CashPlanLine_ID=T_CashFlow.C_CashPlanLine_ID AND " +
"CashFlowSource = ? /* Orders */) " +
"WHERE AD_PInstance_ID = ? " +
"AND CashFlowSource = ? /* Plan */ " +
"AND EXISTS (SELECT 1 FROM T_CashFlow cf " +
"WHERE cf.AD_PInstance_ID = T_CashFlow.AD_PInstance_ID " +
"AND cf.C_CashPlanLine_ID=T_CashFlow.C_CashPlanLine_ID " +
"AND CashFlowSource = ? /* Orders */)";
int noupdord = DB.executeUpdate(sqlupdord,
new Object[] {X_T_CashFlow.CASHFLOWSOURCE_3_CommitmentsOrders,
getAD_PInstance_ID(),
X_T_CashFlow.CASHFLOWSOURCE_2_Plan,
X_T_CashFlow.CASHFLOWSOURCE_3_CommitmentsOrders},
false, get_TrxName());
log.info(noupdord + " plans subtracted from orders");
/* subtract from plan lines the related invoices */
String sqlupdinv = "UPDATE T_CashFlow " +
"SET LineTotalAmt = LineTotalAmt - " +
"(SELECT COALESCE(SUM(LineTotalAmt),0) " +
"FROM T_CashFlow cf " +
"WHERE cf.AD_PInstance_ID = T_CashFlow.AD_Pinstance_ID " +
"AND cf.C_CashPlanLine_ID=T_CashFlow.C_CashPlanLine_ID AND " +
"CashFlowSource = ? /* Invoices */) " +
"WHERE AD_PInstance_ID = ? " +
"AND CashFlowSource = ? /* Plan */ " +
"AND EXISTS (SELECT 1 FROM T_CashFlow cf " +
"WHERE cf.AD_PInstance_ID = T_CashFlow.AD_PInstance_ID " +
"AND cf.C_CashPlanLine_ID=T_CashFlow.C_CashPlanLine_ID " +
"AND CashFlowSource = ? /* Invoices */)";
int noupdinv = DB.executeUpdate(sqlupdinv,
new Object[] {X_T_CashFlow.CASHFLOWSOURCE_4_ActualDebtInvoices,
getAD_PInstance_ID(),
X_T_CashFlow.CASHFLOWSOURCE_2_Plan,
X_T_CashFlow.CASHFLOWSOURCE_4_ActualDebtInvoices},
false, get_TrxName());
log.info(noupdinv + " plans subtracted from invoices");
/* delete overplanned records */
String sqldeloverplanned = "DELETE FROM T_CashFlow " +
"WHERE AD_PInstance_ID = ? " +
"AND CashFlowSource = ? /* Plan */ " +
"AND ((IsSOTrx='Y' AND LineTotalAmt<=0) OR (IsSOTrx='N' AND LineTotalAmt>=0))";
int nodelplan = DB.executeUpdate(sqldeloverplanned,
new Object[] {getAD_PInstance_ID(),
X_T_CashFlow.CASHFLOWSOURCE_2_Plan},
false, get_TrxName());
log.info(nodelplan + " overplanned plans deleted");
return "OK";
} // doIt
} // CashFlow

View File

@ -0,0 +1,80 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* 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.globalqss.process;
import java.util.logging.Level;
import org.compiere.model.MCashPlan;
import org.compiere.model.MCashPlanLine;
import org.compiere.model.PO;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
public class CopyFromCashPlan extends SvrProcess {
private int p_C_CashPlanSource_ID = 0;
private int p_C_CashPlanTarget_ID = 0;
/** Logger */
CLogger log = CLogger.getCLogger (getClass());
protected void prepare()
{
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++) {
String name = para[i].getParameterName();
if (name.equals("C_CashPlan_ID"))
p_C_CashPlanSource_ID = para[i].getParameterAsInt();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
p_C_CashPlanTarget_ID = getRecord_ID();
}
protected String doIt() throws Exception
{
MCashPlan cptarget = new MCashPlan(getCtx(), p_C_CashPlanTarget_ID, get_TrxName());
if (cptarget.get_ID() <= 0)
throw new IllegalArgumentException ("Target Cash Plan does not exist");
MCashPlan cpsource = new MCashPlan(getCtx(), p_C_CashPlanSource_ID, get_TrxName());
if (cptarget.get_ID() <= 0)
throw new IllegalArgumentException ("Source Cash Plan does not exist");
int insertNo = 0;
int lineNo = DB.getSQLValue(get_TrxName(), "SELECT NVL(MAX(Line),0)+10 FROM C_CashPlanLine WHERE C_CashPlan_ID=?", p_C_CashPlanTarget_ID);
for (MCashPlanLine cpls : cpsource.getLines()) {
MCashPlanLine cplt = new MCashPlanLine(getCtx(), 0, get_TrxName());
PO.copyValues(cpls, cplt);
cplt.setAD_Org_ID(cptarget.getAD_Org_ID());
cplt.setLine(lineNo);
cplt.setC_CashPlan_ID(cptarget.getC_CashPlan_ID());
lineNo += 10;
if (!cplt.save())
throw new AdempiereSystemError("Error saving cash plan line");
insertNo++;
}
return "@Inserted@=" + insertNo;
}
} // CopyFromCashPlan

View File

@ -0,0 +1,186 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* 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.globalqss.process;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.logging.Level;
import org.compiere.model.MCashPlan;
import org.compiere.model.MCashPlanLine;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
public class GeneratePeriodicCashPlanLines extends SvrProcess {
private int p_C_Project_ID = 0;
private int p_C_Activity_ID = 0;
private String p_Name = null;
private int p_M_Product_ID = 0;
private int p_C_Charge_ID = 0;
private int p_C_BPartner_ID = 0;
private String p_Periodicity = null;
private int p_Repetitions = 0;
private BigDecimal p_Amount = null;
private Timestamp p_DateFrom = null;
private BigDecimal p_Probability = null;
private int p_C_CashPlan_ID = 0;
/** Logger */
CLogger log = CLogger.getCLogger (getClass());
protected void prepare()
{
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++) {
String name = para[i].getParameterName();
if (name.equals("C_Project_ID"))
p_C_Project_ID = para[i].getParameterAsInt();
else if (name.equals("C_Activity_ID"))
p_C_Activity_ID = para[i].getParameterAsInt();
else if (name.equals("Name"))
p_Name = (String) para[i].getParameter();
else if (name.equals("M_Product_ID"))
p_M_Product_ID = para[i].getParameterAsInt();
else if (name.equals("C_Charge_ID"))
p_C_Charge_ID = para[i].getParameterAsInt();
else if (name.equals("C_BPartner_ID"))
p_C_BPartner_ID = para[i].getParameterAsInt();
else if (name.equals("Periodicity"))
p_Periodicity = (String) para[i].getParameter();
else if (name.equals("Repetitions"))
p_Repetitions = para[i].getParameterAsInt();
else if (name.equals("Amount"))
p_Amount = (BigDecimal) para[i].getParameter();
else if (name.equals("DateFrom"))
p_DateFrom = (Timestamp) para[i].getParameter();
else if (name.equals("Probability"))
p_Probability = (BigDecimal) para[i].getParameter();
else
log.log(Level.SEVERE, "Unknown Parameter: " + name);
}
p_C_CashPlan_ID = getRecord_ID();
}
protected String doIt() throws Exception
{
boolean usename = (p_Name != null && p_Name.trim().length() > 0);
boolean useproduct = (p_M_Product_ID > 0);
boolean usecharge = (p_C_Charge_ID > 0);
if (!usename && !useproduct && !usecharge)
throw new IllegalArgumentException ("Required at least one of the fields Name, Product, Charge");
if (useproduct && usecharge)
throw new IllegalArgumentException ("Product and charge are exclusive, you can use just one of them");
if (p_Amount.signum() == 0)
throw new IllegalArgumentException ("Amount must be different than zero");
if (p_Repetitions <= 0)
return "@Inserted@=0";
if (p_Probability == null)
p_Probability = Env.ONEHUNDRED;
/* Periodicity */
int days = 0;
int months = 0;
int years = 0;
if ("001_D".equals(p_Periodicity)) // 001_D - Daily
days = 1;
else if ("007_W".equals(p_Periodicity)) // 007_W - Weekly
days = 7;
else if ("014_F".equals(p_Periodicity)) // 014_F - Fortnightly
days = 14;
else if ("015_B".equals(p_Periodicity)) // 015_B - Biweekly
days = 15;
else if ("030_M".equals(p_Periodicity)) // 030_M - Monthly
months = 1;
else if ("060_2".equals(p_Periodicity)) // 060_2 - Bimonthly
months = 2;
else if ("090_Q".equals(p_Periodicity)) // 090_Q - Quarterly
months = 3;
else if ("180_S".equals(p_Periodicity)) // 180_S - Semiannual
months = 6;
else if ("365_Y".equals(p_Periodicity)) // 365_Y - Yearly
years = 1;
else
throw new IllegalArgumentException ("Wrong periodicity " + p_Periodicity);
MCashPlan cp = new MCashPlan(getCtx(), p_C_CashPlan_ID, get_TrxName());
if (cp.get_ID() <= 0)
throw new IllegalArgumentException ("Cash Plan does not exist");
int insertNo = 0;
int lineNo = DB.getSQLValue(get_TrxName(), "SELECT NVL(MAX(Line),0)+10 FROM C_CashPlanLine WHERE C_CashPlan_ID=?", p_C_CashPlan_ID);
for (int cnt = 0; cnt < p_Repetitions; cnt++) {
MCashPlanLine cpl = new MCashPlanLine(getCtx(), 0, get_TrxName());
cpl.setC_CashPlan_ID(cp.getC_CashPlan_ID());
cpl.setAD_Org_ID(cp.getAD_Org_ID());
cpl.setProcessed(false);
cpl.setIsActive(true);
cpl.setQtyEntered(Env.ONE);
cpl.setAD_OrgTrx_ID(cp.getAD_OrgTrx_ID());
cpl.setC_Campaign_ID(cp.getC_Campaign_ID());
cpl.setUser1_ID(cp.getUser1_ID());
cpl.setUser2_ID(cp.getUser2_ID());
// cpl.setC_ProjectPhase_ID(cp.getC_ProjectPhase_ID());
// cpl.setC_ProjectTask_ID(cp.getC_ProjectTask_ID());
// cpl.setDescription(cp.getDescription());
cpl.setC_Activity_ID(p_C_Activity_ID);
cpl.setC_Project_ID(p_C_Project_ID);
cpl.setC_Charge_ID(p_C_Charge_ID);
cpl.setM_Product_ID(p_M_Product_ID);
cpl.setName(p_Name);
cpl.setLineTotalAmt(p_Amount);
cpl.setC_BPartner_ID(p_C_BPartner_ID);
cpl.setProbability(p_Probability);
cpl.setLine(lineNo);
// calculate new date from
Calendar cal = Calendar.getInstance();
cal.setTime(p_DateFrom);
if (days == 15) {
// special case Biweekly
// add months
int bwmonths = cnt / 2; // integer division -> 1/2=0 2/2=1 3/2=1
cal.add(Calendar.MONTH, bwmonths);
// if odd add 15 additional days
if ((cnt % 2) != 0) {
cal.add(Calendar.DAY_OF_MONTH, days);
}
} else {
cal.add(Calendar.DAY_OF_MONTH, days*cnt);
cal.add(Calendar.MONTH, months*cnt);
cal.add(Calendar.YEAR, years*cnt);
}
Timestamp datetrx = new Timestamp(cal.getTimeInMillis());
cpl.setDateTrx(datetrx);
lineNo += 10;
if (!cpl.save())
throw new AdempiereSystemError("Error saving cash plan line");
insertNo++;
}
return "@Inserted@=" + insertNo;
}
} // GeneratePeriodicCashPlanLines