Sample Commissions SQL Views Code
In this topic, an excerpt of the SQL code for the Commissions Source Order Lines view is listed and identifies the Source Trigger Date aliases and Available Commission Base Formula aliases referenced in the documentation. To view the complete code for the vwCommissionSourceOrderLines, open the Source SQL View from the Commission Source record installed with Aptify Commissions.
vwCommissionSourceOrderLines
The following excerpt of code is from the SQL select statement used in the vwCommissionSourceOrderLines view installed with the Commission & Royalty Management application.
Â
CREATE VIEW vwCommissionSourceOrderLines AS
SELECT /*Required Fields for plugging into CommissionAgreements*/
      o.SalesRepID, /*To Join Commission Agreements*/
      od.OrderID SourceID,
      'Orders' AS SourceEntity, /*Entity Name as the Source*/
      1 Split, /*Represents 100% or no split.*/
Â
      /*Date fields available for CommissionPeriod*/
Â
The Source Trigger Date field aliases shown below require a # in the alias name
      o.OrderDate [#Order Date],
      o.DepositDate [#Deposit Date],
      o.PromiseDate [#Promise Date],
      o.ShipDate [#Ship Date],
      o.ArrivalDate [#Arrival Date],
      o.DueDate [#Due Date],
Â
      /*Product Information*/
      p.ID AS ProductID,
      p.Name, od.Sequence,
Â
      /*Commission Base Fields for Calculating On*/
      p.CurrentAverageCost [$Current Average Cost],
Â
The Available Commission Base Formula field aliases shown below require a $ in the alias name
      od.Quantity [$Quantity],
      od.Price [$Price],
      od.Discount [$Discount],
       od.QuantityShipped [$Quantity Shipped],
Â
Â
.
Copyright © 2014-2019 Aptify - Confidential and Proprietary