---
title: "Cancellation – API-Referenz · Quittio"
description: "Full cancellation of an issued invoice: a new invoice with its own number that reverses the original and refers to it (BG-3)."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Corrections/Cancellation"
locale: de
meta:
  "og:description": "Full cancellation of an issued invoice: a new invoice with its own number that reverses the original and refers to it (BG-3)."
  "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": "Cancellation – 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) \\ [Corrections](https://quittio.dev/docs/api/Quittio/Core/Corrections)

# Cancellation

final class in quittio/core

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

Full cancellation of an issued invoice: a new invoice with its own number that reverses the original and refers to it (BG-3).

Sign strategies (17.2):

- credit\_note: type code 381, amounts positive; UBL writes a CreditNote document,
- negative\_invoice: type code 380, quantities and allowance/charge amounts negated.

The cancellation of a credit note is an invoice (380) with the same positive amounts in both strategies.

Self-billed documents stay self-billed (issued by the buyer, labelled "Gutschrift" by the kept regulatory note): a self-billed invoice (389) or debit note (527) is cancelled by a self-billed credit note (261) or a negative self-billed invoice (389), a self-billed credit note by a self-billed invoice (389) with positive amounts.

Both are permitted in Germany; apart from self-billing the document must not be called "Gutschrift". The original data is never changed.

Declared amounts (Meta::FLAG\_DECLARED\_AMOUNTS): a full cancellation reverses the declared line net amounts (BT-131) and the declared VAT breakdown (BT-116, BT-117) of the original, also if another system rounded differently (BT-131 within 0.02, PEPPOL-EN16931-R120; BT-117 within the tolerance of BR-CO-17), so that the totals BT-106 to BT-115 are reversed exactly. A partial cancellation keeps the declared amounts of whole cancelled lines; quantities and amounts of a line are recalculated. Its VAT is that of the cancelled part, round2(taxable amount × rate) per VAT group, unless a CancellationHistory of the earlier partial cancellations is given: then the VAT is rounded cumulatively per group and declared (Meta::FLAG\_CANCELLATION\_VAT\_ALIGNED), so that all cancellations together reverse exactly the taxable amount (BT-116) and the VAT (BT-117) of every group and BT-111 in accounting currency. In gross price mode the net amounts follow cumulatively from the gross amounts cancelled so far (round2(G / (1 + rate)) like the original) and the rounding amount (BT-114) from the amounts used, so that the amount due stays the gross amount of the cancelled lines. Every cancellation then differs by at most 0.01 from round2(own taxable amount × rate), with the sign of its taxable amount (QUITTIO-CANCELLATION-VAT-ALIGNED, mentioned in the cancellation note); for an original whose VAT another system rounded, from round2(own taxable amount × the original's BT-117 / BT-116), which spreads that rounding over the parts. A history that does not fit the original (CancellationHistory::assertFits()) is rejected.

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `STRATEGIES` | `[\Quittio\Core\Countries\CorrectionPolicy::CANCELLATION_CREDIT_NOTE, \Quittio\Core\Countries\CorrectionPolicy::CANCELLATION_NEGATIVE_INVOICE]` | |

## Methods \#

| Method | Description |
| --- | --- |
| `::of()` | |

### `of()`#

```
public static function of(
    InvoiceData $original,
    string $number,
    string $strategy = \Quittio\Core\Countries\CorrectionPolicy::CANCELLATION_CREDIT_NOTE,
    ?string $reason = null,
    ?Date $issueDate = null,
    ?string $locale = null,
    string|null $title = null,
    list<array{line: string, quantity?: BigDecimal|int|string, Amount?: string}>|null $lines = null,
    ?CorrectionPolicy $policy = null,
    CancellationHistory|null $history = null,
    TotalsCalculator $calculator = new \Quittio\Core\Calculation\En16931Calculator(),
): InvoiceBuilder
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$original` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |
| `$number` | `string` | |
| `$strategy` | `string` = `\Quittio\Core\Countries\CorrectionPolicy::CANCELLATION_CREDIT_NOTE` | |
| `$reason` | `?string` = `null` | |
| `$issueDate` | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` = `null` | |
| `$locale` | `?string` = `null` | |
| `$title` | `string\|null` = `null` | document title in the PDF, e.g. "Stornorechnung"; without it the title comes from $policy ("cancellation\_self\_billed" for self-billed originals) |
| `$lines` | `list<array{line: string, Quittio\Core\Corrections\quantity?: Brick\Math\BigDecimal\|int\|string, [Amount](https://quittio.dev/docs/api/Quittio/Core/Support/Amount)?: string}>\|null` = `null` | partial cancellation: whole lines, a quantity of a line or an amount of a line (e.g. a price reduction); null cancels the whole invoice. Quantities and amounts are magnitudes, negative lines keep their sign. For lines with a price including VAT (gross price mode) the amount includes VAT |
| `$policy` | `? [CorrectionPolicy](https://quittio.dev/docs/api/Quittio/Core/Countries/CorrectionPolicy)` = `null` | |
| `$history` | `[CancellationHistory](https://quittio.dev/docs/api/Quittio/Core/Corrections/CancellationHistory)\|null` = `null` | partial cancellations: what the earlier partial cancellations of the original cancelled per VAT group, and which groups this one closes, for the cumulative rounding of the VAT (see CancellationHistory); without it the VAT is rounded per document |
| `$calculator` | `[TotalsCalculator](https://quittio.dev/docs/api/Quittio/Core/Calculation/TotalsCalculator)` = `new \Quittio\Core\Calculation\En16931Calculator()` | calculator of the VAT alignment with $history, e.g. the one of the Quittio instance |

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Builder/InvoiceBuilder">InvoiceBuilder</a></code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code> – e.g. for a history that does not fit the original</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/Corrections/Cancellation#webpage","@type":"WebPage","description":"Full cancellation of an issued invoice: a new invoice with its own number that reverses the original and refers to it (BG-3).","name":"Cancellation – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Corrections/Cancellation","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Corrections/Cancellation"]}],"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"}]}
```