API reference / Quittio \ Core \ Corrections
Correction
final class in quittio/core
Quittio\Core\Corrections\Correction · Source
Corrected invoice (type code 384) that replaces an issued invoice: a copy of the original with its own number, the reference to the original (BG-3) and the note "Diese Rechnung berichtigt und ersetzt die Rechnung … vom …" (BT-22), so that it states by a specific and unambiguous reference that it corrects the original (section 31 (5) UStDV, section 15.2a (7) UStAE). Change what was wrong on the returned builder.
Cancelling the original and issuing a new invoice (Cancellation) is the safer default: a receiving system that does not read 384 as replacement books both invoices. Credit notes and self-billed documents are corrected that way only.
Methods#
| Method | Description |
|---|---|
::note() | The note of a corrected invoice in the locale (label "correction_note"). |
::of() |
note()#
public static function note(string $number, ?Date $issueDate, string $locale): stringThe note of a corrected invoice in the locale (label "correction_note").
| Parameter | Type | Description |
|---|---|---|
$number | string | |
$issueDate | ?Date | |
$locale | string |
- Returns
string
of()#
public static function of(
InvoiceData $original,
string $number,
?string $reason = null,
?Date $issueDate = null,
?string $locale = null,
string|null $title = null,
?CorrectionPolicy $policy = null,
TotalsCalculator $calculator = new \Quittio\Core\Calculation\En16931Calculator(),
): InvoiceBuilder| Parameter | Type | Description |
|---|---|---|
$original | InvoiceData | |
$number | string | |
$reason | ?string = null | |
$issueDate | ?Date = null | |
$locale | ?string = null | |
$title | string|null = null | document title in the PDF, e.g. "Rechnungskorrektur"; without it the title "correction" of $policy |
$policy | ?CorrectionPolicy = null | |
$calculator | TotalsCalculator = new \Quittio\Core\Calculation\En16931Calculator() |
- Returns
InvoiceBuilder- Throws
InvalidArgumentException– for a credit note or a self-billed document