Class Allocation

java.lang.Object
org.compiere.apps.form.Allocation
Direct Known Subclasses:
BrERPAllocation, WAllocation

public class Allocation extends Object
Author:
hengsin
  • Field Details

    • format

      protected DecimalFormat format
    • log

      protected static final CLogger log
      Logger
    • m_C_Currency_ID

      protected int m_C_Currency_ID
    • m_C_Charge_ID

      protected int m_C_Charge_ID
    • m_C_DocType_ID

      protected int m_C_DocType_ID
    • m_C_BPartner_ID

      protected int m_C_BPartner_ID
    • totalInv

      protected BigDecimal totalInv
    • totalPay

      protected BigDecimal totalPay
    • totalDiff

      protected BigDecimal totalDiff
    • allocDate

      protected Timestamp allocDate
    • m_AD_Org_ID

      protected int m_AD_Org_ID
  • Constructor Details

    • Allocation

      public Allocation()
  • Method Details

    • dynInit

      protected void dynInit() throws Exception
      Throws:
      Exception
    • checkBPartner

      public void checkBPartner()
      Load Business Partner Info - Payments - Invoices
    • getPaymentData

      public Vector<Vector<Object>> getPaymentData(boolean isMultiCurrency, Object date, IMiniTable paymentTable)
      Deprecated.
      Parameters:
      isMultiCurrency -
      date -
      paymentTable - not used
      Returns:
      list of payment record
    • getPaymentData

      public Vector<Vector<Object>> getPaymentData(boolean isMultiCurrency, Timestamp date, String trxName)
      Parameters:
      isMultiCurrency -
      date -
      trxName - optional trx name
      Returns:
      list of payment record
    • getPaymentColumnNames

      public Vector<String> getPaymentColumnNames(boolean isMultiCurrency)
      Parameters:
      isMultiCurrency -
      Returns:
      column name list for payment data
    • setPaymentColumnClass

      public void setPaymentColumnClass(IMiniTable paymentTable, boolean isMultiCurrency)
      Parameters:
      paymentTable -
      isMultiCurrency -
    • getInvoiceData

      public Vector<Vector<Object>> getInvoiceData(boolean isMultiCurrency, Object date, IMiniTable invoiceTable)
      Deprecated.
      Parameters:
      isMultiCurrency -
      date -
      invoiceTable - not use
      Returns:
      list of unpaid invoice data
    • getInvoiceData

      public Vector<Vector<Object>> getInvoiceData(boolean isMultiCurrency, Timestamp date, String trxName)
      Parameters:
      isMultiCurrency -
      date -
      trxName - optional trx name
      Returns:
      list of unpaid invoice data
    • getInvoiceColumnNames

      public Vector<String> getInvoiceColumnNames(boolean isMultiCurrency)
      Parameters:
      isMultiCurrency -
      Returns:
      list of column name/header
    • setInvoiceColumnClass

      public void setInvoiceColumnClass(IMiniTable invoiceTable, boolean isMultiCurrency)
      set class type for each column
      Parameters:
      invoiceTable -
      isMultiCurrency -
    • prepareForCalculate

      protected void prepareForCalculate(boolean isMultiCurrency)
      set column index for single or multi currency
      Parameters:
      isMultiCurrency -
    • writeOff

      public String writeOff(int row, int col, boolean isInvoice, IMiniTable payment, IMiniTable invoice, boolean isAutoWriteOff)
      update payment or invoice applied and write off amount
      Parameters:
      row - row to update
      col - change is trigger by selected or applied column
      isInvoice - update invoice or payment applied amount
      payment -
      invoice -
      isAutoWriteOff - true to write off difference, false to use over/under for difference
      Returns:
      warning message (if any)
    • calculate

      public void calculate(IMiniTable paymentTable, IMiniTable invoiceTable, boolean isMultiCurrency)
      perform allocation calculation
      Parameters:
      paymentTable -
      invoiceTable -
      isMultiCurrency -
    • calculatePayment

      public String calculatePayment(IMiniTable payment, boolean isMultiCurrency)
      Calculate selected payment total
      Parameters:
      payment -
      isMultiCurrency -
      Returns:
      payment summary
    • getPaymentInfoText

      public String getPaymentInfoText()
      Returns:
      summary info for payment selected and total applied
    • calculateInvoice

      public String calculateInvoice(IMiniTable invoice, boolean isMultiCurrency)
      calculate selected invoice total
      Parameters:
      invoice -
      isMultiCurrency -
      Returns:
      invoice summary
    • getInvoiceInfoText

      public String getInvoiceInfoText()
      Returns:
      summary info for invoice selected and total applied
    • saveData

      public MAllocationHdr saveData(int m_WindowNo, Timestamp dateTrx, IMiniTable payment, IMiniTable invoice, String trxName)
      Save allocation data
      Parameters:
      m_WindowNo -
      dateTrx -
      payment -
      invoice -
      trxName -
      Returns:
      MAllocationHdr
    • getC_BPartner_ID

      public int getC_BPartner_ID()
      Returns:
      C_BPartner_ID
    • setC_BPartner_ID

      public void setC_BPartner_ID(int C_BPartner_ID)
      Parameters:
      C_BPartner_ID -
    • getC_Currency_ID

      public int getC_Currency_ID()
      Returns:
      C_Currency_ID
    • setC_Currency_ID

      public void setC_Currency_ID(int C_Currency_ID)
      Parameters:
      C_Currency_ID -
    • getC_DocType_ID

      public int getC_DocType_ID()
      Returns:
      C_DocType_ID
    • setC_DocType_ID

      public void setC_DocType_ID(int C_DocType_ID)
      Parameters:
      C_DocType_ID -
    • getC_Charge_ID

      public int getC_Charge_ID()
      Returns:
      C_Charge_ID
    • setC_Charge_ID

      public void setC_Charge_ID(int C_Charge_ID)
      Parameters:
      C_Charge_ID -
    • getAD_Org_ID

      public int getAD_Org_ID()
      Returns:
      AD_Org_ID
    • setAD_Org_ID

      public void setAD_Org_ID(int AD_Org_ID)
      Parameters:
      AD_Org_ID -
    • getSelectedInvoiceCount

      public int getSelectedInvoiceCount()
      Returns:
      number of selected invoice
    • getSelectedPaymentCount

      public int getSelectedPaymentCount()
      Returns:
      number of selected payment
    • getInvoiceAppliedTotal

      public BigDecimal getInvoiceAppliedTotal()
      Returns:
      total of invoice applied amount
    • getPaymentAppliedTotal

      public BigDecimal getPaymentAppliedTotal()
      Returns:
      total of payment applied amount
    • isOkToAllocate

      public boolean isOkToAllocate()
      Returns:
      true if all condition is meet to proceed with allocation
    • getTotalDifference

      public BigDecimal getTotalDifference()
      Returns:
      difference between invoice and payment applied amount
    • calculateDifference

      public void calculateDifference()
      calculate difference between invoice and payment applied amount