Skip to content

API reference / Quittio \ Core \ Corrections

PriceReduction

final class in quittio/core

Quittio\Core\Corrections\PriceReduction · Source

Document on a reduction of the consideration of an issued invoice (section 17 UStG), e.g. a cash discount taken, a reduction because of a complaint about defects or a bonus: a credit note (type code 381, positive amounts) with one line per VAT group of the original, the reference to the original (BG-3) and a note that names the reduction of the net amount and of the VAT per rate (BT-22), titled "Entgeltminderung" in Germany.

It is no cancellation and no correction of the invoice: the invoice stays correct, only the consideration changed (section 14.11 (4) UStAE). A prepayment invoice (386) cannot be reduced: its advance payment is settled in the final invoice, an advance refunded is cancelled. In Germany a document is only required for section 17 (4) UStG, and it need not be an e-invoice (section 17.1 (3a) UStAE); a cash discount may as well be booked on receipt of the payment.

The reduction is a percentage of every VAT group, the net amount of an invoice with one VAT group, or net amounts per VAT group keyed "category:rate", e.g. ['S:19' => '50.00', 'S:7' => '5.00'].

VAT is rounded per document and VAT group (BR-CO-17): without history, the VAT of a reduction is round2(its net amount × rate). With a CancellationHistory of the documents that credited the original before (its partial cancellations, its price reductions and the cancellations of those), the VAT is rounded cumulatively per VAT group, as for partial cancellations: the VAT credited so far is round2(net amount credited so far × rate), and exactly the original's VAT (BT-117) once the whole net amount of the group is credited (the group then closes, see CancellationHistory). Three reductions of 0.50 of 1.50 net at 19 % (VAT 0.29) then carry 0.10, 0.09 and 0.10 instead of 3 × 0.10. A VAT amount that differs from the reduction's own rounding is declared (Meta::FLAG_CANCELLATION_VAT_ALIGNED, QUITTIO-CANCELLATION-VAT-ALIGNED, at most 0.01 and with the sign of the net amount), BT-111 in accounting currency is aligned the same way, and the note states the aligned VAT per rate followed by the rounding adjustment sentence (label "price_reduction_vat_aligned"). With a history, the reductions and cancellations together cannot credit more than the taxable amount of a group.

Methods#

MethodDescription
::of()

of()#

public static function of(
    InvoiceData $original,
    string $number,
    PriceReductionReason $reason,
    BigDecimal|int|string|null $percent = null,
    BigDecimal|int|string|null $amount = null,
    array<string, BigDecimal|int|string>|null $amounts = null,
    ?Date $issueDate = null,
    ?string $locale = null,
    string|null $title = null,
    ?CorrectionPolicy $policy = null,
    TotalsCalculator $calculator = new \Quittio\Core\Calculation\En16931Calculator(),
    CancellationHistory|null $history = null,
): InvoiceBuilder

static

ParameterTypeDescription
$originalInvoiceData
$numberstring
$reasonPriceReductionReason
$percentBrick\Math\BigDecimal|int|string|null = null
$amountBrick\Math\BigDecimal|int|string|null = null
$amountsarray<string, Brick\Math\BigDecimal|int|string>|null = nullnet amount per VAT group, keyed "category:rate" ("S:19", "E:0", "O" for a group without rate)
$issueDate?Date = null
$locale?string = null
$titlestring|null = nulldocument title in the PDF; without it the title "price_reduction" of $policy, otherwise the label "price_reduction_title"
$policy?CorrectionPolicy = null
$calculatorTotalsCalculator = new \Quittio\Core\Calculation\En16931Calculator()calculator of the VAT alignment with $history, e.g. the one of the Quittio instance
$historyCancellationHistory|null = nullwhat the earlier partial cancellations and price reductions of the original (less what their cancellations reversed) credited per VAT group, for the cumulative rounding of the VAT (see the class description and CancellationHistory); without it the VAT is rounded per document
Returns
InvoiceBuilder
Throws
InvalidArgumentException – for a credit note, a self-billed document, a prepayment invoice (386, also a document with Meta::FLAG_PREPAYMENT_CORRECTION) or an invoice without calculated VAT breakdown, for amounts that do not fit the original, or for a history that does not fit it

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.