Sales Block Processing
Purpose
The purpose of this document is to outline how Client Processing manages updates from Deal Engine. The majority of this process is handled by the back end. This screen is mainly used for clearing errors, approving large revenue changes, and researching updates to Deals.
Data Processing and Rules
Steps
The below should be followed for any record with process_status_cd = 'U' (Unprocessed).
1. Validate Data (Layer 1)
The following rules must be validated before processing. If any of these rules fail, the row will be set to FAILED Status with detailed status set to Validation Failure - {Rule}.
- Payment Gross Match: Sum of
payment_term.gross_amtmust equalsales_item.gross_amt. If not:Payment Gross does not match Sales Item. - Required Fields: The following fields must be populated. If not:
Required fields missing.- Sales Item (
sales_item):sales_item_refsales_item_verdeal_iduta_entity_idclient_entity_idbuyer_entity_idnamecurrency_cdgross_amtuta_commission_typeuta_commission_amtrevenue_start_dtrevenue_end_dtrev_rec_style_cdrevenue_date_status_cdsales_item_status_cd
- Payment Term (
payment_term):payment_term_refpayment_term_vernamepayment_party_idgross_amtdue_dtdue_date_status_cd
- Sales Item (
- Non-Negative Amounts: The following fields must be greater than or equal to 0. If not:
Amount cannot be less than zero.sales_item.gross_amtsales_item.uta_commission_amtpayment_term.gross_amt
2. Validate Consistency (Layer 2)
If this is the first time the sales_item_ref has been seen (no matching revenue_items record), skip this step. TODO - Define new Revenue and billing creation. If a matching revenue_items record exists, ensure immutable fields have not changed. If they have, set FAILED Status with detailed status set to Data Validation Failure - {Rule}.
- Immutable Fields:
sales_item.sales_item_refmust matchrevenue_items.sales_item_refsales_item.deal_idmust matchrevenue_items.deal_idsales_item.uta_entity_idmust matchrevenue_items.uta_entity_idsales_item.client_entity_idmust matchrevenue_items.client_idsales_item.buyer_entity_idmust matchrevenue_items.buyer_idsales_item.currency_cdmust matchrevenue_items.currency_cd
3. Validate Referential Data (Layer 3)
Verify if all of the referential data matches a valid record. If not, set FAILED Status with detailed status set to Reference Data not found - {Reference}.
sales_item.deal_id-> Valid Dealsales_item.uta_commission_type-> ValidCOMMISSION_TYPE_CDsales_item.rev_rec_style_cd-> ValidREVENUE_ITEM_REC_STYLE_CDsales_item.revenue_date_status_cd-> ValidREVENUE_ITEM_DATE_STATUS_CDsales_item.sales_item_status_cd-> ValidREVENUE_ITEM_STATUS_CDsales_item.currency_cd-> ValidCURRENCY_CDsales_item.client_entity_id-> Valid Partysales_item.buyer_entity_id-> Valid Partypayment_term.payment_party_id-> Valid Partypayment_term.due_date_status_cd-> ValidBILLING_ITEM_DATE_STATUS_CD
4. Process Revenue Update
If all validations pass, proceed with the revenue update.
Fetch Data:
- Retrieve the
revenue_itemsrecord usingsales_item.sales_item_ref. - Retrieve all
payment_termrecords associated with thesales_item.
- Retrieve the
Build Current State:
- Construct a
currentStateobject mappingsales_itemfields torevenue_itemsfields and including the list ofpayment_terms.
Sales Item Field Revenue Item Field namerevenue_item_namegross_amtrevenue_item_gross_amtuta_commission_amtrevenue_item_commission_amtuta_commission_percrevenue_item_commission_percrevenue_start_dtrevenue_item_start_dtrevenue_end_dtrevenue_item_end_dtrev_rec_style_cdrevenue_item_rec_style_cdsales_item_status_cdrevenue_item_status_cdrevenue_date_status_cdrevenue_item_date_status_cd- Construct a
Call Revenue Service:
- Invoke
RevenueService.updateRevenueItem. - Reference: See
src/ref/key-procedurdes.mdfor the detailed logic ofupdateRevenueItem.
- Invoke
UI


Data Mappings
Sales Item to Revenue Item
Source: sales_item | Target: revenue_items
| Sales Item Field | Revenue Item Field | Comment |
|---|---|---|
uta_entity_id | uta_entity_id | |
agent_group_id | agent_group_id | |
sales_item_ref | sales_item_ref | |
sales_item_status_cd | revenue_item_status_cd | Default 'U' if null |
name | revenue_item_name | |
revenue_date_status_cd | revenue_item_date_status_cd | Default 'U' if null |
deal_id | deal_id | |
client_entity_id | client_id | |
buyer_entity_id | buyer_id | |
project_id | project_id | |
department_id | department_id | |
currency_cd | currency_cd | |
gross_amt | revenue_item_gross_amt | |
uta_commission_type | revenue_item_commission_flat_ind | True if 'FLAT', else False |
uta_commission_perc | revenue_item_commission_perc | |
uta_commission_amt | revenue_item_commission_amt | |
revenue_start_dt | revenue_item_start_dt | |
revenue_end_dt | revenue_item_end_dt | |
rev_rec_style_cd | revenue_item_rec_style_cd | |
| (Constant) | current_item_ind | Set to true |
Sales Item to Revenue Schedules
Source: sales_item (Logic) | Target: revenue_item_schedules
| Source Value | Revenue Schedule Field | Comment |
|---|---|---|
| (Generated ID) | revenue_item_id | From created revenue_items record |
uta_commission_amt | revenue_amt | Distributed based on rev_rec_style_cd |
revenue_start_dt | revenue_dt | Iterated monthly if rev_rec_style_cd = 'M' |
| (Constant) | revenue_item_posting_status_cd | Set to 'U' |
| (Constant) | revenue_item_posting_dt | Set to NULL |
Payment Term to Billing Item
Source: payment_term | Target: billing_item
| Payment Term Field | Billing Item Field | Comment |
|---|---|---|
| (Generated ID) | revenue_item_id | From created revenue_items record |
payment_term_ref | payment_term_ref | |
due_dt | billing_item_due_dt | |
| (Constant) | billing_item_due_dt_status_cd | Set to 'U' |
due_dt | billing_item_aging_dt | Defaults to due_dt (unless matched) |
name | billing_item_name | |
| (Constant) | billing_item_status_cd | Set to 'U' |
payment_party_id | collection_party_id | Logic applies if override exists |
| (Logic) | collection_style_cd | 'BUYER' if party matches buyer, else 'CLIENT' |
| (Match/Default) | deal_id | From matched item or default |
| (Match/Default) | uta_entity_id | From matched item or default |
| (Match/Default) | agent_group_id | From matched item or default |
| (Match/Default) | buyer_id | From matched item or default |
| (Match/Default) | client_id | From matched item or default |
| (Match/Default) | billing_item_project_id | From matched item or default |
| (Match/Default) | billing_item_currency_cd | From matched item or default |
| (Match/Default) | uta_department | From matched item or default |
| (Constant) | current_item_ind | Set to true |
| (Constant) | open_item_ind | Set to true (updated later) |
Payment Term to Billing Item Detail
Source: payment_term | Target: billing_item_detail
| Payment Term Field | Billing Item Detail Field | Comment |
|---|---|---|
| (Generated ID) | billing_item_id | From created billing_item record |
| (Constant) | billing_item_detail_type_cd | 'REV' or 'PAY' |
gross_amt | billing_item_detail_gross_amt | |
gross_amt | billing_item_detail_net_amt | Initially same as gross |
| (Logic) | billing_item_detail_percent | commissionPerc (REV) or 1-commissionPerc (PAY) |
| (Calculated) | billing_item_detail_billing_amt | net_amt * percent |
| (Constant) | billing_item_detail_tax_amt | Set to 0.00 |
| (Calculated) | billing_item_detail_total_amt | billing_amt + tax_amt |
| (Constant) | posting_status_cd | Set to 'U' |
| (Constant) | posting_dt | Set to NULL |