Logic Documentation (Sales Compensation)

See also the architecture documentation.

Core Logics

SC_Compensation

This is the core logic for the whole package. The logic works in four contexts:

  1. Agreement context (line items) which as a result outputs a set of Compensation Records with some data prefilled.

  2. Generate Compensation Record context which regenerates records if any of the main source data changed.

  3. Generate Accrual Records context which constructs the snapshot of the current transaction data and stores them in Accrual Records to be used in calculations later on.

  4. Compensation Record which does the actual calculation that is run via the Sales Compensation Calculation object on a set schedule.

This logic – due to its size – has “context separators” which make it easier to see which elements run in which context. The separators are empty elements with the following name pattern: ___SOME_NAME_CONTEXT1_CONTEXT2___

  • SOME_NAME describes what is in the section.

  • CONTEXT1, CONTEXT2 define the contexts this section runs in.

 

  • CompensationConfig – Initialization of a ConfigManager structure defined in SC_CompensationProcessingLib.

  • CompensationTypeCode – Retrieves the type name of the currently processed Compensation Line Item. This is the Name column value from ConditionTypes. This code is used to access the appropriate element from the CompensationTypesLib later on.

  • CalculationType – Defines the calculation type of a currently processed Compensation Type. Can be one of these values: Conditional, Growth, Stepped.

  • QuotaType – Defines the quota type of a currently processed Compensation Type. Can be one of these values: None, Single, Multi.

  • QuotaValueType – Defines the target value type of a currently processed Compensation Type. Can be one of these values: Amount, Percent.

  • CompensationValueType – Defines the compensation value type of a currently processed Compensation Type. Can be one of these values: Amount, Amount Per Unit, Percent, None.

  • DatamartCurrency – Defines the currency used by the main Datamart. The Datamart configuration is stored in SC_AdvancedConfiguration.

  • CustomerGroupInput – User input for Customer Group, used for filtering later on.

  • ProductGroupInput – User input for Product Group, used for filtering later on.

  • SingleQuotaInput – Returns a user input for a particular Compensation Type that has the quota defined as Single. Allows input of a quota factor.

  • SingleCompensationInput – Returns a user input for a particular Compensation Type that has the target defined as Single. Allows input of a compensation value.

  • TargetIncentiveInput – Returns a user input for a particular Compensation Type that has the calculation type defiend as Bonus. Allows input of a target incentive value.

  • VariablePayPercentageInput – Returns a user input for a particular Compensation Type that has the target defined as Variable Pay or Stepped Variable Pay. Allows input of a variable pay percentage value.

  • MultiQuotaInput – Returns a user input for a particular Compensation Type that has the quota defined as Multi and Calculation Type as one of Conditional, Growth or Stepped. Allows input of a combination of both quota factor and compensation value in a multitiered fashion.

  • MultiTargetBonusInput – Returns a user input for a particular Compensation Type that has the quota defined as Multi and Calculation Type as Bonus. Allows input of a combination of both quota factor and bonus payout rate factor in a multitiered fashion.

  • SteppedBonusInput – Returns a user input for a particular Compensation Type that has the quota defined as Multi and Calculation Type as Stepped Bonus or Stepped Variable Pay. Allows input of a combination of both quota factor and bonus payout rate factor in a multitiered fashion.

  • MultiTargetVariablePayInput – Returns a user input for a particular Compensation Type that has the quota defined as Multi and Calculation Type as Variable Pay. Allows input of a combination of both quota factor and variable pay in a multitiered fashion.

  • CompensationCapInput – If the Compensation Caps feature is turned on this input, it allows users to enter the cap value.

  • PaymentPeriodInput – Displays a used input for a Payment Period selection as an option. Available values are Monthly, Quarterly, Semi-Annually, Annually.

  • GeneralFilterInput – If the “general filter on line item” feature is turned on, this input displays and allows you to set the General filter on line item level.

  • QuotaForInput – Displays a read-only user input containing the QuotaFor value stored in Condition Types table. If the value is not present, the value from Advanced Configuration SC_AdvancedConfiguration is taken instead.

  • DepositSchemeInput – Displays a read-only user input containing the DepositScheme value stored in Condition Types table. If the value is not present, the value from Advanced Configuration SC_AdvancedConfiguration is taken instead.

  • BaselineFieldNameInput – Displays a read-only user input containing the BaselineFieldName value stored in Condition Types table. If the value is not present, the value from Advanced Configuration SC_AdvancedConfiguration is taken instead.

  • SyntaxCheckAbort

  • HeaderSellerGroupInput Retrieves the Seller group input value from the header level.

  • HeaderCurrencyInput Retrieves the currency value from the header level.

  • HeaderTypeInput Retrieves the type of the header.

  • ObjectValidation Performs validation of the state of a currently processed item in order to assess whether the logic execution should continue.

  • SellerIdsInput Returns the Seller group converted into a list of individual Seller IDs.

  • CompensationInputDefinition – Returns CompensationInputParameter that stores all the inputs taken from user/header etc. This parameter is used later on for other processing/access operations.

  • InputValidation – Performs validation on all inputs that were provided. If any input is marked as invalid, an exception is thrown with a proper message to the user.

  • PreviousPeriodAdjustmentData – Returns the previous period adjustment data used later on in calculations.

    CurrentPeriodAdjustmentData – Returns the current period adjustment data used later on in calculations.

  • PreviousPeriodData – Returns a value of the previous period compensation based on the current context.

  • CurrentPeriodData – Returns a value of the current period compensation based on the current context.

  • BaselineValueFieldLabel – Returns a field in a Datamart that will be used for baseline calculations. The field is defined in the Datamart Advanced Options configuration.

  • PreviousBaselineValue – Extracts the baseline value from the previous period data fetched in one of the previous elements.

  • CurrentBaselineValue – Extracts the baseline value from the current period data fetched in one of the previous elements.

  • PreviousCompensation – Extracts the compensation value from the previous period data fetched in one of the previous elements. It colors the result according to the value.

  • CurrentCompensation – Extracts the baseline value from the current period data fetched in one of the previous elements. It colors the result according to the value.

  • CompensationPayment – Extracts the Compensation Payment value (taking holdback into account). It colors the result according to the value.

  • IsForecastApplied – Returns the value defining whether the forecast method has been selected, therefore forecasts should be calculated.

  • ForecastMethod – Passes the value of the Forecast Method input.

  • SalesGoalIncreasePct Passes the value of Sales Goal Increase % input.

  • ForecastBaselineValue – Extracts the forecasted baseline value from the current period data fetched in one of the previous elements.

  • ForecastCompensation – Extracts the forecasted compensation value from the current period data fetched in one of the previous elements.

  • TrueUp – Forecast Compensation minus Current Compensation.

  • QuotaFor – Retrieves the quota for a value stored in the configuration of a currently processed Compensation Type of Advanced Configuration of the package (default). Can be either Payment Period or Plan Duration.

  • DepositScheme – Retrieves the deposit scheme value stored in the configuration of a currently processed Compensation Type of Advanced Configuration of the package (default). Can be either Cumulative or Non-Cumulative.

  • PaymentPeriod – Passes the value of the Payment Period input.

  • SellerNamesTable – Passes the value of the Seller input, stores the name of the Sellers.

  • CustomerGroup – Passes the value of the CustomerGroup input.

  • ProductGroup – Passes the value of the ProductGroup input.

  • GeneralFilter – Passes the value of the GeneralFilter input.

  • PayoutCurrency – Passes the value of the Payout Currency input.

  • CurrentPeriods – Returns a list of periods based on the line item payment period input and CO plan startDate/endDate.

  • PreviousPeriods – Returns a list of previous periods based on the line item payment period input and CO plan startDate/endDate.

  • PreviousCompensationDataOnPeriods – Returns data (adjustment data & Datamart data) of the previous periods. The period is based on the payment period input, used later on in calculations.

  • CurrentCompensationDataOnPeriods – Returns data (adjustment data & Datamart data) of the current periods. The period is based on the payment period input, used later on in calculations.

  • PreviousMonthlyPeriodsData – Returns data (adjustment data & Datamart data) of the previous monthly periods, used to aggregate data in the header.

  • CurrentMonthlyPeriodsData – Returns data (adjustment data & Datamart data) of the current monthly periods, used to aggregate data in the header.

  • AddingMonthlyPeriodsDataToCache – Adds previous monthly periods data and current monthly periods data to the cache, used to pass data to the header (post phase) for aggregation header data.

  • ForecastCompensationComparisonChart – Bar chart displaying Previous Compensation vs. Current Compensation vs. Forecasted Compensation.

  • ForecastBaselineValueTable – Table displaying this year’s sales forecast by Payment Period of the particular line item.

  • ForecastBaselineValueChart – Bar chart displaying this year’s sales forecast by Payment Period of the particular line item.

  • Holdback – Returns the holdback value that was taken into account during calculations.

  • PreviousPeriodAdjustmentIds – Returns the list of IDs of Adjustments that were taken into account during calculations. These Adjustments are taken from the previous period.

  • CurrentPeriodAdjustmentIds – Returns the list of IDs of Adjustments that were taken into account during calculations. These Adjustments are taken from the current period.

  • SourceCurrencyExchangeRate – Retrieves the currency exchange rate based on the selected Payout Currency and the Datamart Currency. The Exchange rate is based on the payout date of the record.

  • SourceCurrencyPreviousBaselineValue – Extracts the baseline value from the previous period data fetched in one of the previous elements, but in source currency.

  • SourceCurrencyCurrentBaselineValue – Extracts the baseline value from the current period data fetched in one of the previous elements, but in source currency.

  • SourceCurrencyPreviousCompensation – Extracts the compensation value from the previous period data fetched in one of the previous elements, but in source currency. It colors the result according to the value.

  • SourceCurrencyCompensationPayment – Extracts the Compensation Payment value (taking holdback into account), but in the source currency.

  • SourceCurrencyCurrentCompensation – Extracts the baseline value from the current period data fetched in one of the previous elements, but in source currency. It colors the result according to the value.

  • SourceCurrencyHoldback – Returns the holdback value that was taken into account during calculations, but in the source currency.

  • SourceCurrencyForecastBaselineValue – Extracts the forecasted baseline value from the current period data fetched in one of the previous elements, but in source currency.

  • SourceCurrencyForecastCompensation – Extracts the forecasted compensation value from the current period data fetched in one of the previous elements, but in source currency.

  • SourceCurrencyTrueUp – Forecast Compensation minus Current Compensation in source currency.

  • SourceCurrency – Defines the Source currency of the source data, the same as DatamartCurrency.

  • CompensationRecords – Generates the Compensation Record shells according to the processed information. This element is only run in the Plan context.

  • RegenerateCompensationRecords – Re-generates the Compensation Records if any of the re-generation conditions were met. This element is run only in the Generate Compensation Record context.

  • GenerateAccrualRecords – Generates the main calculation data snapshot in the Accrual Records table. This element is run only in the Generate Accrual Record context.

  • CalculationBase – Returns the calculationBase for the Compensation Record.

