Class Doc_AllocationHdr


  • public class Doc_AllocationHdr
    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 $ FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual Avoid posting if Receipt and both accounts Unallocated Cash and Receivable are equal Avoid posting if Payment and both accounts Payment Select and Liability are equal
    Author:
    Jorg Janke, phib BF [ 2019262 ] Allocation posting currency gain/loss omits line reference
    • Constructor Detail

      • Doc_AllocationHdr

        public Doc_AllocationHdr​(MAcctSchema as,
                                 ResultSet rs,
                                 String trxName)
        Constructor
        Parameters:
        as - accounting schema
        rs - record
        trxName - trx
    • Method Detail

      • loadDocumentDetails

        protected String loadDocumentDetails()
        Load Specific Document Details
        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 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 and Loss
                        AR/AP                   DR              CR
                        Realized G/L    DR              CR
        
        
          
        Tax needs to be corrected for discount and write-off; Currency gain and loss is realized here.
        Specified by:
        createFacts in class Doc
        Parameters:
        as - accounting schema
        Returns:
        Fact