# DecreasedTable

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/models/common/decreased-table.model.ts` (line 2)

**Part of:** [Pams](subsystem-pams)

`DecreasedTable` manages source and target currency symbol state for a decreased-value table model. Its methods reset symbols and handle currency-change events so related UI state can stay aligned with selected currencies.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `resetFromSymobl` | `resetFromSymobl()` | `void` |
| `FromcurrencyChange` | `FromcurrencyChange(e: any)` | `void` |
| `TocurrencyChange` | `TocurrencyChange(e: any)` | `void` |
| `resetToSymobl` | `resetToSymobl()` | `void` |

## Properties

| Property | Type |
|---|---|
| `ID` | `number` |
| `SupplierID` | `number` |
| `DecreasedTableSerial` | `number` |
| `FromValue` | `number` |
| `ToValue` | `number` |
| `FormCurrencyCode` | `string` |
| `ToCurrencyCode` | `string` |
| `Percentage` | `number` |
| `_FromCurrencySymbol` | `string` |
| `_ToCurrencySymbol` | `string` |

## Where it refuses work

- `DecreasedTable` stops the work with an early return when `this.ToValue == null`.
- `DecreasedTable` stops the work with an early return when `this._FromCurrencySymbol != ""`.
- `DecreasedTable` stops the work with an early return when `this._ToCurrencySymbol != ""`.

## Diagram

```mermaid
graph LR
  UI[Currency selection UI] --> FromChange[FromcurrencyChange()]
  UI --> ToChange[TocurrencyChange()]
  FromChange --> Table[DecreasedTable]
  ToChange --> Table
  ResetFrom[resetFromSymobl()] --> Table
  ResetTo[resetToSymobl()] --> Table
```

## Usage

```ts
import { DecreasedTable } from './models/common/decreased-table.model';

const decreasedTable = new DecreasedTable();

// Handle source and target currency selection changes.
decreasedTable.FromcurrencyChange();
decreasedTable.TocurrencyChange();

// Reset currency symbol state when clearing the table or form.
decreasedTable.resetFromSymobl();
decreasedTable.resetToSymobl();
```

## AI Coding Instructions

- Keep the existing method names and casing, including `Symobl`, when calling this class.
- Call `FromcurrencyChange()` and `TocurrencyChange()` from the matching currency selection handlers.
- Reset symbol state with `resetFromSymobl()` or `resetToSymobl()` when clearing related form state.
- Check connected components and templates before changing currency-state behavior.

## Relationships

- IMPORTS → `AppSettings`

## Used by

3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (3)

- `SupplierContractualInfo` — `Pams/Web/Pams.WebApp/Client/app/models/common/supplier-contractual-info.model.ts`:6
- `Account` — `Pams/Web/Pams.WebApp/Client/app/models/person/accounts.model.ts`:10
- `Supplier` — `Pams/Web/Pams.WebApp/Client/app/models/person/supplier.model.ts`:9