SC_CompensationHeader

This is currently the only header logic that defines the header behavior of Compensation Plan. The logic defines the inputs and outputs from the header and further operations that happen in the main core logic.

  • ConfigManager – Initialization of a ConfigManager structure defined in SC_CompensationProcessingLib.

  • HeaderUtils – Contains methods for creating header inputs and outputs, main codebase of the logic. Calculation methods for Previous and Current compensation can also be found here.

  • SyntaxCheckAbort

  • HeaderInputs – Contains initialization of all header inputs using HeaderUtils (even the hidden ones, such as the type of the header).

  • HeaderOutputs – Adds outputs to the header using HeaderUtils.

SC_CompensationCap_Configurator

This is the configurator for the Compnesation Cap input on the line item level. It is used to display Compensation Cap inputs for the user: Compensation Cap and Cap For.

  • QuotaForHiddenInput – Used to pass a Quota For value to the configurator in order to set the default value for the Cap For input.

  • CompensationCapInput – Creates a row layout input containing the Compensation Cap (Decimal) and Cap For (Option) inputs. If the Quota For input is set to Payment Period the Cap For becomes read-only.

SC_Forecast_Configurator

This is the configurator for the Forecast input on the header level. It is used to display forecast inputs for the user: Forecast Method and Sales Goal Increase Percent.

  • ForecastMethod – Generates the Forecast Method options selection input that allows the user to provide forecast method.

  • SalesGoalIncreasePercent – Presents sales goal increase % value user input.

  • PreviousForecastMethod – Stores the old value of ForecastMethod. It is used to check the current value of ForecastMethod to reset value for SalesGoalIncreasePercent.

