Package org.compiere.process
Class CommissionCalc
java.lang.Object
org.compiere.process.SvrProcess
org.compiere.process.CommissionCalc
- All Implemented Interfaces:
ProcessCall
Commission Calculation
- Version:
- $Id: CommissionCalc.java,v 1.3 2006/09/25 00:59:41 jjanke Exp $
- Author:
- Jorg Janke
-
Field Summary
Fields inherited from class org.compiere.process.SvrProcess
log, MSG_InvalidArguments, MSG_SaveErrorRowNotFound, PROCESS_INFO_CTX_KEY, PROCESS_UI_CTX_KEY, processUI
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check if the process parameters are validprotected MCommissionRun
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
Returns the String that will be used for the description column in the Commission Runprotected String
Creates the SQL statement for invoices (C_Invoice)protected String
Creates the SQL statement for orders (C_Order)protected String
Creates the SQL statement for payments (C_Payment)protected void
prepare()
Prepare - e.g., get Parameters.protected void
Set Start and End DateMethods 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, getRecord_UU, getRecord_UUs, getTable_ID, isLocked, lockObject, postProcess, rollback, saveProgress, saveStatus, setProcessUI, startProcess, statusUpdate, unlockObject, updateProgress
-
Field Details
-
p_StartDate
-
m_EndDate
-
m_com
-
-
Constructor Details
-
CommissionCalc
public CommissionCalc()
-
-
Method Details
-
prepare
protected void prepare()Prepare - e.g., get Parameters.- Specified by:
prepare
in classSvrProcess
-
doIt
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
Creates the Commission run with the parameter start date and sets the description- Returns:
- MCommissionRun
-
getCommissionRunDescription
Returns the String that will be used for the description column in the Commission Run- Returns:
- Description String
-
getCommissionCalculationSQL
Creates the SQL statement string that is used to generate the Commission detail records- Parameters:
commissionLine
- MCommissionLine- Returns:
- SQL statement
-
getPaymentCommissionSQL
Creates the SQL statement for payments (C_Payment)- Returns:
- SQL statement
-
getOrderCommissionSQL
Creates the SQL statement for orders (C_Order)- Returns:
- SQL statement
-
getInvoiceCommissionSQL
Creates the SQL statement for invoices (C_Invoice)- Returns:
- SQL statement
-
getCommissionLineWhereClause
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
Create Commission Detail- Parameters:
sql
- sql statementcomAmt
- parent- Throws:
Exception
-