Class MAllocationHdr

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_C_AllocationHdr, I_Persistent, DocAction, Evaluatee

public class MAllocationHdr extends X_C_AllocationHdr implements DocAction
Allocation Model. Allocation Trigger update of C_BPartner balance.
Version:
$Id: MAllocationHdr.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
  • FR [ 1866214 ]
  • https://sourceforge.net/p/adempiere/feature-requests/298/
  • FR [ 2520591 ] Support multiples calendar for Org
  • https://sourceforge.net/p/adempiere/feature-requests/631/
  • BF [ 2880182 ] Error you can allocate a payment to invoice that was paid
  • https://sourceforge.net/p/adempiere/bugs/2181/
  • See Also:
    • Constructor Details

      • MAllocationHdr

        public MAllocationHdr(Properties ctx, String C_AllocationHdr_UU, String trxName)
        UUID based Constructor
        Parameters:
        ctx - Context
        C_AllocationHdr_UU - UUID key
        trxName - Transaction
      • MAllocationHdr

        public MAllocationHdr(Properties ctx, int C_AllocationHdr_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        C_AllocationHdr_ID - id
        trxName - transaction
      • MAllocationHdr

        public MAllocationHdr(Properties ctx, boolean IsManual, Timestamp DateTrx, int C_Currency_ID, String description, String trxName)
        Mandatory New Constructor
        Parameters:
        ctx - context
        IsManual - manual trx
        DateTrx - date (if null today)
        C_Currency_ID - currency
        description - description
        trxName - transaction
      • MAllocationHdr

        public MAllocationHdr(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
    • Method Details

      • getOfPayment

        public static MAllocationHdr[] getOfPayment(Properties ctx, int C_Payment_ID, String trxName)
        Get Allocations of Payment
        Parameters:
        ctx - context
        C_Payment_ID - payment
        trxName - transaction
        Returns:
        allocations of payment
      • getOfInvoice

        public static MAllocationHdr[] getOfInvoice(Properties ctx, int C_Invoice_ID, String trxName)
        Get Allocations of Invoice
        Parameters:
        ctx - context
        C_Invoice_ID - payment
        trxName - transaction
        Returns:
        allocations of payment
      • getOfCash

        public static MAllocationHdr[] getOfCash(Properties ctx, int C_Cash_ID, String trxName)
        Get Allocations of Cash
        Parameters:
        ctx - context
        C_Cash_ID - Cash ID
        trxName - transaction
        Returns:
        allocations of payment
      • getLines

        public MAllocationLine[] getLines(boolean requery)
        Get Allocation Lines
        Parameters:
        requery - if true requery
        Returns:
        allocation lines
      • setProcessed

        public void setProcessed(boolean processed)
        Set Processed
        Specified by:
        setProcessed in interface I_C_AllocationHdr
        Overrides:
        setProcessed in class X_C_AllocationHdr
        Parameters:
        processed - Processed
      • beforeSave

        protected boolean beforeSave(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord -
        Returns:
        save
      • beforeDelete

        protected boolean beforeDelete()
        Before Delete.
        Overrides:
        beforeDelete in class PO
        Returns:
        true if acct was deleted
      • afterDelete

        protected boolean afterDelete(boolean success)
        Description copied from class: PO
        Executed after Delete operation.
        Overrides:
        afterDelete in class PO
        Parameters:
        success - true if record deleted
        Returns:
        true if delete is a success
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        After Save
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord -
        success -
        Returns:
        success
      • processIt

        public boolean processIt(String processAction)
        Process document
        Specified by:
        processIt in interface DocAction
        Parameters:
        processAction - document action
        Returns:
        true if performed
      • unlockIt

        public boolean unlockIt()
        Unlock Document.
        Specified by:
        unlockIt in interface DocAction
        Returns:
        true if success
      • invalidateIt

        public boolean invalidateIt()
        Invalidate Document
        Specified by:
        invalidateIt in interface DocAction
        Returns:
        true if success
      • prepareIt

        public String prepareIt()
        Prepare Document
        Specified by:
        prepareIt in interface DocAction
        Returns:
        new status (In Progress or Invalid)
      • approveIt

        public boolean approveIt()
        Approve Document
        Specified by:
        approveIt in interface DocAction
        Returns:
        true if success
      • rejectIt

        public boolean rejectIt()
        Reject Approval
        Specified by:
        rejectIt in interface DocAction
        Returns:
        true if success
      • completeIt

        public String completeIt()
        Complete Document
        Specified by:
        completeIt in interface DocAction
        Returns:
        new status (Complete, In Progress, Invalid, Waiting ..)
      • voidIt

        public boolean voidIt()
        Void Document.
        Specified by:
        voidIt in interface DocAction
        Returns:
        true if success
      • closeIt

        public boolean closeIt()
        Close Document.
        Specified by:
        closeIt in interface DocAction
        Returns:
        true if success
      • reverseCorrectIt

        public boolean reverseCorrectIt()
        Reverse Correction (using original DateAcct)
        Specified by:
        reverseCorrectIt in interface DocAction
        Returns:
        true if success
      • reverseAccrualIt

        public boolean reverseAccrualIt()
        Reverse Accrual (using current date as DateAcct)
        Specified by:
        reverseAccrualIt in interface DocAction
        Returns:
        false
      • reActivateIt

        public boolean reActivateIt()
        Re-activate
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        false
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class X_C_AllocationHdr
        Returns:
        info
      • getDocumentInfo

        public String getDocumentInfo()
        Get Document Info
        Specified by:
        getDocumentInfo in interface DocAction
        Returns:
        document info (untranslated)
      • createPDF

        public File createPDF()
        Create PDF
        Specified by:
        createPDF in interface DocAction
        Returns:
        File or null
      • createPDF

        public File createPDF(File file)
        Create PDF file.
        Parameters:
        file - output file
        Returns:
        not implemented, always return null
      • getSummary

        public String getSummary()
        Get Summary
        Specified by:
        getSummary in interface DocAction
        Returns:
        Summary of Document
      • getProcessMsg

        public String getProcessMsg()
        Get Process Message
        Specified by:
        getProcessMsg in interface DocAction
        Returns:
        clear text error message
      • getDoc_User_ID

        public int getDoc_User_ID()
        Get Document Owner (Responsible)
        Specified by:
        getDoc_User_ID in interface DocAction
        Returns:
        AD_User_ID
      • addDescription

        public void addDescription(String description)
        Add to Description
        Parameters:
        description - text
      • isComplete

        public boolean isComplete()
        Document Status is Complete, Closed or Reversed
        Returns:
        true if CO, CL or RE
      • copyFrom

        public static MAllocationHdr copyFrom(MAllocationHdr from, Timestamp dateAcct, Timestamp dateTrx, String trxName)
        Create new Allocation by copying
        Parameters:
        from - source allocation to copy from
        dateAcct - date of the document accounting date
        dateTrx - date of the document transaction.
        trxName -
        Returns:
        Allocation
      • copyLinesFrom

        public int copyLinesFrom(MAllocationHdr otherAllocation)
        Copy Lines From other Allocation.
        Parameters:
        otherAllocation - other allocation to copy from
        Returns:
        number of lines copied
      • getDescriptionForManualAllocation

        public String getDescriptionForManualAllocation(int bpartnerID, String trxName)
        Parameters:
        bpartnerID -
        trxName -
        Returns:
        Returns a description parsing the bpartner in allocation header and then the allocation document itself