SC_CompensationHeaderSellerConfigurator

This is the configurator for Seller selection on the header level. It is used only in header types that contain a singular Seller. It displays additional information that is configured to be displayed in SC_HeaderSellerDetailsMapping Company Parameter table.

  • SellerInput – Returns a user input that allows a Seller selection.

  • SellerDetailsInput – Returns a read-only user input that, based on selection in SellerInput, displays additional Seller information provided in the SC_HeaderSellerDetailsMapping Company Parameter table.

SC_QuotingPluginLib

This is a library that is used for integration with quoting solutions. It allows you to inject the Sales Compensation into the calculation results. The library also supports displaying the results in a pie chart or line score chart.

Backend Logics

SC_CompensationDashboardsLib

This logic contains common utility functions that are used by the Sales Compensation package. The library focuses on dashboards and operations related to them – mostly data fetching and processing.

SC_CompensationProcessingLib

This logic contains common utility functions that are used by the Sales Compensation package. The library focuses on data processing related to the core of this package – that means calculation of plans and records mostly.

SC_CompensationTypesLib

The library stores all types of currently supported Compensation Types that can be added as line items in Compensation Agreements. Each type has a strictly defined structure: Calculation Type, Target Type, Target Value Type, Compensation Value Type as well as a way to calculate the compensation. The element names match 1-1 the Condition Types defined in the system and should be carefully maintained if any changes arise.

