Package org.compiere.process
Class CommissionCalc
- java.lang.Object
-
- org.compiere.process.SvrProcess
-
- org.compiere.process.CommissionCalc
-
- All Implemented Interfaces:
ProcessCall
public class CommissionCalc extends SvrProcess
Commission Calculation- Version:
- $Id: CommissionCalc.java,v 1.3 2006/09/25 00:59:41 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description protected MCommission
m_com
protected Timestamp
m_EndDate
protected Timestamp
p_StartDate
-
Fields inherited from class org.compiere.process.SvrProcess
log, MSG_InvalidArguments, MSG_SaveErrorRowNotFound, PROCESS_INFO_CTX_KEY, PROCESS_UI_CTX_KEY, processUI
-
-
Constructor Summary
Constructors Constructor Description CommissionCalc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkParameters()
Check if the process parameters are validprotected MCommissionRun
createCommissionRun()
Creates the Commission run with the parameter start date and sets the descriptionprotected void
createDetail(String sql, MCommissionAmt comAmt)
Create Commission Detailprotected String
doIt()
Perform process.protected String
getCommissionCalculationSQL(MCommissionLine commissionLine)
Creates the SQL statement string that is used to generate the Commission detail recordsprotected String
getCommissionLineWhereClause(MCommissionLine commissionLine)
Creates the SQL WHERE clause based on the field values defined in the Commission Lien recordprotected String
getCommissionRunDescription()
Returns the String that will be used for the description column in the Commission Runprotected String
getInvoiceCommissionSQL()
Creates the SQL statement for invoices (C_Invoice)protected String
getOrderCommissionSQL()
Creates the SQL statement for orders (C_Order)protected String
getPaymentCommissionSQL()
Creates the SQL statement for payments (C_Payment)protected void
prepare()
Prepare - e.g., get Parameters.protected void
setStartEndDate()
Set Start and End Date-
Methods inherited from class org.compiere.process.SvrProcess
addBufferLog, addLog, addLog, addLog, commit, commitEx, doIt, get_TrxName, getAD_Client_ID, getAD_PInstance_ID, getAD_User_ID, getCtx, getName, getParameter, getProcessInfo, getRecord_ID, getRecord_IDs, getTable_ID, isLocked, lockObject, postProcess, rollback, setProcessUI, startProcess, statusUpdate, unlockObject
-
-
-
-
Field Detail
-
p_StartDate
protected Timestamp p_StartDate
-
m_EndDate
protected Timestamp m_EndDate
-
m_com
protected MCommission m_com
-
-
Method Detail
-
prepare
protected void prepare()
Prepare - e.g., get Parameters.- Specified by:
prepare
in classSvrProcess
-
doIt
protected String doIt() throws Exception
Perform process.- Specified by:
doIt
in classSvrProcess
- Returns:
- Message (text with variables)
- Throws:
Exception
- if not successful
-
checkParameters
protected void checkParameters()
Check if the process parameters are valid- Throws:
Exception
- if the commission record is not valid
-
createCommissionRun
protected MCommissionRun createCommissionRun()
Creates the Commission run with the parameter start date and sets the description- Returns:
- MCommissionRun
-
getCommissionRunDescription
protected String getCommissionRunDescription()
Returns the String that will be used for the description column in the Commission Run- Returns:
- Description String
-
getCommissionCalculationSQL
protected String getCommissionCalculationSQL(MCommissionLine commissionLine)
Creates the SQL statement string that is used to generate the Commission detail records- Parameters:
commissionLine
- MCommissionLine- Returns:
- SQL statement
-
getPaymentCommissionSQL
protected String getPaymentCommissionSQL()
Creates the SQL statement for payments (C_Payment)- Returns:
- SQL statement
-
getOrderCommissionSQL
protected String getOrderCommissionSQL()
Creates the SQL statement for orders (C_Order)- Returns:
- SQL statement
-
getInvoiceCommissionSQL
protected String getInvoiceCommissionSQL()
Creates the SQL statement for invoices (C_Invoice)- Returns:
- SQL statement
-
getCommissionLineWhereClause
protected String getCommissionLineWhereClause(MCommissionLine commissionLine)
Creates the SQL WHERE clause based on the field values defined in the Commission Lien record- Returns:
- SQL statement
-
setStartEndDate
protected void setStartEndDate()
Set Start and End Date
-
createDetail
protected void createDetail(String sql, MCommissionAmt comAmt) throws Exception
Create Commission Detail- Parameters:
sql
- sql statementcomAmt
- parent- Throws:
Exception
-
-