Package org.compiere.apps.form
Class Allocation
java.lang.Object
org.compiere.apps.form.Allocation
- Direct Known Subclasses:
BrERPAllocation
,WAllocation
- 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 selected invoice totalcalculatePayment
(IMiniTable payment, boolean isMultiCurrency) Calculate selected payment totalvoid
Load Business Partner Info - Payments - Invoicesprotected void
dynInit()
int
int
int
int
int
getInvoiceColumnNames
(boolean isMultiCurrency) getInvoiceData
(boolean isMultiCurrency, Object date, IMiniTable invoiceTable) Deprecated.getInvoiceData
(boolean isMultiCurrency, Timestamp date, String trxName) getPaymentColumnNames
(boolean isMultiCurrency) getPaymentData
(boolean isMultiCurrency, Object date, IMiniTable paymentTable) Deprecated.getPaymentData
(boolean isMultiCurrency, Timestamp date, String trxName) int
int
boolean
protected void
prepareForCalculate
(boolean isMultiCurrency) set column index for single or multi currencysaveData
(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) writeOff
(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) - Parameters:
isMultiCurrency
-date
-trxName
- optional trx name- Returns:
- list of payment record
-
getPaymentColumnNames
- Parameters:
isMultiCurrency
-- Returns:
- column name list for payment data
-
setPaymentColumnClass
- 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
- 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- 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 selected payment total- Parameters:
payment
-isMultiCurrency
-- Returns:
- payment summary
-
getPaymentInfoText
- Returns:
- summary info for payment selected and total applied
-
calculateInvoice
calculate selected invoice total- Parameters:
invoice
-isMultiCurrency
-- Returns:
- invoice summary
-
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
- Returns:
- total of invoice applied amount
-
getPaymentAppliedTotal
- Returns:
- total of payment applied amount
-
isOkToAllocate
public boolean isOkToAllocate()- Returns:
- true if all condition is meet to proceed with allocation
-
getTotalDifference
- Returns:
- difference between invoice and payment applied amount
-
calculateDifference
public void calculateDifference()calculate difference between invoice and payment applied amount
-