SC_CompensationRecordCalculationFeeder

This is a feeder logic used for fetching and providing items for scheduled compensation calculation executions.

Adjustments Logics

SC_AdjustmentHeader

This is a header logic for the Adjustment Custom Form object. It is used to read the properties of the object and pass them to the header configurator.

SC_AdjustmentHeader_Configurator

This is the main configurator logic for the Adjustment Custom Form object. It is displayed in the Query Details tab. It is used to generate adjustments based on user provided inputs.

SC_AdjustmentWizard_Executor

This is an executor logic for Adjustment Configurator Wizard, it creates the Adjustment Custom Form Object.

SC_AdjustmentWizard_Inputs

This is an input logic for the Adjustment Configurator Wizard, used to display inputs of the Adjustment Custom Form for the user.

Output Logics

SC_Dashboard_SellerOverview

This is a logic for the Seller Overview dashboard. It handles display of all inputs, validation of the inputs, data fetching as well as processing of the obtained data. The dashboard displays three portlets: one data table and two charts.

SC_Dashboard_SellerOverview_Configurator

Default label: Seller Overview

This is the configurator logic for the Compensations Dashboard. Its main purpose is to allow selection of different Compensation Agreements based on the selected Seller.

SC_Dashboard_SellerOverview_CompensationReferenceTable_PlanDetails_ContextLink

This is a logic for the Context Link part in Compensation Reference Table, for the button that leads to Plan Details.

SC_Dashboard_SellerOverview_CompensationReferenceTable_TransactionDetails_ContextLink

