Creating a Commission Sources
The Commission Source service stores the types of available business transactions, such as orders for commissionable products, and references the SQL Views on the transactional entities that are required for computing commissions.
To calculate commissions, the SQL Views require the following specific fields:
- Source Entity and Source ID fields to identify the business transactions
- Product ID field to identify which product a commission is calculated
- Sales Rep ID field to link commission agreements
- Date fields to indicate the time period to calculate a commission
- Numeric fields to calculate a commission base formula.
The SQL Views that the Commission Sources record references is generally a predefined view. Aptify provides three sample SQL views with the application:
- Commission Source Order Lines SQL view (vwCommissionSourceOrderLines)
- Commission Source Insertion Order SQL view (vwCommissionSourceInsertionOrder)
- Commission Source Royalties SQL view (vwCommissionSourceRoyalties).
See Sample Commissions SQL Views Code for information on the vwCommissionSourceOrderLines view. Note that an administrator can access the SQL text for any of these views from the Database Objects service in Aptify.
Follow these steps to create Commission Sources records:
- Open a new record from the Commission Sources service.
- Enter a name for the commission source in the Name field that reflects the content of the desired source.
- On the General tab, enter the Source Entity. This should generally be an entity related to a business transaction, such as Orders or Advertising Insertion Orders.
- Use the Find feature to locate a Source View from the Database Object entity that contains a query to the source transactions for computing commissions. The Source SQL View identifies the fields that group the records, the lowest level of detail, and the valid aggregate fields.
- For example, the Commission Sources record for Orders that is installed with the product uses the vwCommissionSourceOrderLines view to join the vwOrderDetails, vwOrders and vwProducts views. The grouping fields are SalesRepID, ProductID and the calculated Commission Period. As a result, the lowest level of detail is the OrderLines records. Therefore, aggregate functions can be used on the vwProducts or vwOrderDetails view. Aggregate calculations on the vwOrders view alone will produce erroneous results.
- To view the code for the vwCommissionSourceOrderLines, click the Source View hyperlink. Other views should follow the code layout if you wish to create other commission sources.
- Save the Commission Sources record.
- See Sample Commissions SQL Views Code for more information about the SQL View. For more information on Commission Sources and SQL views, contact your Aptify representative.
Copyright © 2014-2019 Aptify - Confidential and Proprietary