---
title: "GrossPriceConverter – API-Referenz · Quittio"
description: "Gross price mode for B2C and shops."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Calculation/GrossPriceConverter"
locale: de
meta:
  "og:description": "Gross price mode for B2C and shops."
  "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": "GrossPriceConverter – 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)

# GrossPriceConverter

final class in quittio/core

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

Gross price mode for B2C and shops.

Shops calculate with prices including VAT, EN 16931 calculates net. Per VAT group:

1. G = Σ g\_i with g\_i = round2(quantity × price incl. VAT)
2. N = round2(G / (1 + rate / 100)); a partial cancellation aligned with the earlier ones declares its N (Corrections\\CancellationHistory), which is used within 0.01
3. T = round2(N × rate / 100) (BR-CO-17)
4. Every line gets n\_i = round2(g\_i / (1 + rate / 100)); the few cents N − Σ n\_i are added to the lines with the largest rounding remainders. Each line keeps the sign of its gross amount (returns and vouchers stay negative). Net prices are derived with the precision needed so that the line formula yields the line amount.
5. G − (N + T) is returned as rounding amount for BT-114, so that the amount due equals the gross amount the customer saw. The calculator takes BT-114 from the total G and the amounts it finally uses, so that it also holds when declared amounts are kept (e.g. the aligned VAT of a partial cancellation).

Limits: all lines must use gross prices, and gross lines must not have line or document allowances or charges. Model shipping costs and discounts as lines; a discount line needs a negative quantity, because prices must not be negative (BR-27).

## Methods \#

| Method | Description |
| --- | --- |
| `->appliesTo()` | |
| `->convert()` | |
| `::netOf()` | N = round2(G / (1 + rate / 100)), step 2. |

### `appliesTo()`#

```
public function appliesTo(InvoiceData $invoice): bool
```

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

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

### `convert()`#

```
public function convert(
    InvoiceData $invoice,
    array<string, BigDecimal> $nets = [],
): array{lines: list<InvoiceLine>, rounding: BigDecimal, gross: BigDecimal}
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$invoice` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |
| `$nets` | `array<string, Brick\Math\BigDecimal>` = `[]` | declared net amounts N per VAT group (key: DeclaredAmounts::breakdownKey()), e.g. of a partial cancellation aligned with the earlier ones (Corrections\\CancellationHistory); used instead of step 2 within 0.01 |

<dl><dt>Returns</dt>
<dd><code>array{lines: list&lt;<a href="https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine">InvoiceLine</a>&gt;, rounding: Brick\Math\BigDecimal, gross: Brick\Math\BigDecimal}</code> – gross: G of all groups</dd></dl>

### `netOf()`#

```
public static function netOf(BigDecimal $gross, BigDecimal $rate): BigDecimal
```

static

N = round2(G / (1 + rate / 100)), step 2.

| Parameter | Type | Description |
| --- | --- | --- |
| `$gross` | `Brick\Math\BigDecimal` | |
| `$rate` | `Brick\Math\BigDecimal` | |

<dl><dt>Returns</dt>
<dd><code>Brick\Math\BigDecimal</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/GrossPriceConverter#webpage","@type":"WebPage","description":"Gross price mode for B2C and shops.","name":"GrossPriceConverter – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Calculation/GrossPriceConverter","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Calculation/GrossPriceConverter"]}],"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"}]}
```