Package org.compiere.acct
Class Doc_Invoice
- java.lang.Object
-
- org.compiere.acct.Doc
-
- org.compiere.acct.Doc_Invoice
-
public class Doc_Invoice extends Doc
Post Invoice Documents.Table: C_Invoice (318) Document Types: ARI, ARC, ARF, API, APC
- Version:
- $Id: Doc_Invoice.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $
- Author:
- Jorg Janke, Armen Rizal, Goodwill Consulting
- BF: 2797257 Landed Cost Detail is not using allocation qty
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_allLinesItem
All lines are product itemprotected boolean
m_allLinesService
All lines are Serviceprotected int
m_precision
Currency Precisionprotected DocTax[]
m_taxes
Contained Optional Tax Lines-
Fields inherited from class org.compiere.acct.Doc
ACCTTYPE_BankAsset, ACCTTYPE_BankInTransit, ACCTTYPE_C_Prepayment, ACCTTYPE_C_Receivable, ACCTTYPE_C_Receivable_Services, ACCTTYPE_CashAsset, ACCTTYPE_CashDifference, ACCTTYPE_CashExpense, ACCTTYPE_CashReceipt, ACCTTYPE_CashTransfer, ACCTTYPE_Charge, ACCTTYPE_CommitmentOffset, ACCTTYPE_CommitmentOffsetSales, ACCTTYPE_DiscountExp, ACCTTYPE_DiscountRev, ACCTTYPE_InterestExp, ACCTTYPE_InterestRev, ACCTTYPE_InvDifferences, ACCTTYPE_NotInvoicedReceipts, ACCTTYPE_PaymentSelect, ACCTTYPE_PPVOffset, ACCTTYPE_ProjectAsset, ACCTTYPE_ProjectWIP, ACCTTYPE_UnallocatedCash, ACCTTYPE_V_Liability, ACCTTYPE_V_Liability_Services, ACCTTYPE_V_Prepayment, ACCTTYPE_WriteOff, AMTTYPE_Charge, AMTTYPE_Gross, AMTTYPE_Net, DOC_TYPE_BY_DOC_BASE_TYPE_SQL, DOCTYPE_Allocation, DOCTYPE_APCredit, DOCTYPE_APInvoice, DOCTYPE_APPayment, DOCTYPE_ARCredit, DOCTYPE_ARInvoice, DOCTYPE_ARProForma, DOCTYPE_ARReceipt, DOCTYPE_BankStatement, DOCTYPE_CashJournal, DOCTYPE_GLJournal, DOCTYPE_MatInventory, DOCTYPE_MatMatchInv, DOCTYPE_MatMatchPO, DOCTYPE_MatMovement, DOCTYPE_MatProduction, DOCTYPE_MatReceipt, DOCTYPE_MatShipment, DOCTYPE_POrder, DOCTYPE_ProjectIssue, DOCTYPE_PurchaseRequisition, DOCTYPE_SOrder, log, NO_CURRENCY, p_Error, p_lines, p_po, p_Status, s_log, STATUS_Deferred, STATUS_Error, STATUS_InvalidAccount, STATUS_NotBalanced, STATUS_NotConvertible, STATUS_NotPosted, STATUS_PeriodClosed, STATUS_Posted, STATUS_PostPrepared
-
-
Constructor Summary
Constructors Constructor Description Doc_Invoice(MAcctSchema as, ResultSet rs, String trxName)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
createFactCash(MAcctSchema as, Fact fact, BigDecimal multiplier)
Create Fact Cash Based (i.e. only revenue/expense)ArrayList<Fact>
createFacts(MAcctSchema as)
Create Facts (the accounting logic) for ARI, ARC, ARF, API, APC.BigDecimal
getBalance()
Get Source Currency Balance - subtracts line and tax amounts from total - no roundingBigDecimal
getCurrencyRate()
boolean
isConvertible(MAcctSchema acctSchema)
Is Document convertible to currency and Conversion Typeprotected boolean
landedCost(MAcctSchema as, Fact fact, DocLine line, boolean dr)
Create Landed Cost accounting and Cost linesprotected String
loadDocumentDetails()
Load Specific Document Detailsprotected void
updateProductPO(MAcctSchema as)
Update ProductPO PriceLastInv-
Methods inherited from class org.compiere.acct.Doc
deleteAcct, get, get, get_ID, get_Table_ID, get_TableName, getAccount, getAcctSchema, getAD_Client_ID, getAD_Org_ID, getAD_OrgTrx_ID, getAmount, getAmount, getBP_C_SalesRegion_ID, getC_Activity_ID, getC_BankAccount_ID, getC_BPartner_ID, getC_BPartner_Location_ID, getC_Campaign_ID, getC_CashBook_ID, getC_Charge_ID, getC_ConversionType_ID, getC_Currency_ID, getC_DocType_ID, getC_LocFrom_ID, getC_LocTo_ID, getC_Period_ID, getC_Project_ID, getC_ProjectPhase_ID, getC_ProjectTask_ID, getC_SalesRegion_ID, getCtx, getDateAcct, getDateDoc, getDescription, getDocLine, getDocumentNo, getDocumentType, getFacts, getGL_Budget_ID, getGL_Category_ID, getM_Product_ID, getM_Warehouse_ID, getPO, getPostStatus, getQty, getSalesRep_ID, getTrxName, getUser1_ID, getUser2_ID, getValidCombination_ID, getValue, isBalanced, isDeferPosting, isMultiCurrency, isPeriodOpen, isPosted, isSOTrx, isTaxIncluded, manualPosting, post, postImmediate, setAmount, setBP_C_SalesRegion_ID, setC_BankAccount_ID, setC_BPartner_ID, setC_CashBook_ID, setC_Currency_ID, setC_LocFrom_ID, setC_LocTo_ID, setDateAcct, setDateDoc, setDocumentType, setIsMultiCurrency, setIsTaxIncluded, setPeriod, setQty, toString
-
-
-
-
Field Detail
-
m_taxes
protected DocTax[] m_taxes
Contained Optional Tax Lines
-
m_precision
protected int m_precision
Currency Precision
-
m_allLinesService
protected boolean m_allLinesService
All lines are Service
-
m_allLinesItem
protected boolean m_allLinesItem
All lines are product item
-
-
Constructor Detail
-
Doc_Invoice
public Doc_Invoice(MAcctSchema as, ResultSet rs, String trxName)
Constructor- Parameters:
as
- accounting schematars
- recordtrxName
- trx
-
-
Method Detail
-
loadDocumentDetails
protected String loadDocumentDetails()
Load Specific Document Details- Specified by:
loadDocumentDetails
in classDoc
- Returns:
- error message or null
-
getBalance
public BigDecimal getBalance()
Get Source Currency Balance - subtracts line and tax amounts from total - no rounding- Specified by:
getBalance
in classDoc
- Returns:
- positive amount, if total invoice is bigger than lines
-
createFacts
public ArrayList<Fact> createFacts(MAcctSchema as)
Create Facts (the accounting logic) for ARI, ARC, ARF, API, APC.ARI, ARF Receivables DR Charge CR TaxDue CR Revenue CR ARC Receivables CR Charge DR TaxDue DR Revenue RR API Payables CR Charge DR TaxCredit DR Expense DR APC Payables DR Charge CR TaxCredit CR Expense CR
- Specified by:
createFacts
in classDoc
- Parameters:
as
- accounting schema- Returns:
- Fact
-
createFactCash
public BigDecimal createFactCash(MAcctSchema as, Fact fact, BigDecimal multiplier)
Create Fact Cash Based (i.e. only revenue/expense)- Parameters:
as
- accounting schemafact
- fact to add lines tomultiplier
- source amount multiplier- Returns:
- accounted amount
-
landedCost
protected boolean landedCost(MAcctSchema as, Fact fact, DocLine line, boolean dr)
Create Landed Cost accounting and Cost lines- Parameters:
as
- accounting schemafact
- factline
- document linedr
- DR entry (normal api)- Returns:
- true if landed costs were created
-
updateProductPO
protected void updateProductPO(MAcctSchema as)
Update ProductPO PriceLastInv- Parameters:
as
- accounting schema
-
getCurrencyRate
public BigDecimal getCurrencyRate()
- Overrides:
getCurrencyRate
in classDoc
-
isConvertible
public boolean isConvertible(MAcctSchema acctSchema)
Description copied from class:Doc
Is Document convertible to currency and Conversion Type- Overrides:
isConvertible
in classDoc
- Parameters:
acctSchema
- accounting schema- Returns:
- true, if convertible to accounting currency
-
-