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
    Payment Allocation Model. Allocation Trigger update C_BPartner
    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:
    Serialized Form
    • Constructor Detail

      • 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 Detail

      • 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 Lines
        Parameters:
        requery - if true requery
        Returns:
        lines
      • 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. Same as Close.
        Specified by:
        voidIt in interface DocAction
        Returns:
        true if success
      • closeIt

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

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

        public boolean reverseAccrualIt()
        Reverse Accrual - none
        Specified by:
        reverseAccrualIt in interface DocAction
        Returns:
        false
      • reActivateIt

        public boolean reActivateIt()
        Re-activate
        Specified by:
        reActivateIt in interface DocAction
        Returns:
        false
      • 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:
        file if success
      • 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 or Closed
        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 - allocation
        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 - allocation
        Returns:
        number of lines copied
      • getDescriptionForManualAllocation

        public String getDescriptionForManualAllocation​(int bpartnerID,
                                                        String trxName)
        Returns a description parsing the bpartner defined in the Allocation form and then the allocation itself