FR [ 1696228 ] ModelValidator for BeforePost and AfterPost
Big thanks to Heng Sin for helping me to solve this
This commit is contained in:
parent
cd7b94b876
commit
ca3ebb02b7
|
@ -35,7 +35,7 @@ public final class Fact
|
|||
* @param acctSchema Account Schema to create accounts
|
||||
* @param defaultPostingType the default Posting type (actual,..) for this posting
|
||||
*/
|
||||
public Fact (Doc document, MAcctSchema acctSchema, String defaultPostingType)
|
||||
public Fact (IDoc document, MAcctSchema acctSchema, String defaultPostingType)
|
||||
{
|
||||
m_doc = document;
|
||||
m_acctSchema = acctSchema;
|
||||
|
@ -49,7 +49,7 @@ public final class Fact
|
|||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
/** Document */
|
||||
private Doc m_doc = null;
|
||||
private IDoc m_doc = null;
|
||||
/** Accounting Schema */
|
||||
private MAcctSchema m_acctSchema = null;
|
||||
/** Transaction */
|
||||
|
@ -95,7 +95,7 @@ public final class Fact
|
|||
* @param creditAmt credit amount, can be null
|
||||
* @return Fact Line
|
||||
*/
|
||||
public FactLine createLine (DocLine docLine, MAccount account,
|
||||
public FactLine createLine (IDocLine docLine, MAccount account,
|
||||
int C_Currency_ID, BigDecimal debitAmt, BigDecimal creditAmt)
|
||||
{
|
||||
// log.fine("createLine - " + account + " - Dr=" + debitAmt + ", Cr=" + creditAmt);
|
||||
|
@ -161,7 +161,7 @@ public final class Fact
|
|||
* @param Amt if negative Cr else Dr
|
||||
* @return FactLine
|
||||
*/
|
||||
public FactLine createLine (DocLine docLine, MAccount accountDr, MAccount accountCr,
|
||||
public FactLine createLine (IDocLine docLine, MAccount accountDr, MAccount accountCr,
|
||||
int C_Currency_ID, BigDecimal Amt)
|
||||
{
|
||||
if (Amt.signum() < 0)
|
||||
|
@ -180,7 +180,7 @@ public final class Fact
|
|||
* @param Amt if negative Cr else Dr
|
||||
* @return FactLine
|
||||
*/
|
||||
public FactLine createLine (DocLine docLine, MAccount account,
|
||||
public FactLine createLine (IDocLine docLine, MAccount account,
|
||||
int C_Currency_ID, BigDecimal Amt)
|
||||
{
|
||||
if (Amt.signum() < 0)
|
||||
|
@ -272,15 +272,15 @@ public final class Fact
|
|||
line.setDocumentInfo(m_doc, null);
|
||||
line.setPostingType(m_postingType);
|
||||
|
||||
// Account
|
||||
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
|
||||
|
||||
// Amount
|
||||
if (diff.signum() < 0) // negative balance => DR
|
||||
line.setAmtSource(m_doc.getC_Currency_ID(), diff.abs(), Env.ZERO);
|
||||
else // positive balance => CR
|
||||
line.setAmtSource(m_doc.getC_Currency_ID(), Env.ZERO, diff);
|
||||
|
||||
// Account
|
||||
line.setAccount(m_acctSchema, m_acctSchema.getSuspenseBalancing_Acct());
|
||||
|
||||
// Convert
|
||||
line.convert();
|
||||
//
|
|
@ -66,9 +66,9 @@ public final class FactLine extends X_Fact_Acct
|
|||
/** Accounting Schema */
|
||||
private MAcctSchema m_acctSchema = null;
|
||||
/** Document Header */
|
||||
private Doc m_doc = null;
|
||||
private IDoc m_doc = null;
|
||||
/** Document Line */
|
||||
private DocLine m_docLine = null;
|
||||
private IDocLine m_docLine = null;
|
||||
|
||||
/**
|
||||
* Create Reversal (negate DR/CR) of the line
|
||||
|
@ -280,7 +280,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
* @param doc document
|
||||
* @param docLine doc line
|
||||
*/
|
||||
public void setDocumentInfo(Doc doc, DocLine docLine)
|
||||
public void setDocumentInfo(IDoc doc, IDocLine docLine)
|
||||
{
|
||||
m_doc = doc;
|
||||
m_docLine = docLine;
|
||||
|
@ -391,7 +391,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
* Get Document Line
|
||||
* @return doc line
|
||||
*/
|
||||
protected DocLine getDocLine()
|
||||
protected IDocLine getDocLine()
|
||||
{
|
||||
return m_docLine;
|
||||
} // getDocLine
|
||||
|
@ -610,7 +610,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
public boolean convert ()
|
||||
{
|
||||
// Document has no currency
|
||||
if (getC_Currency_ID() == Doc.NO_CURRENCY)
|
||||
if (getC_Currency_ID() == IDoc.NO_CURRENCY)
|
||||
setC_Currency_ID (m_acctSchema.getC_Currency_ID());
|
||||
|
||||
if (m_acctSchema.getC_Currency_ID() == getC_Currency_ID())
|
||||
|
@ -722,7 +722,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
// Prio 3 - get from doc - if not GL
|
||||
if (m_doc != null && super.getAD_Org_ID() == 0)
|
||||
{
|
||||
if (Doc.DOCTYPE_GLJournal.equals (m_doc.getDocumentType()))
|
||||
if (IDoc.DOCTYPE_GLJournal.equals (m_doc.getDocumentType()))
|
||||
{
|
||||
setAD_Org_ID (m_acct.getAD_Org_ID()); // inter-company GL
|
||||
log.finer("AD_Org_ID=" + super.getAD_Org_ID() + " (3 from Acct)");
|
||||
|
@ -736,7 +736,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
// Prio 4 - get from account - if not GL
|
||||
if (m_doc != null && super.getAD_Org_ID() == 0)
|
||||
{
|
||||
if (Doc.DOCTYPE_GLJournal.equals (m_doc.getDocumentType()))
|
||||
if (IDoc.DOCTYPE_GLJournal.equals (m_doc.getDocumentType()))
|
||||
{
|
||||
setAD_Org_ID (m_doc.getAD_Org_ID());
|
||||
log.finer("AD_Org_ID=" + super.getAD_Org_ID() + " (4 from Document)");
|
||||
|
@ -844,7 +844,7 @@ public final class FactLine extends X_Fact_Acct
|
|||
setUser2_ID (m_acct.getUser2_ID());
|
||||
|
||||
// Revenue Recognition for AR Invoices
|
||||
if (m_doc.getDocumentType().equals(Doc.DOCTYPE_ARInvoice)
|
||||
if (m_doc.getDocumentType().equals(IDoc.DOCTYPE_ARInvoice)
|
||||
&& m_docLine != null
|
||||
&& m_docLine.getC_RevenueRecognition_ID() != 0)
|
||||
{
|
|
@ -0,0 +1,500 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MDocType;
|
||||
|
||||
public interface IDoc {
|
||||
|
||||
/** AR Invoices - ARI */
|
||||
public static final String DOCTYPE_ARInvoice = MDocType.DOCBASETYPE_ARInvoice;
|
||||
/** AR Credit Memo */
|
||||
public static final String DOCTYPE_ARCredit = "ARC";
|
||||
/** AR Receipt */
|
||||
public static final String DOCTYPE_ARReceipt = "ARR";
|
||||
/** AR ProForma */
|
||||
public static final String DOCTYPE_ARProForma = "ARF";
|
||||
/** AP Invoices */
|
||||
public static final String DOCTYPE_APInvoice = "API";
|
||||
/** AP Credit Memo */
|
||||
public static final String DOCTYPE_APCredit = "APC";
|
||||
/** AP Payment */
|
||||
public static final String DOCTYPE_APPayment = "APP";
|
||||
/** CashManagement Bank Statement */
|
||||
public static final String DOCTYPE_BankStatement = "CMB";
|
||||
/** CashManagement Cash Journals */
|
||||
public static final String DOCTYPE_CashJournal = "CMC";
|
||||
/** CashManagement Allocations */
|
||||
public static final String DOCTYPE_Allocation = "CMA";
|
||||
/** Material Shipment */
|
||||
public static final String DOCTYPE_MatShipment = "MMS";
|
||||
/** Material Receipt */
|
||||
public static final String DOCTYPE_MatReceipt = "MMR";
|
||||
/** Material Inventory */
|
||||
public static final String DOCTYPE_MatInventory = "MMI";
|
||||
/** Material Movement */
|
||||
public static final String DOCTYPE_MatMovement = "MMM";
|
||||
/** Material Production */
|
||||
public static final String DOCTYPE_MatProduction = "MMP";
|
||||
/** Match Invoice */
|
||||
public static final String DOCTYPE_MatMatchInv = "MXI";
|
||||
/** Match PO */
|
||||
public static final String DOCTYPE_MatMatchPO = "MXP";
|
||||
/** GL Journal */
|
||||
public static final String DOCTYPE_GLJournal = "GLJ";
|
||||
/** Purchase Order */
|
||||
public static final String DOCTYPE_POrder = "POO";
|
||||
/** Sales Order */
|
||||
public static final String DOCTYPE_SOrder = "SOO";
|
||||
/** Project Issue */
|
||||
public static final String DOCTYPE_ProjectIssue = "PJI";
|
||||
/** Purchase Requisition */
|
||||
public static final String DOCTYPE_PurchaseRequisition = "POR";
|
||||
// Posting Status - AD_Reference_ID=234 //
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotPosted = "N";
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotBalanced = "b";
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotConvertible = "c";
|
||||
/** Document Status */
|
||||
public static final String STATUS_PeriodClosed = "p";
|
||||
/** Document Status */
|
||||
public static final String STATUS_InvalidAccount = "i";
|
||||
/** Document Status */
|
||||
public static final String STATUS_PostPrepared = "y";
|
||||
/** Document Status */
|
||||
public static final String STATUS_Posted = "Y";
|
||||
/** Document Status */
|
||||
public static final String STATUS_Error = "E";
|
||||
|
||||
/** No Currency in Document Indicator (-1) */
|
||||
public static final int NO_CURRENCY = -2;
|
||||
|
||||
/**
|
||||
* Get Table Name
|
||||
* @return table name
|
||||
*/
|
||||
public abstract String get_TableName(); // get_TableName
|
||||
|
||||
/**
|
||||
* Get Table ID
|
||||
* @return table id
|
||||
*/
|
||||
public abstract int get_Table_ID(); // get_Table_ID
|
||||
|
||||
/**
|
||||
* Get Record_ID
|
||||
* @return record id
|
||||
*/
|
||||
public abstract int get_ID(); // get_ID
|
||||
|
||||
/**
|
||||
* Post Document.
|
||||
* <pre>
|
||||
* - try to lock document (Processed='Y' (AND Processing='N' AND Posted='N'))
|
||||
* - if not ok - return false
|
||||
* - postlogic (for all Accounting Schema)
|
||||
* - create Fact lines
|
||||
* - postCommit
|
||||
* - commits Fact lines and Document & sets Processing = 'N'
|
||||
* - if error - create Note
|
||||
* </pre>
|
||||
* @param force if true ignore that locked
|
||||
* @param repost if true ignore that already posted
|
||||
* @return null if posted error otherwise
|
||||
*/
|
||||
public abstract String post(boolean force, boolean repost); // post
|
||||
|
||||
/**************************************************************************
|
||||
* Is the Source Document Balanced
|
||||
* @return true if (source) baanced
|
||||
*/
|
||||
public abstract boolean isBalanced(); // isBalanced
|
||||
|
||||
/**
|
||||
* Is Document convertible to currency and Conversion Type
|
||||
* @param acctSchema accounting schema
|
||||
* @return true, if vonvertable to accounting currency
|
||||
*/
|
||||
public abstract boolean isConvertible(MAcctSchema acctSchema); // isConvertible
|
||||
|
||||
/**
|
||||
* Calculate Period from DateAcct.
|
||||
* m_C_Period_ID is set to -1 of not open to 0 if not found
|
||||
*/
|
||||
public abstract void setPeriod(); // setC_Period_ID
|
||||
|
||||
/**
|
||||
* Get C_Period_ID
|
||||
* @return period
|
||||
*/
|
||||
public abstract int getC_Period_ID(); // getC_Period_ID
|
||||
|
||||
/**
|
||||
* Is Period Open
|
||||
* @return true if period is open
|
||||
*/
|
||||
public abstract boolean isPeriodOpen(); // isPeriodOpen
|
||||
|
||||
/** Amount Type - Invoice - Gross */
|
||||
public static final int AMTTYPE_Gross = 0;
|
||||
/** Amount Type - Invoice - Net */
|
||||
public static final int AMTTYPE_Net = 1;
|
||||
/** Amount Type - Invoice - Charge */
|
||||
public static final int AMTTYPE_Charge = 2;
|
||||
|
||||
/**
|
||||
* Get the Amount
|
||||
* (loaded in loadDocumentDetails)
|
||||
*
|
||||
* @param AmtType see AMTTYPE_*
|
||||
* @return Amount
|
||||
*/
|
||||
public abstract BigDecimal getAmount(int AmtType); // getAmount
|
||||
|
||||
/**
|
||||
* Get Amount with index 0
|
||||
* @return Amount (primary document amount)
|
||||
*/
|
||||
public abstract BigDecimal getAmount(); // getAmount
|
||||
|
||||
/**
|
||||
* Get Quantity
|
||||
* @return Quantity
|
||||
*/
|
||||
public abstract BigDecimal getQty(); // getQty
|
||||
|
||||
/** Account Type - Invoice - Charge */
|
||||
public static final int ACCTTYPE_Charge = 0;
|
||||
/** Account Type - Invoice - AR */
|
||||
public static final int ACCTTYPE_C_Receivable = 1;
|
||||
/** Account Type - Invoice - AP */
|
||||
public static final int ACCTTYPE_V_Liability = 2;
|
||||
/** Account Type - Invoice - AP Service */
|
||||
public static final int ACCTTYPE_V_Liability_Services = 3;
|
||||
/** Account Type - Invoice - AR Service */
|
||||
public static final int ACCTTYPE_C_Receivable_Services = 4;
|
||||
/** Account Type - Payment - Unallocated */
|
||||
public static final int ACCTTYPE_UnallocatedCash = 10;
|
||||
/** Account Type - Payment - Transfer */
|
||||
public static final int ACCTTYPE_BankInTransit = 11;
|
||||
/** Account Type - Payment - Selection */
|
||||
public static final int ACCTTYPE_PaymentSelect = 12;
|
||||
/** Account Type - Payment - Prepayment */
|
||||
public static final int ACCTTYPE_C_Prepayment = 13;
|
||||
/** Account Type - Payment - Prepayment */
|
||||
public static final int ACCTTYPE_V_Prepayment = 14;
|
||||
/** Account Type - Cash - Asset */
|
||||
public static final int ACCTTYPE_CashAsset = 20;
|
||||
/** Account Type - Cash - Transfer */
|
||||
public static final int ACCTTYPE_CashTransfer = 21;
|
||||
/** Account Type - Cash - Expense */
|
||||
public static final int ACCTTYPE_CashExpense = 22;
|
||||
/** Account Type - Cash - Receipt */
|
||||
public static final int ACCTTYPE_CashReceipt = 23;
|
||||
/** Account Type - Cash - Difference */
|
||||
public static final int ACCTTYPE_CashDifference = 24;
|
||||
/** Account Type - Allocation - Discount Expense (AR) */
|
||||
public static final int ACCTTYPE_DiscountExp = 30;
|
||||
/** Account Type - Allocation - Discount Revenue (AP) */
|
||||
public static final int ACCTTYPE_DiscountRev = 31;
|
||||
/** Account Type - Allocation - Write Off */
|
||||
public static final int ACCTTYPE_WriteOff = 32;
|
||||
/** Account Type - Bank Statement - Asset */
|
||||
public static final int ACCTTYPE_BankAsset = 40;
|
||||
/** Account Type - Bank Statement - Interest Revenue */
|
||||
public static final int ACCTTYPE_InterestRev = 41;
|
||||
/** Account Type - Bank Statement - Interest Exp */
|
||||
public static final int ACCTTYPE_InterestExp = 42;
|
||||
/** Inventory Accounts - Differnces */
|
||||
public static final int ACCTTYPE_InvDifferences = 50;
|
||||
/** Inventory Accounts - NIR */
|
||||
public static final int ACCTTYPE_NotInvoicedReceipts = 51;
|
||||
/** Project Accounts - Assets */
|
||||
public static final int ACCTTYPE_ProjectAsset = 61;
|
||||
/** Project Accounts - WIP */
|
||||
public static final int ACCTTYPE_ProjectWIP = 62;
|
||||
/** GL Accounts - PPV Offset */
|
||||
public static final int ACCTTYPE_PPVOffset = 101;
|
||||
/** GL Accounts - Commitment Offset */
|
||||
public static final int ACCTTYPE_CommitmentOffset = 111;
|
||||
|
||||
/**
|
||||
* Get the Valid Combination id for Accounting Schema
|
||||
* @param AcctType see ACCTTYPE_*
|
||||
* @param as accounting schema
|
||||
* @return C_ValidCombination_ID
|
||||
*/
|
||||
public abstract int getValidCombination_ID(int AcctType, MAcctSchema as); // getAccount_ID
|
||||
|
||||
/**
|
||||
* Get the account for Accounting Schema
|
||||
* @param AcctType see ACCTTYPE_*
|
||||
* @param as accounting schema
|
||||
* @return Account
|
||||
*/
|
||||
public abstract MAccount getAccount(int AcctType, MAcctSchema as); // getAccount
|
||||
|
||||
/**
|
||||
* Get DocLine with ID
|
||||
* @param Record_ID Record ID
|
||||
* @return DocLine
|
||||
*/
|
||||
public abstract IDocLine getDocLine(int Record_ID); // getDocLine
|
||||
|
||||
/**
|
||||
* Get AD_Client_ID
|
||||
* @return client
|
||||
*/
|
||||
public abstract int getAD_Client_ID(); // getAD_Client_ID
|
||||
|
||||
/**
|
||||
* Get AD_Org_ID
|
||||
* @return org
|
||||
*/
|
||||
public abstract int getAD_Org_ID(); // getAD_Org_ID
|
||||
|
||||
/**
|
||||
* Get Document No
|
||||
* @return document No
|
||||
*/
|
||||
public abstract String getDocumentNo(); // getDocumentNo
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* @return Description
|
||||
*/
|
||||
public abstract String getDescription(); // getDescription
|
||||
|
||||
/**
|
||||
* Get C_Currency_ID
|
||||
* @return currency
|
||||
*/
|
||||
public abstract int getC_Currency_ID(); // getC_Currency_ID
|
||||
|
||||
/**
|
||||
* Set C_Currency_ID
|
||||
* @param C_Currency_ID id
|
||||
*/
|
||||
public abstract void setC_Currency_ID(int C_Currency_ID); // setC_Currency_ID
|
||||
|
||||
/**
|
||||
* Is Multi Currency
|
||||
* @return mc
|
||||
*/
|
||||
public abstract boolean isMultiCurrency(); // isMultiCurrency
|
||||
|
||||
/**
|
||||
* Is Tax Included
|
||||
* @return tax incl
|
||||
*/
|
||||
public abstract boolean isTaxIncluded(); // isTaxIncluded
|
||||
|
||||
/**
|
||||
* Get C_ConversionType_ID
|
||||
* @return ConversionType
|
||||
*/
|
||||
public abstract int getC_ConversionType_ID(); // getC_ConversionType_ID
|
||||
|
||||
/**
|
||||
* Get GL_Category_ID
|
||||
* @return categoory
|
||||
*/
|
||||
public abstract int getGL_Category_ID(); // getGL_Category_ID
|
||||
|
||||
/**
|
||||
* Get GL_Category_ID
|
||||
* @return categoory
|
||||
*/
|
||||
public abstract int getGL_Budget_ID(); // getGL_Budget_ID
|
||||
|
||||
/**
|
||||
* Get Accounting Date
|
||||
* @return currency
|
||||
*/
|
||||
public abstract Timestamp getDateAcct(); // getDateAcct
|
||||
|
||||
/**
|
||||
* Get Document Date
|
||||
* @return currency
|
||||
*/
|
||||
public abstract Timestamp getDateDoc(); // getDateDoc
|
||||
|
||||
/**
|
||||
* Is Document Posted
|
||||
* @return true if posted
|
||||
*/
|
||||
public abstract boolean isPosted(); // isPosted
|
||||
|
||||
/**
|
||||
* Is Sales Trx
|
||||
* @return true if posted
|
||||
*/
|
||||
public abstract boolean isSOTrx(); // isSOTrx
|
||||
|
||||
/**
|
||||
* Get C_DocType_ID
|
||||
* @return DocType
|
||||
*/
|
||||
public abstract int getC_DocType_ID(); // getC_DocType_ID
|
||||
|
||||
/**
|
||||
* Get header level C_Charge_ID
|
||||
* @return Charge
|
||||
*/
|
||||
public abstract int getC_Charge_ID(); // getC_Charge_ID
|
||||
|
||||
/**
|
||||
* Get SalesRep_ID
|
||||
* @return SalesRep
|
||||
*/
|
||||
public abstract int getSalesRep_ID(); // getSalesRep_ID
|
||||
|
||||
/**
|
||||
* Get C_BankAccount_ID
|
||||
* @return BankAccount
|
||||
*/
|
||||
public abstract int getC_BankAccount_ID(); // getC_BankAccount_ID
|
||||
|
||||
/**
|
||||
* Get C_CashBook_ID
|
||||
* @return CashBook
|
||||
*/
|
||||
public abstract int getC_CashBook_ID(); // getC_CashBook_ID
|
||||
|
||||
/**
|
||||
* Get M_Warehouse_ID
|
||||
* @return Warehouse
|
||||
*/
|
||||
public abstract int getM_Warehouse_ID(); // getM_Warehouse_ID
|
||||
|
||||
/**
|
||||
* Get C_BPartner_ID
|
||||
* @return BPartner
|
||||
*/
|
||||
public abstract int getC_BPartner_ID(); // getC_BPartner_ID
|
||||
|
||||
/**
|
||||
* Get C_BPartner_Location_ID
|
||||
* @return BPartner Location
|
||||
*/
|
||||
public abstract int getC_BPartner_Location_ID(); // getC_BPartner_Location_ID
|
||||
|
||||
/**
|
||||
* Get C_Project_ID
|
||||
* @return Project
|
||||
*/
|
||||
public abstract int getC_Project_ID(); // getC_Project_ID
|
||||
|
||||
/**
|
||||
* Get C_SalesRegion_ID
|
||||
* @return Sales Region
|
||||
*/
|
||||
public abstract int getC_SalesRegion_ID(); // getC_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get C_SalesRegion_ID
|
||||
* @return Sales Region
|
||||
*/
|
||||
public abstract int getBP_C_SalesRegion_ID(); // getBP_C_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get C_Activity_ID
|
||||
* @return Activity
|
||||
*/
|
||||
public abstract int getC_Activity_ID(); // getC_Activity_ID
|
||||
|
||||
/**
|
||||
* Get C_Campaign_ID
|
||||
* @return Campaign
|
||||
*/
|
||||
public abstract int getC_Campaign_ID(); // getC_Campaign_ID
|
||||
|
||||
/**
|
||||
* Get M_Product_ID
|
||||
* @return Product
|
||||
*/
|
||||
public abstract int getM_Product_ID(); // getM_Product_ID
|
||||
|
||||
/**
|
||||
* Get AD_OrgTrx_ID
|
||||
* @return Trx Org
|
||||
*/
|
||||
public abstract int getAD_OrgTrx_ID(); // getAD_OrgTrx_ID
|
||||
|
||||
/**
|
||||
* Get C_LocFrom_ID
|
||||
* @return loc from
|
||||
*/
|
||||
public abstract int getC_LocFrom_ID(); // getC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Get C_LocTo_ID
|
||||
* @return loc to
|
||||
*/
|
||||
public abstract int getC_LocTo_ID(); // getC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Get User1_ID
|
||||
* @return Campaign
|
||||
*/
|
||||
public abstract int getUser1_ID(); // getUser1_ID
|
||||
|
||||
/**
|
||||
* Get User2_ID
|
||||
* @return Campaign
|
||||
*/
|
||||
public abstract int getUser2_ID(); // getUser2_ID
|
||||
|
||||
/**
|
||||
* Get User Defined value
|
||||
* @return User defined
|
||||
*/
|
||||
public abstract int getValue(String ColumnName); // getValue
|
||||
|
||||
/**
|
||||
* Get Source Currency Balance - subtracts line (and tax) amounts from total - no rounding
|
||||
* @return positive amount, if total header is bigger than lines
|
||||
*/
|
||||
public abstract BigDecimal getBalance();
|
||||
|
||||
/**
|
||||
* Create Facts (the accounting logic)
|
||||
* @param as accounting schema
|
||||
* @return Facts
|
||||
*/
|
||||
public abstract ArrayList<Fact> createFacts(MAcctSchema as);
|
||||
|
||||
/**
|
||||
* Get Context
|
||||
* @return context
|
||||
*/
|
||||
public Properties getCtx();
|
||||
|
||||
/**************************************************************************
|
||||
* Load Document Type and GL Info.
|
||||
* Set p_DocumentType and p_GL_Category_ID
|
||||
* @return document type
|
||||
*/
|
||||
public String getDocumentType();
|
||||
|
||||
/**
|
||||
* Set C_SalesRegion_ID
|
||||
* @param C_SalesRegion_ID id
|
||||
*/
|
||||
public void setBP_C_SalesRegion_ID (int C_SalesRegion_ID);
|
||||
|
||||
|
||||
/*
|
||||
* Get the facts
|
||||
* @return ArrayList<Fact>
|
||||
*/
|
||||
public ArrayList<Fact> getFacts();
|
||||
|
||||
}
|
|
@ -0,0 +1,399 @@
|
|||
package org.compiere.acct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import org.compiere.model.MAccount;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.ProductCost;
|
||||
|
||||
public interface IDocLine {
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* @return c_Currency_ID
|
||||
*/
|
||||
public abstract int getC_Currency_ID(); // getC_Currency_ID
|
||||
|
||||
/**
|
||||
* Get Conversion Type
|
||||
* @return C_ConversionType_ID
|
||||
*/
|
||||
public abstract int getC_ConversionType_ID(); // getC_ConversionType_ID
|
||||
|
||||
/**
|
||||
* Set Amount (DR)
|
||||
* @param sourceAmt source amt
|
||||
*/
|
||||
public abstract void setAmount(BigDecimal sourceAmt); // setAmounts
|
||||
|
||||
/**
|
||||
* Set Amounts
|
||||
* @param amtSourceDr source amount dr
|
||||
* @param amtSourceCr source amount cr
|
||||
*/
|
||||
public abstract void setAmount(BigDecimal amtSourceDr,
|
||||
BigDecimal amtSourceCr); // setAmounts
|
||||
|
||||
/**
|
||||
* Set Converted Amounts
|
||||
* @param C_AcctSchema_ID acct schema
|
||||
* @param amtAcctDr acct amount dr
|
||||
* @param amtAcctCr acct amount cr
|
||||
*/
|
||||
public abstract void setConvertedAmt(int C_AcctSchema_ID,
|
||||
BigDecimal amtAcctDr, BigDecimal amtAcctCr); // setConvertedAmt
|
||||
|
||||
/**
|
||||
* Line Net Amount or Dr-Cr
|
||||
* @return balance
|
||||
*/
|
||||
public abstract BigDecimal getAmtSource(); // getAmount
|
||||
|
||||
/**
|
||||
* Get (Journal) Line Source Dr Amount
|
||||
* @return DR source amount
|
||||
*/
|
||||
public abstract BigDecimal getAmtSourceDr(); // getAmtSourceDr
|
||||
|
||||
/**
|
||||
* Get (Journal) Line Source Cr Amount
|
||||
* @return CR source amount
|
||||
*/
|
||||
public abstract BigDecimal getAmtSourceCr(); // getAmtSourceCr
|
||||
|
||||
/**
|
||||
* Line Journal Accounted Dr Amount
|
||||
* @return DR accounted amount
|
||||
*/
|
||||
public abstract BigDecimal getAmtAcctDr(); // getAmtAcctDr
|
||||
|
||||
/**
|
||||
* Line Journal Accounted Cr Amount
|
||||
* @return CR accounted amount
|
||||
*/
|
||||
public abstract BigDecimal getAmtAcctCr(); // getAmtAccrCr
|
||||
|
||||
/**
|
||||
* Charge Amount
|
||||
* @return charge amount
|
||||
*/
|
||||
public abstract BigDecimal getChargeAmt(); // getChargeAmt
|
||||
|
||||
/**
|
||||
* Set Product Amounts
|
||||
* @param LineNetAmt Line Net Amt
|
||||
* @param PriceList Price List
|
||||
* @param Qty Qty for discount calc
|
||||
*/
|
||||
public abstract void setAmount(BigDecimal LineNetAmt, BigDecimal PriceList,
|
||||
BigDecimal Qty); // setAmounts
|
||||
|
||||
/**
|
||||
* Line Discount
|
||||
* @return discount amount
|
||||
*/
|
||||
public abstract BigDecimal getDiscount(); // getDiscount
|
||||
|
||||
/**
|
||||
* Line List Amount
|
||||
* @return list amount
|
||||
*/
|
||||
public abstract BigDecimal getListAmount(); // getListAmount
|
||||
|
||||
/**
|
||||
* Set Line Net Amt Difference
|
||||
* @param diff difference (to be subtracted)
|
||||
*/
|
||||
public abstract void setLineNetAmtDifference(BigDecimal diff); // setLineNetAmtDifference
|
||||
|
||||
/**************************************************************************
|
||||
* Set Accounting Date
|
||||
* @param dateAcct acct date
|
||||
*/
|
||||
public abstract void setDateAcct(Timestamp dateAcct); // setDateAcct
|
||||
|
||||
/**
|
||||
* Get Accounting Date
|
||||
* @return accounting date
|
||||
*/
|
||||
public abstract Timestamp getDateAcct(); // getDateAcct
|
||||
|
||||
/**
|
||||
* Set Document Date
|
||||
* @param dateDoc doc date
|
||||
*/
|
||||
public abstract void setDateDoc(Timestamp dateDoc); // setDateDoc
|
||||
|
||||
/**
|
||||
* Get Document Date
|
||||
* @return document date
|
||||
*/
|
||||
public abstract Timestamp getDateDoc(); // getDateDoc
|
||||
|
||||
/**************************************************************************
|
||||
* Set GL Journal Account
|
||||
* @param acct account
|
||||
*/
|
||||
public abstract void setAccount(MAccount acct); // setAccount
|
||||
|
||||
/**
|
||||
* Get GL Journal Account
|
||||
* @return account
|
||||
*/
|
||||
public abstract MAccount getAccount(); // getAccount
|
||||
|
||||
/**
|
||||
* Line Account from Product (or Charge).
|
||||
*
|
||||
* @param AcctType see ProductCost.ACCTTYPE_* (0..3)
|
||||
* @param as Accounting schema
|
||||
* @return Requested Product Account
|
||||
*/
|
||||
public abstract MAccount getAccount(int AcctType, MAcctSchema as); // getAccount
|
||||
|
||||
/**
|
||||
* Get Charge Account
|
||||
* @param as account schema
|
||||
* @param amount amount for expense(+)/revenue(-)
|
||||
* @return Charge Account or null
|
||||
*/
|
||||
public abstract MAccount getChargeAccount(MAcctSchema as, BigDecimal amount); // getChargeAccount
|
||||
|
||||
/**************************************************************************
|
||||
* Get (Journal) AcctSchema
|
||||
* @return C_AcctSchema_ID
|
||||
*/
|
||||
public abstract int getC_AcctSchema_ID(); // getC_AcctSchema_ID
|
||||
|
||||
/**
|
||||
* Get Line ID
|
||||
* @return id
|
||||
*/
|
||||
public abstract int get_ID(); // get_ID
|
||||
|
||||
/**
|
||||
* Get AD_Org_ID
|
||||
* @return org
|
||||
*/
|
||||
public abstract int getAD_Org_ID(); // getAD_Org_ID
|
||||
|
||||
/**
|
||||
* Get Order AD_Org_ID
|
||||
* @return order org if defined
|
||||
*/
|
||||
public abstract int getOrder_Org_ID(); // getOrder_Org_ID
|
||||
|
||||
/**
|
||||
* Product
|
||||
* @return M_Product_ID
|
||||
*/
|
||||
public abstract int getM_Product_ID(); // getM_Product_ID
|
||||
|
||||
/**
|
||||
* Is this an Item Product (vs. not a Service, a charge)
|
||||
* @return true if product
|
||||
*/
|
||||
public abstract boolean isItem(); // isItem
|
||||
|
||||
/**
|
||||
* ASI
|
||||
* @return M_AttributeSetInstance_ID
|
||||
*/
|
||||
public abstract int getM_AttributeSetInstance_ID(); // getM_AttributeSetInstance_ID
|
||||
|
||||
/**
|
||||
* Get Warehouse Locator (from)
|
||||
* @return M_Locator_ID
|
||||
*/
|
||||
public abstract int getM_Locator_ID(); // getM_Locator_ID
|
||||
|
||||
/**
|
||||
* Get Warehouse Locator To
|
||||
* @return M_Locator_ID
|
||||
*/
|
||||
public abstract int getM_LocatorTo_ID(); // getM_LocatorTo_ID
|
||||
|
||||
/**
|
||||
* Set Production BOM flag
|
||||
* @param productionBOM flag
|
||||
*/
|
||||
public abstract void setProductionBOM(boolean productionBOM); // setProductionBOM
|
||||
|
||||
/**
|
||||
* Is this the BOM to be produced
|
||||
* @return true if BOM
|
||||
*/
|
||||
public abstract boolean isProductionBOM(); // isProductionBOM
|
||||
|
||||
/**
|
||||
* Get Production Plan
|
||||
* @return M_ProductionPlan_ID
|
||||
*/
|
||||
public abstract int getM_ProductionPlan_ID(); // getM_ProductionPlan_ID
|
||||
|
||||
/**
|
||||
* Get Order Line Reference
|
||||
* @return C_OrderLine_ID
|
||||
*/
|
||||
public abstract int getC_OrderLine_ID(); // getC_OrderLine_ID
|
||||
|
||||
/**
|
||||
* Get C_LocFrom_ID
|
||||
* @return loc from
|
||||
*/
|
||||
public abstract int getC_LocFrom_ID(); // getC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Set C_LocFrom_ID
|
||||
* @param C_LocFrom_ID loc from
|
||||
*/
|
||||
public abstract void setC_LocFrom_ID(int C_LocFrom_ID); // setC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Get C_LocTo_ID
|
||||
* @return loc to
|
||||
*/
|
||||
public abstract int getC_LocTo_ID(); // getC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Set C_LocTo_ID
|
||||
* @param C_LocTo_ID loc to
|
||||
*/
|
||||
public abstract void setC_LocTo_ID(int C_LocTo_ID); // setC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Get Product Cost Info
|
||||
* @return product cost
|
||||
*/
|
||||
public abstract ProductCost getProductCost(); // getProductCost
|
||||
|
||||
/**
|
||||
* Get Total Product Costs
|
||||
* @param as accounting schema
|
||||
* @param AD_Org_ID trx org
|
||||
* @param zeroCostsOK zero/no costs are OK
|
||||
* @return costs
|
||||
*/
|
||||
public abstract BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID,
|
||||
boolean zeroCostsOK); // getProductCosts
|
||||
|
||||
/**
|
||||
* Get Product
|
||||
* @return product or null if no product
|
||||
*/
|
||||
public abstract MProduct getProduct(); // getProduct
|
||||
|
||||
/**
|
||||
* Get Revenue Recognition
|
||||
* @return C_RevenueRecognition_ID or 0
|
||||
*/
|
||||
public abstract int getC_RevenueRecognition_ID(); // getC_RevenueRecognition_ID
|
||||
|
||||
/**
|
||||
* Quantity UOM
|
||||
* @return Transaction or Storage M_UOM_ID
|
||||
*/
|
||||
public abstract int getC_UOM_ID(); // getC_UOM
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @param qty transaction Qty
|
||||
* @param isSOTrx SL order trx (i.e. negative qty)
|
||||
*/
|
||||
public abstract void setQty(BigDecimal qty, boolean isSOTrx); // setQty
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @return transaction Qty
|
||||
*/
|
||||
public abstract BigDecimal getQty(); // getQty
|
||||
|
||||
/**
|
||||
* Description
|
||||
* @return doc line description
|
||||
*/
|
||||
public abstract String getDescription(); // getDescription
|
||||
|
||||
/**
|
||||
* Line Tax
|
||||
* @return C_Tax_ID
|
||||
*/
|
||||
public abstract int getC_Tax_ID(); // getC_Tax_ID
|
||||
|
||||
/**
|
||||
* Get Line Number
|
||||
* @return line no
|
||||
*/
|
||||
public abstract int getLine(); // getLine
|
||||
|
||||
/**
|
||||
* Get BPartner
|
||||
* @return C_BPartner_ID
|
||||
*/
|
||||
public abstract int getC_BPartner_ID(); // getC_BPartner_ID
|
||||
|
||||
/**
|
||||
* Get C_BPartner_Location_ID
|
||||
* @return BPartner Location
|
||||
*/
|
||||
public abstract int getC_BPartner_Location_ID(); // getC_BPartner_Location_ID
|
||||
|
||||
/**
|
||||
* Get TrxOrg
|
||||
* @return AD_OrgTrx_ID
|
||||
*/
|
||||
public abstract int getAD_OrgTrx_ID(); // getAD_OrgTrx_ID
|
||||
|
||||
/**
|
||||
* Get SalesRegion.
|
||||
* - get Sales Region from BPartner
|
||||
* @return C_SalesRegion_ID
|
||||
*/
|
||||
public abstract int getC_SalesRegion_ID(); // getC_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get Project
|
||||
* @return C_Project_ID
|
||||
*/
|
||||
public abstract int getC_Project_ID(); // getC_Project_ID
|
||||
|
||||
/**
|
||||
* Get Campaign
|
||||
* @return C_Campaign_ID
|
||||
*/
|
||||
public abstract int getC_Campaign_ID(); // getC_Campaign_ID
|
||||
|
||||
/**
|
||||
* Get Activity
|
||||
* @return C_Activity_ID
|
||||
*/
|
||||
public abstract int getC_Activity_ID(); // getC_Activity_ID
|
||||
|
||||
/**
|
||||
* Get User 1
|
||||
* @return user defined 1
|
||||
*/
|
||||
public abstract int getUser1_ID(); // getUser1_ID
|
||||
|
||||
/**
|
||||
* Get User 2
|
||||
* @return user defined 2
|
||||
*/
|
||||
public abstract int getUser2_ID(); // getUser2_ID
|
||||
|
||||
/**
|
||||
* Get User Defined Column
|
||||
* @param ColumnName column name
|
||||
* @return user defined column value
|
||||
*/
|
||||
public abstract int getValue(String ColumnName); // getValue
|
||||
|
||||
/**
|
||||
* Get Period
|
||||
* @return C_Period_ID
|
||||
*/
|
||||
public int getC_Period_ID();
|
||||
|
||||
}
|
|
@ -73,6 +73,10 @@ public interface ModelValidator
|
|||
public static final int TIMING_AFTER_REVERSECORRECT = 13;
|
||||
/** Called after document is reverseaccrual */
|
||||
public static final int TIMING_AFTER_REVERSEACCRUAL = 14;
|
||||
/** Called before document is posted */
|
||||
public static final int TIMING_BEFORE_POST = 15;
|
||||
/** Called after document is posted */
|
||||
public static final int TIMING_AFTER_POST = 16;
|
||||
|
||||
/**
|
||||
* Initialize Validation
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.xml.transform.*;
|
|||
import javax.xml.transform.dom.*;
|
||||
import javax.xml.transform.stream.*;
|
||||
import org.compiere.*;
|
||||
import org.compiere.acct.IDoc;
|
||||
import org.compiere.util.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
|
@ -3411,4 +3412,23 @@ public abstract class PO
|
|||
return document;
|
||||
} // getDocument
|
||||
|
||||
/* Doc - To be used on ModelValidator to get the corresponding Doc from the PO */
|
||||
private IDoc m_doc;
|
||||
|
||||
/**
|
||||
* Set the accounting document associated to the PO - for use in POST ModelValidator
|
||||
* @param doc Document
|
||||
*/
|
||||
public void setDoc(IDoc doc) {
|
||||
m_doc = doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the accounting document associated to the PO - for use in POST ModelValidator
|
||||
* @return Doc Document
|
||||
*/
|
||||
public IDoc getDoc() {
|
||||
return m_doc;
|
||||
}
|
||||
|
||||
} // PO
|
||||
|
|
|
@ -80,7 +80,7 @@ import org.compiere.util.*;
|
|||
* @author Jorg Janke
|
||||
* @version $Id: Doc.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $
|
||||
*/
|
||||
public abstract class Doc
|
||||
public abstract class Doc implements IDoc
|
||||
{
|
||||
/** AD_Table_ID's of documents */
|
||||
public static int[] documentsTableID = new int[] {
|
||||
|
@ -136,72 +136,6 @@ public abstract class Doc
|
|||
* M_Requisition POR
|
||||
**************************************************************************/
|
||||
|
||||
/** AR Invoices - ARI */
|
||||
public static final String DOCTYPE_ARInvoice = MDocType.DOCBASETYPE_ARInvoice;
|
||||
/** AR Credit Memo */
|
||||
public static final String DOCTYPE_ARCredit = "ARC";
|
||||
/** AR Receipt */
|
||||
public static final String DOCTYPE_ARReceipt = "ARR";
|
||||
/** AR ProForma */
|
||||
public static final String DOCTYPE_ARProForma = "ARF";
|
||||
/** AP Invoices */
|
||||
public static final String DOCTYPE_APInvoice = "API";
|
||||
/** AP Credit Memo */
|
||||
public static final String DOCTYPE_APCredit = "APC";
|
||||
/** AP Payment */
|
||||
public static final String DOCTYPE_APPayment = "APP";
|
||||
/** CashManagement Bank Statement */
|
||||
public static final String DOCTYPE_BankStatement = "CMB";
|
||||
/** CashManagement Cash Journals */
|
||||
public static final String DOCTYPE_CashJournal = "CMC";
|
||||
/** CashManagement Allocations */
|
||||
public static final String DOCTYPE_Allocation = "CMA";
|
||||
/** Material Shipment */
|
||||
public static final String DOCTYPE_MatShipment = "MMS";
|
||||
/** Material Receipt */
|
||||
public static final String DOCTYPE_MatReceipt = "MMR";
|
||||
/** Material Inventory */
|
||||
public static final String DOCTYPE_MatInventory = "MMI";
|
||||
/** Material Movement */
|
||||
public static final String DOCTYPE_MatMovement = "MMM";
|
||||
/** Material Production */
|
||||
public static final String DOCTYPE_MatProduction = "MMP";
|
||||
/** Match Invoice */
|
||||
public static final String DOCTYPE_MatMatchInv = "MXI";
|
||||
/** Match PO */
|
||||
public static final String DOCTYPE_MatMatchPO = "MXP";
|
||||
/** GL Journal */
|
||||
public static final String DOCTYPE_GLJournal = "GLJ";
|
||||
/** Purchase Order */
|
||||
public static final String DOCTYPE_POrder = "POO";
|
||||
/** Sales Order */
|
||||
public static final String DOCTYPE_SOrder = "SOO";
|
||||
/** Project Issue */
|
||||
public static final String DOCTYPE_ProjectIssue = "PJI";
|
||||
/** Purchase Requisition */
|
||||
public static final String DOCTYPE_PurchaseRequisition = "POR";
|
||||
|
||||
|
||||
|
||||
// Posting Status - AD_Reference_ID=234 //
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotPosted = "N";
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotBalanced = "b";
|
||||
/** Document Status */
|
||||
public static final String STATUS_NotConvertible = "c";
|
||||
/** Document Status */
|
||||
public static final String STATUS_PeriodClosed = "p";
|
||||
/** Document Status */
|
||||
public static final String STATUS_InvalidAccount = "i";
|
||||
/** Document Status */
|
||||
public static final String STATUS_PostPrepared = "y";
|
||||
/** Document Status */
|
||||
public static final String STATUS_Posted = "Y";
|
||||
/** Document Status */
|
||||
public static final String STATUS_Error = "E";
|
||||
|
||||
|
||||
/**
|
||||
* Create Posting document
|
||||
* @param ass accounting schema
|
||||
|
@ -435,9 +369,6 @@ public abstract class Doc
|
|||
/** Facts */
|
||||
private ArrayList<Fact> m_fact = null;
|
||||
|
||||
/** No Currency in Document Indicator (-1) */
|
||||
protected static final int NO_CURRENCY = -2;
|
||||
|
||||
/** Actual Document Status */
|
||||
protected String p_Status = null;
|
||||
/** Error Message */
|
||||
|
@ -448,32 +379,29 @@ public abstract class Doc
|
|||
* Get Context
|
||||
* @return context
|
||||
*/
|
||||
protected Properties getCtx()
|
||||
public Properties getCtx()
|
||||
{
|
||||
return m_ctx;
|
||||
} // getCtx
|
||||
|
||||
/**
|
||||
* Get Table Name
|
||||
* @return table name
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#get_TableName()
|
||||
*/
|
||||
public String get_TableName()
|
||||
{
|
||||
return p_po.get_TableName();
|
||||
} // get_TableName
|
||||
|
||||
/**
|
||||
* Get Table ID
|
||||
* @return table id
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#get_Table_ID()
|
||||
*/
|
||||
public int get_Table_ID()
|
||||
{
|
||||
return p_po.get_Table_ID();
|
||||
} // get_Table_ID
|
||||
|
||||
/**
|
||||
* Get Record_ID
|
||||
* @return record id
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#get_ID()
|
||||
*/
|
||||
public int get_ID()
|
||||
{
|
||||
|
@ -489,20 +417,8 @@ public abstract class Doc
|
|||
return p_po;
|
||||
} // getPO
|
||||
|
||||
/**
|
||||
* Post Document.
|
||||
* <pre>
|
||||
* - try to lock document (Processed='Y' (AND Processing='N' AND Posted='N'))
|
||||
* - if not ok - return false
|
||||
* - postlogic (for all Accounting Schema)
|
||||
* - create Fact lines
|
||||
* - postCommit
|
||||
* - commits Fact lines and Document & sets Processing = 'N'
|
||||
* - if error - create Note
|
||||
* </pre>
|
||||
* @param force if true ignore that locked
|
||||
* @param repost if true ignore that already posted
|
||||
* @return null if posted error otherwise
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#post(boolean, boolean)
|
||||
*/
|
||||
public final String post (boolean force, boolean repost)
|
||||
{
|
||||
|
@ -617,9 +533,30 @@ public abstract class Doc
|
|||
OK = false;
|
||||
}
|
||||
|
||||
String validatorMsg = null;
|
||||
// Call validator on before post
|
||||
if (!p_Status.equals(STATUS_Error)) {
|
||||
getPO().setDoc(this);
|
||||
validatorMsg = ModelValidationEngine.get().fireDocValidate(getPO(), ModelValidator.TIMING_BEFORE_POST);
|
||||
if (validatorMsg != null) {
|
||||
p_Status = STATUS_Error;
|
||||
p_Error = validatorMsg;
|
||||
OK = false;
|
||||
}
|
||||
}
|
||||
|
||||
// commitFact
|
||||
p_Status = postCommit (p_Status);
|
||||
|
||||
if (!p_Status.equals(STATUS_Error)) {
|
||||
validatorMsg = ModelValidationEngine.get().fireDocValidate(getPO(), ModelValidator.TIMING_AFTER_POST);
|
||||
if (validatorMsg != null) {
|
||||
p_Status = STATUS_Error;
|
||||
p_Error = validatorMsg;
|
||||
OK = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Create Note
|
||||
if (!p_Status.equals(STATUS_Posted))
|
||||
{
|
||||
|
@ -844,7 +781,7 @@ public abstract class Doc
|
|||
* Set p_DocumentType and p_GL_Category_ID
|
||||
* @return document type
|
||||
*/
|
||||
protected String getDocumentType()
|
||||
public String getDocumentType()
|
||||
{
|
||||
if (m_DocumentType == null)
|
||||
setDocumentType(null);
|
||||
|
@ -940,9 +877,8 @@ public abstract class Doc
|
|||
} // setDocumentType
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Is the Source Document Balanced
|
||||
* @return true if (source) baanced
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isBalanced()
|
||||
*/
|
||||
public boolean isBalanced()
|
||||
{
|
||||
|
@ -958,10 +894,8 @@ public abstract class Doc
|
|||
return retValue;
|
||||
} // isBalanced
|
||||
|
||||
/**
|
||||
* Is Document convertible to currency and Conversion Type
|
||||
* @param acctSchema accounting schema
|
||||
* @return true, if vonvertable to accounting currency
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isConvertible(org.compiere.model.MAcctSchema)
|
||||
*/
|
||||
public boolean isConvertible (MAcctSchema acctSchema)
|
||||
{
|
||||
|
@ -1013,9 +947,8 @@ public abstract class Doc
|
|||
return convertible;
|
||||
} // isConvertible
|
||||
|
||||
/**
|
||||
* Calculate Period from DateAcct.
|
||||
* m_C_Period_ID is set to -1 of not open to 0 if not found
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#setPeriod()
|
||||
*/
|
||||
public void setPeriod()
|
||||
{
|
||||
|
@ -1043,9 +976,8 @@ public abstract class Doc
|
|||
getDateAcct() + " - " + getDocumentType() + " => " + m_C_Period_ID);
|
||||
} // setC_Period_ID
|
||||
|
||||
/**
|
||||
* Get C_Period_ID
|
||||
* @return period
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Period_ID()
|
||||
*/
|
||||
public int getC_Period_ID()
|
||||
{
|
||||
|
@ -1054,9 +986,8 @@ public abstract class Doc
|
|||
return m_C_Period_ID;
|
||||
} // getC_Period_ID
|
||||
|
||||
/**
|
||||
* Is Period Open
|
||||
* @return true if period is open
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isPeriodOpen()
|
||||
*/
|
||||
public boolean isPeriodOpen()
|
||||
{
|
||||
|
@ -1071,24 +1002,13 @@ public abstract class Doc
|
|||
|
||||
/*************************************************************************/
|
||||
|
||||
/** Amount Type - Invoice - Gross */
|
||||
public static final int AMTTYPE_Gross = 0;
|
||||
/** Amount Type - Invoice - Net */
|
||||
public static final int AMTTYPE_Net = 1;
|
||||
/** Amount Type - Invoice - Charge */
|
||||
public static final int AMTTYPE_Charge = 2;
|
||||
|
||||
/** Source Amounts (may not all be used) */
|
||||
private BigDecimal[] m_Amounts = new BigDecimal[4];
|
||||
/** Quantity */
|
||||
private BigDecimal m_qty = null;
|
||||
|
||||
/**
|
||||
* Get the Amount
|
||||
* (loaded in loadDocumentDetails)
|
||||
*
|
||||
* @param AmtType see AMTTYPE_*
|
||||
* @return Amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAmount(int)
|
||||
*/
|
||||
public BigDecimal getAmount(int AmtType)
|
||||
{
|
||||
|
@ -1112,9 +1032,8 @@ public abstract class Doc
|
|||
m_Amounts[AmtType] = amt;
|
||||
} // setAmount
|
||||
|
||||
/**
|
||||
* Get Amount with index 0
|
||||
* @return Amount (primary document amount)
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAmount()
|
||||
*/
|
||||
public BigDecimal getAmount()
|
||||
{
|
||||
|
@ -1130,9 +1049,8 @@ public abstract class Doc
|
|||
m_qty = qty;
|
||||
} // setQty
|
||||
|
||||
/**
|
||||
* Get Quantity
|
||||
* @return Quantity
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getQty()
|
||||
*/
|
||||
public BigDecimal getQty()
|
||||
{
|
||||
|
@ -1149,74 +1067,8 @@ public abstract class Doc
|
|||
|
||||
/*************************************************************************/
|
||||
|
||||
/** Account Type - Invoice - Charge */
|
||||
public static final int ACCTTYPE_Charge = 0;
|
||||
/** Account Type - Invoice - AR */
|
||||
public static final int ACCTTYPE_C_Receivable = 1;
|
||||
/** Account Type - Invoice - AP */
|
||||
public static final int ACCTTYPE_V_Liability = 2;
|
||||
/** Account Type - Invoice - AP Service */
|
||||
public static final int ACCTTYPE_V_Liability_Services = 3;
|
||||
/** Account Type - Invoice - AR Service */
|
||||
public static final int ACCTTYPE_C_Receivable_Services = 4;
|
||||
|
||||
/** Account Type - Payment - Unallocated */
|
||||
public static final int ACCTTYPE_UnallocatedCash = 10;
|
||||
/** Account Type - Payment - Transfer */
|
||||
public static final int ACCTTYPE_BankInTransit = 11;
|
||||
/** Account Type - Payment - Selection */
|
||||
public static final int ACCTTYPE_PaymentSelect = 12;
|
||||
/** Account Type - Payment - Prepayment */
|
||||
public static final int ACCTTYPE_C_Prepayment = 13;
|
||||
/** Account Type - Payment - Prepayment */
|
||||
public static final int ACCTTYPE_V_Prepayment = 14;
|
||||
|
||||
/** Account Type - Cash - Asset */
|
||||
public static final int ACCTTYPE_CashAsset = 20;
|
||||
/** Account Type - Cash - Transfer */
|
||||
public static final int ACCTTYPE_CashTransfer = 21;
|
||||
/** Account Type - Cash - Expense */
|
||||
public static final int ACCTTYPE_CashExpense = 22;
|
||||
/** Account Type - Cash - Receipt */
|
||||
public static final int ACCTTYPE_CashReceipt = 23;
|
||||
/** Account Type - Cash - Difference */
|
||||
public static final int ACCTTYPE_CashDifference = 24;
|
||||
|
||||
/** Account Type - Allocation - Discount Expense (AR) */
|
||||
public static final int ACCTTYPE_DiscountExp = 30;
|
||||
/** Account Type - Allocation - Discount Revenue (AP) */
|
||||
public static final int ACCTTYPE_DiscountRev = 31;
|
||||
/** Account Type - Allocation - Write Off */
|
||||
public static final int ACCTTYPE_WriteOff = 32;
|
||||
|
||||
/** Account Type - Bank Statement - Asset */
|
||||
public static final int ACCTTYPE_BankAsset = 40;
|
||||
/** Account Type - Bank Statement - Interest Revenue */
|
||||
public static final int ACCTTYPE_InterestRev = 41;
|
||||
/** Account Type - Bank Statement - Interest Exp */
|
||||
public static final int ACCTTYPE_InterestExp = 42;
|
||||
|
||||
/** Inventory Accounts - Differnces */
|
||||
public static final int ACCTTYPE_InvDifferences = 50;
|
||||
/** Inventory Accounts - NIR */
|
||||
public static final int ACCTTYPE_NotInvoicedReceipts = 51;
|
||||
|
||||
/** Project Accounts - Assets */
|
||||
public static final int ACCTTYPE_ProjectAsset = 61;
|
||||
/** Project Accounts - WIP */
|
||||
public static final int ACCTTYPE_ProjectWIP = 62;
|
||||
|
||||
/** GL Accounts - PPV Offset */
|
||||
public static final int ACCTTYPE_PPVOffset = 101;
|
||||
/** GL Accounts - Commitment Offset */
|
||||
public static final int ACCTTYPE_CommitmentOffset = 111;
|
||||
|
||||
|
||||
/**
|
||||
* Get the Valid Combination id for Accounting Schema
|
||||
* @param AcctType see ACCTTYPE_*
|
||||
* @param as accounting schema
|
||||
* @return C_ValidCombination_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getValidCombination_ID(int, org.compiere.model.MAcctSchema)
|
||||
*/
|
||||
public int getValidCombination_ID (int AcctType, MAcctSchema as)
|
||||
{
|
||||
|
@ -1430,11 +1282,8 @@ public abstract class Doc
|
|||
return Account_ID;
|
||||
} // getAccount_ID
|
||||
|
||||
/**
|
||||
* Get the account for Accounting Schema
|
||||
* @param AcctType see ACCTTYPE_*
|
||||
* @param as accounting schema
|
||||
* @return Account
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAccount(int, org.compiere.model.MAcctSchema)
|
||||
*/
|
||||
public final MAccount getAccount (int AcctType, MAcctSchema as)
|
||||
{
|
||||
|
@ -1465,10 +1314,8 @@ public abstract class Doc
|
|||
return no == 1;
|
||||
} // save
|
||||
|
||||
/**
|
||||
* Get DocLine with ID
|
||||
* @param Record_ID Record ID
|
||||
* @return DocLine
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getDocLine(int)
|
||||
*/
|
||||
public DocLine getDocLine (int Record_ID)
|
||||
{
|
||||
|
@ -1493,27 +1340,24 @@ public abstract class Doc
|
|||
} // toString
|
||||
|
||||
|
||||
/**
|
||||
* Get AD_Client_ID
|
||||
* @return client
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAD_Client_ID()
|
||||
*/
|
||||
public int getAD_Client_ID()
|
||||
{
|
||||
return p_po.getAD_Client_ID();
|
||||
} // getAD_Client_ID
|
||||
|
||||
/**
|
||||
* Get AD_Org_ID
|
||||
* @return org
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAD_Org_ID()
|
||||
*/
|
||||
public int getAD_Org_ID()
|
||||
{
|
||||
return p_po.getAD_Org_ID();
|
||||
} // getAD_Org_ID
|
||||
|
||||
/**
|
||||
* Get Document No
|
||||
* @return document No
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getDocumentNo()
|
||||
*/
|
||||
public String getDocumentNo()
|
||||
{
|
||||
|
@ -1528,9 +1372,8 @@ public abstract class Doc
|
|||
return m_DocumentNo;
|
||||
} // getDocumentNo
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* @return Description
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getDescription()
|
||||
*/
|
||||
public String getDescription()
|
||||
{
|
||||
|
@ -1545,9 +1388,8 @@ public abstract class Doc
|
|||
return m_Description;
|
||||
} // getDescription
|
||||
|
||||
/**
|
||||
* Get C_Currency_ID
|
||||
* @return currency
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Currency_ID()
|
||||
*/
|
||||
public int getC_Currency_ID()
|
||||
{
|
||||
|
@ -1566,18 +1408,16 @@ public abstract class Doc
|
|||
return m_C_Currency_ID;
|
||||
} // getC_Currency_ID
|
||||
|
||||
/**
|
||||
* Set C_Currency_ID
|
||||
* @param C_Currency_ID id
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#setC_Currency_ID(int)
|
||||
*/
|
||||
public void setC_Currency_ID (int C_Currency_ID)
|
||||
{
|
||||
m_C_Currency_ID = C_Currency_ID;
|
||||
} // setC_Currency_ID
|
||||
|
||||
/**
|
||||
* Is Multi Currency
|
||||
* @return mc
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isMultiCurrency()
|
||||
*/
|
||||
public boolean isMultiCurrency()
|
||||
{
|
||||
|
@ -1593,9 +1433,8 @@ public abstract class Doc
|
|||
m_MultiCurrency = mc;
|
||||
} // setIsMultiCurrency
|
||||
|
||||
/**
|
||||
* Is Tax Included
|
||||
* @return tax incl
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isTaxIncluded()
|
||||
*/
|
||||
public boolean isTaxIncluded()
|
||||
{
|
||||
|
@ -1611,9 +1450,8 @@ public abstract class Doc
|
|||
m_TaxIncluded = ti;
|
||||
} // setIsTaxIncluded
|
||||
|
||||
/**
|
||||
* Get C_ConversionType_ID
|
||||
* @return ConversionType
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_ConversionType_ID()
|
||||
*/
|
||||
public int getC_ConversionType_ID()
|
||||
{
|
||||
|
@ -1627,18 +1465,16 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_ConversionType_ID
|
||||
|
||||
/**
|
||||
* Get GL_Category_ID
|
||||
* @return categoory
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getGL_Category_ID()
|
||||
*/
|
||||
public int getGL_Category_ID()
|
||||
{
|
||||
return m_GL_Category_ID;
|
||||
} // getGL_Category_ID
|
||||
|
||||
/**
|
||||
* Get GL_Category_ID
|
||||
* @return categoory
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getGL_Budget_ID()
|
||||
*/
|
||||
public int getGL_Budget_ID()
|
||||
{
|
||||
|
@ -1652,9 +1488,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getGL_Budget_ID
|
||||
|
||||
/**
|
||||
* Get Accounting Date
|
||||
* @return currency
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getDateAcct()
|
||||
*/
|
||||
public Timestamp getDateAcct()
|
||||
{
|
||||
|
@ -1679,9 +1514,8 @@ public abstract class Doc
|
|||
m_DateAcct = da;
|
||||
} // setDateAcct
|
||||
|
||||
/**
|
||||
* Get Document Date
|
||||
* @return currency
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getDateDoc()
|
||||
*/
|
||||
public Timestamp getDateDoc()
|
||||
{
|
||||
|
@ -1708,9 +1542,8 @@ public abstract class Doc
|
|||
m_DateDoc = dd;
|
||||
} // setDateDoc
|
||||
|
||||
/**
|
||||
* Is Document Posted
|
||||
* @return true if posted
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isPosted()
|
||||
*/
|
||||
public boolean isPosted()
|
||||
{
|
||||
|
@ -1726,9 +1559,8 @@ public abstract class Doc
|
|||
throw new IllegalStateException("No Posted");
|
||||
} // isPosted
|
||||
|
||||
/**
|
||||
* Is Sales Trx
|
||||
* @return true if posted
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#isSOTrx()
|
||||
*/
|
||||
public boolean isSOTrx()
|
||||
{
|
||||
|
@ -1746,9 +1578,8 @@ public abstract class Doc
|
|||
return false;
|
||||
} // isSOTrx
|
||||
|
||||
/**
|
||||
* Get C_DocType_ID
|
||||
* @return DocType
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_DocType_ID()
|
||||
*/
|
||||
public int getC_DocType_ID()
|
||||
{
|
||||
|
@ -1769,9 +1600,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_DocType_ID
|
||||
|
||||
/**
|
||||
* Get header level C_Charge_ID
|
||||
* @return Charge
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Charge_ID()
|
||||
*/
|
||||
public int getC_Charge_ID()
|
||||
{
|
||||
|
@ -1785,9 +1615,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_Charge_ID
|
||||
|
||||
/**
|
||||
* Get SalesRep_ID
|
||||
* @return SalesRep
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getSalesRep_ID()
|
||||
*/
|
||||
public int getSalesRep_ID()
|
||||
{
|
||||
|
@ -1801,9 +1630,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getSalesRep_ID
|
||||
|
||||
/**
|
||||
* Get C_BankAccount_ID
|
||||
* @return BankAccount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_BankAccount_ID()
|
||||
*/
|
||||
public int getC_BankAccount_ID()
|
||||
{
|
||||
|
@ -1831,9 +1659,8 @@ public abstract class Doc
|
|||
m_C_BankAccount_ID = C_BankAccount_ID;
|
||||
} // setC_BankAccount_ID
|
||||
|
||||
/**
|
||||
* Get C_CashBook_ID
|
||||
* @return CashBook
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_CashBook_ID()
|
||||
*/
|
||||
public int getC_CashBook_ID()
|
||||
{
|
||||
|
@ -1861,9 +1688,8 @@ public abstract class Doc
|
|||
m_C_CashBook_ID = C_CashBook_ID;
|
||||
} // setC_CashBook_ID
|
||||
|
||||
/**
|
||||
* Get M_Warehouse_ID
|
||||
* @return Warehouse
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getM_Warehouse_ID()
|
||||
*/
|
||||
public int getM_Warehouse_ID()
|
||||
{
|
||||
|
@ -1878,9 +1704,8 @@ public abstract class Doc
|
|||
} // getM_Warehouse_ID
|
||||
|
||||
|
||||
/**
|
||||
* Get C_BPartner_ID
|
||||
* @return BPartner
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_BPartner_ID()
|
||||
*/
|
||||
public int getC_BPartner_ID()
|
||||
{
|
||||
|
@ -1908,9 +1733,8 @@ public abstract class Doc
|
|||
m_C_BPartner_ID = C_BPartner_ID;
|
||||
} // setC_BPartner_ID
|
||||
|
||||
/**
|
||||
* Get C_BPartner_Location_ID
|
||||
* @return BPartner Location
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_BPartner_Location_ID()
|
||||
*/
|
||||
public int getC_BPartner_Location_ID()
|
||||
{
|
||||
|
@ -1924,9 +1748,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_BPartner_Location_ID
|
||||
|
||||
/**
|
||||
* Get C_Project_ID
|
||||
* @return Project
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Project_ID()
|
||||
*/
|
||||
public int getC_Project_ID()
|
||||
{
|
||||
|
@ -1940,9 +1763,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_Project_ID
|
||||
|
||||
/**
|
||||
* Get C_SalesRegion_ID
|
||||
* @return Sales Region
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_SalesRegion_ID()
|
||||
*/
|
||||
public int getC_SalesRegion_ID()
|
||||
{
|
||||
|
@ -1956,9 +1778,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get C_SalesRegion_ID
|
||||
* @return Sales Region
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getBP_C_SalesRegion_ID()
|
||||
*/
|
||||
public int getBP_C_SalesRegion_ID()
|
||||
{
|
||||
|
@ -1981,14 +1802,13 @@ public abstract class Doc
|
|||
* Set C_SalesRegion_ID
|
||||
* @param C_SalesRegion_ID id
|
||||
*/
|
||||
protected void setBP_C_SalesRegion_ID (int C_SalesRegion_ID)
|
||||
public void setBP_C_SalesRegion_ID (int C_SalesRegion_ID)
|
||||
{
|
||||
m_BP_C_SalesRegion_ID = C_SalesRegion_ID;
|
||||
} // setBP_C_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get C_Activity_ID
|
||||
* @return Activity
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Activity_ID()
|
||||
*/
|
||||
public int getC_Activity_ID()
|
||||
{
|
||||
|
@ -2002,9 +1822,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_Activity_ID
|
||||
|
||||
/**
|
||||
* Get C_Campaign_ID
|
||||
* @return Campaign
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_Campaign_ID()
|
||||
*/
|
||||
public int getC_Campaign_ID()
|
||||
{
|
||||
|
@ -2018,9 +1837,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getC_Campaign_ID
|
||||
|
||||
/**
|
||||
* Get M_Product_ID
|
||||
* @return Product
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getM_Product_ID()
|
||||
*/
|
||||
public int getM_Product_ID()
|
||||
{
|
||||
|
@ -2034,9 +1852,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getM_Product_ID
|
||||
|
||||
/**
|
||||
* Get AD_OrgTrx_ID
|
||||
* @return Trx Org
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getAD_OrgTrx_ID()
|
||||
*/
|
||||
public int getAD_OrgTrx_ID()
|
||||
{
|
||||
|
@ -2050,9 +1867,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getAD_OrgTrx_ID
|
||||
|
||||
/**
|
||||
* Get C_LocFrom_ID
|
||||
* @return loc from
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_LocFrom_ID()
|
||||
*/
|
||||
public int getC_LocFrom_ID()
|
||||
{
|
||||
|
@ -2068,9 +1884,8 @@ public abstract class Doc
|
|||
m_C_LocFrom_ID = C_LocFrom_ID;
|
||||
} // setC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Get C_LocTo_ID
|
||||
* @return loc to
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getC_LocTo_ID()
|
||||
*/
|
||||
public int getC_LocTo_ID()
|
||||
{
|
||||
|
@ -2086,9 +1901,8 @@ public abstract class Doc
|
|||
m_C_LocTo_ID = C_LocTo_ID;
|
||||
} // setC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Get User1_ID
|
||||
* @return Campaign
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getUser1_ID()
|
||||
*/
|
||||
public int getUser1_ID()
|
||||
{
|
||||
|
@ -2102,9 +1916,8 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getUser1_ID
|
||||
|
||||
/**
|
||||
* Get User2_ID
|
||||
* @return Campaign
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getUser2_ID()
|
||||
*/
|
||||
public int getUser2_ID()
|
||||
{
|
||||
|
@ -2118,10 +1931,9 @@ public abstract class Doc
|
|||
return 0;
|
||||
} // getUser2_ID
|
||||
|
||||
/**
|
||||
* Get User Defined value
|
||||
* @return User defined
|
||||
*/
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getValue(java.lang.String)
|
||||
*/
|
||||
public int getValue (String ColumnName)
|
||||
{
|
||||
int index = p_po.get_ColumnIndex(ColumnName);
|
||||
|
@ -2144,17 +1956,21 @@ public abstract class Doc
|
|||
*/
|
||||
protected abstract String loadDocumentDetails ();
|
||||
|
||||
/**
|
||||
* Get Source Currency Balance - subtracts line (and tax) amounts from total - no rounding
|
||||
* @return positive amount, if total header is bigger than lines
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getBalance()
|
||||
*/
|
||||
public abstract BigDecimal getBalance();
|
||||
|
||||
/**
|
||||
* Create Facts (the accounting logic)
|
||||
* @param as accounting schema
|
||||
* @return Facts
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#createFacts(org.compiere.model.MAcctSchema)
|
||||
*/
|
||||
public abstract ArrayList<Fact> createFacts (MAcctSchema as);
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDoc#getFacts()
|
||||
*/
|
||||
public ArrayList<Fact> getFacts() {
|
||||
return m_fact;
|
||||
}
|
||||
|
||||
} // Doc
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.compiere.util.*;
|
|||
* @author Jorg Janke
|
||||
* @version $Id: DocLine.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $
|
||||
*/
|
||||
public class DocLine
|
||||
public class DocLine implements IDocLine
|
||||
{
|
||||
/**
|
||||
* Create Document Line
|
||||
|
@ -103,9 +103,8 @@ public class DocLine
|
|||
/** Period */
|
||||
private int m_C_Period_ID = -1;
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* @return c_Currency_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_Currency_ID()
|
||||
*/
|
||||
public int getC_Currency_ID ()
|
||||
{
|
||||
|
@ -124,9 +123,8 @@ public class DocLine
|
|||
return m_C_Currency_ID;
|
||||
} // getC_Currency_ID
|
||||
|
||||
/**
|
||||
* Get Conversion Type
|
||||
* @return C_ConversionType_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_ConversionType_ID()
|
||||
*/
|
||||
public int getC_ConversionType_ID ()
|
||||
{
|
||||
|
@ -154,9 +152,8 @@ public class DocLine
|
|||
m_C_ConversionType_ID = C_ConversionType_ID;
|
||||
} // setC_ConversionType_ID
|
||||
|
||||
/**
|
||||
* Set Amount (DR)
|
||||
* @param sourceAmt source amt
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setAmount(java.math.BigDecimal)
|
||||
*/
|
||||
public void setAmount (BigDecimal sourceAmt)
|
||||
{
|
||||
|
@ -164,10 +161,8 @@ public class DocLine
|
|||
m_AmtSourceCr = Env.ZERO;
|
||||
} // setAmounts
|
||||
|
||||
/**
|
||||
* Set Amounts
|
||||
* @param amtSourceDr source amount dr
|
||||
* @param amtSourceCr source amount cr
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setAmount(java.math.BigDecimal, java.math.BigDecimal)
|
||||
*/
|
||||
public void setAmount (BigDecimal amtSourceDr, BigDecimal amtSourceCr)
|
||||
{
|
||||
|
@ -175,11 +170,8 @@ public class DocLine
|
|||
m_AmtSourceCr = amtSourceCr == null ? Env.ZERO : amtSourceCr;
|
||||
} // setAmounts
|
||||
|
||||
/**
|
||||
* Set Converted Amounts
|
||||
* @param C_AcctSchema_ID acct schema
|
||||
* @param amtAcctDr acct amount dr
|
||||
* @param amtAcctCr acct amount cr
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setConvertedAmt(int, java.math.BigDecimal, java.math.BigDecimal)
|
||||
*/
|
||||
public void setConvertedAmt (int C_AcctSchema_ID, BigDecimal amtAcctDr, BigDecimal amtAcctCr)
|
||||
{
|
||||
|
@ -188,54 +180,48 @@ public class DocLine
|
|||
m_AmtAcctCr = amtAcctCr;
|
||||
} // setConvertedAmt
|
||||
|
||||
/**
|
||||
* Line Net Amount or Dr-Cr
|
||||
* @return balance
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAmtSource()
|
||||
*/
|
||||
public BigDecimal getAmtSource()
|
||||
{
|
||||
return m_AmtSourceDr.subtract(m_AmtSourceCr);
|
||||
} // getAmount
|
||||
|
||||
/**
|
||||
* Get (Journal) Line Source Dr Amount
|
||||
* @return DR source amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAmtSourceDr()
|
||||
*/
|
||||
public BigDecimal getAmtSourceDr()
|
||||
{
|
||||
return m_AmtSourceDr;
|
||||
} // getAmtSourceDr
|
||||
|
||||
/**
|
||||
* Get (Journal) Line Source Cr Amount
|
||||
* @return CR source amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAmtSourceCr()
|
||||
*/
|
||||
public BigDecimal getAmtSourceCr()
|
||||
{
|
||||
return m_AmtSourceCr;
|
||||
} // getAmtSourceCr
|
||||
|
||||
/**
|
||||
* Line Journal Accounted Dr Amount
|
||||
* @return DR accounted amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAmtAcctDr()
|
||||
*/
|
||||
public BigDecimal getAmtAcctDr()
|
||||
{
|
||||
return m_AmtAcctDr;
|
||||
} // getAmtAcctDr
|
||||
|
||||
/**
|
||||
* Line Journal Accounted Cr Amount
|
||||
* @return CR accounted amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAmtAcctCr()
|
||||
*/
|
||||
public BigDecimal getAmtAcctCr()
|
||||
{
|
||||
return m_AmtAcctCr;
|
||||
} // getAmtAccrCr
|
||||
|
||||
/**
|
||||
* Charge Amount
|
||||
* @return charge amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getChargeAmt()
|
||||
*/
|
||||
public BigDecimal getChargeAmt()
|
||||
{
|
||||
|
@ -249,11 +235,8 @@ public class DocLine
|
|||
return Env.ZERO;
|
||||
} // getChargeAmt
|
||||
|
||||
/**
|
||||
* Set Product Amounts
|
||||
* @param LineNetAmt Line Net Amt
|
||||
* @param PriceList Price List
|
||||
* @param Qty Qty for discount calc
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setAmount(java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal)
|
||||
*/
|
||||
public void setAmount (BigDecimal LineNetAmt, BigDecimal PriceList, BigDecimal Qty)
|
||||
{
|
||||
|
@ -271,27 +254,24 @@ public class DocLine
|
|||
// + " => Amount=" + getAmount());
|
||||
} // setAmounts
|
||||
|
||||
/**
|
||||
* Line Discount
|
||||
* @return discount amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getDiscount()
|
||||
*/
|
||||
public BigDecimal getDiscount()
|
||||
{
|
||||
return m_DiscountAmt;
|
||||
} // getDiscount
|
||||
|
||||
/**
|
||||
* Line List Amount
|
||||
* @return list amount
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getListAmount()
|
||||
*/
|
||||
public BigDecimal getListAmount()
|
||||
{
|
||||
return m_ListAmt;
|
||||
} // getListAmount
|
||||
|
||||
/**
|
||||
* Set Line Net Amt Difference
|
||||
* @param diff difference (to be subtracted)
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setLineNetAmtDifference(java.math.BigDecimal)
|
||||
*/
|
||||
public void setLineNetAmtDifference (BigDecimal diff)
|
||||
{
|
||||
|
@ -304,18 +284,16 @@ public class DocLine
|
|||
log.fine(msg);
|
||||
} // setLineNetAmtDifference
|
||||
|
||||
/**************************************************************************
|
||||
* Set Accounting Date
|
||||
* @param dateAcct acct date
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setDateAcct(java.sql.Timestamp)
|
||||
*/
|
||||
public void setDateAcct (Timestamp dateAcct)
|
||||
{
|
||||
m_DateAcct = dateAcct;
|
||||
} // setDateAcct
|
||||
|
||||
/**
|
||||
* Get Accounting Date
|
||||
* @return accounting date
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getDateAcct()
|
||||
*/
|
||||
public Timestamp getDateAcct ()
|
||||
{
|
||||
|
@ -332,18 +310,16 @@ public class DocLine
|
|||
return m_DateAcct;
|
||||
} // getDateAcct
|
||||
|
||||
/**
|
||||
* Set Document Date
|
||||
* @param dateDoc doc date
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setDateDoc(java.sql.Timestamp)
|
||||
*/
|
||||
public void setDateDoc (Timestamp dateDoc)
|
||||
{
|
||||
m_DateDoc = dateDoc;
|
||||
} // setDateDoc
|
||||
|
||||
/**
|
||||
* Get Document Date
|
||||
* @return document date
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getDateDoc()
|
||||
*/
|
||||
public Timestamp getDateDoc ()
|
||||
{
|
||||
|
@ -361,30 +337,24 @@ public class DocLine
|
|||
} // getDateDoc
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Set GL Journal Account
|
||||
* @param acct account
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setAccount(org.compiere.model.MAccount)
|
||||
*/
|
||||
public void setAccount (MAccount acct)
|
||||
{
|
||||
m_account = acct;
|
||||
} // setAccount
|
||||
|
||||
/**
|
||||
* Get GL Journal Account
|
||||
* @return account
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAccount()
|
||||
*/
|
||||
public MAccount getAccount()
|
||||
{
|
||||
return m_account;
|
||||
} // getAccount
|
||||
|
||||
/**
|
||||
* Line Account from Product (or Charge).
|
||||
*
|
||||
* @param AcctType see ProductCost.ACCTTYPE_* (0..3)
|
||||
* @param as Accounting schema
|
||||
* @return Requested Product Account
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAccount(int, org.compiere.model.MAcctSchema)
|
||||
*/
|
||||
public MAccount getAccount (int AcctType, MAcctSchema as)
|
||||
{
|
||||
|
@ -418,11 +388,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_Charge_ID
|
||||
|
||||
/**
|
||||
* Get Charge Account
|
||||
* @param as account schema
|
||||
* @param amount amount for expense(+)/revenue(-)
|
||||
* @return Charge Account or null
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getChargeAccount(org.compiere.model.MAcctSchema, java.math.BigDecimal)
|
||||
*/
|
||||
public MAccount getChargeAccount (MAcctSchema as, BigDecimal amount)
|
||||
{
|
||||
|
@ -436,7 +403,7 @@ public class DocLine
|
|||
* Get Period
|
||||
* @return C_Period_ID
|
||||
*/
|
||||
protected int getC_Period_ID()
|
||||
public int getC_Period_ID()
|
||||
{
|
||||
if (m_C_Period_ID == -1)
|
||||
{
|
||||
|
@ -462,36 +429,32 @@ public class DocLine
|
|||
m_C_Period_ID = C_Period_ID;
|
||||
} // setC_Period_ID
|
||||
|
||||
/**************************************************************************
|
||||
* Get (Journal) AcctSchema
|
||||
* @return C_AcctSchema_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_AcctSchema_ID()
|
||||
*/
|
||||
public int getC_AcctSchema_ID()
|
||||
{
|
||||
return m_C_AcctSchema_ID;
|
||||
} // getC_AcctSchema_ID
|
||||
|
||||
/**
|
||||
* Get Line ID
|
||||
* @return id
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#get_ID()
|
||||
*/
|
||||
public int get_ID()
|
||||
{
|
||||
return p_po.get_ID();
|
||||
} // get_ID
|
||||
|
||||
/**
|
||||
* Get AD_Org_ID
|
||||
* @return org
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAD_Org_ID()
|
||||
*/
|
||||
public int getAD_Org_ID()
|
||||
{
|
||||
return p_po.getAD_Org_ID();
|
||||
} // getAD_Org_ID
|
||||
|
||||
/**
|
||||
* Get Order AD_Org_ID
|
||||
* @return order org if defined
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getOrder_Org_ID()
|
||||
*/
|
||||
public int getOrder_Org_ID()
|
||||
{
|
||||
|
@ -506,9 +469,8 @@ public class DocLine
|
|||
return getAD_Org_ID();
|
||||
} // getOrder_Org_ID
|
||||
|
||||
/**
|
||||
* Product
|
||||
* @return M_Product_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getM_Product_ID()
|
||||
*/
|
||||
public int getM_Product_ID()
|
||||
{
|
||||
|
@ -522,9 +484,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getM_Product_ID
|
||||
|
||||
/**
|
||||
* Is this an Item Product (vs. not a Service, a charge)
|
||||
* @return true if product
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#isItem()
|
||||
*/
|
||||
public boolean isItem()
|
||||
{
|
||||
|
@ -541,9 +502,8 @@ public class DocLine
|
|||
return m_isItem.booleanValue();
|
||||
} // isItem
|
||||
|
||||
/**
|
||||
* ASI
|
||||
* @return M_AttributeSetInstance_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getM_AttributeSetInstance_ID()
|
||||
*/
|
||||
public int getM_AttributeSetInstance_ID()
|
||||
{
|
||||
|
@ -557,9 +517,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getM_AttributeSetInstance_ID
|
||||
|
||||
/**
|
||||
* Get Warehouse Locator (from)
|
||||
* @return M_Locator_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getM_Locator_ID()
|
||||
*/
|
||||
public int getM_Locator_ID()
|
||||
{
|
||||
|
@ -573,9 +532,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getM_Locator_ID
|
||||
|
||||
/**
|
||||
* Get Warehouse Locator To
|
||||
* @return M_Locator_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getM_LocatorTo_ID()
|
||||
*/
|
||||
public int getM_LocatorTo_ID()
|
||||
{
|
||||
|
@ -589,27 +547,24 @@ public class DocLine
|
|||
return 0;
|
||||
} // getM_LocatorTo_ID
|
||||
|
||||
/**
|
||||
* Set Production BOM flag
|
||||
* @param productionBOM flag
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setProductionBOM(boolean)
|
||||
*/
|
||||
public void setProductionBOM(boolean productionBOM)
|
||||
{
|
||||
m_productionBOM = productionBOM;
|
||||
} // setProductionBOM
|
||||
|
||||
/**
|
||||
* Is this the BOM to be produced
|
||||
* @return true if BOM
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#isProductionBOM()
|
||||
*/
|
||||
public boolean isProductionBOM()
|
||||
{
|
||||
return m_productionBOM;
|
||||
} // isProductionBOM
|
||||
|
||||
/**
|
||||
* Get Production Plan
|
||||
* @return M_ProductionPlan_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getM_ProductionPlan_ID()
|
||||
*/
|
||||
public int getM_ProductionPlan_ID()
|
||||
{
|
||||
|
@ -623,9 +578,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getM_ProductionPlan_ID
|
||||
|
||||
/**
|
||||
* Get Order Line Reference
|
||||
* @return C_OrderLine_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_OrderLine_ID()
|
||||
*/
|
||||
public int getC_OrderLine_ID()
|
||||
{
|
||||
|
@ -639,45 +593,40 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_OrderLine_ID
|
||||
|
||||
/**
|
||||
* Get C_LocFrom_ID
|
||||
* @return loc from
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_LocFrom_ID()
|
||||
*/
|
||||
public int getC_LocFrom_ID()
|
||||
{
|
||||
return m_C_LocFrom_ID;
|
||||
} // getC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Set C_LocFrom_ID
|
||||
* @param C_LocFrom_ID loc from
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setC_LocFrom_ID(int)
|
||||
*/
|
||||
public void setC_LocFrom_ID(int C_LocFrom_ID)
|
||||
{
|
||||
m_C_LocFrom_ID = C_LocFrom_ID;
|
||||
} // setC_LocFrom_ID
|
||||
|
||||
/**
|
||||
* Get C_LocTo_ID
|
||||
* @return loc to
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_LocTo_ID()
|
||||
*/
|
||||
public int getC_LocTo_ID()
|
||||
{
|
||||
return m_C_LocTo_ID;
|
||||
} // getC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Set C_LocTo_ID
|
||||
* @param C_LocTo_ID loc to
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setC_LocTo_ID(int)
|
||||
*/
|
||||
public void setC_LocTo_ID(int C_LocTo_ID)
|
||||
{
|
||||
m_C_LocTo_ID = C_LocTo_ID;
|
||||
} // setC_LocTo_ID
|
||||
|
||||
/**
|
||||
* Get Product Cost Info
|
||||
* @return product cost
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getProductCost()
|
||||
*/
|
||||
public ProductCost getProductCost()
|
||||
{
|
||||
|
@ -687,12 +636,8 @@ public class DocLine
|
|||
return m_productCost;
|
||||
} // getProductCost
|
||||
|
||||
/**
|
||||
* Get Total Product Costs
|
||||
* @param as accounting schema
|
||||
* @param AD_Org_ID trx org
|
||||
* @param zeroCostsOK zero/no costs are OK
|
||||
* @return costs
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getProductCosts(org.compiere.model.MAcctSchema, int, boolean)
|
||||
*/
|
||||
public BigDecimal getProductCosts (MAcctSchema as, int AD_Org_ID, boolean zeroCostsOK)
|
||||
{
|
||||
|
@ -706,9 +651,8 @@ public class DocLine
|
|||
return Env.ZERO;
|
||||
} // getProductCosts
|
||||
|
||||
/**
|
||||
* Get Product
|
||||
* @return product or null if no product
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getProduct()
|
||||
*/
|
||||
public MProduct getProduct()
|
||||
{
|
||||
|
@ -720,9 +664,8 @@ public class DocLine
|
|||
return null;
|
||||
} // getProduct
|
||||
|
||||
/**
|
||||
* Get Revenue Recognition
|
||||
* @return C_RevenueRecognition_ID or 0
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_RevenueRecognition_ID()
|
||||
*/
|
||||
public int getC_RevenueRecognition_ID()
|
||||
{
|
||||
|
@ -732,9 +675,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_RevenueRecognition_ID
|
||||
|
||||
/**
|
||||
* Quantity UOM
|
||||
* @return Transaction or Storage M_UOM_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_UOM_ID()
|
||||
*/
|
||||
public int getC_UOM_ID()
|
||||
{
|
||||
|
@ -754,10 +696,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_UOM
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @param qty transaction Qty
|
||||
* @param isSOTrx SL order trx (i.e. negative qty)
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#setQty(java.math.BigDecimal, boolean)
|
||||
*/
|
||||
public void setQty (BigDecimal qty, boolean isSOTrx)
|
||||
{
|
||||
|
@ -770,9 +710,8 @@ public class DocLine
|
|||
getProductCost().setQty (qty);
|
||||
} // setQty
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @return transaction Qty
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getQty()
|
||||
*/
|
||||
public BigDecimal getQty()
|
||||
{
|
||||
|
@ -781,9 +720,8 @@ public class DocLine
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* Description
|
||||
* @return doc line description
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getDescription()
|
||||
*/
|
||||
public String getDescription()
|
||||
{
|
||||
|
@ -793,9 +731,8 @@ public class DocLine
|
|||
return null;
|
||||
} // getDescription
|
||||
|
||||
/**
|
||||
* Line Tax
|
||||
* @return C_Tax_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_Tax_ID()
|
||||
*/
|
||||
public int getC_Tax_ID()
|
||||
{
|
||||
|
@ -809,9 +746,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_Tax_ID
|
||||
|
||||
/**
|
||||
* Get Line Number
|
||||
* @return line no
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getLine()
|
||||
*/
|
||||
public int getLine()
|
||||
{
|
||||
|
@ -825,9 +761,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getLine
|
||||
|
||||
/**
|
||||
* Get BPartner
|
||||
* @return C_BPartner_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_BPartner_ID()
|
||||
*/
|
||||
public int getC_BPartner_ID()
|
||||
{
|
||||
|
@ -856,9 +791,8 @@ public class DocLine
|
|||
} // setC_BPartner_ID
|
||||
|
||||
|
||||
/**
|
||||
* Get C_BPartner_Location_ID
|
||||
* @return BPartner Location
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_BPartner_Location_ID()
|
||||
*/
|
||||
public int getC_BPartner_Location_ID()
|
||||
{
|
||||
|
@ -872,9 +806,8 @@ public class DocLine
|
|||
return m_doc.getC_BPartner_Location_ID();
|
||||
} // getC_BPartner_Location_ID
|
||||
|
||||
/**
|
||||
* Get TrxOrg
|
||||
* @return AD_OrgTrx_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getAD_OrgTrx_ID()
|
||||
*/
|
||||
public int getAD_OrgTrx_ID()
|
||||
{
|
||||
|
@ -888,10 +821,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getAD_OrgTrx_ID
|
||||
|
||||
/**
|
||||
* Get SalesRegion.
|
||||
* - get Sales Region from BPartner
|
||||
* @return C_SalesRegion_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_SalesRegion_ID()
|
||||
*/
|
||||
public int getC_SalesRegion_ID()
|
||||
{
|
||||
|
@ -915,9 +846,8 @@ public class DocLine
|
|||
return m_C_SalesRegion_ID;
|
||||
} // getC_SalesRegion_ID
|
||||
|
||||
/**
|
||||
* Get Project
|
||||
* @return C_Project_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_Project_ID()
|
||||
*/
|
||||
public int getC_Project_ID()
|
||||
{
|
||||
|
@ -931,9 +861,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_Project_ID
|
||||
|
||||
/**
|
||||
* Get Campaign
|
||||
* @return C_Campaign_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_Campaign_ID()
|
||||
*/
|
||||
public int getC_Campaign_ID()
|
||||
{
|
||||
|
@ -947,9 +876,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_Campaign_ID
|
||||
|
||||
/**
|
||||
* Get Activity
|
||||
* @return C_Activity_ID
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getC_Activity_ID()
|
||||
*/
|
||||
public int getC_Activity_ID()
|
||||
{
|
||||
|
@ -963,9 +891,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getC_Activity_ID
|
||||
|
||||
/**
|
||||
* Get User 1
|
||||
* @return user defined 1
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getUser1_ID()
|
||||
*/
|
||||
public int getUser1_ID()
|
||||
{
|
||||
|
@ -979,9 +906,8 @@ public class DocLine
|
|||
return 0;
|
||||
} // getUser1_ID
|
||||
|
||||
/**
|
||||
* Get User 2
|
||||
* @return user defined 2
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getUser2_ID()
|
||||
*/
|
||||
public int getUser2_ID()
|
||||
{
|
||||
|
@ -995,11 +921,9 @@ public class DocLine
|
|||
return 0;
|
||||
} // getUser2_ID
|
||||
|
||||
/**
|
||||
* Get User Defined Column
|
||||
* @param ColumnName column name
|
||||
* @return user defined column value
|
||||
*/
|
||||
/* (non-Javadoc)
|
||||
* @see org.compiere.acct.IDocLine#getValue(java.lang.String)
|
||||
*/
|
||||
public int getValue(String ColumnName)
|
||||
{
|
||||
int index = p_po.get_ColumnIndex(ColumnName);
|
||||
|
|
Loading…
Reference in New Issue