Salesware User Guide for Advanced Users : Triggered Counts : Configuration : Changes to database for Max4Sale capability : Changes to database for Points4Sale capability
 
Changes to database for Points4Sale capability
 
The following changes have been made to the SiriusSQL database in support of Triggered Counts for Points4Sale capability:
siriussp_GetPointsRemaining_By_DCI_base_sub:
If UseCounts in prefs_sl is TRUE, stored procedure now attempts to retrieve current sold and saved points from the related Pts4SaleCounts table for the relevant Points4Sale restrictions.
Those point counts which are not yet calculated and available in Pts4SaleCounts are calculated as before by summing existing transact and tr_save rows.
Those missing counts are then added to the Pts4SaleCounts table, thereby speeding up subsequent calls to this GetPointsRemaining stored procedure.
 
prefs_sl:
Added UseCounts (bit).
Modified Insert/Update trigger to truncate the Pts4SaleCounts table if the values of the UseCounts or Max4Save columns are changed.
 
Pts4Sale:
Created Insert/Update trigger to delete the related Pts4SaleCounts child row if one exists.
 
Pts4SaleCounts:
Added CurrentSavedCount (numeric(12,4)).
 
tr_save:
Added Insert/Update/Delete triggers to update CurrentSavedCount values in all affected Pts4SaleCounts rows, using the same criteria used in the siriussp_GetPointsRemaining_By_DCI_base stored procedure.
This affects only one row inserts, updates and deletes performed through Siriusware modules.
Multiple row batch inserts, updates and deletes done outside of Siriusware modules truncate the Pts4SaleCounts table and are rebuilt as necessary by calls to the siriussp_GetPointsRemaining_By_DCI_base stored procedure.
 
transact:
Added Insert/Update/Delete triggers to update CurrentCount values in all affected Pts4SaleCounts rows, using the same criteria used in the siriussp_GetPointsRemaining_By_DCI_base stored procedure.
This affects only one row inserts, updates and deletes performed through Siriusware modules.
Multiple row batch inserts, updates and deletes done outside of Siriusware modules truncate the Pts4SaleCounts table and are rebuilt as necessary by calls to the siriussp_GetPointsRemaining_By_DCI_base stored procedure.