Package org.compiere.apps.form
Class Allocation
java.lang.Object
org.compiere.apps.form.Allocation
- Direct Known Subclasses:
WAllocation
Form to create allocation (C_AllocationHdr and C_AllocationLine).
- Author:
- hengsin
-
Field Summary
Modifier and TypeFieldDescriptionprotected Timestamp
protected DecimalFormat
protected static final CLogger
Loggerprotected int
protected int
protected int
protected int
protected int
protected BigDecimal
protected BigDecimal
protected BigDecimal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calculate
(IMiniTable paymentTable, IMiniTable invoiceTable, boolean isMultiCurrency) Perform allocation calculationvoid
Calculate difference between invoice and payment applied amountcalculateInvoice
(IMiniTable invoice, boolean isMultiCurrency) Calculate total of selected invoicescalculatePayment
(IMiniTable payment, boolean isMultiCurrency) Calculate total of selected paymentsvoid
Load Business Partner Info Payments Invoicesprotected void
dynInit()
int
int
int
int
int
Get total of invoice applied amountgetInvoiceColumnNames
(boolean isMultiCurrency) Get column names forgetInvoiceData(boolean, Timestamp, String)
getInvoiceData
(boolean isMultiCurrency, Object date, IMiniTable invoiceTable) Deprecated.getInvoiceData
(boolean isMultiCurrency, Timestamp date, String trxName) Get unpaid invoicesGet summary info for invoice selected and total appliedGet total of payment applied amountgetPaymentColumnNames
(boolean isMultiCurrency) Get column names forgetPaymentData(boolean, Timestamp, String)
getPaymentData
(boolean isMultiCurrency, Object date, IMiniTable paymentTable) Deprecated.getPaymentData
(boolean isMultiCurrency, Timestamp date, String trxName) Get unallocated payment recordsGet summary info for payment selected and total appliedint
Get number of selected invoiceint
Get number of selected paymentGet difference between invoice and payment applied amountboolean
Is ok to perform allocationprotected void
prepareForCalculate
(boolean isMultiCurrency) Set column index for single or multi currency tablesaveData
(int m_WindowNo, Timestamp dateTrx, IMiniTable payment, IMiniTable invoice, String trxName) Save allocation datavoid
setAD_Org_ID
(int AD_Org_ID) void
setC_BPartner_ID
(int C_BPartner_ID) void
setC_Charge_ID
(int C_Charge_ID) void
setC_Currency_ID
(int C_Currency_ID) void
setC_DocType_ID
(int C_DocType_ID) void
setInvoiceColumnClass
(IMiniTable invoiceTable, boolean isMultiCurrency) Set class type for each columnvoid
setPaymentColumnClass
(IMiniTable paymentTable, boolean isMultiCurrency) Set class/type of columnswriteOff
(int row, int col, boolean isInvoice, IMiniTable payment, IMiniTable invoice, boolean isAutoWriteOff) Update payment or invoice applied and write off amount
-
Field Details
-
format
-
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
-
totalPay
-
totalDiff
-
allocDate
-
m_AD_Org_ID
protected int m_AD_Org_ID
-
-
Constructor Details
-
Allocation
public Allocation()
-
-
Method Details
-
dynInit
- 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) Get unallocated payment records- Parameters:
isMultiCurrency
-date
-trxName
- optional trx name- Returns:
- list of payment record
-
getPaymentColumnNames
Get column names forgetPaymentData(boolean, Timestamp, String)
- Parameters:
isMultiCurrency
-- Returns:
- column name list for payment data
-
setPaymentColumnClass
Set class/type of columns- 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) Get unpaid invoices- Parameters:
isMultiCurrency
-date
-trxName
- optional trx name- Returns:
- list of unpaid invoice data
-
getInvoiceColumnNames
Get column names forgetInvoiceData(boolean, Timestamp, String)
- Parameters:
isMultiCurrency
-- Returns:
- list of column name/header
-
setInvoiceColumnClass
Set class type for each column- Parameters:
invoiceTable
-isMultiCurrency
-
-
prepareForCalculate
protected void prepareForCalculate(boolean isMultiCurrency) Set column index for single or multi currency table- 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 updatecol
- change is trigger by selected or applied columnisInvoice
- update invoice or payment applied amountpayment
-invoice
-isAutoWriteOff
- true to write off difference, false to use over/under for difference- Returns:
- warning message (if any)
-
calculate
Perform allocation calculation- Parameters:
paymentTable
-invoiceTable
-isMultiCurrency
-
-
calculatePayment
Calculate total of selected payments- Parameters:
payment
-isMultiCurrency
-- Returns:
- payment summary
-
getPaymentInfoText
Get summary info for payment selected and total applied- Returns:
- summary info for payment selected and total applied
-
calculateInvoice
Calculate total of selected invoices- Parameters:
invoice
-isMultiCurrency
-- Returns:
- invoice summary
-
getInvoiceInfoText
Get summary info for invoice selected and total applied- 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()Get number of selected invoice- Returns:
- number of selected invoice
-
getSelectedPaymentCount
public int getSelectedPaymentCount()Get number of selected payment- Returns:
- number of selected payment
-
getInvoiceAppliedTotal
Get total of invoice applied amount- Returns:
- total of invoice applied amount
-
getPaymentAppliedTotal
Get total of payment applied amount- Returns:
- total of payment applied amount
-
isOkToAllocate
public boolean isOkToAllocate()Is ok to perform allocation- Returns:
- true if all condition is meet to proceed with allocation
-
getTotalDifference
Get difference between invoice and payment applied amount- Returns:
- difference between invoice and payment applied amount
-
calculateDifference
public void calculateDifference()Calculate difference between invoice and payment applied amount
-