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 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
      Perform process.
      Specified by:
      doIt in class SvrProcess
      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 statement
      comAmt - parent
      Throws:
      Exception