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
FieldsFields inherited from class org.compiere.process.SvrProcess
log, MSG_InvalidArguments, MSG_SaveErrorRowNotFound, PROCESS_INFO_CTX_KEY, PROCESS_UI_CTX_KEY, processUI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck if the process parameters are validprotected MCommissionRunCreates the Commission run with the parameter start date and sets the descriptionprotected voidcreateDetail(String sql, MCommissionAmt comAmt) Create Commission Detailprotected StringdoIt()Perform process.protected StringgetCommissionCalculationSQL(MCommissionLine commissionLine) Creates the SQL statement string that is used to generate the Commission detail recordsprotected StringgetCommissionLineWhereClause(MCommissionLine commissionLine) Creates the SQL WHERE clause based on the field values defined in the Commission Lien recordprotected StringReturns the String that will be used for the description column in the Commission Runprotected StringCreates the SQL statement for invoices (C_Invoice)protected StringCreates the SQL statement for orders (C_Order)protected StringCreates the SQL statement for payments (C_Payment)protected voidprepare()Prepare - e.g., get Parameters.protected voidSet 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:
preparein classSvrProcess- See Also:
-
doIt
Perform process.- Specified by:
doItin 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
-