---
title: "DeclaredAmounts – API-Referenz · Quittio"
description: "Declared amounts of an existing document (Meta::FLAG_DECLARED_AMOUNTS): whether they are needed at all, and the fingerprint of the amount inputs they belong to."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Calculation/DeclaredAmounts"
locale: de
meta:
  "og:description": "Declared amounts of an existing document (Meta::FLAG_DECLARED_AMOUNTS): whether they are needed at all, and the fingerprint of the amount inputs they belong to."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "DeclaredAmounts – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Calculation](https://quittio.dev/docs/api/Quittio/Core/Calculation)

# DeclaredAmounts

final class in quittio/core

`Quittio\Core\Calculation\DeclaredAmounts` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Calculation/DeclaredAmounts.php#L31)

Declared amounts of an existing document (Meta::FLAG\_DECLARED\_AMOUNTS): whether they are needed at all, and the fingerprint of the amount inputs they belong to.

The fingerprint (Meta::amountsFingerprint(), set by the calculator on every result and by the builder on data with amounts) covers per line (with sub lines) the identifier, quantity, prices, base quantity, VAT category and rate, line allowances and charges and the net amount, the document allowances and charges, the VAT breakdown and the currency. Data whose fingerprint no longer matches was changed afterwards (e.g. with with() or in stored JSON): its amounts are stale and never kept. Data without fingerprint (e.g. read from XML) is taken as declared by its issuer.

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `LINE_TOLERANCE` | `'0.02'` | Tolerance of a declared line net amount (BT-131), as PEPPOL-EN16931-R120 tolerates it. |
| `TAX_CURRENCY_TOLERANCE` | `'0.01'` | Tolerance of a declared VAT total in accounting currency (BT-111) against round2(BT-110 × exchange rate): EN 16931 does not check it, the cumulative rounding of partial cancellations (Corrections\\CancellationHistory) needs one cent. |

## Methods \#

| Method | Description |
| --- | --- |
| `::breakdownKey()` | VAT group key of a breakdown; categories without rate (O) ignore a rate written as 0. |
| `::fingerprint()` | |
| `::hasAmounts()` | Whether the data carries line net amounts or a VAT breakdown. |
| `::isStale()` | Data whose amount inputs changed after Quittio calculated or declared its amounts (fingerprint mismatch), or flagged with declared amounts without fingerprint. |
| `::isTrusted()` | Data flagged with declared amounts whose amount inputs still match the fingerprint. |
| `::needed()` | Whether the recalculation does not reproduce the declared line net amounts (BT-131), the declared VAT breakdown (BT-116, BT-117) or the declared VAT total in accounting currency (BT-111) exactly, e.g. because another system rounded per line or a partial cancellation aligns its VAT with earlier ones. Data calculated by Quittio never needs declared amounts. |

### `breakdownKey()`#

```
public static function breakdownKey(VatCategory $category, ?BigDecimal $rate): string
```

static

VAT group key of a breakdown; categories without rate (O) ignore a rate written as 0.

| Parameter | Type | Description |
| --- | --- | --- |
| `$category` | `[VatCategory](https://quittio.dev/docs/api/Quittio/Core/Enums/VatCategory)` | |
| `$rate` | `?Brick\Math\BigDecimal` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `fingerprint()`#

```
public static function fingerprint(InvoiceData $data): string
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `hasAmounts()`#

```
public static function hasAmounts(InvoiceData $data): bool
```

static

Whether the data carries line net amounts or a VAT breakdown.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `isStale()`#

```
public static function isStale(InvoiceData $data): bool
```

static

Data whose amount inputs changed after Quittio calculated or declared its amounts (fingerprint mismatch), or flagged with declared amounts without fingerprint.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `isTrusted()`#

```
public static function isTrusted(InvoiceData $data): bool
```

static

Data flagged with declared amounts whose amount inputs still match the fingerprint.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `needed()`#

```
public static function needed(
    InvoiceData $data,
    TotalsCalculator $calculator = new \Quittio\Core\Calculation\En16931Calculator(),
): bool
```

static

Whether the recalculation does not reproduce the declared line net amounts (BT-131), the declared VAT breakdown (BT-116, BT-117) or the declared VAT total in accounting currency (BT-111) exactly, e.g. because another system rounded per line or a partial cancellation aligns its VAT with earlier ones. Data calculated by Quittio never needs declared amounts.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |
| `$calculator` | `[TotalsCalculator](https://quittio.dev/docs/api/Quittio/Core/Calculation/TotalsCalculator)` = `new \Quittio\Core\Calculation\En16931Calculator()` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Calculation/DeclaredAmounts#webpage","@type":"WebPage","description":"Declared amounts of an existing document (Meta::FLAG_DECLARED_AMOUNTS): whether they are needed at all, and the fingerprint of the amount inputs they belong to.","name":"DeclaredAmounts – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Calculation/DeclaredAmounts","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Calculation/DeclaredAmounts"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```