Compiere 3.1

org.compiere.acct
Class Doc_Allocation

java.lang.Object
  extended by org.compiere.acct.Doc
      extended by org.compiere.acct.Doc_Allocation
All Implemented Interfaces:
AccountingInterface

public class Doc_Allocation
extends Doc

Post Allocation Documents.

  Table:              C_AllocationHdr
  Document Types:     CMA
  

Version:
$Id: Doc_Allocation.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $
Author:
Jorg Janke

Field Summary
 
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_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_WOCloseExpenseAcct, ACCTTYPE_WOMaterial, ACCTTYPE_WriteOff, AMTTYPE_Charge, AMTTYPE_Gross, AMTTYPE_Net, log, NO_CURRENCY, p_Error, p_lines, p_po, p_Status, s_log, STATUS_DocumentError, STATUS_Error, STATUS_InvalidAccount, STATUS_NotBalanced, STATUS_NotConvertible, STATUS_NotPosted, STATUS_PeriodClosed, STATUS_Posted, STATUS_PostPrepared
 
Constructor Summary
Doc_Allocation(MAcctSchema[] ass, ResultSet rs, String trxName)
          Constructor
 
Method Summary
 ArrayList<Fact> createFacts(MAcctSchema as)
          Create Facts (the accounting logic) for CMA.
 BigDecimal getBalance()
          Get Source Currency Balance - subtracts line and tax amounts from total - no rounding
 String loadDocumentDetails()
          Load Specific Document Details
 
Methods inherited from class org.compiere.acct.Doc
get_ID, get_Table_ID, get_TableName, get, get, getAccount, 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_SalesRegion_ID, getCtx, getDateAcct, getDateDoc, getDescription, getDocLine, getDocumentNo, getDocumentType, getGL_Budget_ID, getGL_Category_ID, getM_Product_ID, getM_Warehouse_ID, getM_WorkOrder_ID, getPO, getQty, getSalesRep_ID, getTrxName, getUser1_ID, getUser2_ID, getValidCombination_ID, getValue, isBalanced, isConvertible, isMultiCurrency, isPeriodOpen, isPosted, isReturnTrx, isSOTrx, isTaxIncluded, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Doc_Allocation

public Doc_Allocation(MAcctSchema[] ass,
                      ResultSet rs,
                      String trxName)
Constructor

Parameters:
ass - accounting schemata
rs - record
trxName - trx
Method Detail

loadDocumentDetails

public String loadDocumentDetails()
Load Specific Document Details

Specified by:
loadDocumentDetails in interface AccountingInterface
Specified by:
loadDocumentDetails in class Doc
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 interface AccountingInterface
Specified by:
getBalance in class Doc
Returns:
positive amount, if total invoice is bigger than lines

createFacts

public ArrayList<Fact> createFacts(MAcctSchema as)
Create Facts (the accounting logic) for CMA.
  AR_Invoice_Payment
      UnAllocatedCash DR
      or C_Prepayment
      DiscountExp     DR
      WriteOff        DR
      Receivables             CR
  AR_Invoice_Cash
      CashTransfer    DR
      DiscountExp     DR
      WriteOff        DR
      Receivables             CR
 
  AP_Invoice_Payment
      Liability       DR
      DiscountRev             CR
      WriteOff                CR
      PaymentSelect           CR
      or V_Prepayment
  AP_Invoice_Cash
      Liability       DR
      DiscountRev             CR
      WriteOff                CR
      CashTransfer            CR
  CashBankTransfer
      -
  ==============================
  Realized Gain & Loss
                AR/AP                   DR              CR
                Realized G/L    DR              CR
 

  
Tax needs to be corrected for discount & write-off; Currency gain & loss is realized here.

Specified by:
createFacts in class Doc
Parameters:
as - accounting schema
Returns:
Fact

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.