This is a logic for the Context Link part in Compensation Reference Table, for the button that leads to Transaction Details.

SC_Dashboard_AdminYTDSummary

This is a logic for the Admin YTD Summary dashboard. It handles display of all inputs, validation of the inputs, data fetching as well as processing of the obtained data. The dashboard displays two portlets: one summary and one table.

SC_Dashboard_AdminYTDSummary_Configurator

This is the configurator logic for the Admin YTD Summary dashboard. Its main purpose is to allow filtering in the Dashboard, currently the supported inputs are: SellerGroup, Reporting Currency, Plan Currency.

SC_Dashboard_AdminYTDSummary_PayoutsOverviewTable_PayoutDateDetails_ContextLink

This is a logic for the Context Link part in Payouts Overview Table, for the button that leads to Payout Date Details on SC_PayoutsAndPlans Dashboard.

SC_Dashboard_AdminYTDSummary_PayoutsOverviewTable_PayoutSellerDetails_ContextLink

This is a logic for the Context Link part in Payouts Overview Table, for the button that leads to Seller and Payout Date Details on SC_PayoutsAndPlans Dashboard.

SC_Dashboard_AdminYTDSummary_PayoutsOverviewTable_SellerYearlyOverview_ContextLink

This is a logic for the Context Link part in Payouts Overview Table, for the button that leads to Seller YTD Details on SC_SellerOverview Dashboard.

SC_Dashboard_PayoutsAndPlans

This is a logic for the Payout and Plans dashboard. It handles display of all inputs, validation of the inputs, data fetching as well as processing of the obtained data. The dashboard displays two portlets: one summary and two tables.

SC_Dashboard_PayoutsAndPlans_Configurator

This is the configurator logic for the Payouts and Plans dashboard. Its main purpose is to allow filtering in the Dashboard, currently the supported inputs are: SellerGroup, Reporting Currency, Plan Currency, Payout Year and PayoutDate.

SC_Dashboard_PayoutsAndPlans_PayoutsTable_Details_ContextLink

This is a logic for the Context Link part in Payouts Table, for the button that leads to Payout Details on SC_TransactionsAndStatistics dashboard.

SC_Dashboard_TransactionsAndStatistics

This is a logic for the Transactions and Statistics dashboard. It handles display of all inputs, validation of the inputs, data fetching as well as processing of the obtained data. The dashboard displays three portlets: one summary and two tables.

SC_Dashboard_TransactionsAndStatistics_Configurator

This is the configurator logic for the Transactions and Statistics dashboard. Its main purpose is to allow filtering the transaction list present in the Dashboard, currently the supported inputs are: SellerGroup, Plan Currency, Compensation Plan Type, Compensation Plan Status, Compensation Plan, Compensation Record, Start Date, End Date.

SC_Embedded_Dashboard_Compensation_Detail

This is a logic for the embedded dashboard that is used in Payouts and Plans Dashboard. The dashboard displays additional information about any selected plan.

Filter Logics

SC_DefaultConditionTypeFilter

This logic is used to limit the visibility of Condition Types during plan selection. It returns all Condition Types that are related to the Sales Compensation package. This logic should be set as default filtering when Sales Compensation Accelerator is in active use on the partition.

SC_NoConditionTypeFilter

This is a filtering logic for the Default Header type present on the partition. It is created so the Default type does not display any SC related Condition Types during item selection.

SC_SellerInputFilter

Filter logic used in various Seller Pickers to limit the visibility of the selection based on the available data and user permissions.

SC_SPIFFConditionTypeFilter

This is a filtering logic for the SPIFF Header type. It is created so the SPIFF type does not display any non-SPIFF related Condition Types during item selection.

Other Logics

SC_HoldBack_Configurator

This is the configurator for the Holdback input on the header level. It is used to display holdback inputs for the user that allow to select a holdback value and type.

SC_Compensation_RecordCalculationFeeder

This is a feeder logic used for fetching and providing items for scheduled compensation calculation executions.