---
title: Compute premium summary adjustment sub-totals
summary: Premium summary adjustment sub-totalling.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Premium
reference_type: package
operation_id: OP-004
trigger: Premium display / document generation needs grouped premium sub-totals
---

# Compute premium summary adjustment sub-totals

Premium display / document generation needs grouped premium sub-totals

| Field | Value |
| --- | --- |
| **Operation ID** | OP-004 |
| **Trigger** | Premium display / document generation needs grouped premium sub-totals |
| **Inputs** | A collection of iPremiumSummaryAdjustment lines |
| **Outputs** | PremiumSummaryAdjustmentSubTotalList of SubTotalPremiumSummaryAdjustment entries |
| **Primary components** | `PremiumSummaryAdjustmentSubTotalList.GetSubTotalPremiumSummaryAdjustments(list) (SubTotalPremiumSummaryAdjustment.vb)` |
| **Entry point** | `Business\SAIF.Business.Policy.Premium\SubTotalPremiumSummaryAdjustment.vb` |

## Steps
1. If the input list is empty, return an empty result immediately.
2. Resolve the single governing rating rule master via `GetSingleRatingRuleMaster`. If the input spans more than one `RatingRuleMasterId`, this throws `ApplicationException` ([BR-013](../business-rules.md#br-013-subtotals-must-use-one-rating-rule-master)).
3. Build the working list as `PremiumSummaryAdjustmentSubTotalList(list, ratingRuleMaster.PremiumAdjustmentTypeCodes)`.
4. Compute `AllPeriods` = distinct `EffectiveRange` values, compared with `DateRangeEqualityComparer`.
5. Compute `Periods`: when more than one distinct period exists, use all split periods **excluding** the overall minimum→maximum span; otherwise use the single period.
6. Select per-period sub-total types: those where `PremiumRatingRulePriority IsNot Nothing` `AndAlso RatingRuleMasterID <> 0` `AndAlso AreAllGetAdjustmentSQLsNull` `AndAlso` `RatingRuleFunction` is one of `Addition`, `IncreasedLimitsMinimumPremium`, `Multiplication`, `PremiumPeriodProcessing` ([BR-014](../business-rules.md#br-014-per-period-subtotal-eligibility-is-filtered-by-rule-metadata)).
7. Select overall sub-total types: the same first three conditions `AndAlso RatingRuleFunction` is one of `DCBSSplitProcessing`, `ProcessLater` ([BR-015](../business-rules.md#br-015-whole-term-subtotal-eligibility-is-filtered-by-rule-metadata)). These span minimum effective date → maximum expiration date.
8. For each sub-total basis, `GetPSAsToSum(bases, psaList)` returns `Nothing` when either input is empty; otherwise it selects the adjustments whose `AdjustmentTypeCode` equals the basis's `PremiumAdjustmentTypeCodeIncluded`.
9. The result is the union of per-period sub-totals and overall sub-totals, tagged with one of the 24 sub-total codes (ZMAN, ZWAV, ZSUBP, ZMOD, ZRATE, ZGRP, ZOCC, ZEST, ZTEST, ZSPC, ZPREP, ZSTD, ZDISC, ZREM, ZDP, ZNEAP, ZLCF, ZUSLH, ZTERR, ZCAT, ZDCBS, ZRXT, ZDCBR, ZDCBT) mapped by the `SubTotalPremiumSummaryAdjustmentTypes` enum (25 members).

## Process flow
The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([Trigger]) --> S1[Step 1]
    S1 --> S2[Step 2]
    S2 --> EndOk([Outputs returned])
```

## Failure and edge-case behavior
- See the linked rules and SQL references above for validation failures, null-handling, and persistence contention behavior.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `Business\SAIF.Business.Policy.Premium\SubTotalPremiumSummaryAdjustment.vb`
- `Business\SAIF.Business.Policy.Premium\iPremiumSummaryAdjustment.vb`
