---
title: "SQL-053: CollectionsRepository.ApplyPayments"
summary: Update / Create operation for CollectionsRepository
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
---


# SQL-053: CollectionsRepository.ApplyPayments

This statement is a update / create operation invoked through StoredProc (inline CreateSqlQuery + ExecuteUpdate). Executed by `CollectionsRepository.ApplyPayments`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-053 |
| **Operation type** | Update / Create |
| **Execution method** | StoredProc (inline `CreateSqlQuery` + `ExecuteUpdate`) |
| **Database** | Oracle |
| **Schema** | WCIS_DBA* (package owner; unqualified inside package) |
| **Command type** | StoredProcedure |
| **Business object** | `CollectionsRepository` |
| **Criteria property** | N/A — no IBusinessCriteria |
| **Lifecycle method** | `ApplyPayments` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:inSeqNum` | Input | NUMBER (.NET `SetDecimal`) | N/A | Case id; 0 applies payments for all cases |
| `:pmt_date` | Input | DATE (.NET `SetDateTime`) | N/A | Transaction date; ignored by the procedure body |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [LEGAL_COLLECTION_TRANSACTION](../database-tables.md#legal_collection_transaction) | R/U | See Sample SQL |
| [LEGAL_COLLECTION_TRAN_CODE](../database-tables.md#legal_collection_tran_code) | Write | See Sample SQL |
| [LC_TRAN_CATEGORY_CODE](../database-tables.md#lc_tran_category_code) | Write | See Sample SQL |
| [LEGAL_COLLECTION_PAYMENT_REF](../database-tables.md#legal_collection_payment_ref) | C | See Sample SQL |

## Sample SQL

Source: `Data/SAIF.Data.NHibernate/Repositories/CollectionsRepository.cs:88`

```sql
call WCIS_DBA.PK80010_LEGAL_COLLECTIONS.APPLYPAYMENTS(
    :inSeqNum,
    :pmt_date
)
```

## Operations and processes

- [Collections payment application](../operations/collections-payment-application.md)

## Business rules

- [SDN-BR-010](../business-rules.md#sdn-br-010-collection-case-payments-are-applied-by-the-oracle-package-applypayments-for-the-case-and-payment-date)
- [PROC-RULE-025](../business-rules.md#proc-rule-025-only-unapplied-payments-are-applied)
- [PROC-RULE-028](../business-rules.md#proc-rule-028-the-payment-keeps-the-unapplied-remainder)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `Data/SAIF.Data.NHibernate/Repositories/CollectionsRepository.cs:86`
