Class CommissionCalc

java.lang.Object
org.compiere.process.SvrProcess
org.compiere.process.CommissionCalc
All Implemented Interfaces:
ProcessCall
Direct Known Subclasses:
ProcCOFCommissionCalc, ProcMassiveCommission

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 Details

  • Constructor Details

    • CommissionCalc

      public CommissionCalc()
  • Method Details

    • prepare

      protected void prepare()
      Prepare - e.g., get Parameters.
      Specified by:
      prepare in class SvrProcess
    • doIt

      protected String doIt() throws Exception
      Description copied from class: SvrProcess
      Perform process.
      Specified by:
      doIt in class SvrProcess
      Returns:
      Message (variables are parsed)
      Throws:
      Exception - if not successful e.g. throw new AdempiereUserError ("@FillMandatory@ @C_BankAccount_ID@");
    • doIt

      protected String doIt(int row_ID) throws Exception
      Perform process.
      Parameters:
      row_ID -
      Returns:
      Message (text with variables)
      Throws:
      Exception - if not successful
    • checkParameters

      protected void checkParameters(int row_ID)
      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 statement
      comAmt - parent
      Throws:
      Exception