dbo.SXAMMPriceAlgorithmRangeRule 
Default Table Name  SXAMMPriceAlgorithmRangeRule 
Definition  This entity defines the Price Algorithm Range Rules for a Price Algorithm.A set of range rules is optional for a Price Algorithm.
If it does not not exist, then the Price (amount to bill) is equal to the cost.A range rule is tiered, so a different set of rules can be applied based upon which range (Cost From / Cost To) the Cost falls into.
A range rule includes markups, fees, a rounding option, and minimum price functionality. Two sets of tiers can be applied for the same Price Algorithm - 'multi ingredient', or 'non multi ingredient'. Multi Ingredient indicates that the product being dispensed is a multi-ingredient product (made up of several ingredients), and therefore a separate tiered pricing structure should apply. 

dbo.SXAMMPriceAlgorithmRangeRule Columns 
ColumnName  Domain  Datatype  NULL  Definition 
SiteID    smallint  NO  Identifies the unique distributed database ID where the row was inserted. Distributed databases are no longer supported so this column is deprecated. 
Build    int  NO  Identifies the build number and patch level of the software that inserted/updated this row. The format is the Build number followed by 3 digits for the patch level which is typically 000. The build number is tied to specific versions of the software, e.g. Sunrise 15.3 is Build 5021, Sunrise 16.3 is Build 5503. 
TouchedBy    varchar(50)  NO  Information about the user that last updated the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
TouchedWhen    datetime  NO  The date and time that the row was last updated and will be based on the Enterprise time zone. 
CreatedBy    varchar(50)  NO  Information about the user that created the row. This will typically be the UserID (IDCode from CV3User table) and may be prefixed with an environment identifier followed by an underscore, e.g. b96d2bf5_jongmore. 
CreatedWhen    datetime  NO  The date and time that the row was created and will be based on the Enterprise time zone. 
Active    bit  NO  Denotes whether the row is active or not, 0 means the row has been soft deleted or deactivated. 
PriceAlgorithmRangeRuleID(PK)    int  NO  Auto generated unique primary key value. 
PriceAlgorithmID(FK)    int  NO  A foreign key to the PriceAlgorithmID column in the SXAMMPriceAlgorithm table. 
FromCostAmt    numeric(11, 3)  NO  Identifies the From Cost range of the Price Algorithm.

If the Cost is between the From Cost Amt and the To Cost Amt, and the Is Multi Ingredient indicator matches whether the drugs are multi-ingredient, then this is the range rule (fees, markups) that are applied to the cost to determine the price. 
ToCostAmt    numeric(11, 3)  YES  Identifies the To Cost range of the Price Algorithm.

If the Cost is between the From Cost Amt and the To Cost Amt, and the Is Multi Ingredient indicator matches whether the drugs are multi-ingredient, then this is the range rule (fees, markups) that are applied to the cost to determine the price. 
IsMultiIngredient    bit  NO  Identifies whether this Tiered Price Algorithm is for Multi-Ingredient, or for Single-Ingredient. 
MarkupType    int  NO  An enumerated type with the following list of possible values: 0 = [None],1 = [Amount],2 = [Percent], 
MarkupAmt    numeric(11, 3)  YES  Identifies the Markup (based on the Markup Type).

If Markup Type indicates 'Percent', then this is a percentage markup.

If Markup Type indicates 'Amount', then this is a Dollar markup.
DispensingFeeType    int  NO  An enumerated type with the following list of possible values: 0 = [None],1 = [Amount],2 = [Percent], 
DispensingFeeAmt    numeric(11, 3)  YES  Identifies the Dispensing Fee (based on the Dispensing Fee Type).

If Dispensing Fee Type indicates 'Percent', then this is a percentage Fee.

If Dispensing Fee Type indicates 'Amount', then this is a Dollar Fee. 
CompoundingFeeAmt    numeric(11, 3)  YES  Identifies the Compounding Fee (if there is one) that should be applied.

This is the fee applied for creating the order.
Commonly used as reimbursement for effort used in dispensing multi-ingredient orders.
AdministrationFeeAmt    numeric(11, 3)  YES  Identifies the Administration Fee (if there is one) that should be applied.
RoundUpAmt    numeric(11, 3)  YES  Identifies the Round Up amount (if there is one).

Round up to the nearest unit specified.
The main values used are:
0.01 - Round up to the nearest Cent
0.10 - Round up to the nearest Dime
0.50 - Round up to the nearest half dollar
1.00 - Round up to the nearest Dollar

Any value can be specified (for example 1.25 would indicate to round up to the nearest Dollar and 25 Cents).

Default of Blank will round to the nearest Cent and is equivalent to 0.01.
MinimumPriceAmt    numeric(11, 3)  YES  Identifies a Minimum price for the tiered range.

If the Price determined as a result of applying the Price Algorithm is less than this Minimum Price, then this Minimum Price is the Price of the Stock Item Product
MSrepl_tran_version    uniqueidentifier  NO  Optimistic lock identifier. 
MSReplrowguid    uniqueidentifier  NO  Unique GUID used to support merge replication. 

dbo.SXAMMPriceAlgorithmRangeRule Primary and Unique Keys 
Key Name  Key Type  Keys 
SXAMMPriceAlgorithmRangeRulePK  PrimaryKey  PriceAlgorithmRangeRuleID