Calculate Totals Based on Client Defined Rules (sa_totals_calc_job)

Module Name

sa_totals_calc_job

Description

Calculate Totals based on Client Defined Rules

Functional Area

Sales Audit, Totals

Module Type

Admin - Ad hoc

Module Technology

Background Processing

Catalog ID

N/A

Wrapper Script

b8dwrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.

Thread assignment program will filter eligible records from the Sales Audit Store/Day table for all stores wherein auditing status is "Re-Totaling/Auditing Required". Totaling provides the values against which auditors can compare receipts. These comparisons find data errors that could be the result of either honest mistakes or fraud. Finding these mistakes during the sales auditing process prevents these errors from being passed on to merchandising and data warehouse systems. Totaling also provides quick access to other numeric figures about the day's sales transactions.

Totaling in Sales Audit is dynamic. Sales Audit automatically totals transactions based on calculation definitions that the retailer's users create using the online Totals Calculation Definition Wizard. In addition, the retailer is able to define totals that come from the POS but that Sales Audit does not calculate. Whenever users create new calculation definitions or edit existing ones, they become part of the automated totaling process the next time that this program runs. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.

The Business logic program will process all records from the staging table. Using bulk processing, this program will process the records for totals build-up and calculation by calling SA_BUILD_TOTAL_SQL.PROCESS_CALC_TOTALS for each store day captured. It will free up and clean the staging table afterwards. There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.

Restart/Recovery

N/A

Key Tables Affected

Table 19-1 Key Tables Affected

Table Select Insert Update Delete

RMS_BATCH_STATUS

Yes

No

No

No

B8D_PROCESS_CONFIG

Yes

No

No

No

JOB_AUDIT_LOGS

No

Yes

No

No

B8D_SA_TOTALS_CALC_STG

Yes

Yes

No

Yes

SA_STORE_DAY

Yes

No

Yes

No

SA_TOTAL

No

Yes

No

No

SA_TOTAL_HEAD

Yes

No

No

No

SA_ERROR

No

Yes

No

Yes

SA_ERROR_WKSHT

No

Yes

No

Yes

SA_POS_VALUE

No

Yes

No

No

SA_POS_VALUE_WKSHT

No

Yes

No

No

SA_SYS_VALUE

No

Yes

No

No

SA_SYS_VALUE_WKSHT

No

Yes

No

No

SA_ERROR_REV

No

Yes

No

No

SA_EXPORTED_REV

No

Yes

No

No

SA_EXPORTED

No

No

No

Yes

Design Assumptions

N/A