Package org.compiere.acct
Class Doc
- java.lang.Object
-
- org.compiere.acct.Doc
-
- Direct Known Subclasses:
Doc_AllocationHdr
,Doc_AssetAddition
,Doc_AssetDisposed
,Doc_AssetReval
,Doc_AssetTransfer
,Doc_BankStatement
,Doc_Cash
,Doc_DepreciationEntry
,Doc_GLJournal
,Doc_InOut
,Doc_Inventory
,Doc_Invoice
,Doc_MatchInv
,Doc_MatchPO
,Doc_Movement
,Doc_Order
,Doc_Payment
,Doc_Production
,Doc_ProjectIssue
,Doc_Requisition
public abstract class Doc extends Object
Posting Document Root.Table Base Document Types (C_DocType.DocBaseType and AD_Reference_ID=183) Class AD_Table_ID ------------------ ------------------------------ C_Invoice: ARI, ARC, ARF, API, APC Doc_Invoice 318 - has C_DocType_ID C_Payment: ARP, APP Doc_Payment 335 - has C_DocType_ID C_Order: SOO, POO, POR (Requisition) Doc_Order 259 - has C_DocType_ID M_InOut: MMS, MMR Doc_InOut 319 - DocType derived M_Inventory: MMI Doc_Inventory 321 - DocType fixed M_Movement: MMM Doc_Movement 323 - DocType fixed M_Production: MMP Doc_Production 325 - DocType fixed M_Production: MMO Doc_CostCollector 330 - DocType fixed C_BankStatement: CMB Doc_Bank 392 - DocType fixed C_Cash: CMC Doc_Cash 407 - DocType fixed C_Allocation: CMA Doc_Allocation 390 - DocType fixed GL_Journal: GLJ Doc_GLJournal 224 = has C_DocType_ID Matching Invoice MXI M_MatchInv 472 - DocType fixed Matching PO MXP M_MatchPO 473 - DocType fixed Project Issue PJI C_ProjectIssue 623 - DocType fixed
- Version:
- $Id: Doc.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $
- Author:
- Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
- FR [ 2520591 ] Support multiples calendar for Org
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACCTTYPE_BankAsset
Account Type - Bank Statement - Assetstatic int
ACCTTYPE_BankInTransit
Account Type - Payment - Transferstatic int
ACCTTYPE_C_Prepayment
Account Type - Payment - Prepaymentstatic int
ACCTTYPE_C_Receivable
Account Type - Invoice - ARstatic int
ACCTTYPE_C_Receivable_Services
Account Type - Invoice - AR Servicestatic int
ACCTTYPE_CashAsset
Account Type - Cash - Assetstatic int
ACCTTYPE_CashDifference
Account Type - Cash - Differencestatic int
ACCTTYPE_CashExpense
Account Type - Cash - Expensestatic int
ACCTTYPE_CashReceipt
Account Type - Cash - Receiptstatic int
ACCTTYPE_CashTransfer
Account Type - Cash - Transferstatic int
ACCTTYPE_Charge
Account Type - Invoice - Chargestatic int
ACCTTYPE_CommitmentOffset
GL Accounts - Commitment Offsetstatic int
ACCTTYPE_CommitmentOffsetSales
GL Accounts - Commitment Offset Salesstatic int
ACCTTYPE_DiscountExp
Account Type - Allocation - Discount Expense (AR)static int
ACCTTYPE_DiscountRev
Account Type - Allocation - Discount Revenue (AP)static int
ACCTTYPE_InterestExp
Account Type - Bank Statement - Interest Expstatic int
ACCTTYPE_InterestRev
Account Type - Bank Statement - Interest Revenuestatic int
ACCTTYPE_InvDifferences
Inventory Accounts - Differencesstatic int
ACCTTYPE_NotInvoicedReceipts
Inventory Accounts - NIRstatic int
ACCTTYPE_PaymentSelect
Account Type - Payment - Selectionstatic int
ACCTTYPE_PPVOffset
GL Accounts - PPV Offsetstatic int
ACCTTYPE_ProjectAsset
Project Accounts - Assetsstatic int
ACCTTYPE_ProjectWIP
Project Accounts - WIPstatic int
ACCTTYPE_UnallocatedCash
Account Type - Payment - Unallocatedstatic int
ACCTTYPE_V_Liability
Account Type - Invoice - APstatic int
ACCTTYPE_V_Liability_Services
Account Type - Invoice - AP Servicestatic int
ACCTTYPE_V_Prepayment
Account Type - Payment - Prepaymentstatic int
ACCTTYPE_WriteOff
Account Type - Allocation - Write Offstatic int
AMTTYPE_Charge
Amount Type - Invoice - Chargestatic int
AMTTYPE_Gross
Amount Type - Invoice - Grossstatic int
AMTTYPE_Net
Amount Type - Invoice - Netstatic String
DOC_TYPE_BY_DOC_BASE_TYPE_SQL
Document Types -------------- C_DocType.DocBaseType and AD_Reference_ID=183 C_Invoice: ARI, ARC, ARF, API, APC C_Payment: ARP, APP C_Order: SOO, POO M_Transaction: MMI, MMM, MMS, MMR C_BankStatement: CMB C_Cash: CMC C_Allocation: CMA GL_Journal: GLJ C_ProjectIssue PJI M_Requisition PORstatic String
DOCTYPE_Allocation
CashManagement Allocationsstatic String
DOCTYPE_APCredit
AP Credit Memostatic String
DOCTYPE_APInvoice
AP Invoicesstatic String
DOCTYPE_APPayment
AP Paymentstatic String
DOCTYPE_ARCredit
AR Credit Memostatic String
DOCTYPE_ARInvoice
AR Invoices - ARIstatic String
DOCTYPE_ARProForma
AR ProFormastatic String
DOCTYPE_ARReceipt
AR Receiptstatic String
DOCTYPE_BankStatement
CashManagement Bank Statementstatic String
DOCTYPE_CashJournal
CashManagement Cash Journalsstatic String
DOCTYPE_GLJournal
GL Journalstatic String
DOCTYPE_MatInventory
Material Inventorystatic String
DOCTYPE_MatMatchInv
Match Invoicestatic String
DOCTYPE_MatMatchPO
Match POstatic String
DOCTYPE_MatMovement
Material Movementstatic String
DOCTYPE_MatProduction
Material Productionstatic String
DOCTYPE_MatReceipt
Material Receiptstatic String
DOCTYPE_MatShipment
Material Shipmentstatic String
DOCTYPE_POrder
Purchase Orderstatic String
DOCTYPE_ProjectIssue
Project Issuestatic String
DOCTYPE_PurchaseRequisition
Purchase Requisitionstatic String
DOCTYPE_SOrder
Sales Orderprotected CLogger
log
Log per Documentprotected static int
NO_CURRENCY
No Currency in Document Indicator (-1)protected String
p_Error
Error Messageprotected DocLine[]
p_lines
Contained Doc Linesprotected PO
p_po
The Documentprotected String
p_Status
Actual Document Statusprotected static CLogger
s_log
Static Logstatic String
STATUS_Deferred
Document Statusstatic String
STATUS_Error
Document Statusstatic String
STATUS_InvalidAccount
Document Statusstatic String
STATUS_NotBalanced
Document Statusstatic String
STATUS_NotConvertible
Document Statusstatic String
STATUS_NotPosted
Document Statusstatic String
STATUS_PeriodClosed
Document Statusstatic String
STATUS_Posted
Document Statusstatic String
STATUS_PostPrepared
Document Status
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ArrayList<Fact>
createFacts(MAcctSchema as)
Create Facts (the accounting logic)protected int
deleteAcct()
Delete Accountingstatic Doc
get(MAcctSchema as, int AD_Table_ID, int Record_ID, String trxName)
Create Posting documentstatic Doc
get(MAcctSchema as, int AD_Table_ID, ResultSet rs, String trxName)
Create Posting documentint
get_ID()
Get Record_IDint
get_Table_ID()
Get Table IDString
get_TableName()
Get Table NameMAccount
getAccount(int AcctType, MAcctSchema as)
Get the account for Accounting Schemaprotected MAcctSchema
getAcctSchema()
int
getAD_Client_ID()
Get AD_Client_IDint
getAD_Org_ID()
Get AD_Org_IDint
getAD_OrgTrx_ID()
Get AD_OrgTrx_IDBigDecimal
getAmount()
Get Amount with index 0BigDecimal
getAmount(int AmtType)
Get the Amount (loaded in loadDocumentDetails)abstract BigDecimal
getBalance()
Get Source Currency Balance - subtracts line (and tax) amounts from total - no roundingint
getBP_C_SalesRegion_ID()
Get C_SalesRegion_IDint
getC_Activity_ID()
Get C_Activity_IDint
getC_BankAccount_ID()
Get C_BankAccount_IDint
getC_BPartner_ID()
Get C_BPartner_IDint
getC_BPartner_Location_ID()
Get C_BPartner_Location_IDint
getC_Campaign_ID()
Get C_Campaign_IDint
getC_CashBook_ID()
Get C_CashBook_IDint
getC_Charge_ID()
Get header level C_Charge_IDint
getC_ConversionType_ID()
Get C_ConversionType_IDint
getC_Currency_ID()
Get C_Currency_IDint
getC_DocType_ID()
Get C_DocType_IDint
getC_LocFrom_ID()
Get C_LocFrom_IDint
getC_LocTo_ID()
Get C_LocTo_IDint
getC_Period_ID()
Get C_Period_IDint
getC_Project_ID()
Get C_Project_IDint
getC_ProjectPhase_ID()
Get C_ProjectPhase_IDint
getC_ProjectTask_ID()
Get C_ProjectTask_IDint
getC_SalesRegion_ID()
Get C_SalesRegion_IDProperties
getCtx()
Get ContextBigDecimal
getCurrencyRate()
Timestamp
getDateAcct()
Get Accounting DateTimestamp
getDateDoc()
Get Document DateString
getDescription()
Get DescriptionDocLine
getDocLine(int Record_ID)
Get DocLine with IDString
getDocumentNo()
Get Document NoString
getDocumentType()
Load Document Type and GL Info.ArrayList<Fact>
getFacts()
Get Facts (the accounting logic)int
getGL_Budget_ID()
Get getGL_Budget_IDint
getGL_Category_ID()
Get GL_Category_IDint
getM_Product_ID()
Get M_Product_IDint
getM_Warehouse_ID()
Get M_Warehouse_IDPO
getPO()
Get Persistent ObjectString
getPostStatus()
BigDecimal
getQty()
Get Quantityint
getSalesRep_ID()
Get SalesRep_IDString
getTrxName()
Get Trx Name and create Transactionint
getUser1_ID()
Get User1_IDint
getUser2_ID()
Get User2_IDint
getValidCombination_ID(int AcctType, MAcctSchema as)
Get the Valid Combination id for Accounting Schemaint
getValue(String ColumnName)
Get User Defined valueboolean
isBalanced()
Is the Source Document Balancedboolean
isConvertible(MAcctSchema acctSchema)
Is Document convertible to currency and Conversion Typeboolean
isDeferPosting()
Return document whether need to defer posting or notboolean
isMultiCurrency()
Is Multi Currencyboolean
isPeriodOpen()
Is Period Openboolean
isPosted()
Is Document Postedboolean
isSOTrx()
Is Sales Trxboolean
isTaxIncluded()
Is Tax Includedprotected abstract String
loadDocumentDetails()
Load Document Detailsstatic String
manualPosting(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)
Manual posting by userString
post(boolean force, boolean repost)
Post Document.static String
postImmediate(MAcctSchema[] ass, int AD_Table_ID, int Record_ID, boolean force, String trxName)
Post Documentvoid
setAmount(int AmtType, BigDecimal amt)
Set the Amountvoid
setBP_C_SalesRegion_ID(int C_SalesRegion_ID)
Set C_SalesRegion_IDvoid
setC_BankAccount_ID(int C_BankAccount_ID)
Set C_BankAccount_IDvoid
setC_BPartner_ID(int C_BPartner_ID)
Set C_BPartner_IDvoid
setC_CashBook_ID(int C_CashBook_ID)
Set C_CashBook_IDvoid
setC_Currency_ID(int C_Currency_ID)
Set C_Currency_IDvoid
setC_LocFrom_ID(int C_LocFrom_ID)
Set C_LocFrom_IDvoid
setC_LocTo_ID(int C_LocTo_ID)
Set C_LocTo_IDvoid
setDateAcct(Timestamp da)
Set Date Acctvoid
setDateDoc(Timestamp dd)
Set Date Docvoid
setDocumentType(String DocumentType)
Load Document Type and GL Info.void
setIsMultiCurrency(boolean mc)
Set Multi Currencyvoid
setIsTaxIncluded(boolean ti)
Set Tax Includedvoid
setPeriod()
Calculate Period from DateAcct.void
setQty(BigDecimal qty)
Set QuantityString
toString()
String Representation
-
-
-
Field Detail
-
DOC_TYPE_BY_DOC_BASE_TYPE_SQL
public static final String DOC_TYPE_BY_DOC_BASE_TYPE_SQL
Document Types -------------- C_DocType.DocBaseType and AD_Reference_ID=183 C_Invoice: ARI, ARC, ARF, API, APC C_Payment: ARP, APP C_Order: SOO, POO M_Transaction: MMI, MMM, MMS, MMR C_BankStatement: CMB C_Cash: CMC C_Allocation: CMA GL_Journal: GLJ C_ProjectIssue PJI M_Requisition POR- See Also:
- Constant Field Values
-
DOCTYPE_ARInvoice
public static final String DOCTYPE_ARInvoice
AR Invoices - ARI- See Also:
- Constant Field Values
-
DOCTYPE_ARCredit
public static final String DOCTYPE_ARCredit
AR Credit Memo- See Also:
- Constant Field Values
-
DOCTYPE_ARReceipt
public static final String DOCTYPE_ARReceipt
AR Receipt- See Also:
- Constant Field Values
-
DOCTYPE_ARProForma
public static final String DOCTYPE_ARProForma
AR ProForma- See Also:
- Constant Field Values
-
DOCTYPE_APInvoice
public static final String DOCTYPE_APInvoice
AP Invoices- See Also:
- Constant Field Values
-
DOCTYPE_APCredit
public static final String DOCTYPE_APCredit
AP Credit Memo- See Also:
- Constant Field Values
-
DOCTYPE_APPayment
public static final String DOCTYPE_APPayment
AP Payment- See Also:
- Constant Field Values
-
DOCTYPE_BankStatement
public static final String DOCTYPE_BankStatement
CashManagement Bank Statement- See Also:
- Constant Field Values
-
DOCTYPE_CashJournal
public static final String DOCTYPE_CashJournal
CashManagement Cash Journals- See Also:
- Constant Field Values
-
DOCTYPE_Allocation
public static final String DOCTYPE_Allocation
CashManagement Allocations- See Also:
- Constant Field Values
-
DOCTYPE_MatShipment
public static final String DOCTYPE_MatShipment
Material Shipment- See Also:
- Constant Field Values
-
DOCTYPE_MatReceipt
public static final String DOCTYPE_MatReceipt
Material Receipt- See Also:
- Constant Field Values
-
DOCTYPE_MatInventory
public static final String DOCTYPE_MatInventory
Material Inventory- See Also:
- Constant Field Values
-
DOCTYPE_MatMovement
public static final String DOCTYPE_MatMovement
Material Movement- See Also:
- Constant Field Values
-
DOCTYPE_MatProduction
public static final String DOCTYPE_MatProduction
Material Production- See Also:
- Constant Field Values
-
DOCTYPE_MatMatchInv
public static final String DOCTYPE_MatMatchInv
Match Invoice- See Also:
- Constant Field Values
-
DOCTYPE_MatMatchPO
public static final String DOCTYPE_MatMatchPO
Match PO- See Also:
- Constant Field Values
-
DOCTYPE_GLJournal
public static final String DOCTYPE_GLJournal
GL Journal- See Also:
- Constant Field Values
-
DOCTYPE_POrder
public static final String DOCTYPE_POrder
Purchase Order- See Also:
- Constant Field Values
-
DOCTYPE_SOrder
public static final String DOCTYPE_SOrder
Sales Order- See Also:
- Constant Field Values
-
DOCTYPE_ProjectIssue
public static final String DOCTYPE_ProjectIssue
Project Issue- See Also:
- Constant Field Values
-
DOCTYPE_PurchaseRequisition
public static final String DOCTYPE_PurchaseRequisition
Purchase Requisition- See Also:
- Constant Field Values
-
STATUS_NotPosted
public static final String STATUS_NotPosted
Document Status- See Also:
- Constant Field Values
-
STATUS_NotBalanced
public static final String STATUS_NotBalanced
Document Status- See Also:
- Constant Field Values
-
STATUS_NotConvertible
public static final String STATUS_NotConvertible
Document Status- See Also:
- Constant Field Values
-
STATUS_PeriodClosed
public static final String STATUS_PeriodClosed
Document Status- See Also:
- Constant Field Values
-
STATUS_InvalidAccount
public static final String STATUS_InvalidAccount
Document Status- See Also:
- Constant Field Values
-
STATUS_PostPrepared
public static final String STATUS_PostPrepared
Document Status- See Also:
- Constant Field Values
-
STATUS_Posted
public static final String STATUS_Posted
Document Status- See Also:
- Constant Field Values
-
STATUS_Error
public static final String STATUS_Error
Document Status- See Also:
- Constant Field Values
-
STATUS_Deferred
public static final String STATUS_Deferred
Document Status- See Also:
- Constant Field Values
-
s_log
protected static final CLogger s_log
Static Log
-
log
protected transient CLogger log
Log per Document
-
p_po
protected PO p_po
The Document
-
p_lines
protected DocLine[] p_lines
Contained Doc Lines
-
NO_CURRENCY
protected static final int NO_CURRENCY
No Currency in Document Indicator (-1)- See Also:
- Constant Field Values
-
p_Status
protected String p_Status
Actual Document Status
-
p_Error
protected String p_Error
Error Message
-
AMTTYPE_Gross
public static final int AMTTYPE_Gross
Amount Type - Invoice - Gross- See Also:
- Constant Field Values
-
AMTTYPE_Net
public static final int AMTTYPE_Net
Amount Type - Invoice - Net- See Also:
- Constant Field Values
-
AMTTYPE_Charge
public static final int AMTTYPE_Charge
Amount Type - Invoice - Charge- See Also:
- Constant Field Values
-
ACCTTYPE_Charge
public static final int ACCTTYPE_Charge
Account Type - Invoice - Charge- See Also:
- Constant Field Values
-
ACCTTYPE_C_Receivable
public static final int ACCTTYPE_C_Receivable
Account Type - Invoice - AR- See Also:
- Constant Field Values
-
ACCTTYPE_V_Liability
public static final int ACCTTYPE_V_Liability
Account Type - Invoice - AP- See Also:
- Constant Field Values
-
ACCTTYPE_V_Liability_Services
public static final int ACCTTYPE_V_Liability_Services
Account Type - Invoice - AP Service- See Also:
- Constant Field Values
-
ACCTTYPE_C_Receivable_Services
public static final int ACCTTYPE_C_Receivable_Services
Account Type - Invoice - AR Service- See Also:
- Constant Field Values
-
ACCTTYPE_UnallocatedCash
public static final int ACCTTYPE_UnallocatedCash
Account Type - Payment - Unallocated- See Also:
- Constant Field Values
-
ACCTTYPE_BankInTransit
public static final int ACCTTYPE_BankInTransit
Account Type - Payment - Transfer- See Also:
- Constant Field Values
-
ACCTTYPE_PaymentSelect
public static final int ACCTTYPE_PaymentSelect
Account Type - Payment - Selection- See Also:
- Constant Field Values
-
ACCTTYPE_C_Prepayment
public static final int ACCTTYPE_C_Prepayment
Account Type - Payment - Prepayment- See Also:
- Constant Field Values
-
ACCTTYPE_V_Prepayment
public static final int ACCTTYPE_V_Prepayment
Account Type - Payment - Prepayment- See Also:
- Constant Field Values
-
ACCTTYPE_CashAsset
public static final int ACCTTYPE_CashAsset
Account Type - Cash - Asset- See Also:
- Constant Field Values
-
ACCTTYPE_CashTransfer
public static final int ACCTTYPE_CashTransfer
Account Type - Cash - Transfer- See Also:
- Constant Field Values
-
ACCTTYPE_CashExpense
public static final int ACCTTYPE_CashExpense
Account Type - Cash - Expense- See Also:
- Constant Field Values
-
ACCTTYPE_CashReceipt
public static final int ACCTTYPE_CashReceipt
Account Type - Cash - Receipt- See Also:
- Constant Field Values
-
ACCTTYPE_CashDifference
public static final int ACCTTYPE_CashDifference
Account Type - Cash - Difference- See Also:
- Constant Field Values
-
ACCTTYPE_DiscountExp
public static final int ACCTTYPE_DiscountExp
Account Type - Allocation - Discount Expense (AR)- See Also:
- Constant Field Values
-
ACCTTYPE_DiscountRev
public static final int ACCTTYPE_DiscountRev
Account Type - Allocation - Discount Revenue (AP)- See Also:
- Constant Field Values
-
ACCTTYPE_WriteOff
public static final int ACCTTYPE_WriteOff
Account Type - Allocation - Write Off- See Also:
- Constant Field Values
-
ACCTTYPE_BankAsset
public static final int ACCTTYPE_BankAsset
Account Type - Bank Statement - Asset- See Also:
- Constant Field Values
-
ACCTTYPE_InterestRev
public static final int ACCTTYPE_InterestRev
Account Type - Bank Statement - Interest Revenue- See Also:
- Constant Field Values
-
ACCTTYPE_InterestExp
public static final int ACCTTYPE_InterestExp
Account Type - Bank Statement - Interest Exp- See Also:
- Constant Field Values
-
ACCTTYPE_InvDifferences
public static final int ACCTTYPE_InvDifferences
Inventory Accounts - Differences- See Also:
- Constant Field Values
-
ACCTTYPE_NotInvoicedReceipts
public static final int ACCTTYPE_NotInvoicedReceipts
Inventory Accounts - NIR- See Also:
- Constant Field Values
-
ACCTTYPE_ProjectAsset
public static final int ACCTTYPE_ProjectAsset
Project Accounts - Assets- See Also:
- Constant Field Values
-
ACCTTYPE_ProjectWIP
public static final int ACCTTYPE_ProjectWIP
Project Accounts - WIP- See Also:
- Constant Field Values
-
ACCTTYPE_PPVOffset
public static final int ACCTTYPE_PPVOffset
GL Accounts - PPV Offset- See Also:
- Constant Field Values
-
ACCTTYPE_CommitmentOffset
public static final int ACCTTYPE_CommitmentOffset
GL Accounts - Commitment Offset- See Also:
- Constant Field Values
-
ACCTTYPE_CommitmentOffsetSales
public static final int ACCTTYPE_CommitmentOffsetSales
GL Accounts - Commitment Offset Sales- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Doc
public Doc(MAcctSchema as, Class<?> clazz, ResultSet rs, String defaultDocumentType, String trxName)
Constructor- Parameters:
as
- accounting schemaclazz
- Document Classrs
- result setdefaultDocumentType
- default document type or nulltrxName
- trx
-
-
Method Detail
-
get
public static Doc get(MAcctSchema as, int AD_Table_ID, int Record_ID, String trxName)
Create Posting document- Parameters:
as
- accounting schemaAD_Table_ID
- Table ID of DocumentsRecord_ID
- record ID to loadtrxName
- transaction name- Returns:
- Document or null
-
get
public static Doc get(MAcctSchema as, int AD_Table_ID, ResultSet rs, String trxName)
Create Posting document- Parameters:
as
- accounting schemaAD_Table_ID
- Table ID of Documentsrs
- ResultSettrxName
- transaction name- Returns:
- Document
- Throws:
AdempiereUserError
-
postImmediate
public static String postImmediate(MAcctSchema[] ass, int AD_Table_ID, int Record_ID, boolean force, String trxName)
Post Document- Parameters:
ass
- accounting schemataAD_Table_ID
- Transaction tableRecord_ID
- Record ID of this documentforce
- force postingtrxName
- transaction- Returns:
- null if the document was posted or error message
-
manualPosting
public static String manualPosting(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)
Manual posting by user- Parameters:
WindowNo
-AD_Client_ID
-AD_Table_ID
-Record_ID
-force
-- Returns:
- error message ( if any )
-
getPostStatus
public String getPostStatus()
-
getCtx
public Properties getCtx()
Get Context- Returns:
- context
-
get_TableName
public String get_TableName()
Get Table Name- Returns:
- table name
-
get_Table_ID
public int get_Table_ID()
Get Table ID- Returns:
- table id
-
get_ID
public int get_ID()
Get Record_ID- Returns:
- record id
-
getPO
public PO getPO()
Get Persistent Object- Returns:
- po
-
post
public final String post(boolean force, boolean repost)
Post Document.- 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 and sets Processing = 'N' - if error - create Note
- Parameters:
force
- if true ignore that lockedrepost
- if true ignore that already posted- Returns:
- null if posted error otherwise
-
deleteAcct
protected int deleteAcct()
Delete Accounting- Returns:
- number of records
-
getTrxName
public String getTrxName()
Get Trx Name and create Transaction- Returns:
- Trx Name
-
getDocumentType
public String getDocumentType()
Load Document Type and GL Info. Set p_DocumentType and p_GL_Category_ID- Returns:
- document type (i.e. C_DocType.DocBaseType)
-
setDocumentType
public void setDocumentType(String DocumentType)
Load Document Type and GL Info. Set p_DocumentType and p_GL_Category_ID- Parameters:
DocumentType
-
-
isBalanced
public boolean isBalanced()
Is the Source Document Balanced- Returns:
- true if (source) balanced
-
isConvertible
public boolean isConvertible(MAcctSchema acctSchema)
Is Document convertible to currency and Conversion Type- Parameters:
acctSchema
- accounting schema- Returns:
- true, if convertible to accounting currency
-
setPeriod
public void setPeriod()
Calculate Period from DateAcct. m_C_Period_ID is set to -1 of not open to 0 if not found
-
getC_Period_ID
public int getC_Period_ID()
Get C_Period_ID- Returns:
- period
-
isPeriodOpen
public boolean isPeriodOpen()
Is Period Open- Returns:
- true if period is open
-
getAmount
public BigDecimal getAmount(int AmtType)
Get the Amount (loaded in loadDocumentDetails)- Parameters:
AmtType
- see AMTTYPE_*- Returns:
- Amount
-
setAmount
public void setAmount(int AmtType, BigDecimal amt)
Set the Amount- Parameters:
AmtType
- see AMTTYPE_*amt
- Amount
-
getAmount
public BigDecimal getAmount()
Get Amount with index 0- Returns:
- Amount (primary document amount)
-
setQty
public void setQty(BigDecimal qty)
Set Quantity- Parameters:
qty
- Quantity
-
getQty
public BigDecimal getQty()
Get Quantity- Returns:
- Quantity
-
getValidCombination_ID
public int getValidCombination_ID(int AcctType, MAcctSchema as)
Get the Valid Combination id for Accounting Schema- Parameters:
AcctType
- see ACCTTYPE_*as
- accounting schema- Returns:
- C_ValidCombination_ID
-
getAccount
public final MAccount getAccount(int AcctType, MAcctSchema as)
Get the account for Accounting Schema- Parameters:
AcctType
- see ACCTTYPE_*as
- accounting schema- Returns:
- Account
-
getDocLine
public DocLine getDocLine(int Record_ID)
Get DocLine with ID- Parameters:
Record_ID
- Record ID- Returns:
- DocLine
-
toString
public String toString()
String Representation
-
getAD_Client_ID
public int getAD_Client_ID()
Get AD_Client_ID- Returns:
- client
-
getAD_Org_ID
public int getAD_Org_ID()
Get AD_Org_ID- Returns:
- org
-
getDocumentNo
public String getDocumentNo()
Get Document No- Returns:
- document No
-
getDescription
public String getDescription()
Get Description- Returns:
- Description
-
getC_Currency_ID
public int getC_Currency_ID()
Get C_Currency_ID- Returns:
- currency
-
setC_Currency_ID
public void setC_Currency_ID(int C_Currency_ID)
Set C_Currency_ID- Parameters:
C_Currency_ID
- id
-
isMultiCurrency
public boolean isMultiCurrency()
Is Multi Currency- Returns:
- mc
-
setIsMultiCurrency
public void setIsMultiCurrency(boolean mc)
Set Multi Currency- Parameters:
mc
- multi currency
-
isTaxIncluded
public boolean isTaxIncluded()
Is Tax Included- Returns:
- tax incl
-
setIsTaxIncluded
public void setIsTaxIncluded(boolean ti)
Set Tax Included- Parameters:
ti
- Tax Included
-
getC_ConversionType_ID
public int getC_ConversionType_ID()
Get C_ConversionType_ID- Returns:
- ConversionType
-
getCurrencyRate
public BigDecimal getCurrencyRate()
-
getGL_Category_ID
public int getGL_Category_ID()
Get GL_Category_ID- Returns:
- category
-
getGL_Budget_ID
public int getGL_Budget_ID()
Get getGL_Budget_ID- Returns:
- budget
-
getDateAcct
public Timestamp getDateAcct()
Get Accounting Date- Returns:
- currency
-
setDateAcct
public void setDateAcct(Timestamp da)
Set Date Acct- Parameters:
da
- accounting date
-
getDateDoc
public Timestamp getDateDoc()
Get Document Date- Returns:
- currency
-
setDateDoc
public void setDateDoc(Timestamp dd)
Set Date Doc- Parameters:
dd
- document date
-
isPosted
public boolean isPosted()
Is Document Posted- Returns:
- true if posted
-
isSOTrx
public boolean isSOTrx()
Is Sales Trx- Returns:
- true if posted
-
getC_DocType_ID
public int getC_DocType_ID()
Get C_DocType_ID- Returns:
- DocType
-
getC_Charge_ID
public int getC_Charge_ID()
Get header level C_Charge_ID- Returns:
- Charge
-
getSalesRep_ID
public int getSalesRep_ID()
Get SalesRep_ID- Returns:
- SalesRep
-
getC_BankAccount_ID
public int getC_BankAccount_ID()
Get C_BankAccount_ID- Returns:
- BankAccount
-
setC_BankAccount_ID
public void setC_BankAccount_ID(int C_BankAccount_ID)
Set C_BankAccount_ID- Parameters:
C_BankAccount_ID
- bank acct
-
getC_CashBook_ID
public int getC_CashBook_ID()
Get C_CashBook_ID- Returns:
- CashBook
-
setC_CashBook_ID
public void setC_CashBook_ID(int C_CashBook_ID)
Set C_CashBook_ID- Parameters:
C_CashBook_ID
- cash book
-
getM_Warehouse_ID
public int getM_Warehouse_ID()
Get M_Warehouse_ID- Returns:
- Warehouse
-
getC_BPartner_ID
public int getC_BPartner_ID()
Get C_BPartner_ID- Returns:
- BPartner
-
setC_BPartner_ID
public void setC_BPartner_ID(int C_BPartner_ID)
Set C_BPartner_ID- Parameters:
C_BPartner_ID
- bp
-
getC_BPartner_Location_ID
public int getC_BPartner_Location_ID()
Get C_BPartner_Location_ID- Returns:
- BPartner Location
-
getC_Project_ID
public int getC_Project_ID()
Get C_Project_ID- Returns:
- Project
-
getC_ProjectPhase_ID
public int getC_ProjectPhase_ID()
Get C_ProjectPhase_ID- Returns:
- Project Phase
-
getC_ProjectTask_ID
public int getC_ProjectTask_ID()
Get C_ProjectTask_ID- Returns:
- Project Task
-
getC_SalesRegion_ID
public int getC_SalesRegion_ID()
Get C_SalesRegion_ID- Returns:
- Sales Region
-
getBP_C_SalesRegion_ID
public int getBP_C_SalesRegion_ID()
Get C_SalesRegion_ID- Returns:
- Sales Region
-
setBP_C_SalesRegion_ID
public void setBP_C_SalesRegion_ID(int C_SalesRegion_ID)
Set C_SalesRegion_ID- Parameters:
C_SalesRegion_ID
- id
-
getC_Activity_ID
public int getC_Activity_ID()
Get C_Activity_ID- Returns:
- Activity
-
getC_Campaign_ID
public int getC_Campaign_ID()
Get C_Campaign_ID- Returns:
- Campaign
-
getM_Product_ID
public int getM_Product_ID()
Get M_Product_ID- Returns:
- Product
-
getAD_OrgTrx_ID
public int getAD_OrgTrx_ID()
Get AD_OrgTrx_ID- Returns:
- Trx Org
-
getC_LocFrom_ID
public int getC_LocFrom_ID()
Get C_LocFrom_ID- Returns:
- loc from
-
setC_LocFrom_ID
public void setC_LocFrom_ID(int C_LocFrom_ID)
Set C_LocFrom_ID- Parameters:
C_LocFrom_ID
- loc from
-
getC_LocTo_ID
public int getC_LocTo_ID()
Get C_LocTo_ID- Returns:
- loc to
-
setC_LocTo_ID
public void setC_LocTo_ID(int C_LocTo_ID)
Set C_LocTo_ID- Parameters:
C_LocTo_ID
- loc to
-
getUser1_ID
public int getUser1_ID()
Get User1_ID- Returns:
- Campaign
-
getUser2_ID
public int getUser2_ID()
Get User2_ID- Returns:
- Campaign
-
getValue
public int getValue(String ColumnName)
Get User Defined value- Returns:
- User defined
-
loadDocumentDetails
protected abstract String loadDocumentDetails()
Load Document Details- Returns:
- error message or null
-
getBalance
public abstract BigDecimal getBalance()
Get Source Currency Balance - subtracts line (and tax) amounts from total - no rounding- Returns:
- positive amount, if total header is bigger than lines
-
createFacts
public abstract ArrayList<Fact> createFacts(MAcctSchema as)
Create Facts (the accounting logic)- Parameters:
as
- accounting schema- Returns:
- Facts
-
getAcctSchema
protected MAcctSchema getAcctSchema()
- Returns:
- MAcctSchema
-
isDeferPosting
public boolean isDeferPosting()
Return document whether need to defer posting or not
-
-