[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs:building-invoices":3},{"versions":4,"version":26,"nav":28,"path":43,"kind":106,"page":107},[5,10,13,16,18,20,22,24],{"name":6,"label":7,"prefix":8,"channel":9},"0.7","0.7 (latest)","","latest",{"name":11,"label":12,"prefix":11,"channel":11},"next","next (unreleased)",{"name":14,"label":14,"prefix":14,"channel":15},"0.6","old",{"name":17,"label":17,"prefix":17,"channel":15},"0.5",{"name":19,"label":19,"prefix":19,"channel":15},"0.4",{"name":21,"label":21,"prefix":21,"channel":15},"0.3",{"name":23,"label":23,"prefix":23,"channel":15},"0.2",{"name":25,"label":25,"prefix":25,"channel":15},"0.1",{"name":6,"label":7,"prefix":8,"channel":9,"base":27},"\u002Fdocs",[29,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,91,94,97,100,103],{"slug":30,"title":31,"preview":32},"index","Home",false,{"slug":34,"title":35,"preview":32},"getting-started","Getting started",{"slug":37,"title":38,"preview":32},"concepts","E-invoicing basics",{"slug":40,"title":41,"preview":32},"examples","Examples",{"slug":43,"title":44,"preview":32},"building-invoices","Building invoices",{"slug":46,"title":47,"preview":32},"formats","Formats and profiles",{"slug":49,"title":50,"preview":32},"validation","Validation",{"slug":52,"title":53,"preview":32},"templates","Templates and design",{"slug":55,"title":56,"preview":32},"documents","Quotes and other documents",{"slug":58,"title":59,"preview":32},"reading","Reading incoming invoices",{"slug":61,"title":62,"preview":32},"laravel","Laravel integration",{"slug":64,"title":65,"preview":32},"configuration","Configuration",{"slug":67,"title":68,"preview":32},"commands","Artisan commands",{"slug":70,"title":71,"preview":32},"testing","Testing",{"slug":73,"title":74,"preview":32},"country-packs","Country packs",{"slug":76,"title":77,"parent":74,"preview":32},"country-at","Austria",{"slug":79,"title":80,"parent":74,"preview":32},"country-be","Belgium",{"slug":82,"title":83,"parent":74,"preview":32},"country-ch","Switzerland",{"slug":85,"title":86,"parent":74,"preview":32},"country-fr","France",{"slug":88,"title":89,"preview":90},"managed","Managed layer (preview)",true,{"slug":92,"title":93,"preview":32},"troubleshooting","Troubleshooting",{"slug":95,"title":96,"preview":32},"faq","FAQ",{"slug":98,"title":99,"preview":32},"compatibility","Versioning and compatibility",{"slug":101,"title":102,"preview":32},"field-reference","Field reference",{"slug":104,"title":105,"preview":32},"ai","AI assistants","page",{"title":44,"description":108,"html":109,"headings":110,"editUrl":287,"markdownUrl":288,"prev":289,"next":290},"This page is the reference for creating invoice data with Quittio's invoice builder: every builder method, VAT, payment, the calculation of totals, cancellations and the data model.","\u003Ch1 id=\"building-invoices\">Building invoices\u003C\u002Fh1>\n\u003Cp>This page is the reference for creating invoice data with Quittio's invoice builder: every builder method, VAT, payment, the calculation of totals, cancellations and the data model. Use it when you write your first real invoice and whenever you need an option that the tutorial does not show. If you have not rendered an invoice yet, start with \u003Ca href=\"\u002Fdocs\u002Fgetting-started\">Getting started\u003C\u002Fa>; terms such as EN 16931, business terms and profiles are explained in \u003Ca href=\"\u002Fdocs\u002Fconcepts\">E-invoicing basics\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>The page has three parts:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Basics:\u003C\u002Fstrong> the \u003Ca href=\"#overview\">overview\u003C\u002Fa> with the usual way to write each part of an invoice, the \u003Ca href=\"#conventions\">conventions\u003C\u002Fa> for amounts, dates and codes, and \u003Ca href=\"#creating-and-building\">creating and building\u003C\u002Fa> the data.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The parts of an invoice\u003C\u002Fstrong>, in the order you usually need them: \u003Ca href=\"#document-type-and-identification\">number and type\u003C\u002Fa>, \u003Ca href=\"#dates\">dates\u003C\u002Fa>, \u003Ca href=\"#parties\">parties\u003C\u002Fa>, \u003Ca href=\"#lines\">lines\u003C\u002Fa>, \u003Ca href=\"#vat\">VAT\u003C\u002Fa>, \u003Ca href=\"#payment\">payment\u003C\u002Fa>, \u003Ca href=\"#references\">references\u003C\u002Fa>, \u003Ca href=\"#notes\">notes\u003C\u002Fa>, \u003Ca href=\"#supporting-documents\">attachments\u003C\u002Fa>, \u003Ca href=\"#presentation-and-metadata\">design and metadata\u003C\u002Fa> and \u003Ca href=\"#application-models\">your own models\u003C\u002Fa>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Advanced topics:\u003C\u002Fstrong> \u003Ca href=\"#currency-and-exchange-rate\">foreign currencies\u003C\u002Fa>, \u003Ca href=\"#allowances-and-charges\">allowances and charges\u003C\u002Fa>, \u003Ca href=\"#sub-lines\">sub lines\u003C\u002Fa>, \u003Ca href=\"#gross-price-mode\">prices including VAT\u003C\u002Fa>, \u003Ca href=\"#changing-existing-data\">changing existing data\u003C\u002Fa>, \u003Ca href=\"#cancellations-and-corrections\">cancellations\u003C\u002Fa>, \u003Ca href=\"#extensions\">data of profile EXTENDED\u003C\u002Fa>, \u003Ca href=\"#macros\">macros\u003C\u002Fa>, the \u003Ca href=\"#calculation\">calculation\u003C\u002Fa> and the \u003Ca href=\"#data-model\">data model\u003C\u002Fa>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"overview\">Overview\u003Ca class=\"q-doc-anchor\" href=\"#overview\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>Quittio\\Core\\Builder\\InvoiceBuilder\u003C\u002Fcode> creates an \u003Ccode>InvoiceData\u003C\u002Fcode> object: the invoice as immutable data, following the European standard EN 16931 (\u003Ca href=\"\u002Fdocs\u002Fconcepts#en-16931-and-business-terms\">EN 16931 and business terms\u003C\u002Fa>). The builder is part of \u003Ccode>quittio\u002Fcore\u003C\u002Fcode> and works with and without Laravel. Rendering turns the data into PDF and XML (\u003Ca href=\"\u002Fdocs\u002Fformats\">Formats and profiles\u003C\u002Fa>, \u003Ca href=\"\u002Fdocs\u002Flaravel\">Laravel integration\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>In Laravel, start with \u003Ccode>Quittio::invoice()\u003C\u002Fcode>. It returns the same builder, already filled with the seller, the first bank account and the small business setting of \u003Ccode>config\u002Fquittio.php\u003C\u002Fcode>, and the builder can render itself with \u003Ccode>-&gt;render()\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Flaravel#starting-invoices\">Starting invoices\u003C\u002Fa>):\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Party\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$invoice \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()                                \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F seller and bank account from config\u002Fquittio.php\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">number\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0042'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">issueDate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-10-03'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">deliveryDate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-09-30'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)                             \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F date of supply, mandatory in Germany\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyerReference\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'PO-4711'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Party\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Kunde AG'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vatId\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE987654321'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Bahnhofstraße 5'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'54321'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Beispielstadt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">electronicAddress\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ap@kunde.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Web development'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'95.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">24\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">unit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Hour\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F default VAT: 19 %\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Handbook of VAT law'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'39.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Reduced\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">payment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">SepaCreditTransfer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">remittanceInformation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0042'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F keeps the configured account\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">dueInDays\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">14\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cashDiscount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">days\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">7\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">build\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();                                               \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F or ->render() for PDF and XML\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Without Laravel, start with \u003Ccode>InvoiceBuilder::make()\u003C\u002Fcode> and set the seller yourself (\u003Ca href=\"#seller-and-buyer\">Seller and buyer\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>Three things to know before you continue:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>build()\u003C\u002Fcode> returns the data. In Laravel, \u003Ccode>render()\u003C\u002Fcode> renders it right away instead.\u003C\u002Fli>\n\u003Cli>You never pass totals, VAT amounts or the VAT breakdown. Quittio calculates them when the invoice is rendered (\u003Ca href=\"#calculation\">Calculation\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>The builder only checks that the essential parts are there (\u003Ca href=\"#creating-and-building\">Creating and building\u003C\u002Fa>). Everything else, such as a missing invoice number, is reported by the \u003Ca href=\"\u002Fdocs\u002Fvalidation\">validation\u003C\u002Fa> when the invoice is rendered.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"the-usual-forms\">The usual forms\u003Ca class=\"q-doc-anchor\" href=\"#the-usual-forms\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Most parts of an invoice can be written in several ways. This documentation uses one usual form for each, the same as \u003Ca href=\"\u002Fdocs\u002Fgetting-started#one-way-to-write-it\">Getting started\u003C\u002Fa>. The other forms exist for special cases; the linked sections describe them.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>You need\u003C\u002Fth>\n\u003Cth>Write\u003C\u002Fth>\n\u003Cth>Details\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>A line with price, quantity, unit, VAT or description\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;line('Hosting', netPrice: '49.00', quantity: 12, unit: UnitCode::Month)\u003C\u002Fcode>. Without \u003Ccode>quantity\u003C\u002Fcode> it is 1, without \u003Ccode>vat\u003C\u002Fcode> the default VAT applies (in Laravel 19 % for a German seller).\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#lines\">Lines\u003C\u002Fa>, \u003Ca href=\"#default-vat\">Default VAT\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>A line with more than that: item number, line discount, list price, period, sub lines, line group\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;line(Line::make('Pump', netPrice: '1450.00', quantity: 2)-&gt;sellerId('P-200'))\u003C\u002Fcode>. \u003Ccode>Line::make()\u003C\u002Fcode> takes the same named values as \u003Ccode>line()\u003C\u002Fcode> and returns the line builder for the other methods.\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#linebuilder\">LineBuilder\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Many lines from your data\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;lines($order-&gt;items)\u003C\u002Fcode> with models that implement \u003Ccode>ProvidesInvoiceLine\u003C\u002Fcode>, or \u003Ccode>-&gt;lines($rows)\u003C\u002Fcode> with arrays such as \u003Ccode>['name' =&gt; 'Hosting', 'netPrice' =&gt; '49.00']\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#lines\">Lines\u003C\u002Fa>, \u003Ca href=\"#application-models\">Application models\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>The customer\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;buyer($customer)\u003C\u002Fcode> with a model that implements \u003Ccode>ProvidesParty\u003C\u002Fcode>, otherwise \u003Ccode>-&gt;buyer(Party::make('Kunde AG')-&gt;address(…))\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#seller-and-buyer\">Seller and buyer\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>A VAT rate other than the default\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;line('Book', netPrice: '39.00', vat: VatPreset::Reduced)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#vat\">VAT\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Payment terms\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;dueInDays(14)-&gt;cashDiscount(days: 7, percent: '2.00')\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#payment-terms\">Payment terms\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>The result\u003C\u002Ftd>\n\u003Ctd data-label=\"Write\">\u003Ccode>-&gt;render()\u003C\u002Fcode> for PDF and XML, \u003Ccode>-&gt;build()\u003C\u002Fcode> for the data only, e.g. to store a draft\u003C\u002Ftd>\n\u003Ctd data-label=\"Details\">\u003Ca href=\"#creating-and-building\">Creating and building\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ch2 id=\"conventions\">Conventions\u003Ca class=\"q-doc-anchor\" href=\"#conventions\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>These rules apply to every method on this page.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Chaining.\u003C\u002Fstrong> Every builder method returns the builder, so calls can be chained. The builders are mutable; the built \u003Ccode>InvoiceData\u003C\u002Fcode> is not (\u003Ca href=\"#immutability\">Immutability\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Numbers are strings.\u003C\u002Fstrong> Amounts, prices, quantities, percentages and rates are strings (\u003Ccode>'95.00'\u003C\u002Fcode>), integers or \u003Ccode>Brick\\Math\u003C\u002Fcode> numbers. Floats are rejected with an \u003Ccode>InvalidArgumentException\u003C\u002Fcode> (&quot;Floats are not accepted …&quot;), with or without \u003Ccode>declare(strict_types=1)\u003C\u002Fcode>, because most decimal values have no exact float representation.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Methods typed \u003Ccode>BigDecimal|int|float|string\u003C\u002Fcode> accept a float only to reject it. Without \u003Ccode>float\u003C\u002Fcode> in the signature, PHP would turn \u003Ccode>19.99\u003C\u002Fcode> into \u003Ccode>19\u003C\u002Fcode> in files without strict types.\u003C\u002Fli>\n\u003Cli>Parameters typed \u003Ccode>string\u003C\u002Fcode>, such as the amount of \u003Ccode>allowance()\u003C\u002Fcode>, receive a float as its string form.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Cstrong>Amounts have at most two decimals.\u003C\u002Fstrong> Allowance, charge, prepaid and rounding amounts and the base amounts of cash discounts have at most two decimals, in every currency. More decimals throw an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>. Prices, quantities, percentages and rates keep any precision.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Dates.\u003C\u002Fstrong> Date parameters accept a \u003Ccode>Quittio\\Core\\Support\\Date\u003C\u002Fcode>, a \u003Ccode>DateTimeInterface\u003C\u002Fcode> or a string: \u003Ccode>YYYY-MM-DD\u003C\u002Fcode>, \u003Ccode>YYYYMMDD\u003C\u002Fcode> or another notation that names a calendar date. Relative expressions such as \u003Ccode>tomorrow\u003C\u002Fcode> or \u003Ccode>+14 days\u003C\u002Fcode> are rejected. A \u003Ccode>DateTimeInterface\u003C\u002Fcode> is converted into a date in the time zone set with \u003Ccode>timezone()\u003C\u002Fcode>, so call \u003Ccode>timezone()\u003C\u002Fcode> first. \u003Ccode>invoicingPeriod()\u003C\u002Fcode> and \u003Ccode>LineBuilder::period()\u003C\u002Fcode> accept \u003Ccode>Date\u003C\u002Fcode> objects and strings only.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Codes.\u003C\u002Fstrong> Code parameters take the enum case (\u003Ccode>UnitCode::Hour\u003C\u002Fcode>) or the code as string (\u003Ccode>'HUR'\u003C\u002Fcode>). A string that is not a case of the enum is kept as \u003Ccode>Quittio\\Core\\Codes\\RawCode\u003C\u002Fcode>, so every code of the official code lists can be used; the validation checks raw codes against the code lists. Exception: \u003Ccode>attachment()\u003C\u002Fcode> accepts only the MIME types of \u003Ccode>MimeType\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Calculated values.\u003C\u002Fstrong> Line net amounts (BT-131), the document totals (BG-22), the VAT breakdown (BG-23) and the due date derived from the payment terms are calculated when the invoice is rendered (\u003Ca href=\"#calculation\">Calculation\u003C\u002Fa>). There is no method to set them.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Terms used on this page:\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Numbers such as &quot;buyer reference (BT-10)&quot; or &quot;seller postal address (BG-5)&quot; are the business terms (BT) and business groups (BG) of EN 16931. You never type them in code; they help you match validation messages and the \u003Ca href=\"\u002Fdocs\u002Ffield-reference\">field reference\u003C\u002Fa> (\u003Ca href=\"\u002Fdocs\u002Fconcepts#en-16931-and-business-terms\">EN 16931 and business terms\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>Codes such as \u003Ccode>BR-CO-26\u003C\u002Fcode>, \u003Ccode>BR-DE-1\u003C\u002Fcode> or \u003Ccode>QUITTIO-PROFORMA\u003C\u002Fcode> name the rules that the validation checks (\u003Ca href=\"\u002Fdocs\u002Fconcepts#rules-and-validation\">Rules and validation\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>ZUGFeRD\u002FFactur-X, XRechnung and Peppol are e-invoice formats (\u003Ca href=\"\u002Fdocs\u002Fconcepts#formats\">Formats\u003C\u002Fa>). CII and UBL are the two XML syntaxes they use (\u003Ca href=\"\u002Fdocs\u002Fconcepts#syntaxes-cii-and-ubl\">Syntaxes: CII and UBL\u003C\u002Fa>). A profile, such as EN 16931, EXTENDED or XRechnung, decides which fields and rules an XML file has (\u003Ca href=\"\u002Fdocs\u002Fconcepts#profiles\">Profiles\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>A country pack brings the tax presets, legal rules and texts of one country; \u003Ccode>quittio\u002Fquittio\u003C\u002Fcode> includes the German pack (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs\">Country packs\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>A \u003Cstrong>VAT group\u003C\u002Fstrong> is everything with the same VAT category and rate. The \u003Cstrong>VAT breakdown\u003C\u002Fstrong> (BG-23) has one entry per VAT group, with its taxable amount and its VAT.\u003C\u002Fli>\n\u003Cli>round2(x) is x rounded half up to two decimals.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"creating-and-building\">Creating and building\u003Ca class=\"q-doc-anchor\" href=\"#creating-and-building\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>The tables of this page group the builder methods by topic and name their business terms. The \u003Ca href=\"\u002Fdocs\u002Fapi\u002FQuittio\u002FCore\u002FBuilder\u002FInvoiceBuilder\">API reference\u003C\u002Fa> lists every method with its parameters.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>InvoiceBuilder::make()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">New, empty builder. Defaults: type code 380 (commercial invoice), currency \u003Ccode>EUR\u003C\u002Fcode>, EN 16931:2017.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>InvoiceBuilder::from(InvoiceData $data)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Builder with all values of existing data, e.g. to change a draft, a stored invoice or a read invoice (\u003Ca href=\"#changing-existing-data\">Changing existing data\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Quittio::edit(InvoiceData $data)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Like \u003Ccode>from()\u003C\u002Fcode>, but declared amounts are compared with the configured calculator and its policy (\u003Ca href=\"#declared-amounts\">Declared amounts\u003C\u002Fa>). \u003Ccode>InvoiceBuilder::fromUsing($data, $calculator)\u003C\u002Fcode> does the same with a calculator of your own.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>InvoiceBuilder::fromDocument(DocumentData $document)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoice from a quote, order confirmation, delivery note or proforma invoice. Parties, billable lines, document allowances and charges and payment data are taken over; number, issue date and notes are not. The number of an order confirmation becomes the sales order reference (BT-14), that of a delivery note the despatch advice reference (BT-16). See \u003Ca href=\"\u002Fdocs\u002Fdocuments#from-document-to-invoice\">From document to invoice\u003C\u002Fa>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>build(): InvoiceData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Builds the data. Requires at least one line.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buildDraft(): InvoiceData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Builds without requiring lines, e.g. for drafts or as the basis of payment reminders or account statements. Data without lines can be calculated (its line sum is zero), but it is not a valid invoice (BR-16).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Ccode>build()\u003C\u002Fcode> and \u003Ccode>buildDraft()\u003C\u002Fcode> throw \u003Ccode>Quittio\\Core\\Exceptions\\InvalidInvoiceData\u003C\u002Fcode> (an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>) when an essential part is missing. The message names the business term, e.g. &quot;Missing buyer postal address (BG-8).&quot;:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Missing\u003C\u002Fth>\n\u003Cth>Business term\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Seller, seller name, seller postal address\u003C\u002Ftd>\n\u003Ctd data-label=\"Business term\">BG-4, BT-27, BG-5\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Buyer, buyer name, buyer postal address\u003C\u002Ftd>\n\u003Ctd data-label=\"Business term\">BG-7, BT-44, BG-8\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Lines (\u003Ccode>build()\u003C\u002Fcode> only)\u003C\u002Ftd>\n\u003Ctd data-label=\"Business term\">BG-25\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Item name of a line\u003C\u002Ftd>\n\u003Ctd data-label=\"Business term\">BT-153\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT category of a line, unless the invoice has a \u003Ca href=\"#default-vat\">default VAT\u003C\u002Fa>\u003C\u002Ftd>\n\u003Ctd data-label=\"Business term\">BG-30\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Everything else is reported by the \u003Ca href=\"\u002Fdocs\u002Fvalidation\">validation\u003C\u002Fa> when the invoice is rendered or checked, e.g. a missing invoice number or a missing buyer reference that XRechnung requires.\u003C\u002Fp>\n\u003Cp>Without \u003Ccode>issueDate()\u003C\u002Fcode>, the issue date is today in the builder's time zone (\u003Ccode>timezone()\u003C\u002Fcode>, otherwise PHP's default time zone).\u003C\u002Fp>\n\u003Ch2 id=\"document-type-and-identification\">Document type and identification\u003Ca class=\"q-doc-anchor\" href=\"#document-type-and-identification\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every invoice needs a number. The type code tells the recipient what kind of document it is. Its default, 380, is a normal commercial invoice, so most invoices only call \u003Ccode>number()\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>number(string $number)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-1\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoice number. The builder does not check it; the validation requires it. The \u003Ca href=\"\u002Fdocs\u002Fmanaged\">Managed layer\u003C\u002Fa> assigns numbers itself.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>type(InvoiceTypeCode|RawCode|string $type)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-3\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Type code from the code list UNTDID 1001, default \u003Ccode>InvoiceTypeCode::CommercialInvoice\u003C\u002Fcode> (380). See \u003Ca href=\"#type-codes\">Type codes\u003C\u002Fa>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>businessProcess(?string $process)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-23\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Business process identifier. The profiles Peppol and XRechnung write \u003Ccode>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0\u003C\u002Fcode> when it is not set.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>standard(StandardVersion $version)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-24\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Version of EN 16931: \u003Ccode>StandardVersion::En16931_2017\u003C\u002Fcode> (default) or \u003Ccode>En16931_2026\u003C\u002Fcode>. Only the profile EN 16931 supports 2026 (\u003Ccode>urn:cen.eu:en16931:2026\u003C\u002Fcode>); other profiles report \u003Ccode>QUITTIO-STANDARD-VERSION\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The specification identifier (BT-24) itself is not part of the data. It comes from the profile chosen when rendering (\u003Ca href=\"\u002Fdocs\u002Fformats#profiles\">Formats and profiles\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"credit-notes-corrected-invoices-and-self-billing\">Credit notes, corrected invoices and self-billing\u003Ca class=\"q-doc-anchor\" href=\"#credit-notes-corrected-invoices-and-self-billing\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Set another type code when the document is not a normal invoice:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\InvoiceTypeCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Credit note: positive amounts, type code 381, reference to the invoice\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">type\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">InvoiceTypeCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">CreditNote\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">precedingInvoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0042'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-10-03'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Corrected invoice (384) based on the original, with the note \"Diese Rechnung berichtigt und ersetzt …\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">correction\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0050'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">updateLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'80.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Self-billing: the buyer issues the invoice, the supplier stays the seller (BG-4)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">type\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">InvoiceTypeCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">SelfBilledInvoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>To cancel an issued invoice, build a cancellation with \u003Ccode>Quittio::cancellation()\u003C\u002Fcode> instead (\u003Ca href=\"#cancellations-and-corrections\">Cancellations and corrections\u003C\u002Fa>); \u003Ccode>Quittio::correction()\u003C\u002Fcode> is described in \u003Ca href=\"#corrected-invoices\">Corrected invoices\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>The German pack adds \u003Ccode>selfBilled()\u003C\u002Fcode> for self-billing. It sets type code 389 and adds the note &quot;Gutschrift&quot; (self-billed invoice) with subject \u003Ccode>REG\u003C\u002Fcode>, which the German rules require (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs#self-billing-gutschrift\">Self-billing\u003C\u002Fa>, \u003Ca href=\"\u002Fdocs\u002Fconcepts#german-terms\">German terms\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"type-codes\">Type codes\u003Ca class=\"q-doc-anchor\" href=\"#type-codes\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>InvoiceTypeCode\u003C\u002Fcode> contains the type codes that EN 16931 allows:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Case\u003C\u002Fth>\n\u003Cth>Code\u003C\u002Fth>\n\u003Cth>Note\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CommercialInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">380\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Default.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CreditNote\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">381\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Credit note with positive amounts; UBL writes a \u003Ccode>CreditNote\u003C\u002Fcode> document.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CorrectedInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">384\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Reference the corrected invoice with \u003Ccode>precedingInvoice()\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SelfBilledInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">389\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Issued by the buyer (self-billing).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SelfBilledCreditNote\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">261\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Self-billed credit note.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SelfBilledDebitNote\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">527\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Self-billed debit note.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PartialInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">326\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Partial invoice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PrepaymentInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">386\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Advance payment invoice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PartialConstructionInvoice\u003C\u002Fcode>, \u003Ccode>PartialFinalConstructionInvoice\u003C\u002Fcode>, \u003Ccode>FinalConstructionInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">875, 876, 877\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Construction invoices.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>DebitNote\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">383\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Debit note.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ProformaInvoice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">325\u003C\u002Ftd>\n\u003Ctd data-label=\"Note\">Rejected in the invoice pipeline (\u003Ccode>QUITTIO-PROFORMA\u003C\u002Fcode>); use \u003Ccode>Quittio::proforma()\u003C\u002Fcode> in Laravel or \u003Ccode>DocumentBuilder::proforma()\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Fdocuments#proforma-invoices\">Proforma invoices\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Further cases: \u003Ccode>RequestForPayment\u003C\u002Fcode> (71), \u003Ccode>DebitNoteGoodsServices\u003C\u002Fcode> (80), \u003Ccode>CreditNoteGoodsServices\u003C\u002Fcode> (81), \u003Ccode>MeteredServicesInvoice\u003C\u002Fcode> (82), \u003Ccode>CreditNoteFinancialAdjustment\u003C\u002Fcode> (83), \u003Ccode>DebitNoteFinancialAdjustment\u003C\u002Fcode> (84), \u003Ccode>TaxNotification\u003C\u002Fcode> (102), \u003Ccode>InvoicingDataSheet\u003C\u002Fcode> (130), \u003Ccode>DirectPaymentValuation\u003C\u002Fcode> (202), \u003Ccode>ProvisionalPaymentValuation\u003C\u002Fcode> (203), \u003Ccode>PaymentValuation\u003C\u002Fcode> (204), \u003Ccode>InterimApplicationForPayment\u003C\u002Fcode> (211), \u003Ccode>FinalPaymentRequest\u003C\u002Fcode> (218), \u003Ccode>PaymentRequestForCompletedUnits\u003C\u002Fcode> (219), \u003Ccode>ConsolidatedCreditNote\u003C\u002Fcode> (262), \u003Ccode>PriceVariationInvoice\u003C\u002Fcode> (295), \u003Ccode>CreditNoteForPriceVariation\u003C\u002Fcode> (296), \u003Ccode>DelcredereCreditNote\u003C\u002Fcode> (308), \u003Ccode>CommercialInvoiceWithPackingList\u003C\u002Fcode> (331), \u003Ccode>CommissionNote\u003C\u002Fcode> (382), \u003Ccode>ConsolidatedInvoice\u003C\u002Fcode> (385), \u003Ccode>HireInvoice\u003C\u002Fcode> (387), \u003Ccode>TaxInvoice\u003C\u002Fcode> (388), \u003Ccode>DelcredereInvoice\u003C\u002Fcode> (390), \u003Ccode>FactoredInvoice\u003C\u002Fcode> (393), \u003Ccode>LeaseInvoice\u003C\u002Fcode> (394), \u003Ccode>ConsignmentInvoice\u003C\u002Fcode> (395), \u003Ccode>FactoredCreditNote\u003C\u002Fcode> (396), \u003Ccode>OcrPaymentCreditNote\u003C\u002Fcode> (420), \u003Ccode>DebitAdvice\u003C\u002Fcode> (456), \u003Ccode>ReversalOfDebit\u003C\u002Fcode> (457), \u003Ccode>ReversalOfCredit\u003C\u002Fcode> (458), \u003Ccode>ForwardersCreditNote\u003C\u002Fcode> (532), \u003Ccode>ForwardersInvoiceDiscrepancyReport\u003C\u002Fcode> (553), \u003Ccode>InsurersInvoice\u003C\u002Fcode> (575), \u003Ccode>ForwardersInvoice\u003C\u002Fcode> (623), \u003Ccode>PortChargesDocument\u003C\u002Fcode> (633), \u003Ccode>InvoiceInformationForAccounting\u003C\u002Fcode> (751), \u003Ccode>FreightInvoice\u003C\u002Fcode> (780), \u003Ccode>ClaimNotification\u003C\u002Fcode> (817), \u003Ccode>ConsularInvoice\u003C\u002Fcode> (870), \u003Ccode>CustomsInvoice\u003C\u002Fcode> (935).\u003C\u002Fp>\n\u003Cp>\u003Ccode>InvoiceTypeCode::isCreditNote()\u003C\u002Fcode> is true for 81, 83, 261, 262, 296, 308, 381, 396, 420, 458 and 532. These are written as a \u003Ccode>CreditNote\u003C\u002Fcode> document in UBL. \u003Ccode>isSelfBilled()\u003C\u002Fcode> is true for 261, 389 and 527.\u003C\u002Fp>\n\u003Cp>The document title in PDF, HTML and file names follows the type code:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>380, 381, 384, 389, 325, 326, 386, 875, 876 and 877 have their own title.\u003C\u002Fli>\n\u003Cli>Other credit notes use the title of 381, other self-billed documents that of 389.\u003C\u002Fli>\n\u003Cli>Everything else is titled &quot;Invoice&quot; (&quot;Rechnung&quot; on a German invoice).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ccode>Presentation::$title\u003C\u002Fcode> overrides the title.\u003C\u002Fp>\n\u003Ch2 id=\"dates\">Dates\u003Ca class=\"q-doc-anchor\" href=\"#dates\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>An invoice has an issue date and usually the date or period of the delivery or service. German invoices must state the date of supply: a delivery date (\u003Ccode>deliveryDate()\u003C\u002Fcode>), an invoicing period (\u003Ccode>invoicingPeriod()\u003C\u002Fcode>) or a period on the lines (rule \u003Ccode>DE-USTG-03\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>issueDate(Date|DateTimeInterface|string $date)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-2\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Issue date, default today.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>deliveryDate(Date|DateTimeInterface|string $date)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-72\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Actual delivery or service date. Keeps the deliver-to data.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>invoicingPeriod(Date|string|null $start, Date|string|null $end = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-14 (BT-73, BT-74)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoicing or service period. One of the two dates may be \u003Ccode>null\u003C\u002Fcode>, not both.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>dueDate(Date|DateTimeInterface|string $date)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-9\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Due date. Without it, the calculator derives it from \u003Ccode>dueInDays()\u003C\u002Fcode>. Without payment terms, the configured default applies when rendering (\u003Ccode>due_days\u003C\u002Fcode>, Laravel \u003Ccode>defaults.due_days\u003C\u002Fcode>, default 14 there); never for credit notes.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxPointDate(Date|DateTimeInterface|string $date)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-7\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Date when VAT becomes chargeable, if it differs from the issue date.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxPointDateCode(TaxPointDateCode $code)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-8\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">\u003Ccode>TaxPointDateCode::IssueDate\u003C\u002Fcode>, \u003Ccode>DeliveryDate\u003C\u002Fcode> or \u003Ccode>PaymentDate\u003C\u002Fcode> (written as 5, 29, 72 in CII and 3, 35, 432 in UBL). EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>timezone(string $timezone)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Time zone for \u003Ccode>DateTimeInterface\u003C\u002Fcode> values and the default issue date.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Lines can carry their own period (\u003Ccode>LineBuilder::period()\u003C\u002Fcode>, BG-26).\u003C\u002Fp>\n\u003Ch2 id=\"parties\">Parties\u003Ca class=\"q-doc-anchor\" href=\"#parties\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every invoice has a seller (your company) and a buyer (your customer). Further parties are optional: a payee, a tax representative of the seller and a deliver-to party.\u003C\u002Fp>\n\u003Ch3 id=\"seller-and-buyer\">Seller and buyer\u003Ca class=\"q-doc-anchor\" href=\"#seller-and-buyer\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>In Laravel, the seller comes from \u003Ccode>config\u002Fquittio.php\u003C\u002Fcode> and you set only the buyer. Without Laravel, set both:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Party\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">seller\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Party\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Muster GmbH'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vatId\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE123456789'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Hauptstraße 1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'12345'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Musterstadt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">contact\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Max Muster'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'+49 123 456789'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'rechnung@muster.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">electronicAddress\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'rechnung@muster.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Party\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Kunde AG'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vatId\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE987654321'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Bahnhofstraße 5'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'54321'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Beispielstadt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">electronicAddress\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ap@kunde.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">));\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>seller()\u003C\u002Fcode> and \u003Ccode>buyer()\u003C\u002Fcode> take one of four kinds of argument:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Argument\u003C\u002Fth>\n\u003Cth>Effect\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Party::make('Kunde AG')-&gt;vatId(…)-&gt;address(…)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Effect\">A \u003Ccode>PartyBuilder\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Builder\\Party\u003C\u002Fcode> starts one). It replaces the party set before. The builder is copied, so it can serve as a template.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>An application model implementing \u003Ccode>ProvidesParty\u003C\u002Fcode>, e.g. \u003Ccode>-&gt;buyer($customer)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Effect\">The model fills a new \u003Ccode>PartyBuilder\u003C\u002Fcode> (\u003Ca href=\"#application-models\">Application models\u003C\u002Fa>). It replaces the party set before.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SellerParty\u003C\u002Fcode>, \u003Ccode>BuyerParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Effect\">A finished party, e.g. \u003Ccode>Seller::fromConfig()\u003C\u002Fcode> in Laravel. It replaces the party set before.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>A callable that receives a \u003Ccode>PartyBuilder\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Effect\">Continues the party set before, also a \u003Ccode>SellerParty\u003C\u002Fcode> or \u003Ccode>BuyerParty\u003C\u002Fcode> (e.g. from \u003Ccode>Quittio::invoice()\u003C\u002Fcode> in Laravel or from \u003Ccode>InvoiceBuilder::from()\u003C\u002Fcode>), so you can change single values.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A callable is the way to change the configured seller in Laravel, e.g. to add a contact person:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\PartyBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()                                                 \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F seller from config\u002Fquittio.php\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">seller\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">fn\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PartyBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $s) => $s\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">contact\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Erika Muster'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'+49 123 4567'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'erika@muster.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($customer);                                            \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F ProvidesParty\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Cstrong>Replacing the configured seller.\u003C\u002Fstrong> \u003Ccode>Quittio::invoice()\u003C\u002Fcode> starts the builder with the defaults of a seller: the seller of the configuration or the current issuer of the Managed layer. It does this with \u003Ccode>applyDefaults(callable $apply)\u003C\u002Fcode>, and the builder remembers what these defaults set. If you then replace the seller with another one, those values are removed again: the bank account, the small business flag and the other defaults of that seller. Values that you set on the builder yourself stay. A callable keeps the seller and its defaults (\u003Ca href=\"\u002Fdocs\u002Flaravel#starting-invoices\">Starting invoices\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>\u003Ccode>PartyBuilder\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Builder\\PartyBuilder\u003C\u002Fcode>) has these methods:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Seller\u003C\u002Fth>\n\u003Cth>Buyer\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>name(string $name)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-27\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-44\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Legal name. Required.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>tradingName(?string $tradingName)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-28\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-45\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Trading name.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>vatId(?string $vatId)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-31\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-48\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">VAT identifier with country prefix, e.g. \u003Ccode>DE123456789\u003C\u002Fcode>; uppercased, spaces removed (a Swiss UID number keeps one before its note, &quot;CHE-123.456.789 MWST&quot;).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxNumber(?string $taxNumber)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-32\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Tax registration number (German &quot;Steuernummer&quot;, the number issued by the local tax office); ignored for the buyer.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>legalRegistration(?string $value, IdentifierScheme|RawCode|string|null $scheme = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-30\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-47\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Legal registration identifier, e.g. the commercial register number.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>additionalLegalInfo(?string $info)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-33\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Additional legal information (legal form, share capital …); ignored for the buyer.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>identifier(string $value, IdentifierScheme|RawCode|string|null $scheme = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-29\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-46\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds a party identifier, e.g. a GLN (Global Location Number) or the customer number at the buyer. The seller keeps all identifiers, the buyer and the payee only the first. CII writes identifiers without scheme as \u003Ccode>ram:ID\u003C\u002Fcode>, with scheme as \u003Ccode>ram:GlobalID\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>address(?string $line1, ?string $postcode, ?string $city, string $countryCode, ?string $line2 = null, ?string $line3 = null, ?string $subdivision = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BG-5\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BG-8\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Postal address. The country code (ISO 3166-1 alpha-2, e.g. \u003Ccode>DE\u003C\u002Fcode>) is uppercased. Required.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>postalAddress(Address $address)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BG-5\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BG-8\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Postal address as object.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>electronicAddress(string $value, ElectronicAddressScheme|RawCode|string $scheme = ElectronicAddressScheme::Email)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BT-34\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BT-49\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Electronic address, e.g. an e-mail address, with its scheme (EAS code, e.g. \u003Ccode>EM\u003C\u002Fcode> for e-mail). Required by XRechnung and Peppol. Peppol needs a participant identifier, e.g. \u003Ccode>9930\u003C\u002Fcode> (German VAT number) or \u003Ccode>0088\u003C\u002Fcode> (GLN); \u003Ccode>EM\u003C\u002Fcode> is rejected there.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>contact(?string $name = null, ?string $phone = null, ?string $email = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">BG-6\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">BG-9\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Contact person, phone and e-mail. XRechnung requires all three for the seller.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>consumer(bool $consumer = true)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Marks the buyer as consumer (B2C). The automatic format choice then renders a PDF without XML, country packs apply their consumer rules, and templates get \u003Ccode>buyer.isConsumer\u003C\u002Fcode>. Not part of the XML; ignored for the seller.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>fromModel(ProvidesParty $model)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Lets an application model fill the builder (\u003Ca href=\"#application-models\">Application models\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PartyBuilder::fromSeller(SellerParty $seller)\u003C\u002Fcode>, \u003Ccode>PartyBuilder::fromBuyer(BuyerParty $buyer)\u003C\u002Fcode>, \u003Ccode>PartyBuilder::fromPayee(PayeeParty $payee)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Builder with the values of an existing party.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>countryCode(): ?string\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Country code of the postal address set so far.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buildSeller(): SellerParty\u003C\u002Fcode>, \u003Ccode>buildBuyer(): BuyerParty\u003C\u002Fcode>, \u003Ccode>buildPayee(): PayeeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Seller\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Buyer\">\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Build the party. A missing name, or a missing address of seller or buyer, throws \u003Ccode>InvalidInvoiceData\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Without a VAT identifier, EN 16931 requires a seller identifier (BT-29) or a legal registration identifier (BT-30); otherwise rendering fails with BR-CO-26.\u003C\u002Fp>\n\u003Cp>Identifiers and electronic addresses take a scheme code. Use the enum case or pass any other code of the lists as string:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>IdentifierScheme\u003C\u002Fcode> (identifier schemes of ISO 6523, the ICD codes) has the cases \u003Ccode>Siren\u003C\u002Fcode> (0002), \u003Ccode>SwedishOrganisationNumber\u003C\u002Fcode> (0007), \u003Ccode>Siret\u003C\u002Fcode> (0009), \u003Ccode>Duns\u003C\u002Fcode> (0060), \u003Ccode>Gln\u003C\u002Fcode> (0088), \u003Ccode>DutchKvk\u003C\u002Fcode> (0106), \u003Ccode>Gtin\u003C\u002Fcode> (0160), \u003Ccode>DanishCvr\u003C\u002Fcode> (0184), \u003Ccode>DutchOin\u003C\u002Fcode> (0190), \u003Ccode>NorwegianOrganisationNumber\u003C\u002Fcode> (0192), \u003Ccode>LeitwegId\u003C\u002Fcode> (0204) and \u003Ccode>BelgianEnterpriseNumber\u003C\u002Fcode> (0208).\u003C\u002Fli>\n\u003Cli>\u003Ccode>ElectronicAddressScheme\u003C\u002Fcode> (EAS, the electronic address schemes) has \u003Ccode>Email\u003C\u002Fcode> (EM), \u003Ccode>Siren\u003C\u002Fcode> (0002), \u003Ccode>SwedishOrganisationNumber\u003C\u002Fcode> (0007), \u003Ccode>Siret\u003C\u002Fcode> (0009), \u003Ccode>Duns\u003C\u002Fcode> (0060), \u003Ccode>Gln\u003C\u002Fcode> (0088), \u003Ccode>DutchKvk\u003C\u002Fcode> (0106), \u003Ccode>DanishCvr\u003C\u002Fcode> (0184), \u003Ccode>DutchOin\u003C\u002Fcode> (0190), \u003Ccode>NorwegianOrganisationNumber\u003C\u002Fcode> (0192), \u003Ccode>LeitwegId\u003C\u002Fcode> (0204), \u003Ccode>BelgianEnterpriseNumber\u003C\u002Fcode> (0208), \u003Ccode>AustrianVatNumber\u003C\u002Fcode> (9914), \u003Ccode>AustrianOrganisationNumber\u003C\u002Fcode> (9915), \u003Ccode>GermanVatNumber\u003C\u002Fcode> (9930) and \u003Ccode>FrenchVatNumber\u003C\u002Fcode> (9957).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"payee-tax-representative-and-delivery\">Payee, tax representative and delivery\u003Ca class=\"q-doc-anchor\" href=\"#payee-tax-representative-and-delivery\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>payee(PayeeParty|PartyBuilder|string|callable $payee, ?string $identifier = null, ?string $legalRegistration = null, IdentifierScheme|RawCode|string|null $identifierScheme = null, IdentifierScheme|RawCode|string|null $legalRegistrationScheme = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-10 (BT-59, BT-60, BT-61)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Payee, if different from the seller (e.g. a factoring company). See below.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxRepresentative(string $name, string $vatId, Address $address)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-11 (BT-62, BT-63, BG-12)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">The seller's tax representative.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>deliverTo(?string $recipientName, ?Address $address = null, ?Identifier $locationId = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-13 (BT-70, BG-15, BT-71)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Deliver-to party, address and location identifier. Replaces these three values (also with \u003Ccode>null\u003C\u002Fcode>) and keeps the delivery date.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>delivery(Delivery $delivery)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-13\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Replaces the whole delivery information, including the delivery date.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Ccode>payee()\u003C\u002Fcode> takes one of these:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>the name, optionally with the identifier, the legal registration identifier and their schemes (e.g. \u003Ccode>'0088'\u003C\u002Fcode> for a GLN);\u003C\u002Fli>\n\u003Cli>a \u003Ccode>PayeeParty\u003C\u002Fcode>;\u003C\u002Fli>\n\u003Cli>a \u003Ccode>PartyBuilder\u003C\u002Fcode>, e.g. \u003Ccode>Party::make('Factoring AG')-&gt;identifier(…)\u003C\u002Fcode>;\u003C\u002Fli>\n\u003Cli>a callable that receives a \u003Ccode>PartyBuilder\u003C\u002Fcode> (\u003Ccode>name()\u003C\u002Fcode>, \u003Ccode>identifier()\u003C\u002Fcode>, \u003Ccode>legalRegistration()\u003C\u002Fcode>). Like \u003Ccode>seller()\u003C\u002Fcode> and \u003Ccode>buyer()\u003C\u002Fcode>, it continues an earlier payee.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Identifiers and schemes as arguments are allowed only next to a name; otherwise \u003Ccode>payee()\u003C\u002Fcode> throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Identifier\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Party\\Address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\IdentifierScheme\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">deliverTo\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Kunde AG, Lager Nord'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Address\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Industriestraße 9'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'54322'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Beispielstadt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">), \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Identifier\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">of\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'4000001000005'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">IdentifierScheme\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Gln\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">taxRepresentative\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Steuer Vertretung GmbH'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE111111125'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">countryCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">line1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Ring 1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">city\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Berlin'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">postcode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'10115'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>Address::make(?string $line1, ?string $postcode, ?string $city, string $countryCode)\u003C\u002Fcode> creates an address with the most common fields. The constructor takes \u003Ccode>countryCode\u003C\u002Fcode>, \u003Ccode>line1\u003C\u002Fcode>, \u003Ccode>line2\u003C\u002Fcode>, \u003Ccode>line3\u003C\u002Fcode>, \u003Ccode>city\u003C\u002Fcode>, \u003Ccode>postcode\u003C\u002Fcode> and \u003Ccode>subdivision\u003C\u002Fcode>. \u003Ccode>Identifier::of(string $value, IdentifierScheme|RawCode|string|null $scheme = null)\u003C\u002Fcode> creates an identifier.\u003C\u002Fp>\n\u003Ch2 id=\"lines\">Lines\u003Ca class=\"q-doc-anchor\" href=\"#lines\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Lines (BG-25) are the goods and services you invoice. Every invoice needs at least one line.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>InvoiceBuilder\u003C\u002Fcode> method\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>line(string|LineBuilder|ProvidesInvoiceLine|array|callable|InvoiceLine $line, netPrice, quantity, unit, vat, description, priceInclVat)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds a line (BG-25), in one of the forms below.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>lines(iterable $lines)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds several lines. Each entry may be any of the forms, e.g. an array of arrays or an Eloquent collection of order items.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>updateLine(string $id, ?callable $change = null, netPrice, quantity, priceInclVat, name, description)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Changes an existing line (\u003Ca href=\"#changing-existing-data\">Changing existing data\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>removeLine(string $id)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Removes an existing line by its identifier (BT-126) (\u003Ca href=\"#changing-existing-data\">Changing existing data\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A line can be given in these forms. Use the first one that fits:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Form\u003C\u002Fth>\n\u003Cth>Use it when\u003C\u002Fth>\n\u003Cth>Example\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>The name with named values\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">the line needs only price, quantity, unit, VAT or description (the usual case)\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;line('Web development', netPrice: '95.00', quantity: 24, unit: UnitCode::Hour)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Line::make()\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Builder\\Line\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">the line needs more: item number, line allowance or charge, list price, base quantity, period, sub lines, line group. It takes the same named values and returns the \u003Ccode>LineBuilder\u003C\u002Fcode> for the other methods.\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;line(Line::make('Web development', netPrice: '95.00')-&gt;sellerId('WD-1')-&gt;allowance(percent: '10', reason: 'Framework agreement'))\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>An application model implementing \u003Ccode>ProvidesInvoiceLine\u003C\u002Fcode> (\u003Ca href=\"#application-models\">Application models\u003C\u002Fa>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">the lines come from your models\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;lines($order-&gt;items)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>An array whose keys are methods of the \u003Ccode>LineBuilder\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">the lines come as data, e.g. database rows or a JSON request\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;lines([['name' =&gt; 'Hosting', 'quantity' =&gt; [1, UnitCode::Month], 'netPrice' =&gt; '49.00']])\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>A callable that receives a new \u003Ccode>LineBuilder\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">rarely; the forms above cover the same\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;line(fn (LineBuilder $l) =&gt; $l-&gt;name('Travel expenses')-&gt;netPrice('120.00'))\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>A finished \u003Ccode>InvoiceLine\u003C\u002Fcode>, taken as it is\u003C\u002Ftd>\n\u003Ctd data-label=\"Use it when\">you copy a line of existing data\u003C\u002Ftd>\n\u003Ctd data-label=\"Example\">\u003Ccode>-&gt;line($invoice-&gt;lines[0])\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The named arguments of \u003Ccode>line()\u003C\u002Fcode> and \u003Ccode>Line::make()\u003C\u002Fcode> are:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Argument\u003C\u002Fth>\n\u003Cth>Meaning\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>netPrice\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">The price without VAT (BT-146).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>priceInclVat\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">The price including VAT (\u003Ca href=\"#gross-price-mode\">Gross price mode\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>quantity\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">Default 1.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>unit\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">Default \u003Ccode>UnitCode::Unit\u003C\u002Fcode> (C62).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>vat\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">A tax preset or a category without rate. Default: the \u003Ca href=\"#default-vat\">default VAT\u003C\u002Fa> of the invoice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>description\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Meaning\">The item description.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The named arguments are allowed only together with a name; with another form, \u003Ccode>line()\u003C\u002Fcode> throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>. A string is always the name of the line, never a callable. A \u003Ccode>LineBuilder\u003C\u002Fcode> is copied when it is added, so the same builder can serve as a template for further lines.\u003C\u002Fp>\n\u003Ch3 id=\"lines-as-arrays\">Lines as arrays\u003Ca class=\"q-doc-anchor\" href=\"#lines-as-arrays\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>In an array, each key names a method of the \u003Ccode>LineBuilder\u003C\u002Fcode> and the value is its argument. The keys are \u003Ccode>LineBuilder::ARRAY_KEYS\u003C\u002Fcode>: \u003Ccode>id\u003C\u002Fcode>, \u003Ccode>name\u003C\u002Fcode>, \u003Ccode>description\u003C\u002Fcode>, \u003Ccode>note\u003C\u002Fcode>, \u003Ccode>quantity\u003C\u002Fcode>, \u003Ccode>unit\u003C\u002Fcode>, \u003Ccode>netPrice\u003C\u002Fcode>, \u003Ccode>listPrice\u003C\u002Fcode>, \u003Ccode>priceInclVat\u003C\u002Fcode>, \u003Ccode>vat\u003C\u002Fcode>, \u003Ccode>period\u003C\u002Fcode>, \u003Ccode>allowance\u003C\u002Fcode>, \u003Ccode>charge\u003C\u002Fcode>, \u003Ccode>sellerId\u003C\u002Fcode>, \u003Ccode>buyerId\u003C\u002Fcode>, \u003Ccode>standardId\u003C\u002Fcode>, \u003Ccode>classification\u003C\u002Fcode>, \u003Ccode>originCountry\u003C\u002Fcode>, \u003Ccode>attribute\u003C\u002Fcode>, \u003Ccode>orderLineReference\u003C\u002Fcode>, \u003Ccode>buyerAccountingReference\u003C\u002Fcode>, \u003Ccode>objectId\u003C\u002Fcode>, \u003Ccode>group\u003C\u002Fcode>, \u003Ccode>highlight\u003C\u002Fcode> and \u003Ccode>showGrossPrice\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>A method with several arguments takes an array value, as list or by name: \u003Ccode>'quantity' =&gt; [4, UnitCode::Hour]\u003C\u002Fcode>, \u003Ccode>'allowance' =&gt; ['percent' =&gt; '10', 'reason' =&gt; 'Early bird']\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Null values are skipped, so database rows with empty columns can be passed.\u003C\u002Fli>\n\u003Cli>An unknown key throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Line::fromArray($array)\u003C\u002Fcode> and \u003Ccode>LineBuilder::fill($array)\u003C\u002Fcode> do the same for a single builder.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#79C0FF\">    Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Web development'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'95.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">24\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">unit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Hour\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">),   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F in a list: Line::make()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'name'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Hosting'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'quantity'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> [\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Month\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">], \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'netPrice'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '49.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'name'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Book'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'netPrice'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '39.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'vat'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Reduced\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch3 id=\"line-identifiers\">Line identifiers\u003Ca class=\"q-doc-anchor\" href=\"#line-identifiers\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Every line has an identifier (BT-126). Partial cancellations, \u003Ccode>updateLine()\u003C\u002Fcode> and \u003Ccode>removeLine()\u003C\u002Fcode> refer to lines by it.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>A line without \u003Ccode>id()\u003C\u002Fcode> gets its position (1, 2, 3 …). Identifiers that existing lines or other lines' \u003Ccode>id()\u003C\u002Fcode> already use are skipped, so identifiers stay unique after \u003Ccode>from()\u003C\u002Fcode> and \u003Ccode>removeLine()\u003C\u002Fcode>. Example: lines \u003Ccode>A\u003C\u002Fcode>, \u003Ccode>B\u003C\u002Fcode> with \u003Ccode>id('1')\u003C\u002Fcode> and \u003Ccode>C\u003C\u002Fcode> get \u003Ccode>2\u003C\u002Fcode>, \u003Ccode>1\u003C\u002Fcode> and \u003Ccode>3\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Sub lines get \u003Ccode>{parent}.{n}\u003C\u002Fcode>, e.g. \u003Ccode>2.1\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>An identifier used twice, also by a sub line, makes \u003Ccode>build()\u003C\u002Fcode> throw \u003Ccode>InvalidInvoiceData\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Data from other sources (JSON, incoming invoices) gets the warning \u003Ccode>QUITTIO-LINE-ID-DUPLICATE\u003C\u002Fcode> instead, because EN 16931 does not require unique identifiers.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"linebuilder\">LineBuilder\u003Ca class=\"q-doc-anchor\" href=\"#linebuilder\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>Quittio\\Core\\Builder\\LineBuilder\u003C\u002Fcode> is the builder that \u003Ccode>Line::make()\u003C\u002Fcode> returns:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>id(string $id)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-126\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line identifier; default the position (\u003Ca href=\"#line-identifiers\">Line identifiers\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>name(string $name)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-153\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Item name. Required.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>description(?string $description)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-154\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Item description. Printed as plain text; with the option \u003Ccode>markdown\u003C\u002Fcode> (Laravel \u003Ccode>pdf.markdown\u003C\u002Fcode>) as Markdown (\u003Ca href=\"\u002Fdocs\u002Ftemplates\">Templates\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>note(?string $note)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-127\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line note.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>quantity(BigDecimal|int|string $quantity, UnitCode|RawCode|string|null $unit = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-129, BT-130\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoiced quantity and optionally the unit; default 1. Negative quantities for returns and discounts.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>unit(UnitCode|RawCode|string $unit)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-130\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Unit (UN\u002FECE Recommendation 20\u002F21), default \u003Ccode>UnitCode::Unit\u003C\u002Fcode> (C62).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>netPrice(BigDecimal|int|string $price, BigDecimal|int|string|null $baseQuantity = null, UnitCode|RawCode|string|null $baseQuantityUnit = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-146, BT-149, BT-150\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Net price per base quantity; the base quantity unit defaults to the line unit. Each call replaces the base quantity.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>listPrice(BigDecimal|int|string $grossPrice, BigDecimal|int|string|null $discount = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-148, BT-147\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">List (gross) price before price discount, and the discount per unit. Without \u003Ccode>netPrice()\u003C\u002Fcode> the net price is list price minus discount.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>priceInclVat(BigDecimal|int|string $price)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Price including VAT (\u003Ca href=\"#gross-price-mode\">Gross price mode\u003C\u002Fa>); the calculator derives the net price.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>vat(TaxPreset|VatCategory $presetOrCategory, BigDecimal|int|string|null $rate = null, ?string $exemptionReason = null, VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-30 (BT-151, BT-152)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">VAT treatment: a tax preset of a country pack, or category, rate and exemption reason (\u003Ca href=\"#vat\">VAT\u003C\u002Fa>). Without it, the line takes the \u003Ca href=\"#default-vat\">default VAT\u003C\u002Fa> of the invoice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>period(Date|string|null $start, Date|string|null $end = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-26 (BT-134, BT-135)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line period.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>allowance(?string $amount = null, ?string $percent = null, ?string $reason = null, AllowanceReasonCode|RawCode|string|null $reasonCode = null, ?string $baseAmount = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-27\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line allowance: amount or percentage; repeatable (\u003Ca href=\"#line-allowances-and-charges\">Line allowances and charges\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>charge(?string $amount = null, ?string $percent = null, ?string $reason = null, ChargeReasonCode|RawCode|string|null $reasonCode = null, ?string $baseAmount = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-28\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line charge: amount or percentage; repeatable.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>sellerId(?string $id)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-155\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Seller's item number.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyerId(?string $id)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-156\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Buyer's item number.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>standardId(string $value, IdentifierScheme|RawCode|string $scheme = IdentifierScheme::Gtin)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-157\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Standard item identifier, default scheme GTIN (0160, the global trade item number).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>classification(string $code, ItemClassificationScheme|RawCode|string $scheme, ?string $version = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-158\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Item classification with list identifier and version; repeatable.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>originCountry(?string $country)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-159\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Country of origin (uppercased).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>attribute(string $name, string $value)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-32 (BT-160, BT-161)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Item attribute; repeatable.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>orderLineReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-132\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line of the purchase order.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyerAccountingReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-133\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Buyer's accounting reference of the line.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>objectId(string $value, string|RawCode|null $scheme = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-128\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoiced object identifier of the line, with scheme.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>subLine(string|LineBuilder|ProvidesInvoiceLine|array|callable $line, netPrice, quantity, unit, vat, description, priceInclVat)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds a sub line, in the forms of \u003Ccode>line()\u003C\u002Fcode> except \u003Ccode>InvoiceLine\u003C\u002Fcode> (\u003Ca href=\"#sub-lines\">Sub lines\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>reference(DocumentReference $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line reference to an order, contract, despatch or receiving advice or another document (profile EXTENDED, \u003Ca href=\"#extensions\">Extensions\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>extended(LineExtendedData $extended)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Line data of profile EXTENDED (\u003Ca href=\"#extensions\">Extensions\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>group(string $groupId)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Assigns the line to a line group of the PDF (\u003Ccode>InvoiceBuilder::group()\u003C\u002Fcode>, \u003Ca href=\"#presentation-and-metadata\">Presentation and metadata\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>highlight(bool $highlight = true)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Highlights the line in the PDF (the default templates shade it and mark it in the secondary colour).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>showGrossPrice(?bool $show = true)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Prints the price including VAT below the net unit price of this line (\u003Ccode>false\u003C\u002Fcode>: not), whatever the presentation's \u003Ccode>showGrossPrices\u003C\u002Fcode> says; \u003Ccode>null\u003C\u002Fcode> follows the presentation. Only for lines with \u003Ccode>priceInclVat()\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>fromModel(ProvidesInvoiceLine $model)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Lets an application model fill the builder.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>fill(array $values)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Calls the methods named by the keys of the array (\u003Ca href=\"#lines-as-arrays\">Lines as arrays\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>build(string $currency, string $defaultId, ?string $locale = null, ?LineBuilder $vatDefault = null): InvoiceLine\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Builds the line; called by \u003Ccode>InvoiceBuilder\u003C\u002Fcode>, which passes the \u003Ca href=\"#default-vat\">default VAT\u003C\u002Fa> as \u003Ccode>$vatDefault\u003C\u002Fcode>. Use it to create an \u003Ccode>InvoiceLine\u003C\u002Fcode> on its own, e.g. \u003Ccode>(new LineBuilder)-&gt;name('…')-&gt;…-&gt;build('EUR', '1')\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Ccode>UnitCode\u003C\u002Fcode> has the cases \u003Ccode>Unit\u003C\u002Fcode> (C62), \u003Ccode>Piece\u003C\u002Fcode> (H87), \u003Ccode>Set\u003C\u002Fcode> (SET), \u003Ccode>Pair\u003C\u002Fcode> (PR), \u003Ccode>Dozen\u003C\u002Fcode> (DZN), \u003Ccode>LumpSum\u003C\u002Fcode> (LS), \u003Ccode>Second\u003C\u002Fcode> (SEC), \u003Ccode>Minute\u003C\u002Fcode> (MIN), \u003Ccode>Hour\u003C\u002Fcode> (HUR), \u003Ccode>Day\u003C\u002Fcode> (DAY), \u003Ccode>Week\u003C\u002Fcode> (WEE), \u003Ccode>Month\u003C\u002Fcode> (MON), \u003Ccode>Quarter\u003C\u002Fcode> (QAN), \u003Ccode>Year\u003C\u002Fcode> (ANN), \u003Ccode>Gram\u003C\u002Fcode> (GRM), \u003Ccode>Kilogram\u003C\u002Fcode> (KGM), \u003Ccode>Tonne\u003C\u002Fcode> (TNE), \u003Ccode>Millimetre\u003C\u002Fcode> (MMT), \u003Ccode>Centimetre\u003C\u002Fcode> (CMT), \u003Ccode>Metre\u003C\u002Fcode> (MTR), \u003Ccode>Kilometre\u003C\u002Fcode> (KMT), \u003Ccode>SquareMetre\u003C\u002Fcode> (MTK), \u003Ccode>CubicMetre\u003C\u002Fcode> (MTQ), \u003Ccode>Millilitre\u003C\u002Fcode> (MLT), \u003Ccode>Litre\u003C\u002Fcode> (LTR), \u003Ccode>KilowattHour\u003C\u002Fcode> (KWH), \u003Ccode>Kilowatt\u003C\u002Fcode> (KWT), \u003Ccode>Percent\u003C\u002Fcode> (P1), \u003Ccode>ServiceUnit\u003C\u002Fcode> (E48), \u003Ccode>Package\u003C\u002Fcode> (XPK), \u003Ccode>Box\u003C\u002Fcode> (XBX) and \u003Ccode>Pallet\u003C\u002Fcode> (XPX). Every other code of the list can be passed as string.\u003C\u002Fp>\n\u003Cp>\u003Ccode>ItemClassificationScheme\u003C\u002Fcode> (code list UNTDID 7143) has \u003Ccode>HarmonisedSystem\u003C\u002Fcode> (HS), \u003Ccode>Unspsc\u003C\u002Fcode> (TST), \u003Ccode>CustomsArticleNumber\u003C\u002Fcode> (CV), \u003Ccode>NationalProductGroup\u003C\u002Fcode> (GN), \u003Ccode>Isbn\u003C\u002Fcode> (IB), \u003Ccode>ProductServiceId\u003C\u002Fcode> (MP) and \u003Ccode>MutuallyDefined\u003C\u002Fcode> (ZZZ).\u003C\u002Fp>\n\u003Ch3 id=\"prices\">Prices\u003Ca class=\"q-doc-anchor\" href=\"#prices\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Most lines need only \u003Ccode>netPrice\u003C\u002Fcode>. A price per base quantity (e.g. per 1000 pieces) or a list price with a discount needs \u003Ccode>Line::make()\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Paper A4'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">5000\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">unit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Piece\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'12.50'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">baseQuantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1000\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))                 \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 12.50 per 1000 sheets: 62.50\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Monitor'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">2\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">listPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'299.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">discount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'30.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))                \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F net price 269.00\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The line amount before allowances and charges is round2(quantity × net price \u002F base quantity). Prices must not be negative (BR-27); returns and discounts use a negative quantity.\u003C\u002Fp>\n\u003Ch2 id=\"vat\">VAT\u003Ca class=\"q-doc-anchor\" href=\"#vat\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every line has a VAT category (BT-151) and, except for category O (not subject to VAT), a rate (BT-152). Usually you do not set them on every line. Lines without \u003Ccode>vat()\u003C\u002Fcode> take the \u003Ca href=\"#default-vat\">default VAT\u003C\u002Fa> of the invoice; in Laravel that is 19 % for a German seller.\u003C\u002Fp>\n\u003Cp>Set the VAT of a line when it differs from the default. Use a tax preset of a country pack or the category:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\VatExemptionReasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)                                         \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F preset of the German pack\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">StandardRate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'19'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">ReverseCharge\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'0'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Reverse charge'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatExemptionReasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">ReverseCharge\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Exempt\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'0'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Exempt according to Art. 132 VAT Directive'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'VATEX-EU-132'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">NotSubjectToVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)                                  \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F no rate\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>vat()\u003C\u002Fcode> is a method of the \u003Ccode>LineBuilder\u003C\u002Fcode>; \u003Ccode>line()\u003C\u002Fcode> and \u003Ccode>Line::make()\u003C\u002Fcode> take a preset or a category without rate as named argument \u003Ccode>vat:\u003C\u002Fcode>. A tax preset is a ready-made VAT treatment of a country pack: category, rate and, for exemptions, the reason text and code, e.g. \u003Ccode>VatPreset::Reduced\u003C\u002Fcode> for the German 7 % rate (\u003Ca href=\"#tax-presets\">Tax presets\u003C\u002Fa>). Reverse charge (category AE) means that the buyer, not the seller, owes the VAT.\u003C\u002Fp>\n\u003Cp>With a preset, category, rate, exemption reason and code come from the preset, and the other parameters are ignored. The preset key is kept on the line (\u003Ccode>LineVat::$presetKey\u003C\u002Fcode>). The exemption text of a preset is resolved in the locale of the invoice (\u003Ccode>locale()\u003C\u002Fcode>) when the line is built; the German presets use German without a locale.\u003C\u002Fp>\n\u003Ch3 id=\"default-vat\">Default VAT\u003Ca class=\"q-doc-anchor\" href=\"#default-vat\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Lines and sub lines without \u003Ccode>vat()\u003C\u002Fcode> take the default VAT of the invoice when it is built. The default is, in this order:\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Ccode>defaultVat()\u003C\u002Fcode> of the builder, with the arguments of \u003Ccode>LineBuilder::vat()\u003C\u002Fcode>, e.g. \u003Ccode>-&gt;defaultVat(VatPreset::Reduced)\u003C\u002Fcode> for a bookshop;\u003C\u002Fli>\n\u003Cli>otherwise the application default, set once with \u003Ccode>InvoiceBuilder::useDefaultVat(callable|TaxPreset|null $default)\u003C\u002Fcode>. It is a preset, or a callable that receives the seller's country code (BT-40) and whether the invoice is flagged as small business invoice (\u003Ccode>Meta::FLAG_SMALL_BUSINESS\u003C\u002Fcode>), and returns a preset or \u003Ccode>null\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Ccode>Quittio\\Core\\Tax\\CountryDefaultVat\u003C\u002Fcode> is such a callable: \u003Ccode>new CountryDefaultVat(CountryRegistry $countries, ?TaxPreset $preset = null)\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>For normal invoices it returns \u003Ccode>$preset\u003C\u002Fcode>, otherwise the standard preset of the seller's country pack (\u003Ccode>CountryDefaults::$vatPreset\u003C\u002Fcode>, Germany \u003Ccode>de.standard\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>For small business invoices it returns the small business preset of the pack (\u003Ccode>CountryDefaults::$smallBusinessVatPreset\u003C\u002Fcode>, Germany \u003Ccode>de.small_business\u003C\u002Fcode>), otherwise \u003Ccode>$preset\u003C\u002Fcode>. A small business (&quot;Kleinunternehmer&quot; in Germany) charges no VAT (\u003Ca href=\"\u002Fdocs\u002Fconcepts#german-terms\">German terms\u003C\u002Fa>).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The Laravel integration installs it with the preset of \u003Ccode>quittio.defaults.vat\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Fconfiguration#defaults\">Configuration\u003C\u002Fa>). So in Laravel, lines without \u003Ccode>vat()\u003C\u002Fcode> get 19 % for a German seller. Without Laravel, install it yourself:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Tax\\CountryDefaultVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Without Laravel, once at start-up\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">useDefaultVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> CountryDefaultVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">countries\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()));   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F or a preset: VatPreset::Standard\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$invoice \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#8B949E\">    \u002F\u002F ...\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Web development'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'95.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">24\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">unit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Hour\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 19 %\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Book'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'39.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Reduced\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)                         \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 7 %\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">build\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The default only fills in what a line leaves open: the built data and the XML carry the VAT of every line, as EN 16931 requires. Without a default, a line without VAT makes \u003Ccode>build()\u003C\u002Fcode> fail (\u003Ccode>InvalidInvoiceData\u003C\u002Fcode>, BG-30). \u003Ccode>useDefaultVat(null)\u003C\u002Fcode> removes the application default. Documents (\u003Ccode>DocumentBuilder\u003C\u002Fcode>) use the same defaults and have \u003Ccode>defaultVat()\u003C\u002Fcode> as well.\u003C\u002Fp>\n\u003Ch3 id=\"categories\">Categories\u003Ca class=\"q-doc-anchor\" href=\"#categories\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>VatCategory\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>Code\u003C\u002Fth>\n\u003Cth>Rate\u003C\u002Fth>\n\u003Cth>VAT\u003C\u002Fth>\n\u003Cth>Exemption reason (BT-120\u002FBT-121)\u003C\u002Fth>\n\u003Cth>Further requirements\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>StandardRate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">S\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">greater than 0 (BR-S-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">rate × taxable amount\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">not allowed (BR-S-10)\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">Seller VAT identifier, tax number or tax representative (BR-S-02). One VAT breakdown per rate.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ZeroRated\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">Z\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 (BR-Z-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">not allowed (BR-Z-10)\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">As S (BR-Z-02).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Exempt\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">E\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 (BR-E-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">required (BR-E-10)\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">As S (BR-E-02).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ReverseCharge\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">AE\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 (BR-AE-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">required (BR-AE-10), e.g. \u003Ccode>VATEX-EU-AE\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">As S, and the buyer VAT identifier or legal registration identifier (BR-AE-02).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>IntraCommunitySupply\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">K\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 (BR-IC-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">required (BR-IC-10), e.g. \u003Ccode>VATEX-EU-IC\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">Seller VAT identifier or tax representative, and buyer VAT identifier (BR-IC-02); delivery date or invoicing period (BR-IC-11); deliver-to country (BR-IC-12).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Export\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">G\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 (BR-G-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">required (BR-G-10), e.g. \u003Ccode>VATEX-EU-G\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">Seller VAT identifier or tax representative (BR-G-02).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>NotSubjectToVat\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">O\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">none (BR-O-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">0\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">required (BR-O-10), e.g. \u003Ccode>VATEX-EU-O\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">No VAT identifier of seller, tax representative or buyer (BR-O-02); no other category in the invoice (BR-O-11).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CanaryIslands\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">L\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 or greater (BR-AF-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">rate × taxable amount (BR-AF-09)\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">not allowed (BR-AF-10)\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">IGIC (Canary Islands). As S (BR-AF-02). One VAT breakdown per rate. The official CII validation rejects the rate 0, UBL accepts it (warning \u003Ccode>QUITTIO-IGIC-ZERO-RATE-CII\u003C\u002Fcode>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CeutaMelilla\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">M\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">0 or greater (BR-AG-05)\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">rate × taxable amount (BR-AG-09)\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">not allowed (BR-AG-10)\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">IPSI (Ceuta and Melilla). As S (BR-AG-02). One VAT breakdown per rate.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>TransferredVatItaly\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">B\u003C\u002Ftd>\n\u003Ctd data-label=\"Rate\">as given\u003C\u002Ftd>\n\u003Ctd data-label=\"VAT\">rate × taxable amount\u003C\u002Ftd>\n\u003Ctd data-label=\"Exemption reason (BT-120\u002FBT-121)\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Further requirements\">Split payment (Italy): only in a domestic Italian invoice, every country code (seller, buyer, tax representative, deliver-to, item origin) is \u003Ccode>IT\u003C\u002Fcode> (BR-B-01); no category S in the same invoice (BR-B-02).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cul>\n\u003Cli>Categories Z, E, AE, K, G and O allow exactly one VAT breakdown each (BR-Z-01 …); S, L and M one per rate.\u003C\u002Fli>\n\u003Cli>The calculator calculates VAT 0 for Z, E, AE, K, G and O, whatever rate is given. It writes the rate 0 to the VAT breakdown of a group whose lines have no rate (category O: no rate). The validation still requires the rate 0 on the lines (BR-Z-05 …).\u003C\u002Fli>\n\u003Cli>The rules are part of the \u003Ca href=\"\u002Fdocs\u002Fvalidation\">validation\u003C\u002Fa> (level L3). \u003Ccode>VatCategory::requiresRate()\u003C\u002Fcode>, \u003Ccode>isZeroTax()\u003C\u002Fcode> and \u003Ccode>requiresExemptionReason()\u003C\u002Fcode> expose the same properties.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ccode>VatExemptionReasonCode\u003C\u002Fcode> (code list VATEX) has \u003Ccode>ReverseCharge\u003C\u002Fcode> (VATEX-EU-AE), \u003Ccode>IntraCommunitySupply\u003C\u002Fcode> (VATEX-EU-IC), \u003Ccode>Export\u003C\u002Fcode> (VATEX-EU-G), \u003Ccode>NotSubjectToVat\u003C\u002Fcode> (VATEX-EU-O), \u003Ccode>TravelAgents\u003C\u002Fcode> (VATEX-EU-D), \u003Ccode>SecondHandGoods\u003C\u002Fcode> (VATEX-EU-F), \u003Ccode>WorksOfArt\u003C\u002Fcode> (VATEX-EU-I), \u003Ccode>CollectorsItems\u003C\u002Fcode> (VATEX-EU-J), \u003Ccode>Article79c\u003C\u002Fcode> (VATEX-EU-79-C), \u003Ccode>Article132\u003C\u002Fcode> (VATEX-EU-132), \u003Ccode>Article143\u003C\u002Fcode> (VATEX-EU-143), \u003Ccode>Article148\u003C\u002Fcode> (VATEX-EU-148), \u003Ccode>Article151\u003C\u002Fcode> (VATEX-EU-151) and \u003Ccode>Article309\u003C\u002Fcode> (VATEX-EU-309). Other codes of the list can be passed as strings.\u003C\u002Fp>\n\u003Ch3 id=\"exemption-reasons-in-the-vat-breakdown\">Exemption reasons in the VAT breakdown\u003Ca class=\"q-doc-anchor\" href=\"#exemption-reasons-in-the-vat-breakdown\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>You give the exemption reason per line, but the XML carries it per VAT breakdown entry (one per category and rate). The calculator therefore collects the reasons of the lines of each group, for the categories that require one (E, AE, K, G, O):\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Different texts are joined with &quot;; &quot; in the order of the lines, so that no legally required note is lost.\u003C\u002Fli>\n\u003Cli>A code is kept when all lines of the group have the same code. Otherwise it is left out, and the validation reports \u003Ccode>QUITTIO-EXEMPTION-CONFLICT\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>The exemption reason of a document level allowance or charge is used only if no line of its group provides one, e.g. for an exempt charge on an otherwise standard rated invoice.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"tax-presets\">Tax presets\u003Ca class=\"q-doc-anchor\" href=\"#tax-presets\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>A tax preset implements \u003Ccode>Quittio\\Core\\Tax\\TaxPreset\u003C\u002Fcode> (\u003Ccode>key()\u003C\u002Fcode>, \u003Ccode>category()\u003C\u002Fcode>, \u003Ccode>rate()\u003C\u002Fcode>, \u003Ccode>exemptionReasonCode()\u003C\u002Fcode>, \u003Ccode>exemptionReason(?string $locale = null)\u003C\u002Fcode>). Country packs provide their presets as \u003Ccode>TaxPresetCollection\u003C\u002Fcode> (\u003Ccode>$pack-&gt;taxPresets()\u003C\u002Fcode>, with \u003Ccode>get(string $key)\u003C\u002Fcode>, \u003Ccode>has()\u003C\u002Fcode>, \u003Ccode>add()\u003C\u002Fcode>, \u003Ccode>count()\u003C\u002Fcode> and iteration), so a stored preset key can be resolved again:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$preset \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">countries\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">get\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">?->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">taxPresets\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">get\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'de.standard'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The German presets (\u003Ccode>VatPreset::Standard\u003C\u002Fcode>, \u003Ccode>Reduced\u003C\u002Fcode>, \u003Ccode>SmallBusiness\u003C\u002Fcode>, \u003Ccode>ReverseChargeEu\u003C\u002Fcode>, \u003Ccode>VatPreset::exempt('§ 4 Nr. 14 UStG')\u003C\u002Fcode> …) are listed in \u003Ca href=\"\u002Fdocs\u002Fcountry-packs#tax-presets\">Tax presets\u003C\u002Fa>; \u003Ca href=\"\u002Fdocs\u002Fcountry-packs#presets-of-your-pack\">Presets of your pack\u003C\u002Fa> shows how a pack provides its own.\u003C\u002Fp>\n\u003Cp>Create your own presets with \u003Ccode>CustomTaxPreset::make(string $key, VatCategory $category, BigDecimal|int|string|null $rate = null, VatExemptionReasonCode|RawCode|string|null $code = null, array|string|null $reason = null)\u003C\u002Fcode>. Give the reason as text, or as an array of texts per locale (fallback \u003Ccode>en\u003C\u002Fcode>):\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Tax\\CustomTaxPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$exempt \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> CustomTaxPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'acme.exempt_132'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Exempt\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'0'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'VATEX-EU-132'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#A5D6FF\">    'de'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Steuerfrei nach Art. 132 MwStSystRL'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#A5D6FF\">    'en'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Exempt according to Art. 132 VAT Directive'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Course'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'300.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: $exempt)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch2 id=\"payment\">Payment\u003Ca class=\"q-doc-anchor\" href=\"#payment\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Payment data tells the buyer how and when to pay. It has three parts: the payment instructions (payment means and bank account), the payment terms (due date and cash discount) and amounts already paid. In Laravel, \u003Ccode>Quittio::invoice()\u003C\u002Fcode> already adds a SEPA credit transfer to the first bank account with an IBAN in \u003Ccode>config\u002Fquittio.php\u003C\u002Fcode>, so most invoices only add payment terms.\u003C\u002Fp>\n\u003Ch3 id=\"payment-instructions\">Payment instructions\u003Ca class=\"q-doc-anchor\" href=\"#payment-instructions\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>payment(PaymentMeansCode|RawCode|string $means, ?string $iban = null, ?string $bic = null, ?string $accountName = null, ?string $remittanceInformation = null, ?string $meansText = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-16 (BT-81, BT-82, BT-83), BG-17\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Payment means, optionally with one account (IBAN uppercased, spaces removed), the remittance information (the payment reference the buyer should state) and a text for the means.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>creditTransfer(string $accountId, ?string $bic = null, ?string $accountName = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-17 (BT-84, BT-86, BT-85)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds a further account. CII writes an IBAN as \u003Ccode>IBANID\u003C\u002Fcode> and any other account identifier as \u003Ccode>ProprietaryID\u003C\u002Fcode>. Without payment instructions, it starts them with \u003Ccode>SepaCreditTransfer\u003C\u002Fcode> (58).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>paymentCard(string $lastDigits, ?string $holderName = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-18 (BT-87, BT-88)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Card data: only the last 4 to 6 digits (more throw an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>). Without payment instructions, it starts them with \u003Ccode>BankCard\u003C\u002Fcode> (48).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>directDebit(?string $mandateReference, ?string $creditorId = null, ?string $debitedIban = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-19 (BT-89, BT-90, BT-91)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">SEPA direct debit: mandate reference, creditor identifier, debited account. Without payment instructions, it starts them with \u003Ccode>SepaDirectDebit\u003C\u002Fcode> (59).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A second call of \u003Ccode>payment()\u003C\u002Fcode> replaces the payment instructions:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>An account given in the call replaces all accounts.\u003C\u002Fli>\n\u003Cli>Without an account, existing accounts are kept for the credit transfer codes 30, 42 and 58 (e.g. the seller's default account set by \u003Ccode>Quittio::invoice()\u003C\u002Fcode>), card data for 48, 54 and 55, and direct debit data for 49 and 59. Everything else is dropped.\u003C\u002Fli>\n\u003Cli>The remittance information is kept unless a new one is given.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ccode>creditTransfer()\u003C\u002Fcode>, \u003Ccode>paymentCard()\u003C\u002Fcode> and \u003Ccode>directDebit()\u003C\u002Fcode> add to existing instructions without changing the means code, so call \u003Ccode>payment()\u003C\u002Fcode> with the means first.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F SEPA credit transfer with two accounts\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">payment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">SepaCreditTransfer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">iban\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE02 1203 0000 0000 2020 51'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">bic\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'BYLADEM1001'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">accountName\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Muster GmbH'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">remittanceInformation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0042'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">creditTransfer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'AT61 1904 3002 3457 3201'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'BKAUATWW'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F SEPA direct debit (replaces the seller's default account set by Quittio::invoice())\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">payment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">SepaDirectDebit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">remittanceInformation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0042'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">directDebit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'MANDATE-2026-17'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">creditorId\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE98ZZZ09999999999'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">debitedIban\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE02120300000000202051'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Paid by credit card\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">payment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PaymentMeansCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">CreditCard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">meansText\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Paid online'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">paymentCard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'4242'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Max Muster'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The payment means codes come from the code list UNTDID 4461:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>PaymentMeansCode\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>Code\u003C\u002Fth>\n\u003Cth>Data\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>NotDefined\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">1\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Cash\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">10\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Cheque\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">20\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CreditTransfer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">30\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">account required (BR-61)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>DebitTransfer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">31\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PaymentToBankAccount\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">42\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">account\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>BankCard\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">48\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">card\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>DirectDebit\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">49\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">direct debit\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CreditCard\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">54\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">card\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>DebitCard\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">55\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">card\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>StandingAgreement\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">57\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SepaCreditTransfer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">58\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">account required (BR-61)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SepaDirectDebit\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">59\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">direct debit; XRechnung requires creditor identifier and debited account (BR-DE-30, BR-DE-31)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>OnlinePaymentService\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">68\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Clearing\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">97\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>MutuallyDefined\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">ZZZ\u003C\u002Ftd>\n\u003Ctd data-label=\"Data\">–\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>XRechnung requires payment instructions (BR-DE-1). Profile EXTENDED can carry further payment instructions (\u003Ccode>ExtendedData::$additionalPaymentInstructions\u003C\u002Fcode>, \u003Ca href=\"#extensions\">Extensions\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"payment-terms\">Payment terms\u003Ca class=\"q-doc-anchor\" href=\"#payment-terms\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Set the payment terms (BT-20) with these methods. Each continues the terms set before, also those of \u003Ccode>InvoiceBuilder::from()\u003C\u002Fcode> or of the seller's defaults:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>dueInDays(int $days)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Payment target: the calculator sets the due date (BT-9) to issue date + days, unless \u003Ccode>dueDate()\u003C\u002Fcode> is set.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>cashDiscount(int $days, string $percent, ?string $baseAmount = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Cash discount (&quot;Skonto&quot;) for payment within \u003Ccode>$days\u003C\u002Fcode> days after the issue date, optionally on a base amount. Repeatable for several tiers. The percentage is rounded to two decimals.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>lateFee(?int $days = null, ?string $percent = null, ?string $text = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Late payment terms.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>paymentTerms(PaymentTerms|string|callable $terms)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">A text or a \u003Ccode>PaymentTerms\u003C\u002Fcode> object replaces the earlier terms, e.g. to start over. A callable receives the \u003Ccode>PaymentTermsBuilder\u003C\u002Fcode> (\u003Ccode>text()\u003C\u002Fcode> and the three methods above) and continues them.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">dueInDays\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">30\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cashDiscount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">days\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">10\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'3.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cashDiscount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">days\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">20\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">baseAmount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'1000.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>InvoiceBuilder::from($draft)-&gt;cashDiscount(days: 7, percent: '2.00')\u003C\u002Fcode> adds a cash discount to the terms of the draft.\u003C\u002Fp>\n\u003Cp>A cash discount is an agreed reduction of the price, so it must be part of the XML, not only of the PDF. Quittio therefore writes the terms into the text BT-20, generated in the language of the rendering run:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Without \u003Ccode>text()\u003C\u002Fcode>, \u003Ccode>dueInDays()\u003C\u002Fcode> adds &quot;Payable within 30 days without deduction.&quot; (German: &quot;Zahlbar innerhalb von 30 Tagen ohne Abzug.&quot;).\u003C\u002Fli>\n\u003Cli>Each cash discount adds a line such as &quot;3.00 % cash discount for payment within 10 days (until 2026-10-13).&quot; (German: &quot;3 % Skonto bei Zahlung innerhalb von 10 Tagen (bis 13.10.2026).&quot;). The late fee text follows.\u003C\u002Fli>\n\u003Cli>XRechnung uses its structured notation instead (BR-DE-18): the texts first, then one line \u003Ccode>#SKONTO#TAGE=10#PROZENT=3.00#\u003C\u002Fcode> per cash discount (German for cash discount, days and percent), each closed by a line break. A base amount adds \u003Ccode>BASISBETRAG=1000.00#\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Profile EXTENDED additionally writes the cash discounts (one payment terms group per tier) and the late fee days and percentage as structured CII elements.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"prepaid-amounts-and-rounding\">Prepaid amounts and rounding\u003Ca class=\"q-doc-anchor\" href=\"#prepaid-amounts-and-rounding\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prepaid(BigDecimal|int|string $amount)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-113\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Amount already paid, e.g. received advance payments; replaces an earlier value.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>addPrepaid(BigDecimal|int|string $amount)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-113\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Adds to the amount already paid, e.g. one of several advance payments.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>rounding(BigDecimal|int|string $amount)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-114\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Rounding amount, e.g. cash rounding to 0.05. Never use it to fix wrong totals.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The amount due is BT-115 = gross total − BT-113 + BT-114. For final invoices, the German pack offers \u003Ccode>deductAdvance($advanceInvoice)\u003C\u002Fcode>: it references the advance invoice and adds its gross amount to BT-113 (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs#builder-macros\">Builder macros\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"references\">References\u003Ca class=\"q-doc-anchor\" href=\"#references\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>References link the invoice to other documents, e.g. the buyer's purchase order or a contract. All of them are optional in EN 16931. The one you need most often is the buyer reference (BT-10): XRechnung requires it, and for German public buyers it holds the Leitweg-ID, the routing ID of the authority (\u003Ca href=\"\u002Fdocs\u002Fconcepts#german-terms\">German terms\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyerReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-10\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Buyer reference; required by XRechnung, for German public buyers the Leitweg-ID.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>projectReference(string $id, ?string $name = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-11\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Project reference. CII requires a name and writes the identifier when none is given.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>contractReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-12\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Contract reference.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>purchaseOrderReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-13\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Purchase order reference of the buyer.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>salesOrderReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-14\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Sales order reference of the seller.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>receivingAdviceReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-15\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Receiving advice reference.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>despatchAdviceReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-16\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Despatch advice (delivery note) reference.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>tenderReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-17\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Tender or lot reference.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>invoicedObject(string $value, string|RawCode|null $scheme = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-18\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoiced object identifier (e.g. a meter or subscription), with the scheme from the code list UNTDID 1153, written as \u003Ccode>ReferenceTypeCode\u003C\u002Fcode> (CII) or \u003Ccode>schemeID\u003C\u002Fcode> (UBL).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyerAccountingReference(?string $reference)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-19\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Buyer's accounting reference (cost centre).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>precedingInvoice(string $number, Date|DateTimeInterface|string|null $issueDate = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-3 (BT-25, BT-26)\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Reference to a preceding invoice; repeatable. CII carries only the first reference, UBL all of them.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Lines have their own references (\u003Ccode>orderLineReference()\u003C\u002Fcode>, \u003Ccode>buyerAccountingReference()\u003C\u002Fcode>, \u003Ccode>objectId()\u003C\u002Fcode>, see \u003Ca href=\"#linebuilder\">LineBuilder\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"notes\">Notes\u003Ca class=\"q-doc-anchor\" href=\"#notes\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>note(string $content, NoteSubjectCode|RawCode|string|null $subject = null)\u003C\u002Fcode> adds an invoice note (BG-1): a free text (BT-22) with an optional subject code (BT-21). Call it several times for several notes. UBL writes a note with subject code as \u003Ccode>#CODE#text\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>NoteSubjectCode\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>Code\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>GeneralInformation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">AAI\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PriceConditions\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">AAK\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>LegalInformation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">ABL\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Introduction\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">ACY\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PaymentDetail\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">PMD\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>PaymentInformation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">PMT\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>RegulatoryInformation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">REG\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>SupplierRemarks\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">SUR\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>TaxDeclaration\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Code\">TXD\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Cancellations take over the notes with subject \u003Ccode>REG\u003C\u002Fcode> and \u003Ccode>TXD\u003C\u002Fcode> of the original (\u003Ca href=\"#cancellations-and-corrections\">Cancellations and corrections\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"supporting-documents\">Supporting documents\u003Ca class=\"q-doc-anchor\" href=\"#supporting-documents\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>attachment(string $id, ?string $content = null, MimeType|string|null $mimeType = null, ?string $filename = null, ?string $description = null, ?string $externalUri = null)\u003C\u002Fcode> adds a supporting document (BG-24), e.g. a timesheet. It is repeatable. A supporting document is either embedded or a link:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Embedded: \u003Ccode>$content\u003C\u002Fcode> are the raw bytes; the XML carries them base64 encoded. An embedded document requires MIME type and file name (\u003Ccode>InvalidArgumentException\u003C\u002Fcode> otherwise).\u003C\u002Fli>\n\u003Cli>Link: \u003Ccode>$externalUri\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\MimeType\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">attachment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Timesheet-09'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">file_get_contents\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($path), \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">MimeType\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Pdf\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'timesheet-2026-09.pdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Timesheet September'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">attachment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Contract'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">externalUri\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'https:\u002F\u002Fexample.com\u002Fcontracts\u002F4711.pdf'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">description\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Framework contract'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>\u003Ccode>MimeType\u003C\u002Fcode> has \u003Ccode>Pdf\u003C\u002Fcode> (application\u002Fpdf), \u003Ccode>Png\u003C\u002Fcode> (image\u002Fpng), \u003Ccode>Jpeg\u003C\u002Fcode> (image\u002Fjpeg), \u003Ccode>Csv\u003C\u002Fcode> (text\u002Fcsv), \u003Ccode>Xlsx\u003C\u002Fcode> (application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet) and \u003Ccode>Ods\u003C\u002Fcode> (application\u002Fvnd.oasis.opendocument.spreadsheet), the MIME codes EN 16931 allows. \u003Ccode>Xml\u003C\u002Fcode> (application\u002Fxml) is allowed only in the profile \u003Ccode>xrechnung-extension\u003C\u002Fcode> (BR-DEX-01); other profiles report it with \u003Ccode>BR-CL-24\u003C\u002Fcode>. Another string fails with a \u003Ccode>ValueError\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Supporting documents are part of the XML from profile EN 16931 upwards, not in the profiles MINIMUM, BASIC WL and BASIC. They are not separate files in the PDF (\u003Ca href=\"\u002Fdocs\u002Fformats#embedded-files\">Formats and profiles\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>XRechnung requires unique file names (BR-DE-22).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"presentation-and-metadata\">Presentation and metadata\u003Ca class=\"q-doc-anchor\" href=\"#presentation-and-metadata\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>These methods set the design of the PDF and HTML, the language of the invoice and data for templates and country packs.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>presentation(Presentation|array|callable $presentation)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Design of this invoice in PDF and HTML: logo, colours, font, texts, footer, line groups, gross prices, payment QR code, watermark, paper, labels, title … A \u003Ccode>Presentation\u003C\u002Fcode> replaces it, an array changes single properties (\u003Ccode>['introText' =&gt; '…']\u003C\u002Fcode>), a callable receives the current \u003Ccode>Presentation\u003C\u002Fcode> (or an empty one) and returns the new one. See \u003Ca href=\"\u002Fdocs\u002Ftemplates\">Templates and design\u003C\u002Fa>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>group(string $id, string $title, bool $showSubtotal = true)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Defines a line group of the PDF; lines join it with \u003Ccode>LineBuilder::group($id)\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>locale(string $locale)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Language of the invoice: labels, generated texts, exemption texts of presets. Rendering uses the locale of the call, then this one, then the configured locale, then the country pack default.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>timezone(string $timezone)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Time zone for dates (see \u003Ca href=\"#dates\">Dates\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>custom(string $key, mixed $value)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Free data for templates (view model key \u003Ccode>meta.custom\u003C\u002Fcode>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>source(string $source)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Origin of the data, e.g. \u003Ccode>shop\u003C\u002Fcode> (view model key \u003Ccode>meta.source\u003C\u002Fcode>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>flag(string $flag, bool $enabled = true)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Sets or removes a flag that country packs evaluate, e.g. \u003Ccode>Meta::FLAG_SMALL_BUSINESS\u003C\u002Fcode> (\u003Ccode>small_business\u003C\u002Fcode>) or the German \u003Ccode>Quittio\\Country\\DE\\Support\\Flags::SMALL_AMOUNT\u003C\u002Fcode> (\u003Ccode>de.small_amount\u003C\u002Fcode>, see \u003Ca href=\"\u002Fdocs\u002Fcountry-packs#meta-flags\">Meta flags\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">presentation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'introText'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Thank you for your order.'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'showGrossPrices'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> true\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">])\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">group\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'hardware'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Hardware'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Notebook'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'1200.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">group\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'hardware'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F group(): Line::make()\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Quittio sets some flags itself; do not set them: \u003Ccode>declared_amounts\u003C\u002Fcode>, \u003Ccode>declared_amounts_recalculated\u003C\u002Fcode>, \u003Ccode>cancellation_vat_aligned\u003C\u002Fcode> and those with the prefixes \u003Ccode>amounts_fingerprint:\u003C\u002Fcode> and \u003Ccode>declared_vat_in_tax_currency:\u003C\u002Fcode> (\u003Ca href=\"#declared-amounts\">Declared amounts\u003C\u002Fa>). They are the stored format of the declared amounts: Quittio reads them in any order and writes them after the other flags in a fixed order, the fingerprint last.\u003C\u002Fp>\n\u003Ch2 id=\"application-models\">Application models\u003Ca class=\"q-doc-anchor\" href=\"#application-models\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Your own models can fill the builder, so a customer becomes the buyer and order items become lines. Implement one of three contracts in \u003Ccode>Quittio\\Core\\Contracts\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Contract\u003C\u002Fth>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Used by\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ProvidesParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Method\">\u003Ccode>fillParty(PartyBuilder $party): void\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Used by\">\u003Ccode>InvoiceBuilder::buyer($model)\u003C\u002Fcode> and \u003Ccode>seller($model)\u003C\u002Fcode>, \u003Ccode>PartyBuilder::fromModel($model)\u003C\u002Fcode>, e.g. a customer or user as buyer\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ProvidesInvoiceLine\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Method\">\u003Ccode>fillLine(LineBuilder $line): void\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Used by\">\u003Ccode>InvoiceBuilder::line($model)\u003C\u002Fcode>, \u003Ccode>lines($models)\u003C\u002Fcode>, \u003Ccode>LineBuilder::fromModel($model)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ProvidesInvoiceData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Method\">\u003Ccode>toInvoiceData(): InvoiceData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Used by\">\u003Ccode>Quittio::make($model)\u003C\u002Fcode> (core and Laravel), \u003Ccode>Invoice::draftFor($model)\u003C\u002Fcode> and \u003Ccode>HasInvoices::draftInvoice()\u003C\u002Fcode> in the \u003Ca href=\"\u002Fdocs\u002Fmanaged\">Managed layer\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\LineBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Contracts\\ProvidesInvoiceData\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Contracts\\ProvidesInvoiceLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\InvoiceData\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">class\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\"> OrderItem\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> extends\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Model\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> implements\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> ProvidesInvoiceLine\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> function\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\"> fillLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">LineBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $line)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> void\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#E6EDF3\">        $line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">id\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">((\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">position)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">name\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">product_name)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">sellerId\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">sku)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">((\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">quantity, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Piece\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">unit_price)                       \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F decimal string from the database\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">from\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">tax_preset));          \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F stored preset key, e.g. \"de.standard\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">class\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\"> Order\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> extends\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Model\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> implements\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> ProvidesInvoiceData\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> function\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\"> toInvoiceData\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceData\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">number\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">invoice_number)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">customer)                            \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F ProvidesParty\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">$this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">items)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#FF7B72\">            ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">build\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>fillParty()\u003C\u002Fcode> and \u003Ccode>fillLine()\u003C\u002Fcode> may set any value. \u003Ccode>buyer($model)\u003C\u002Fcode>, \u003Ccode>seller($model)\u003C\u002Fcode>, \u003Ccode>line($model)\u003C\u002Fcode> and \u003Ccode>lines($models)\u003C\u002Fcode> pass them a fresh builder. \u003Ccode>PartyBuilder::fromModel()\u003C\u002Fcode> and \u003Ccode>LineBuilder::fromModel()\u003C\u002Fcode> pass the builder they are called on, e.g. the builder of the party set before inside a \u003Ccode>buyer()\u003C\u002Fcode> callable. The invoice keeps a copy, so changing the model later does not change invoices that were already built. Store amounts as decimal strings (database \u003Ccode>decimal\u003C\u002Fcode> columns), not as floats.\u003C\u002Fp>\n\u003Ch2 id=\"currency-and-exchange-rate\">Currency and exchange rate\u003Ca class=\"q-doc-anchor\" href=\"#currency-and-exchange-rate\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Invoices are in euros by default. Set another invoice currency with \u003Ccode>currency()\u003C\u002Fcode>; all amounts of the invoice are then in that currency. If the VAT must also be stated in another currency, the VAT accounting currency (BT-6), set it with \u003Ccode>taxCurrency()\u003C\u002Fcode> together with the exchange rate.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>currency(string $currency)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-5\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Invoice currency (ISO 4217, uppercased), default \u003Ccode>EUR\u003C\u002Fcode>. All amounts of the invoice are in this currency.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxCurrency(string $currency, BigDecimal|int|string|null $exchangeRate = null, Date|DateTimeInterface|string|null $rateDate = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-6\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">VAT accounting currency; with a rate, also sets \u003Ccode>exchangeRate()\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>exchangeRate(BigDecimal|int|string $rate, Date|DateTimeInterface|string|null $date = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">–\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Units of the VAT accounting currency per unit of the invoice currency.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">currency\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'USD'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">taxCurrency\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EUR'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">exchangeRate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'0.9234'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">rateDate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-10-02'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>The calculator then sets the VAT total in accounting currency: BT-111 = round2(BT-110 × rate), where BT-110 is the VAT total in the invoice currency.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Without a rate, BT-111 stays empty (except for a VAT total of zero) and the validation fails with BR-53.\u003C\u002Fli>\n\u003Cli>BT-6 is written only if it differs from BT-5.\u003C\u002Fli>\n\u003Cli>The rate itself appears in the XML only in profile EXTENDED (CII \u003Ccode>TaxApplicableTradeCurrencyExchange\u003C\u002Fcode>).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Data read from XML has no exchange rate; see \u003Ca href=\"#declared-amounts\">Declared amounts\u003C\u002Fa> for how \u003Ccode>from()\u003C\u002Fcode> handles it.\u003C\u002Fp>\n\u003Ch2 id=\"allowances-and-charges\">Allowances and charges\u003Ca class=\"q-doc-anchor\" href=\"#allowances-and-charges\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>An allowance reduces an amount, a charge increases it, e.g. a discount or a shipping fee. Both exist on two levels:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Line allowances and charges\u003C\u002Fstrong> (BG-27, BG-28) change the net amount of one line. They need \u003Ccode>Line::make()\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Document level allowances and charges\u003C\u002Fstrong> (BG-20, BG-21) belong to one VAT group of the whole invoice. For a discount on the whole invoice, \u003Ccode>discountPercent()\u003C\u002Fcode> and \u003Ccode>discountAmount()\u003C\u002Fcode> split it over the VAT groups for you.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Each one has an amount, or a percentage of a base amount. EN 16931 requires a reason text or a reason code (\u003Ca href=\"#reason-codes\">Reason codes\u003C\u002Fa>). Invoices with prices including VAT cannot have allowances or charges (\u003Ca href=\"#gross-price-mode\">Gross price mode\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"line-allowances-and-charges\">Line allowances and charges\u003Ca class=\"q-doc-anchor\" href=\"#line-allowances-and-charges\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>A line allowance or charge has an amount, or a percentage of a base amount. Without a base amount, the base is the line amount before allowances and charges (quantity × price); the calculator writes it to BT-137\u002FBT-142.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F Line allowances and charges need Line::make()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Seminar'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'400.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">3\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">allowance\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'10'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Early bird'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)       \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 120.00 of 1200.00\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">charge\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'25.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Materials'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ABK'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch3 id=\"document-level-allowances-and-charges\">Document level allowances and charges\u003Ca class=\"q-doc-anchor\" href=\"#document-level-allowances-and-charges\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Method\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>allowance(VatCategory $category, BigDecimal|int|string|null $rate, ?string $amount = null, ?string $percent = null, ?string $reason = null, AllowanceReasonCode|RawCode|string|null $reasonCode = null, ?string $baseAmount = null, ?string $exemptionReason = null, VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Document level allowance (BG-20: BT-92 to BT-98) for one VAT category and rate.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>charge(VatCategory $category, BigDecimal|int|string|null $rate, ?string $amount = null, ?string $percent = null, ?string $reason = null, ChargeReasonCode|RawCode|string|null $reasonCode = null, ?string $baseAmount = null, ?string $exemptionReason = null, VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Document level charge (BG-21: BT-99 to BT-105).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>discountPercent(BigDecimal|int|string $percent, ?string $reason = null, AllowanceReasonCode|RawCode|string|null $reasonCode = AllowanceReasonCode::Discount)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Percentage discount on all lines, split into one allowance per VAT group.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>discountAmount(BigDecimal|int|string $amount, ?string $reason = null, AllowanceReasonCode|RawCode|string|null $reasonCode = AllowanceReasonCode::Discount)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Absolute discount, distributed over the VAT groups in proportion to their line sums.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A document level allowance or charge belongs to exactly one VAT group, given by category and rate. Without a base amount, the base is the sum of the line net amounts of its VAT group; the calculator writes it to BT-93\u002FBT-100. Its exemption reason is used for the VAT breakdown as described in \u003Ca href=\"#exemption-reasons-in-the-vat-breakdown\">Exemption reasons in the VAT breakdown\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\ChargeReasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Enums\\VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">charge\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">StandardRate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'19'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">amount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'9.90'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Shipping'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">ChargeReasonCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Freight\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">allowance\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatCategory\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">StandardRate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'19'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'5'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Loyalty discount'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">discountPercent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'3'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Framework agreement'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)                     \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F one allowance per VAT group\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>discountPercent()\u003C\u002Fcode> and \u003Ccode>discountAmount()\u003C\u002Fcode> split the discount when the invoice is built (\u003Ca href=\"#discount-splitting\">Discount splitting\u003C\u002Fa>):\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Each VAT group gets one allowance, in proportion to the signed line sum of the group. A group with a negative sum (only returns) receives a negative part.\u003C\u002Fli>\n\u003Cli>Rounding differences are distributed with the largest remainder method, so the parts add up exactly to the discount.\u003C\u002Fli>\n\u003Cli>A part keeps percentage and base amount only if it equals round2(base × percentage \u002F 100). Otherwise only the amount is written, because validators check that formula (e.g. PEPPOL-EN16931-R040).\u003C\u002Fli>\n\u003Cli>A discount of 0 adds nothing. A discount on lines that add up to zero throws a \u003Ccode>CalculationException\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"reason-codes\">Reason codes\u003Ca class=\"q-doc-anchor\" href=\"#reason-codes\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Use these codes for the \u003Ccode>reasonCode\u003C\u002Fcode> of allowances and charges on both levels. Other codes of the lists can be passed as strings.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>AllowanceReasonCode\u003C\u002Fcode> (code list UNTDID 5189): \u003Ccode>BonusForWorksAheadOfSchedule\u003C\u002Fcode> (41), \u003Ccode>OtherBonus\u003C\u002Fcode> (42), \u003Ccode>ManufacturersConsumerDiscount\u003C\u002Fcode> (60), \u003Ccode>DueToMilitaryStatus\u003C\u002Fcode> (62), \u003Ccode>DueToWorkAccident\u003C\u002Fcode> (63), \u003Ccode>SpecialAgreement\u003C\u002Fcode> (64), \u003Ccode>ProductionErrorDiscount\u003C\u002Fcode> (65), \u003Ccode>NewOutletDiscount\u003C\u002Fcode> (66), \u003Ccode>SampleDiscount\u003C\u002Fcode> (67), \u003Ccode>EndOfRangeDiscount\u003C\u002Fcode> (68), \u003Ccode>IncotermDiscount\u003C\u002Fcode> (70), \u003Ccode>PointOfSalesThresholdAllowance\u003C\u002Fcode> (71), \u003Ccode>MaterialSurchargeDeduction\u003C\u002Fcode> (88), \u003Ccode>Discount\u003C\u002Fcode> (95), \u003Ccode>SpecialRebate\u003C\u002Fcode> (100), \u003Ccode>FixedLongTerm\u003C\u002Fcode> (102), \u003Ccode>Temporary\u003C\u002Fcode> (103), \u003Ccode>Standard\u003C\u002Fcode> (104), \u003Ccode>YearlyTurnover\u003C\u002Fcode> (105).\u003C\u002Fli>\n\u003Cli>\u003Ccode>ChargeReasonCode\u003C\u002Fcode> (code list UNTDID 7161): \u003Ccode>Advertising\u003C\u002Fcode> (AA), \u003Ccode>Telecommunication\u003C\u002Fcode> (AAA), \u003Ccode>Miscellaneous\u003C\u002Fcode> (ABK), \u003Ccode>AdditionalPackaging\u003C\u002Fcode> (ABL), \u003Ccode>OtherServices\u003C\u002Fcode> (ADR), \u003Ccode>PickUp\u003C\u002Fcode> (ADT), \u003Ccode>Delivery\u003C\u002Fcode> (DL), \u003Ccode>Freight\u003C\u002Fcode> (FC), \u003Ccode>Financing\u003C\u002Fcode> (FI), \u003Ccode>Labelling\u003C\u002Fcode> (LA), \u003Ccode>Packing\u003C\u002Fcode> (PC), \u003Ccode>SpecialHandling\u003C\u002Fcode> (SH).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"sub-lines\">Sub lines\u003Ca class=\"q-doc-anchor\" href=\"#sub-lines\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Sub lines divide a line into parts, e.g. a workstation that consists of a computer and a monitor. The parent line needs \u003Ccode>Line::make()\u003C\u002Fcode>. \u003Ccode>subLine()\u003C\u002Fcode> takes the same forms as \u003Ccode>line()\u003C\u002Fcode>, usually the name with named values:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\Line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Workstation'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">subLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Computer'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'900.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">subLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Monitor'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'250.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">2\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>A parent line without quantity has the quantity 1. Without its own price, it takes the sum of its sub lines as price.\u003C\u002Fli>\n\u003Cli>Sub lines exist only in two profiles: EXTENDED (CII, with parent line identifier and line status \u003Ccode>GROUP\u003C\u002Fcode>\u002F\u003Ccode>DETAIL\u003C\u002Fcode>) and the XRechnung extension (UBL only, \u003Ccode>-&gt;format('xrechnung-ubl')-&gt;profile('xrechnung-extension')\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>The automatic format choice upgrades ZUGFeRD and CII to EXTENDED (\u003Ca href=\"\u002Fdocs\u002Fformats#automatic-choice\">Automatic choice\u003C\u002Fa>). Other profiles reject sub lines (\u003Ccode>QUITTIO-PROFILE-SUBLINES\u003C\u002Fcode>).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"gross-price-mode\">Gross price mode\u003Ca class=\"q-doc-anchor\" href=\"#gross-price-mode\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Shops and B2C invoices often work with prices including VAT. Give every line a \u003Ccode>priceInclVat\u003C\u002Fcode> instead of a \u003Ccode>netPrice\u003C\u002Fcode>. The calculator then derives the net prices so that the customer pays exactly the gross amount (\u003Ca href=\"#gross-price-conversion\">Gross price conversion\u003C\u002Fa>):\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">invoice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#8B949E\">    \u002F\u002F ...\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'T-shirt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">priceInclVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'19.99'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">3\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Shipping'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">priceInclVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'4.90'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Voucher'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">priceInclVat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'5.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">-\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">build\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Restrictions:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>All lines of the invoice use \u003Ccode>priceInclVat()\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Gross price lines have no line allowances, charges or sub lines.\u003C\u002Fli>\n\u003Cli>The invoice has no document level allowances or charges. Model shipping and discounts as lines, a discount with a negative quantity.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Violations throw a \u003Ccode>CalculationException\u003C\u002Fcode> when the invoice is calculated.\u003C\u002Fp>\n\u003Cp>The VAT per rate is rounded commercially from the gross sums (section 14.5 (20) UStAE), and the lines add up exactly to the gross prices; a rounding amount (BT-114) is only needed when net amount and VAT cannot reproduce the gross sum. So the fallback the BMF letter of 15 October 2026 (marginal no. 19) allows for gross price e-invoices until 2027, sums per rate with the lines in an attachment, is not needed.\u003C\u002Fp>\n\u003Cp>To change a price later, \u003Ccode>InvoiceLine::withPriceInclVat()\u003C\u002Fcode> changes a gross price line and \u003Ccode>withNetPrice()\u003C\u002Fcode> a net price line. Each throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode> for a line of the other mode.\u003C\u002Fp>\n\u003Ch2 id=\"changing-existing-data\">Changing existing data\u003Ca class=\"q-doc-anchor\" href=\"#changing-existing-data\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>InvoiceBuilder::from(InvoiceData $data)\u003C\u002Fcode> takes over every value of the data, including lines, document allowances and charges, payment data, presentation and metadata. Drafts, stored invoices and read invoices can then be changed with the normal builder methods. Existing lines are changed with \u003Ccode>updateLine()\u003C\u002Fcode> and removed with \u003Ccode>removeLine()\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\PartyBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Lines\\InvoiceLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Country\\DE\\Tax\\VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$changed \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">from\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($draft)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">issueDate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-10-20'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">buyer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">fn\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PartyBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $b) => $b\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">contact\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Lena Kunde'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">null\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'lena@kunde.de'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F changes the existing buyer\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">updateLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'80.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">description\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Price adjusted'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">updateLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'4'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">fn\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">InvoiceLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $line) => $line\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'note'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Delivered in two parts'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">removeLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'3'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Travel expenses'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'120.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">vat\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">VatPreset\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Standard\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">build\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>updateLine(string $id, ?callable $change = null, netPrice, quantity, priceInclVat, name, description)\u003C\u002Fcode> changes a line in one of two ways: with the named values (\u003Ccode>-&gt;updateLine('2', netPrice: '80.00', quantity: 3)\u003C\u002Fcode>), or with a callable that receives the \u003Ccode>InvoiceLine\u003C\u002Fcode> and returns the changed one. \u003Ccode>removeLine(string $id)\u003C\u002Fcode> removes a line by its identifier (BT-126, \u003Ca href=\"#line-identifiers\">Line identifiers\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>Both work only on lines that already exist as \u003Ccode>InvoiceLine\u003C\u002Fcode>: the lines of data passed to \u003Ccode>InvoiceBuilder::from()\u003C\u002Fcode> and lines added as \u003Ccode>InvoiceLine\u003C\u002Fcode>. Lines added in the other forms are built only in \u003Ccode>build()\u003C\u002Fcode>, so they cannot be changed or removed by identifier. An unknown identifier throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>What happens to the amounts:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Totals and the VAT breakdown are not taken over (except \u003Ca href=\"#declared-amounts\">declared amounts\u003C\u002Fa>); the result is calculated again when rendered.\u003C\u002Fli>\n\u003Cli>Percentage document allowances and charges whose base is the line sum of their VAT group follow the lines when lines are added, changed or removed. So do discounts that \u003Ccode>discountPercent()\u003C\u002Fcode> or \u003Ccode>discountAmount()\u003C\u002Fcode> split over the VAT groups. They are recalculated or split again: a VAT group without lines keeps no allowance of 0.00, and a new VAT group gets its part.\u003C\u002Fli>\n\u003Cli>\u003Ccode>updateLine()\u003C\u002Fcode> resets the line net amount and recalculates percentage line allowances and charges from the new line amount. A base amount that equalled the previous line amount follows the new one.\u003C\u002Fli>\n\u003Cli>\u003Ccode>InvoiceLine::withNetPrice()\u003C\u002Fcode> drops list price and discount. It throws for a line with a price including VAT, and \u003Ccode>withPriceInclVat()\u003C\u002Fcode> throws for a line with a net price (the gross price mode applies to all lines).\u003C\u002Fli>\n\u003Cli>\u003Ccode>dueInDays()\u003C\u002Fcode>, \u003Ccode>cashDiscount()\u003C\u002Fcode> and \u003Ccode>lateFee()\u003C\u002Fcode> continue the existing payment terms; a text passed to \u003Ccode>paymentTerms()\u003C\u002Fcode> replaces them. Seller and buyer callables continue the existing parties.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"cancellations-and-corrections\">Cancellations and corrections\u003Ca class=\"q-doc-anchor\" href=\"#cancellations-and-corrections\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>A cancellation (&quot;Stornorechnung&quot;, cancellation invoice) is a new invoice with its own number. It reverses an issued invoice and refers to it (BG-3); the original is never changed. Build it with \u003Ccode>cancellation()\u003C\u002Fcode> of the \u003Ccode>Quittio\u003C\u002Fcode> instance or the Laravel facade. It returns an \u003Ccode>InvoiceBuilder\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Laravel\\Facades\\Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-2026-0001'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Charged twice'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F core instance\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-2026-0001'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Charged twice'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);    \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F Laravel facade\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$result \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($builder)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>In Laravel, a rendered invoice can also be cancelled with \u003Ccode>$result-&gt;cancel(…)\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Fgetting-started#cancellation\">Getting started\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>\u003Ccode>cancellation(InvoiceData $original, string $number, ?string $reason = null, ?string $strategy = null, ?Date $issueDate = null, ?array $lines = null, ?CancellationHistory $history = null, ?string $title = null): InvoiceBuilder\u003C\u002Fcode>\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Parameter\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$original\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">The issued invoice, calculated (e.g. \u003Ccode>RenderedInvoice::data()\u003C\u002Fcode>, a stored snapshot or read data). A cancellation reverses its amounts exactly, also amounts another system rounded (\u003Ca href=\"#declared-amounts\">declared amounts\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$number\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Number of the cancellation.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$reason\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Appended to the cancellation note (&quot;Reason: …&quot;).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$strategy\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">\u003Ccode>credit_note\u003C\u002Fcode> or \u003Ccode>negative_invoice\u003C\u002Fcode> (\u003Ccode>CorrectionPolicy::CANCELLATION_CREDIT_NOTE\u003C\u002Fcode>, \u003Ccode>CANCELLATION_NEGATIVE_INVOICE\u003C\u002Fcode>, see \u003Ca href=\"#sign-strategies\">Sign strategies\u003C\u002Fa>). Default: the configured \u003Ccode>corrections.cancellation_strategy\u003C\u002Fcode>, then the country pack (Germany: \u003Ccode>credit_note\u003C\u002Fcode>). Another value throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$issueDate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">A \u003Ccode>Date\u003C\u002Fcode> (\u003Ccode>Date::parse('2026-10-20')\u003C\u002Fcode>), default today in the time zone of the original.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$lines\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Partial cancellation (\u003Ca href=\"#partial-cancellations\">below\u003C\u002Fa>); \u003Ccode>null\u003C\u002Fcode> cancels the whole invoice.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$history\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Earlier partial cancellations of the original, for the cumulative VAT rounding (\u003Ca href=\"#cumulative-vat-rounding\">below\u003C\u002Fa>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>$title\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Document title in PDF, HTML and file name (\u003Ccode>Presentation::$title\u003C\u002Fcode>), e.g. &quot;Stornorechnung&quot;. Default: the title \u003Ccode>cancellation\u003C\u002Fcode> of the country pack's correction policy (\u003Ccode>cancellation_self_billed\u003C\u002Fcode> for self-billed originals); without one, the label of the type code.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The leading country pack of the original (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs\">Country packs\u003C\u002Fa>) provides the correction policy and the locale of the texts: the locale of the original, then the configured locale, then the pack default.\u003C\u002Fp>\n\u003Cp>Without a \u003Ccode>Quittio\u003C\u002Fcode> instance, \u003Ccode>Cancellation::of(InvoiceData $original, string $number, string $strategy = 'credit_note', ?string $reason = null, ?Date $issueDate = null, ?string $locale = null, ?string $title = null, ?array $lines = null, ?CorrectionPolicy $policy = null, ?CancellationHistory $history = null)\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Corrections\\Cancellation\u003C\u002Fcode>) does the same. Note the different parameter order, and that without \u003Ccode>$title\u003C\u002Fcode> or \u003Ccode>$policy\u003C\u002Fcode> the document title comes from the type code.\u003C\u002Fp>\n\u003Cp>The cancellation is a copy of the original with these changes:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C\u002Fth>\n\u003Cth>Value\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Number, issue date\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">\u003Ccode>$number\u003C\u002Fcode>, \u003Ccode>$issueDate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Type code\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">by strategy, see \u003Ca href=\"#sign-strategies\">Sign strategies\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Preceding invoice (BG-3)\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">the original's number and issue date (replaces earlier references)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Notes (BG-1)\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">&quot;Stornierung der Rechnung RE-2026-0042 vom 03.10.2026.&quot; (&quot;Cancellation of invoice … of …&quot;; for self-billed originals &quot;Stornierung der Gutschrift …&quot;, &quot;Cancellation of the self-billed invoice …&quot;) with subject \u003Ccode>AAI\u003C\u002Fcode>, plus the reason. The original's notes with subject \u003Ccode>REG\u003C\u002Fcode> and \u003Ccode>TXD\u003C\u002Fcode> are kept, others dropped.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Payment terms, due date\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">&quot;Der Betrag wird mit offenen Forderungen verrechnet oder erstattet.&quot; (&quot;The amount will be offset against open items or refunded.&quot;); no due date\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Lines, allowances, charges\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">all lines with document allowances and charges, or the selected lines\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Prepaid amount BT-113, rounding amount BT-114, third party payments\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">taken over by a full cancellation, so that the amounts due match; not by a partial one\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Title in PDF and file name\u003C\u002Ftd>\n\u003Ctd data-label=\"Value\">from the correction policy (Germany: &quot;Stornorechnung&quot;, cancellation invoice; for self-billed originals &quot;Storno-Gutschrift&quot;, cancellation of the self-billed invoice)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Everything else stays as in the original: parties, references, payment instructions, delivery, currency, attachments and presentation. The result is an \u003Ccode>InvoiceBuilder\u003C\u002Fcode>, so you can change it before rendering, e.g. \u003Ccode>-&gt;note('…')\u003C\u002Fcode> or \u003Ccode>-&gt;payment(PaymentMeansCode::SepaCreditTransfer, iban: '…')\u003C\u002Fcode> for the refund account. Changing lines or allowances recalculates the amounts.\u003C\u002Fp>\n\u003Ch3 id=\"sign-strategies\">Sign strategies\u003Ca class=\"q-doc-anchor\" href=\"#sign-strategies\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>A cancellation reverses the amounts in one of two ways: as a credit note with positive amounts (\u003Ccode>credit_note\u003C\u002Fcode>) or as an invoice with negative amounts (\u003Ccode>negative_invoice\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Original\u003C\u002Fth>\n\u003Cth>\u003Ccode>credit_note\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>\u003Ccode>negative_invoice\u003C\u002Fcode>\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Invoice (380, 384, 326 …)\u003C\u002Ftd>\n\u003Ctd data-label=\"credit_note\">381, positive amounts\u003C\u002Ftd>\n\u003Ctd data-label=\"negative_invoice\">380, negative quantities and amounts\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Credit note (\u003Ccode>isCreditNote()\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"credit_note\">380, positive amounts\u003C\u002Ftd>\n\u003Ctd data-label=\"negative_invoice\">380, positive amounts\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Self-billed invoice (389) or debit note (527)\u003C\u002Ftd>\n\u003Ctd data-label=\"credit_note\">261, positive amounts\u003C\u002Ftd>\n\u003Ctd data-label=\"negative_invoice\">389, negative quantities and amounts\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Self-billed credit note (261)\u003C\u002Ftd>\n\u003Ctd data-label=\"credit_note\">389, positive amounts\u003C\u002Ftd>\n\u003Ctd data-label=\"negative_invoice\">389, positive amounts\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cul>\n\u003Cli>A credit note is reversed by an invoice with the same positive amounts in both strategies; a second credit note would credit twice.\u003C\u002Fli>\n\u003Cli>With \u003Ccode>negative_invoice\u003C\u002Fcode>, the quantities, line net amounts, line and document allowances and charges (amounts and base amounts), BT-113, BT-114 and third party payments are negated. Prices stay positive (BR-27).\u003C\u002Fli>\n\u003Cli>Self-billed documents stay self-billed.\u003C\u002Fli>\n\u003Cli>Both strategies are permitted in Germany. The German pack titles the document &quot;Stornorechnung&quot;, never &quot;Gutschrift&quot; (in German a self-billed invoice), except for self-billing.\u003C\u002Fli>\n\u003Cli>UBL writes a cancellation with \u003Ccode>credit_note\u003C\u002Fcode> as \u003Ccode>CreditNote\u003C\u002Fcode>. The XRechnung extension has no UBL credit note: use \u003Ccode>negative_invoice\u003C\u002Fcode> there.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"partial-cancellations\">Partial cancellations\u003Ca class=\"q-doc-anchor\" href=\"#partial-cancellations\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Pass \u003Ccode>lines:\u003C\u002Fcode> to cancel only some lines, quantities or amounts:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-2026-0002'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Partial return'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '3'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">],                         \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F the whole line\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'quantity'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">],      \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F 1 of 3\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'amount'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '50.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">],    \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F an amount, e.g. a price reduction\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>Each entry names a line identifier (BT-126) once, with a \u003Ccode>quantity\u003C\u002Fcode>, an \u003Ccode>amount\u003C\u002Fcode> or neither (the whole line). Quantity and amount together throw an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>, as do an unknown line or an empty list.\u003C\u002Fli>\n\u003Cli>Quantities and amounts are magnitudes: a negative line (discount, return) keeps its sign and is reversed with it.\u003C\u002Fli>\n\u003Cli>A quantity must be greater than 0 and at most the invoiced quantity. Line allowances and charges are scaled in proportion. Lines with sub lines can only be cancelled as a whole.\u003C\u002Fli>\n\u003Cli>An amount becomes one unit (C62) at that net price, without allowances and charges. It must be greater than 0 and at most the line net amount, so the original must be calculated. For lines with a price including VAT, the amount includes VAT and is compared with the gross line amount.\u003C\u002Fli>\n\u003Cli>Whole lines keep the original's declared net amounts; quantities and amounts are recalculated.\u003C\u002Fli>\n\u003Cli>Invoices with document level allowances or charges cannot be cancelled partially, because these cannot be assigned to single lines reliably. Cancel fully and issue a new invoice.\u003C\u002Fli>\n\u003Cli>Each part is rounded on its own: three cancellations of one unit of a line of 29.00 net for 3 units give 9.67 each. Cancel the remainder of a line as an amount (\u003Ccode>['line' =&gt; '1', 'amount' =&gt; '9.66']\u003C\u002Fcode>), so that the parts add up exactly to the line. The Managed layer tracks this per line (\u003Ca href=\"\u002Fdocs\u002Fmanaged#cancellations-and-corrections\">Managed layer\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>The core checks each part against the invoiced quantity or amount of the line, and with a history the sum per VAT group against the original. It does not know what earlier parts cancelled of a line: limit the last part to the remainder yourself, or let the Managed layer do it.\u003C\u002Fli>\n\u003Cli>A price reduction is no partial cancellation: the invoice stays correct, only the consideration changes. Use \u003Ccode>priceReduction()\u003C\u002Fcode> (\u003Ca href=\"#price-reductions\">Price reductions\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>A full cancellation suits an invoice issued twice: cancel the second, duplicate invoice.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"cumulative-vat-rounding\">Cumulative VAT rounding\u003Ca class=\"q-doc-anchor\" href=\"#cumulative-vat-rounding\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>VAT is rounded per document and VAT group. If each partial cancellation is rounded on its own, the parts together can differ from the original by a cent per part. Example: three parts of 9.67, 9.67 and 9.66 net at 19 % carry 3 × 1.84 = 5.52 VAT, the original 5.51.\u003C\u002Fp>\n\u003Cp>With a \u003Ccode>CancellationHistory\u003C\u002Fcode> of the earlier partial cancellations, the VAT is rounded cumulatively per VAT group:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>S = taxable amount of the earlier cancellations + taxable amount of this one,\u003C\u002Fli>\n\u003Cli>target = round2(S × rate \u002F 100), or the original's VAT BT-117 when this cancellation closes the group (all its lines are cancelled completely afterwards),\u003C\u002Fli>\n\u003Cli>VAT of this cancellation = target − VAT of the earlier cancellations.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The three parts then carry 1.84, 1.83 and 1.84 = 5.51.\u003C\u002Fp>\n\u003Cp>Why cumulatively: section 17 (1) sentence 1 UStG requires the VAT owed to be corrected, here 5.51; rounding every part on its own would correct 5.52, a cent more than was ever owed. Union law leaves the rounding method to the member states within the principles of neutrality and proportionality (CJEU C-302\u002F07, J D Wetherspoon), and the BMF letter of 15 October 2026 (marginal no. 21) looks at the original invoice and all corrections together. Section 14.5 (20) UStAE asks for the VAT of an invoice rounded to the cent; a single part then differs by up to one cent from that, which the note explains. No ruling or administrative instruction deals with cumulative rounding over several correction documents explicitly; the approach was confirmed by a tax adviser in the review of October 2026 (see the README).\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Every part differs by at most 0.01 from round2(own taxable amount × rate) and keeps the sign of its taxable amount.\u003C\u002Fli>\n\u003Cli>The validation reports the difference as information \u003Ccode>QUITTIO-CANCELLATION-VAT-ALIGNED\u003C\u002Fcode>, and the cancellation note explains the rounding: &quot;Rounding adjustment: the VAT of this partial cancellation is set so that all partial cancellations of invoice RE-… together correct its VAT exactly.&quot; (German: &quot;Rundungsausgleich: Die Umsatzsteuer dieses Teilstornos ist so bemessen, dass alle Teilstornos zur Rechnung RE-… zusammen deren Umsatzsteuer exakt berichtigen.&quot;).\u003C\u002Fli>\n\u003Cli>For an original whose VAT another system rounded (BT-117 ≠ round2(BT-116 × rate)), the target uses its effective rate BT-117 \u002F BT-116, which spreads the difference over the parts. This does not apply to groups with positive and negative lines.\u003C\u002Fli>\n\u003Cli>In gross price mode, the taxable amounts follow the same way from the gross amounts cancelled so far, and the rounding amounts (BT-114) of all parts add up to the original's.\u003C\u002Fli>\n\u003Cli>BT-111 in accounting currency is aligned the same way at the original's exchange rate.\u003C\u002Fli>\n\u003Cli>Without a history, or for an original whose amounts are stale, the VAT is rounded per document.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The Managed layer keeps the history itself. Without it, build the history from the cancellations as issued:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Corrections\\CancellationHistory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F $original: 3 × 10.00 with a line allowance of 1.00 at 19 %, 29.00 net, 5.51 VAT\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$history \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> CancellationHistory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;                         \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F no earlier partial cancellation\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$first \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [[\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'quantity'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]], \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">history\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: $history))\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$history \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $history\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">withCancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, $first\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">data\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">());\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$second \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [[\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'quantity'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]], \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">history\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: $history))\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$history \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $history\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">withCancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, $second\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">data\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">());\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F The last part cancels what is left of line 1 and closes the VAT group S|19.00\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$history \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> CancellationHistory\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($history\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">groups, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">closes\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'S|19.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$third \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">cancellation\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'ST-3'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">lines\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [[\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'line'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'amount'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '9.66'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]], \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">history\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: $history))\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>CancellationHistory\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>Description\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>new CancellationHistory(array $groups = [], array $closes = [])\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">\u003Ccode>$groups\u003C\u002Fcode>: per VAT group key (\u003Ccode>DeclaredAmounts::breakdownKey()\u003C\u002Fcode>, e.g. \u003Ccode>S|19.00\u003C\u002Fcode>, \u003Ccode>S|7.00\u003C\u002Fcode>, \u003Ccode>E|0.00\u003C\u002Fcode>, \u003Ccode>O|\u003C\u002Fcode>) the sums of the earlier cancellations as \u003Ccode>BigDecimal\u003C\u002Fcode>: \u003Ccode>taxable\u003C\u002Fcode> (BT-116), \u003Ccode>tax\u003C\u002Fcode> (BT-117), \u003Ccode>taxInTaxCurrency\u003C\u002Fcode> (share of BT-111, null if unknown) and in gross price mode \u003Ccode>gross\u003C\u002Fcode> (null or missing if unknown), in the original's direction. \u003Ccode>$closes\u003C\u002Fcode>: keys of the VAT groups whose lines are all cancelled completely once this cancellation is issued, including groups closed earlier.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>withCancellation(InvoiceData $original, InvoiceData $cancellation, array $closes = []): self\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">The history after an issued (calculated) cancellation; \u003Ccode>$closes\u003C\u002Fcode> for the next one.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>CancellationHistory::entries(InvoiceData $original, InvoiceData $cancellation)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">The VAT groups of an issued cancellation in the original's direction.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxable(string $key)\u003C\u002Fcode>, \u003Ccode>tax(string $key)\u003C\u002Fcode>, \u003Ccode>gross(string $key)\u003C\u002Fcode>, \u003Ccode>closes(string $key)\u003C\u002Fcode>, \u003Ccode>taxInTaxCurrency()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Values of the history.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>align(InvoiceData $original, InvoiceData $cancellation)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">The aligned VAT breakdown and BT-111 of a calculated partial cancellation (used by \u003Ccode>cancellation()\u003C\u002Fcode>).\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>assertFits(InvoiceData $original, InvoiceData $cancellation, array $aligned)\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode> for a history that does not fit the original: unknown VAT groups, more taxable amount than the original's lines, or a VAT more than 0.01 off or of the wrong sign. A history built with \u003Ccode>withCancellation()\u003C\u002Fcode> from the issued cancellations always fits.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>matches(InvoiceData $original, InvoiceData $cancellation): bool\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Description\">Whether an issued cancellation carries the VAT this history gives it; false e.g. after another partial cancellation was issued meanwhile.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Amounts in the history are signed in the original's direction: a credit note that cancels an invoice and an invoice that cancels a credit note count with their amounts, a negative invoice with its amounts negated.\u003C\u002Fp>\n\u003Ch3 id=\"correction-policy\">Correction policy\u003Ca class=\"q-doc-anchor\" href=\"#correction-policy\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>A country pack defines its defaults for cancellations and corrections in \u003Ccode>Quittio\\Core\\Countries\\CorrectionPolicy\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>new CorrectionPolicy(string $cancellationStrategy = 'credit_note', string $correctionStrategy = 'cancel_and_reissue', array $titles = [])\u003C\u002Fcode>, with the constants \u003Ccode>CANCELLATION_CREDIT_NOTE\u003C\u002Fcode>, \u003Ccode>CANCELLATION_NEGATIVE_INVOICE\u003C\u002Fcode>, \u003Ccode>CORRECTION_CANCEL_AND_REISSUE\u003C\u002Fcode> and \u003Ccode>CORRECTION_CORRECTED_INVOICE\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>$titles\u003C\u002Fcode> maps a document kind to titles per locale (\u003Ccode>['cancellation' =&gt; ['de' =&gt; 'Stornorechnung', 'en' =&gt; 'Cancellation invoice']]\u003C\u002Fcode>). \u003Ccode>title(string $kind, string $locale = 'en')\u003C\u002Fcode> and \u003Ccode>cancellationTitle(bool $selfBilled, string $locale = 'en')\u003C\u002Fcode> read them; self-billed originals use \u003Ccode>cancellation_self_billed\u003C\u002Fcode> if defined.\u003C\u002Fli>\n\u003Cli>\u003Ccode>new CorrectionPolicy(…, ?Closure $strategyResolver = null)\u003C\u002Fcode>: a closure \u003Ccode>fn (InvoiceData $original): ?string\u003C\u002Fcode> that chooses the cancellation strategy for a particular original; \u003Ccode>null\u003C\u002Fcode> keeps \u003Ccode>$cancellationStrategy\u003C\u002Fcode>. \u003Ccode>cancellationStrategyFor(InvoiceData $original)\u003C\u002Fcode> applies it; \u003Ccode>Quittio::cancellation()\u003C\u002Fcode> uses it when neither the argument nor \u003Ccode>corrections.cancellation_strategy\u003C\u002Fcode> sets a strategy. The German pack cancels self-billed invoices sent as XRechnung this way by a negative self-billed invoice (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs#cancellations-and-corrections\">Country packs\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>The correction strategy is used by the Managed layer. In the core, correct an invoice by cancelling it and issuing a new one (\u003Ccode>InvoiceBuilder::from($original)-&gt;number(…)\u003C\u002Fcode>), or with a corrected invoice (\u003Ccode>correction()\u003C\u002Fcode>, below).\u003C\u002Fli>\n\u003Cli>The titles \u003Ccode>correction\u003C\u002Fcode> and \u003Ccode>price_reduction\u003C\u002Fcode> title the documents of \u003Ccode>correction()\u003C\u002Fcode> and \u003Ccode>priceReduction()\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"corrected-invoices\">Corrected invoices\u003Ca class=\"q-doc-anchor\" href=\"#corrected-invoices\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>correction(InvoiceData $original, string $number, ?string $reason = null, ?Date $issueDate = null, ?string $title = null): InvoiceBuilder\u003C\u002Fcode> (core instance and Laravel facade) starts a corrected invoice (type code 384) that replaces the original:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">correction\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0050'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">reason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Wrong hourly rate'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">removeLine\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'1'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    ->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">line\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Web development'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">netPrice\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'90.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">quantity\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">24\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">unit\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">UnitCode\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Hour\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$result \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($builder)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">render\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>It is a copy of the original with the new number and issue date, type code 384, the reference to the original (BG-3) and the note &quot;Diese Rechnung berichtigt und ersetzt die Rechnung RE-2026-0042 vom 03.10.2026.&quot; (&quot;This invoice corrects and replaces invoice … of …&quot;, subject \u003Ccode>AAI\u003C\u002Fcode>, label \u003Ccode>correction_note\u003C\u002Fcode>) plus the reason. With this note the corrected invoice refers to the original specifically and unambiguously (section 31 (5) UStDV, section 15.2a (7) UStAE). Correcting a corrected invoice replaces its earlier note.\u003C\u002Fli>\n\u003Cli>Change what was wrong on the builder. The title comes from the policy (\u003Ccode>correction\u003C\u002Fcode>, Germany: &quot;Rechnungskorrektur&quot;).\u003C\u002Fli>\n\u003Cli>Credit notes and self-billed documents cannot be corrected this way (\u003Ccode>InvalidArgumentException\u003C\u002Fcode>): cancel them and issue a new document.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Correction::of(InvoiceData $original, string $number, ?string $reason = null, ?Date $issueDate = null, ?string $locale = null, ?string $title = null, ?CorrectionPolicy $policy = null)\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Corrections\\Correction\u003C\u002Fcode>) does the same without a \u003Ccode>Quittio\u003C\u002Fcode> instance.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Cancelling the original and issuing a new invoice stays the safer default: a receiving system that does not read type code 384 as replacement books both invoices, and the buyer deducts the VAT twice.\u003C\u002Fp>\n\u003Ch3 id=\"price-reductions\">Price reductions\u003Ca class=\"q-doc-anchor\" href=\"#price-reductions\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>A price reduction (German &quot;Entgeltminderung&quot;) reduces the consideration of a correct invoice afterwards: a cash discount (Skonto) taken, a reduction after a complaint about defects, a bonus (section 17 UStG). The invoice is not corrected; in Germany such a document is not even required, except for section 17 (4) UStG, and it need not be an e-invoice (section 14.11 (4), 17.1 (3a) UStAE). A cash discount taken may simply be booked with the payment.\u003C\u002Fp>\n\u003Cp>\u003Ccode>priceReduction(InvoiceData $original, string $number, PriceReductionReason $reason, $percent = null, $amount = null, ?array $amounts = null, ?Date $issueDate = null, ?string $title = null): InvoiceBuilder\u003C\u002Fcode> builds such a document:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Corrections\\PriceReductionReason\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F 2 % cash discount taken, on every VAT group of the invoice\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">priceReduction\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM-2026-0001'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PriceReductionReason\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">CashDiscount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">percent\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F 100.00 net after a complaint, on an invoice with one VAT group\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">priceReduction\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM-2026-0002'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PriceReductionReason\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Defect\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">amount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'100.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#8B949E\">\u002F\u002F per VAT group, keyed \"category:rate\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $quittio\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">priceReduction\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($original, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EM-2026-0003'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">PriceReductionReason\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Bonus\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">amounts\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'S:19'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '50.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'S:7'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '5.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>Give exactly one of \u003Ccode>percent\u003C\u002Fcode>, \u003Ccode>amount\u003C\u002Fcode> (only for an original with one VAT group) and \u003Ccode>amounts\u003C\u002Fcode>. A reduction must be greater than zero and at most the taxable amount of its group; an unknown group throws.\u003C\u002Fli>\n\u003Cli>The document is a credit note (381, positive amounts) with one line &quot;Minderung des Entgelts&quot; per reduced VAT group, with the VAT of that group's first line (preset, exemption reason), the reference to the original (BG-3) and the meta flag \u003Ccode>price_reduction\u003C\u002Fcode> (\u003Ccode>Meta::FLAG_PRICE_REDUCTION\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>The note names reason, net amount and VAT per rate: &quot;Minderung des Entgelts zur Rechnung RE-2026-0042 vom 03.10.2026 wegen in Anspruch genommenen Skontos (2 %). Minderung Entgelt 50,00 €, Umsatzsteuer 19 %: 9,50 €.&quot; The reasons (\u003Ccode>PriceReductionReason\u003C\u002Fcode>): \u003Ccode>CashDiscount\u003C\u002Fcode>, \u003Ccode>Defect\u003C\u002Fcode>, \u003Ccode>Bonus\u003C\u002Fcode>, \u003Ccode>Other\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>Payment terms: for a cash discount &quot;Die Minderung wurde bei der Zahlung bereits einbehalten.&quot;, otherwise the text of a cancellation.\u003C\u002Fli>\n\u003Cli>The title comes from the policy (\u003Ccode>price_reduction\u003C\u002Fcode>, Germany: &quot;Entgeltminderung&quot;); without one, the label \u003Ccode>price_reduction_title\u003C\u002Fcode>. It is deliberately neither &quot;Rechnungskorrektur&quot; nor &quot;Gutschrift&quot;.\u003C\u002Fli>\n\u003Cli>Credit notes, self-billed documents and uncalculated invoices cannot be reduced (\u003Ccode>InvalidArgumentException\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>\u003Ccode>PriceReduction::of(…)\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Corrections\\PriceReduction\u003C\u002Fcode>) does the same without a \u003Ccode>Quittio\u003C\u002Fcode> instance.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>An annual bonus over several invoices (section 17 (4) UStG) is documented by a bonus statement (\u003Ca href=\"\u002Fdocs\u002Fdocuments#bonus-statements\">Documents: Bonus statements\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"extensions\">Extensions\u003Ca class=\"q-doc-anchor\" href=\"#extensions\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Profile EXTENDED of ZUGFeRD\u002FFactur-X carries more data than EN 16931, e.g. further parties, delivery terms or instalments (\u003Ca href=\"\u002Fdocs\u002Fconcepts#profiles\">Profiles\u003C\u002Fa>). Add it with \u003Ccode>extended(ExtendedData $extended)\u003C\u002Fcode> and, for lines, \u003Ccode>LineBuilder::extended(LineExtendedData $extended)\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>The data is written to CII in profile EXTENDED only.\u003C\u002Fli>\n\u003Cli>When you use it, the automatic choice switches ZUGFeRD and CII to EXTENDED. Other profiles report \u003Ccode>QUITTIO-PROFILE-EXTENDED-ONLY\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>ExtendedData\u003C\u002Fcode> (\u003Ccode>Quittio\\Core\\Data\\Extensions\u003C\u002Fcode>)\u003C\u002Fth>\n\u003Cth>Written as\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>invoicer\u003C\u002Fcode>, \u003Ccode>invoicee\u003C\u002Fcode> (\u003Ccode>ExtendedParty\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">\u003Ccode>InvoicerTradeParty\u003C\u002Fcode>, \u003Ccode>InvoiceeTradeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>ultimateCustomer\u003C\u002Fcode> (\u003Ccode>ExtendedParty\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">\u003Ccode>ProductEndUserTradeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>shipFrom\u003C\u002Fcode> (\u003Ccode>ExtendedParty\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">\u003Ccode>ShipFromTradeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>deliveryTermsCode\u003C\u002Fcode> (string, e.g. an Incoterms code of the international delivery terms such as \u003Ccode>FCA\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">\u003Ccode>ApplicableTradeDeliveryTerms\u002FDeliveryTypeCode\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>additionalReferences\u003C\u002Fcode> (list of \u003Ccode>DocumentReference\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">\u003Ccode>AdditionalReferencedDocument\u003C\u002Fcode> with type code (default 916), name and date\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>installments\u003C\u002Fcode> (list of \u003Ccode>Installment(Date $dueDate, ?Money $amount = null, ?string $description = null)\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">one payment terms group per instalment with due date and partial amount\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>additionalPaymentInstructions\u003C\u002Fcode> (list of \u003Ccode>PaymentInstructions\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">further payment means\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>\u003Ccode>LineExtendedData\u003C\u002Fcode>\u003C\u002Fth>\n\u003Cth>Written as\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>lineStatusReasonCode\u003C\u002Fcode> (\u003Ccode>LineExtendedData::STATUS_DETAIL\u003C\u002Fcode>, \u003Ccode>STATUS_GROUP\u003C\u002Fcode>, \u003Ccode>STATUS_INFORMATION\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">Line status; default \u003Ccode>GROUP\u003C\u002Fcode> for lines with sub lines and \u003Ccode>DETAIL\u003C\u002Fcode> for sub lines\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>shipTo\u003C\u002Fcode> (\u003Ccode>ExtendedParty\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">Ship-to party of the line\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>deliveryDate\u003C\u002Fcode> (\u003Ccode>Date\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">Delivery date of the line\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>includedProducts\u003C\u002Fcode> (list of \u003Ccode>IncludedProduct(string $name, ?BigDecimal $quantity = null, UnitCode|RawCode|null $unit = null, ?string $description = null, ?string $sellerId = null)\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003Ctd data-label=\"Written as\">Included products\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Ccode>ExtendedParty(string $name, ?Address $address = null, array $identifiers = [], ?string $vatId = null, ?Contact $contact = null)\u003C\u002Fcode> describes a further party.\u003C\u002Fp>\n\u003Cp>A line \u003Ccode>DocumentReference(string $id, string $kind = DocumentReference::TYPE_OTHER, ?string $lineId = null, ?Date $issueDate = null, ?RawCode $typeCode = null, ?string $description = null)\u003C\u002Fcode> is added with \u003Ccode>LineBuilder::reference()\u003C\u002Fcode>. It is written by its kind: \u003Ccode>TYPE_ORDER\u003C\u002Fcode>, \u003Ccode>TYPE_CONTRACT\u003C\u002Fcode>, \u003Ccode>TYPE_DESPATCH_ADVICE\u003C\u002Fcode>, \u003Ccode>TYPE_RECEIVING_ADVICE\u003C\u002Fcode> or \u003Ccode>TYPE_OTHER\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Extensions\\ExtendedData\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Extensions\\ExtendedParty\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Extensions\\Installment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Data\\Party\\Address\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Support\\Amount\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Support\\Date\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">extended\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> ExtendedData\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FFA657\">    ultimateCustomer\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> ExtendedParty\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Endkunde GmbH'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Address\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">make\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Weg 2'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'12345'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Musterstadt'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'DE'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)),\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FFA657\">    deliveryTermsCode\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'FCA'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FFA657\">    installments\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Installment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Date\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">parse\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-11-01'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">), \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Amount\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">of\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'500.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EUR'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)),\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Installment\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Date\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">parse\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-12-01'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">), \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Amount\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">of\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'690.00'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'EUR'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)),\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    ],\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch3 id=\"xrechnung-extension\">XRechnung extension\u003Ca class=\"q-doc-anchor\" href=\"#xrechnung-extension\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>The XRechnung extension is a profile of XRechnung with additional fields, such as sub lines and third party payments. \u003Ccode>xrechnungExtension(XRechnungExtensionData $extension)\u003C\u002Fcode> adds third party payments (BG-DEX-09): \u003Ccode>new XRechnungExtensionData([new ThirdPartyPayment(string $type, Money $amount, string $description)])\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Third party payments are added to the amount due (BR-DEX-09).\u003C\u002Fli>\n\u003Cli>They can only be transmitted in an XRechnung UBL invoice with profile \u003Ccode>xrechnung-extension\u003C\u002Fcode> (UBL \u003Ccode>cac:PrepaidPayment\u003C\u002Fcode>). CII, credit notes and other profiles fail with \u003Ccode>QUITTIO-THIRD-PARTY-PAYMENTS\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"macros\">Macros\u003Ca class=\"q-doc-anchor\" href=\"#macros\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>InvoiceBuilder\u003C\u002Fcode> and \u003Ccode>LineBuilder\u003C\u002Fcode> are macroable, so you can add your own methods:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>InvoiceBuilder::macro(string $name, callable $macro)\u003C\u002Fcode> adds a method; \u003Ccode>hasMacro(string $name)\u003C\u002Fcode> and \u003Ccode>flushMacros()\u003C\u002Fcode> inspect and remove them.\u003C\u002Fli>\n\u003Cli>The closure is bound to the builder, so \u003Ccode>$this\u003C\u002Fcode> and the builder's private properties are available.\u003C\u002Fli>\n\u003Cli>\u003Ccode>InvoiceBuilder\u003C\u002Fcode> can also be extended: \u003Ccode>make()\u003C\u002Fcode>, \u003Ccode>from()\u003C\u002Fcode> and \u003Ccode>fromDocument()\u003C\u002Fcode> return \u003Ccode>static\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Country packs add their helpers this way, e.g. \u003Ccode>smallAmount()\u003C\u002Fcode>, \u003Ccode>selfBilled()\u003C\u002Fcode> and \u003Ccode>deductAdvance()\u003C\u002Fcode> of the German pack (\u003Ca href=\"\u002Fdocs\u002Fcountry-packs#builder-macros\">Builder macros\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Builder\\InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">macro\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'forProject'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">function\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $id, \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">string\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $name)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceBuilder\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> $this\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">projectReference\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($id, $name)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">note\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Project: '\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">.\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">$name);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">});\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$builder\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">forProject\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'P-17'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'Customer portal'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Ch2 id=\"calculation\">Calculation\u003Ca class=\"q-doc-anchor\" href=\"#calculation\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>Quittio\\Core\\Calculation\\En16931Calculator\u003C\u002Fcode> calculates line net amounts, document allowances and charges, the VAT breakdown and the totals. Every render, check and prepare run calls it, so data from the builder never needs to be calculated by hand. To calculate without rendering, call it directly or use \u003Ccode>prepare()\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Fformats#rendering-in-the-core\">Formats and profiles\u003C\u002Fa>):\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Calculation\\En16931Calculator\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$calculated \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> (\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> En16931Calculator\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">calculate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($invoice);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$calculated\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">isCalculated\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">();                       \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F true\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$calculated\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">totals\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">amountDue;                    \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F Brick\\Money\\Money\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$calculated\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">vatBreakdown[\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">0\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">taxAmount;\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>Amounts are rounded half up to two decimals, only at the points listed below. VAT is calculated per VAT group (category and rate), never per line (BR-CO-17). Calculating calculated data again gives the same result.\u003C\u002Fp>\n\u003Ch3 id=\"line-amounts\">Line amounts\u003Ca class=\"q-doc-anchor\" href=\"#line-amounts\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Step\u003C\u002Fth>\n\u003Cth>Formula\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Net price BT-146\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">as given; otherwise list price BT-148 − price discount BT-147\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Line amount before allowances and charges B\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">round2(quantity BT-129 × net price BT-146 \u002F base quantity BT-149), the base quantity only if it is set and not 0 or 1\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Line allowance BT-136\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">as given; otherwise round2((base BT-137, default B) × percentage BT-138 \u002F 100)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Line charge BT-141\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">as given; otherwise round2((base BT-142, default B) × percentage BT-143 \u002F 100)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Line net amount BT-131\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">B − Σ line allowances + Σ line charges\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>A line with sub lines and without its own price takes the sum of the net amounts of its sub lines as line amount. The price is derived from it with up to ten decimals.\u003C\u002Fp>\n\u003Cp>\u003Ccode>LineCalculator\u003C\u002Fcode> (\u003Ccode>calculate(InvoiceLine $line, string $currency)\u003C\u002Fcode>) does this per line. Its static helpers are:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>baseAmount($quantity, $netPrice, $baseQuantity)\u003C\u002Fcode>: B;\u003C\u002Fli>\n\u003Cli>\u003Ccode>exactAmount(InvoiceLine $line)\u003C\u002Fcode>: the unrounded line amount that PEPPOL-EN16931-R120 checks;\u003C\u002Fli>\n\u003Cli>\u003Ccode>priceFor($amount, $quantity, $baseQuantity)\u003C\u002Fcode>: the shortest net price, 2 to 10 decimals, for which the line formula yields an amount.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"document-totals-and-vat-breakdown\">Document totals and VAT breakdown\u003Ca class=\"q-doc-anchor\" href=\"#document-totals-and-vat-breakdown\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Step\u003C\u002Fth>\n\u003Cth>Formula\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Document allowance BT-92 \u002F charge BT-99\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">as given; otherwise round2((base BT-93\u002FBT-100, default the line net sum of its VAT group) × percentage \u002F 100)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Taxable amount BT-116 per VAT group\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">Σ line net amounts − Σ allowances + Σ charges of the group\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT amount BT-117 per VAT group\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">round2(BT-116 × rate \u002F 100); 0 for categories Z, E, AE, K, G and O\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Sum of line net amounts BT-106\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">Σ BT-131\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Sum of allowances BT-107, charges BT-108\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">Σ document allowances, Σ document charges (empty if there are none)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Total without VAT BT-109\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">BT-106 − BT-107 + BT-108\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT total BT-110\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">Σ BT-117\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT total in accounting currency BT-111\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">round2(BT-110 × exchange rate), only if BT-6 differs from BT-5\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Total with VAT BT-112\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">BT-109 + BT-110\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Amount due BT-115\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">BT-112 − BT-113 + BT-114, plus third party payments of the XRechnung extension\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Due date BT-9\u003C\u002Ftd>\n\u003Ctd data-label=\"Formula\">issue date + \u003Ccode>dueInDays()\u003C\u002Fcode> if no due date is set\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The VAT groups appear in the breakdown in the order of their first line. A document allowance or charge for a group without lines adds its own group. A rounding amount of 0 is left out.\u003C\u002Fp>\n\u003Ch3 id=\"gross-price-conversion\">Gross price conversion\u003Ca class=\"q-doc-anchor\" href=\"#gross-price-conversion\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>GrossPriceConverter\u003C\u002Fcode> applies when a line has a price including VAT (\u003Ccode>priceInclVat()\u003C\u002Fcode>, \u003Ca href=\"#gross-price-mode\">Gross price mode\u003C\u002Fa>). Per VAT group:\u003C\u002Fp>\n\u003Col>\n\u003Cli>G = Σ g_i with g_i = round2(quantity × price including VAT).\u003C\u002Fli>\n\u003Cli>N = round2(G \u002F (1 + rate \u002F 100)), the taxable amount.\u003C\u002Fli>\n\u003Cli>T = round2(N × rate \u002F 100), the VAT (BR-CO-17).\u003C\u002Fli>\n\u003Cli>Every line gets n_i = round2(g_i \u002F (1 + rate \u002F 100)); the cents N − Σ n_i go to the lines with the largest rounding remainders. A line keeps the sign of its gross amount (returns and vouchers stay negative). A cent never moves a line to zero or across zero while another line can take it. Net prices are derived with the precision needed for the line formula to yield n_i.\u003C\u002Fli>\n\u003Cli>G − (N + T) of all groups becomes the rounding amount BT-114, so that the amount due equals the gross amount the customer saw.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Example: 3 × 9.99 including 19 % gives G = 29.97, N = 25.18, T = 4.78, net price 8.393, BT-114 = 0.01 and an amount due of 29.97. \u003Ccode>GrossPriceConverter::netOf(BigDecimal $gross, BigDecimal $rate)\u003C\u002Fcode> is step 2.\u003C\u002Fp>\n\u003Ch3 id=\"discount-splitting\">Discount splitting\u003Ca class=\"q-doc-anchor\" href=\"#discount-splitting\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>AllowanceSplitter::splitAllowance(array $lines, string $currency, ?BigDecimal $percent, ?Money $amount, ?string $reason = null, AllowanceReasonCode|RawCode|null $reasonCode = null): list&lt;DocumentAllowance&gt;\u003C\u002Fcode> implements \u003Ccode>discountPercent()\u003C\u002Fcode> and \u003Ccode>discountAmount()\u003C\u002Fcode>. The discount (the amount, or round2(line sum × percentage \u002F 100)) is distributed over the VAT groups in proportion to their signed line sums with \u003Ccode>LargestRemainder::distribute(BigDecimal $total, array $weights, int $scale = 2)\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>\u003Ccode>LargestRemainder::distribute()\u003C\u002Fcode> floors every part and gives the remaining cents to the parts with the largest remainders (ties in the order of the weights). It returns parts that add up exactly to the total. Weights that are all zero share equally; weights that add up to zero throw a \u003Ccode>CalculationException\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Example: a discount of 10.00 on 100.00 at 19 % and 50.00 at 7 % becomes 6.67 and 3.33.\u003C\u002Fp>\n\u003Ch3 id=\"declared-amounts\">Declared amounts\u003Ca class=\"q-doc-anchor\" href=\"#declared-amounts\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Data that Quittio did not calculate itself can carry amounts that another system rounded differently, e.g. line net amounts rounded per line or a VAT amount within the tolerance of BR-CO-17. Recalculating such data would change amounts that were already issued, and a cancellation would no longer reverse the original exactly. Quittio therefore keeps these declared amounts in two cases:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>InvoiceBuilder::from($data)\u003C\u002Fcode> with data whose line net amounts or VAT breakdown the recalculation does not reproduce exactly (e.g. an invoice read from XML), as long as no amount-relevant input changes: lines, document allowances and charges, discounts and the currency. Changing a line, adding one or calling \u003Ccode>allowance()\u003C\u002Fcode> recalculates everything.\u003C\u002Fli>\n\u003Cli>Cancellations of such data (\u003Ca href=\"#cancellations-and-corrections\">Cancellations and corrections\u003C\u002Fa>).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The builder then sets \u003Ccode>Meta::FLAG_DECLARED_AMOUNTS\u003C\u002Fcode> with a fingerprint of the amount inputs (\u003Ccode>DeclaredAmounts::fingerprint()\u003C\u002Fcode>, an xxh128 hash over identifiers, quantities, prices, VAT groups, allowances, charges, net amounts, VAT breakdown and currency). The calculator keeps a declared amount within these tolerances:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Declared amount\u003C\u002Fth>\n\u003Cth>Kept if\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>Line net amount BT-131\u003C\u002Ftd>\n\u003Ctd data-label=\"Kept if\">within 0.02 of the unrounded line formula (\u003Ccode>DeclaredAmounts::LINE_TOLERANCE\u003C\u002Fcode>, as PEPPOL-EN16931-R120 tolerates it); a parent line may also state the sum of its sub lines\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT amount BT-117\u003C\u002Ftd>\n\u003Ctd data-label=\"Kept if\">less than one currency unit from the recalculation (BR-CO-17); 0 for categories without VAT\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>VAT total in accounting currency BT-111\u003C\u002Ftd>\n\u003Ctd data-label=\"Kept if\">within 0.01 (\u003Ccode>DeclaredAmounts::TAX_CURRENCY_TOLERANCE\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cul>\n\u003Cli>Amounts beyond these tolerances are recalculated, and the data gets \u003Ccode>Meta::FLAG_DECLARED_AMOUNTS_RECALCULATED\u003C\u002Fcode>. The validation reports it as \u003Ccode>QUITTIO-DECLARED-AMOUNTS\u003C\u002Fcode> (the document may not reverse the original exactly).\u003C\u002Fli>\n\u003Cli>Data whose amount inputs no longer match the fingerprint, e.g. changed with \u003Ccode>with()\u003C\u002Fcode> or edited in stored JSON, is recalculated completely.\u003C\u002Fli>\n\u003Cli>Data calculated by Quittio never needs declared amounts. The calculator also writes a fingerprint to every result, so \u003Ccode>from()\u003C\u002Fcode>, cancellations and the calculator never keep amounts that were changed afterwards.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The calculation policy decides what happens with declared amounts (\u003Ccode>calculation.declared_amounts\u003C\u002Fcode> in Laravel, \u003Ccode>calculation.declared_amounts\u003C\u002Fcode> in \u003Ccode>Quittio::create()\u003C\u002Fcode>, or \u003Ccode>new En16931Calculator(policy: new CalculationPolicy(DeclaredAmountsMode::Recalculate))\u003C\u002Fcode>):\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Mode\u003C\u002Fth>\n\u003Cth>Declared amounts\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>keep\u003C\u002Fcode> (default)\u003C\u002Ftd>\n\u003Ctd data-label=\"Declared amounts\">kept within the tolerances above\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>recalculate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Declared amounts\">always recalculated, reported as \u003Ccode>QUITTIO-DECLARED-AMOUNTS\u003C\u002Fcode>; the aligned VAT of partial cancellations is kept\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>reject\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Declared amounts\">kept within the tolerances, otherwise a \u003Ccode>CalculationException\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The policy belongs to the run, not to the data: the same stored invoice gives other amounts under another policy. \u003Ccode>InvoiceBuilder::from()\u003C\u002Fcode> compares the declared amounts with the default calculator; \u003Ccode>Quittio::edit()\u003C\u002Fcode> and cancellations use the calculator of the instance.\u003C\u002Fp>\n\u003Cp>The helpers are public: \u003Ccode>DeclaredAmounts::needed(InvoiceData $data)\u003C\u002Fcode> (the recalculation does not reproduce the declared amounts), \u003Ccode>isStale()\u003C\u002Fcode> (changed after the amounts were calculated or declared), \u003Ccode>isTrusted()\u003C\u002Fcode> (flagged and fingerprint matches), \u003Ccode>hasAmounts()\u003C\u002Fcode> and \u003Ccode>breakdownKey(VatCategory $category, ?BigDecimal $rate)\u003C\u002Fcode> (VAT group key, e.g. \u003Ccode>S|19.00\u003C\u002Fcode>).\u003C\u002Fp>\n\u003Cp>Data read from XML has no exchange rate. \u003Ccode>InvoiceData::withImpliedExchangeRate()\u003C\u002Fcode> returns a copy with the rate BT-111 \u002F BT-110 (ten decimals). \u003Ccode>from()\u003C\u002Fcode> takes it over, so that the recalculation reproduces BT-111. It drops the rate once amounts or the VAT accounting currency change, because the rate is only as precise as the declared amounts. Set the rate with \u003Ccode>exchangeRate()\u003C\u002Fcode> then, otherwise the validation fails with BR-53.\u003C\u002Fp>\n\u003Ch2 id=\"data-model\">Data model\u003Ca class=\"q-doc-anchor\" href=\"#data-model\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>Quittio\\Core\\Data\\InvoiceData\u003C\u002Fcode> is the root of the model. It is a superset of EN 16931 (versions 2017 and 2026) with the extensions of profile EXTENDED and the XRechnung extension. All data classes are \u003Ccode>final readonly\u003C\u002Fcode> with promoted constructor properties. The \u003Ca href=\"\u002Fdocs\u002Ffield-reference\">field reference\u003C\u002Fa> lists every field with business term, cardinality, profile level and XML paths.\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Property\u003C\u002Fth>\n\u003Cth>Type\u003C\u002Fth>\n\u003Cth>BT\u003C\u002Fth>\n\u003Cth>Set with\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>number\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>string\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-1\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>number()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>issueDate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>Date\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-2\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>issueDate()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>typeCode\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>InvoiceTypeCode|RawCode\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-3\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>type()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>currency\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>string\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-5\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>currency()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>seller\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>SellerParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-4\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>seller()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyer\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>BuyerParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-7\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>buyer()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>lines\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;InvoiceLine&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-25\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>line()\u003C\u002Fcode>, \u003Ccode>lines()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxCurrency\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?string\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-6\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>taxCurrency()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>taxPointDate\u003C\u002Fcode>, \u003Ccode>taxPointDateCode\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Date\u003C\u002Fcode>, \u003Ccode>TaxPointDateCode|RawCode|null\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-7, BT-8\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>taxPointDate()\u003C\u002Fcode>, \u003Ccode>taxPointDateCode()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>dueDate\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Date\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-9\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>dueDate()\u003C\u002Fcode>, calculator\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>buyerReference\u003C\u002Fcode>, \u003Ccode>projectReference\u003C\u002Fcode>, \u003Ccode>contractReference\u003C\u002Fcode>, \u003Ccode>purchaseOrderReference\u003C\u002Fcode>, \u003Ccode>salesOrderReference\u003C\u002Fcode>, \u003Ccode>receivingAdviceReference\u003C\u002Fcode>, \u003Ccode>despatchAdviceReference\u003C\u002Fcode>, \u003Ccode>tenderReference\u003C\u002Fcode>, \u003Ccode>invoicedObject\u003C\u002Fcode>, \u003Ccode>buyerAccountingReference\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?string\u003C\u002Fcode>, \u003Ccode>?ProjectReference\u003C\u002Fcode>, \u003Ccode>?Identifier\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-10 to BT-19\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ca href=\"#references\">References\u003C\u002Fa>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>paymentTerms\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?PaymentTerms\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-20\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>paymentTerms()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>notes\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;Note&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-1\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>note()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>businessProcess\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?string\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BT-23\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>businessProcess()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>precedingInvoices\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;PrecedingInvoiceReference&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-3\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>precedingInvoice()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>payee\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?PayeeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-10\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>payee()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>sellerTaxRepresentative\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?TaxRepresentativeParty\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-11\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>taxRepresentative()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>delivery\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Delivery\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-13\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>deliveryDate()\u003C\u002Fcode>, \u003Ccode>deliverTo()\u003C\u002Fcode>, \u003Ccode>delivery()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>invoicingPeriod\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Period\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-14\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>invoicingPeriod()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>paymentInstructions\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?PaymentInstructions\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-16\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>payment()\u003C\u002Fcode>, \u003Ccode>creditTransfer()\u003C\u002Fcode>, \u003Ccode>paymentCard()\u003C\u002Fcode>, \u003Ccode>directDebit()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>allowances\u003C\u002Fcode>, \u003Ccode>charges\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;DocumentAllowance&gt;\u003C\u002Fcode>, \u003Ccode>list&lt;DocumentCharge&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-20, BG-21\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>allowance()\u003C\u002Fcode>, \u003Ccode>charge()\u003C\u002Fcode>, \u003Ccode>discountPercent()\u003C\u002Fcode>, \u003Ccode>discountAmount()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>totals\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Totals\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-22\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">calculator\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>vatBreakdown\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;VatBreakdown&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-23\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">calculator\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>attachments\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>list&lt;Attachment&gt;\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">BG-24\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>attachment()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prepaidAmount\u003C\u002Fcode>, \u003Ccode>roundingAmount\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Money\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">input for BT-113, BT-114\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>prepaid()\u003C\u002Fcode>, \u003Ccode>addPrepaid()\u003C\u002Fcode>, \u003Ccode>rounding()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>extended\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?ExtendedData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">profile EXTENDED\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>extended()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>xrechnungExtension\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?XRechnungExtensionData\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">XRechnung extension\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>xrechnungExtension()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>presentation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>?Presentation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">PDF and HTML only\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>presentation()\u003C\u002Fcode>, \u003Ccode>group()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>meta\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>Meta\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">internal\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>locale()\u003C\u002Fcode>, \u003Ccode>timezone()\u003C\u002Fcode>, \u003Ccode>custom()\u003C\u002Fcode>, \u003Ccode>source()\u003C\u002Fcode>, \u003Ccode>flag()\u003C\u002Fcode>, \u003Ccode>exchangeRate()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>standardVersion\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Type\">\u003Ccode>StandardVersion\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"BT\">internal\u003C\u002Ftd>\n\u003Ctd data-label=\"Set with\">\u003Ccode>standard()\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>The parts live in sub namespaces of \u003Ccode>Quittio\\Core\\Data\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Ctable class=\"q-doc-table q-stack-table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Namespace\u003C\u002Fth>\n\u003Cth>Classes\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Party\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>SellerParty\u003C\u002Fcode>, \u003Ccode>BuyerParty\u003C\u002Fcode>, \u003Ccode>PayeeParty\u003C\u002Fcode>, \u003Ccode>TaxRepresentativeParty\u003C\u002Fcode>, \u003Ccode>Address\u003C\u002Fcode>, \u003Ccode>Contact\u003C\u002Fcode>, \u003Ccode>ElectronicAddress\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Lines\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>InvoiceLine\u003C\u002Fcode>, \u003Ccode>Item\u003C\u002Fcode>, \u003Ccode>Price\u003C\u002Fcode>, \u003Ccode>LineVat\u003C\u002Fcode>, \u003Ccode>Classification\u003C\u002Fcode>, \u003Ccode>ItemAttribute\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>AllowanceCharge\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>DocumentAllowance\u003C\u002Fcode>, \u003Ccode>DocumentCharge\u003C\u002Fcode> (base \u003Ccode>DocumentAllowanceCharge\u003C\u002Fcode>), \u003Ccode>LineAllowance\u003C\u002Fcode>, \u003Ccode>LineCharge\u003C\u002Fcode> (base \u003Ccode>LineAllowanceCharge\u003C\u002Fcode>)\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Payment\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>PaymentInstructions\u003C\u002Fcode>, \u003Ccode>CreditTransfer\u003C\u002Fcode>, \u003Ccode>PaymentCard\u003C\u002Fcode>, \u003Ccode>DirectDebit\u003C\u002Fcode>, \u003Ccode>PaymentTerms\u003C\u002Fcode>, \u003Ccode>CashDiscount\u003C\u002Fcode>, \u003Ccode>PenaltyTerms\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Delivery\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>Delivery\u003C\u002Fcode>, \u003Ccode>Period\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>References\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>PrecedingInvoiceReference\u003C\u002Fcode>, \u003Ccode>ProjectReference\u003C\u002Fcode>, \u003Ccode>DocumentReference\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Totals\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>Totals\u003C\u002Fcode>, \u003Ccode>VatBreakdown\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Attachments\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>Attachment\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Extensions\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>ExtendedData\u003C\u002Fcode>, \u003Ccode>ExtendedParty\u003C\u002Fcode>, \u003Ccode>Installment\u003C\u002Fcode>, \u003Ccode>IncludedProduct\u003C\u002Fcode>, \u003Ccode>LineExtendedData\u003C\u002Fcode>, \u003Ccode>XRechnungExtensionData\u003C\u002Fcode>, \u003Ccode>ThirdPartyPayment\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>Presentation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>Presentation\u003C\u002Fcode>, \u003Ccode>Colors\u003C\u002Fcode>, \u003Ccode>LineGroup\u003C\u002Fcode>, \u003Ccode>LinePresentation\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>(root)\u003C\u002Ftd>\n\u003Ctd data-label=\"Classes\">\u003Ccode>InvoiceData\u003C\u002Fcode>, \u003Ccode>Identifier\u003C\u002Fcode>, \u003Ccode>Note\u003C\u002Fcode>, \u003Ccode>Meta\u003C\u002Fcode>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>\u003Ccode>Totals\u003C\u002Fcode> has \u003Ccode>lineNetSum\u003C\u002Fcode> (BT-106), \u003Ccode>allowanceSum\u003C\u002Fcode> (BT-107), \u003Ccode>chargeSum\u003C\u002Fcode> (BT-108), \u003Ccode>netTotal\u003C\u002Fcode> (BT-109), \u003Ccode>vatTotal\u003C\u002Fcode> (BT-110), \u003Ccode>vatTotalInTaxCurrency\u003C\u002Fcode> (BT-111), \u003Ccode>grossTotal\u003C\u002Fcode> (BT-112), \u003Ccode>prepaidAmount\u003C\u002Fcode> (BT-113), \u003Ccode>roundingAmount\u003C\u002Fcode> (BT-114) and \u003Ccode>amountDue\u003C\u002Fcode> (BT-115), all \u003Ccode>Brick\\Money\\Money\u003C\u002Fcode>. A \u003Ccode>VatBreakdown\u003C\u002Fcode> has \u003Ccode>taxableAmount\u003C\u002Fcode> (BT-116), \u003Ccode>taxAmount\u003C\u002Fcode> (BT-117), \u003Ccode>category\u003C\u002Fcode> (BT-118), \u003Ccode>rate\u003C\u002Fcode> (BT-119), \u003Ccode>exemptionReason\u003C\u002Fcode> (BT-120) and \u003Ccode>exemptionReasonCode\u003C\u002Fcode> (BT-121).\u003C\u002Fp>\n\u003Cp>Types: amounts are \u003Ccode>Money\u003C\u002Fcode> with two decimals; prices, quantities and rates are \u003Ccode>Brick\\Math\\BigDecimal\u003C\u002Fcode>; dates are \u003Ccode>Quittio\\Core\\Support\\Date\u003C\u002Fcode> (\u003Ccode>toIsoString()\u003C\u002Fcode>, \u003Ccode>format()\u003C\u002Fcode>, \u003Ccode>addDays()\u003C\u002Fcode>, \u003Ccode>toCarbon()\u003C\u002Fcode>, \u003Ccode>isBefore()\u003C\u002Fcode> …).\u003C\u002Fp>\n\u003Ch3 id=\"immutability\">Immutability\u003Ca class=\"q-doc-anchor\" href=\"#immutability\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Data objects never change. \u003Ccode>with(array $changes)\u003C\u002Fcode> returns a copy with the named properties replaced; an unknown property throws an \u003Ccode>InvalidArgumentException\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$copy \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'buyerReference'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '04011000-12345-03'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$copy \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">withNumber\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'RE-2026-0043'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">withIssueDate\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">Date\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">parse\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'2026-10-05'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">));\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$line \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">lines[\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">0\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">with\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">'note'\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> =>\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> 'Delivered in two parts'\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>with()\u003C\u002Fcode> does not recalculate anything and checks nothing. For changes of amounts, prefer \u003Ccode>InvoiceBuilder::from()\u003C\u002Fcode>, so that allowances and discounts follow the lines (\u003Ca href=\"#changing-existing-data\">Changing existing data\u003C\u002Fa>). Changing amount inputs of calculated data with \u003Ccode>with()\u003C\u002Fcode> makes its amounts stale: the next calculation recalculates them (\u003Ca href=\"#declared-amounts\">Declared amounts\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>Helpers of \u003Ccode>InvoiceData\u003C\u002Fcode>: \u003Ccode>isCalculated()\u003C\u002Fcode> (totals present), \u003Ccode>typeCodeValue()\u003C\u002Fcode> (BT-3 as string), \u003Ccode>isCreditNote()\u003C\u002Fcode>, \u003Ccode>allLines()\u003C\u002Fcode> (all lines including sub lines, depth first), \u003Ccode>withImpliedExchangeRate()\u003C\u002Fcode> and \u003Ccode>InvoiceData::factory()\u003C\u002Fcode> for test data (\u003Ca href=\"\u002Fdocs\u002Ftesting\">Testing\u003C\u002Fa>).\u003C\u002Fp>\n\u003Cp>Helpers of the parts: \u003Ccode>InvoiceLine::withNetPrice()\u003C\u002Fcode>, \u003Ccode>withPriceInclVat()\u003C\u002Fcode>, \u003Ccode>hasSubLines()\u003C\u002Fcode>, \u003Ccode>Price::isGrossMode()\u003C\u002Fcode>, \u003Ccode>LineVat::groupKey()\u003C\u002Fcode>, \u003Ccode>DocumentAllowanceCharge::isCharge()\u003C\u002Fcode> and \u003Ccode>reasonCodeValue()\u003C\u002Fcode>, \u003Ccode>PaymentInstructions::primaryCreditTransfer()\u003C\u002Fcode>, \u003Ccode>CreditTransfer::isIban()\u003C\u002Fcode>, \u003Ccode>PaymentTerms::isEmpty()\u003C\u002Fcode>, \u003Ccode>Period::isValid()\u003C\u002Fcode>, \u003Ccode>Attachment::size()\u003C\u002Fcode>, \u003Ccode>Identifier::schemeValue()\u003C\u002Fcode>, \u003Ccode>Meta::hasFlag()\u003C\u002Fcode>, \u003Ccode>Presentation::isExplicit()\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3 id=\"arrays-and-json\">Arrays and JSON\u003Ca class=\"q-doc-anchor\" href=\"#arrays-and-json\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ccode>InvoiceData::toArray()\u003C\u002Fcode>, \u003Ccode>toJson(int $flags = 0)\u003C\u002Fcode>, \u003Ccode>InvoiceData::fromArray(array $data)\u003C\u002Fcode> and \u003Ccode>InvoiceData::fromJson(string $json)\u003C\u002Fcode> convert the model losslessly, including totals, presentation and metadata:\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$json \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $invoice\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">->\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">toJson\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">JSON_PRETTY_PRINT\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">);\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">$same \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> InvoiceData\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">fromJson\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">($json);\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>json\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"number\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"RE-1\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"issueDate\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"2026-10-03\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"typeCode\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"380\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"currency\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"EUR\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"seller\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Muster GmbH\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"address\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: { \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"countryCode\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"DE\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"line1\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Hauptstraße 1\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"city\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Musterstadt\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"postcode\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"12345\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"vatId\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"DE123456789\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"buyer\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Kunde AG\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#7EE787\">        \"address\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: { \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"countryCode\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"DE\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"line1\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Bahnhofstraße 5\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"city\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Beispielstadt\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"postcode\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"54321\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#7EE787\">    \"lines\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: [\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#E6EDF3\">        {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"1\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"quantity\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"2\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"unit\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"HUR\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"price\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: { \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"netPrice\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"95.00\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"vat\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: { \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"category\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"S\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"rate\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"19\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:14ch;text-indent:-14ch\">\u003Cspan style=\"color:#7EE787\">            \"item\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: { \u003C\u002Fspan>\u003Cspan style=\"color:#7EE787\">\"name\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Beratung\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#E6EDF3\">        }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    ]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>Keys are the property names. Values equal to the constructor default are left out and restored on the way back.\u003C\u002Fli>\n\u003Cli>Amounts are strings with two decimals and without currency: \u003Ccode>fromArray()\u003C\u002Fcode> uses the invoice currency (BT-5), for BT-111 the VAT accounting currency (BT-6). Decimals are strings, dates \u003Ccode>YYYY-MM-DD\u003C\u002Fcode>, codes their value. The content of attachments is base64 encoded.\u003C\u002Fli>\n\u003Cli>\u003Ccode>fromArray()\u003C\u002Fcode> rejects unknown fields, missing required values, floats and values of the wrong type with a \u003Ccode>Quittio\\Core\\Exceptions\\HydrationException\u003C\u002Fcode> that names the path, e.g. \u003Ccode>lines[0].price.netPrice: Floats are not accepted. Pass monetary values and quantities as strings.\u003C\u002Fcode> A code that is not a case of its enum becomes a \u003Ccode>RawCode\u003C\u002Fcode> where the property allows one.\u003C\u002Fli>\n\u003Cli>\u003Ccode>toJson()\u003C\u002Fcode> always uses \u003Ccode>JSON_THROW_ON_ERROR\u003C\u002Fcode>, \u003Ccode>JSON_UNESCAPED_SLASHES\u003C\u002Fcode> and \u003Ccode>JSON_UNESCAPED_UNICODE\u003C\u002Fcode>; pass further flags such as \u003Ccode>JSON_PRETTY_PRINT\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The JSON Schema (draft 2020-12, \u003Ccode>$id\u003C\u002Fcode> \u003Ccode>https:\u002F\u002Fquittio.dev\u002Fschema\u002Finvoice.schema.json\u003C\u002Fcode>) is shipped in \u003Ccode>packages\u002Fcore\u002Fresources\u002Fschema\u002Finvoice.schema.json\u003C\u002Fcode> (\u003Ccode>JsonSchemaGenerator::defaultPath()\u003C\u002Fcode>). With the optional package \u003Ccode>opis\u002Fjson-schema\u003C\u002Fcode>, \u003Ccode>Quittio\\Core\\Serialization\\JsonSchemaValidator\u003C\u002Fcode> checks input before hydration:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>JsonSchemaValidator::available()\u003C\u002Fcode> tells whether the package is installed.\u003C\u002Fli>\n\u003Cli>\u003Ccode>(new JsonSchemaValidator)-&gt;validate(string $json)\u003C\u002Fcode> returns up to 20 errors as \u003Ccode>path: message\u003C\u002Fcode>, or an empty list if the input is valid. Without the package it throws a \u003Ccode>RuntimeException\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"snapshots\">Snapshots\u003Ca class=\"q-doc-anchor\" href=\"#snapshots\" aria-label=\"Link to this section\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Stored invoices (the Managed layer, queued render jobs) use snapshots. A snapshot is \u003Ccode>toSnapshot()\u003C\u002Fcode>: \u003Ccode>toArray()\u003C\u002Fcode> plus the schema version \u003Ccode>_version\u003C\u002Fcode> (\u003Ccode>InvoiceData::SNAPSHOT_VERSION\u003C\u002Fcode>, currently 1).\u003C\u002Fp>\n\u003Cp>\u003Ccode>InvoiceData::fromSnapshot(array $snapshot, ?SnapshotUpcasterChain $chain = null)\u003C\u002Fcode> brings a snapshot of an older version to the current model before hydrating it; a snapshot without \u003Ccode>_version\u003C\u002Fcode> counts as version 1. Snapshots of issued invoices are never rewritten: upcasters run in memory when a snapshot is read.\u003C\u002Fp>\n\u003Cdiv class=\"q-doc-code\">\u003Cdiv class=\"q-doc-code-bar\">\u003Cspan>php\u003C\u002Fspan>\u003Cbutton type=\"button\" class=\"q-doc-copy\" data-copy aria-label=\"Copy code\">\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\u003Crect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\"\u002F>\u003Cpath d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\u002F>\u003C\u002Fsvg>\u003Cspan>Copy\u003C\u002Fspan>\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Serialization\\Snapshots\\SnapshotUpcaster\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">use\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> Quittio\\Core\\Serialization\\Snapshots\\SnapshotUpcasterChain\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#FF7B72\">final\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> class\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\"> SnapshotV1ToV2\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> implements\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> SnapshotUpcaster\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> function\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\"> from\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">()\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> int\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> 1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">;                                   \u003C\u002Fspan>\u003Cspan style=\"color:#8B949E\">\u002F\u002F reads version 1, produces version 2\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#FF7B72\">    public\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> function\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\"> upcast\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">array\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $snapshot)\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">:\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\"> array\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#8B949E\">        \u002F\u002F rename or convert the fields that changed between the versions\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:10ch;text-indent:-10ch\">\u003Cspan style=\"color:#FF7B72\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> $snapshot;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:6ch;text-indent:-6ch\">\u003Cspan style=\"color:#E6EDF3\">    }\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003C\u002Fspan>\n\u003Cspan class=\"line\" style=\"padding-left:2ch;text-indent:-2ch\">\u003Cspan style=\"color:#79C0FF\">SnapshotUpcasterChain\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">::\u003C\u002Fspan>\u003Cspan style=\"color:#D2A8FF\">useDefault\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> SnapshotUpcasterChain\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">([\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">new\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> SnapshotV1ToV2\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]));\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>\u003Ccode>SnapshotUpcasterChain\u003C\u002Fcode> (\u003Ccode>register(SnapshotUpcaster $upcaster)\u003C\u002Fcode>, \u003Ccode>upcast(array $snapshot, int $from, int $to = InvoiceData::SNAPSHOT_VERSION)\u003C\u002Fcode>) applies one upcaster per version step.\u003C\u002Fli>\n\u003Cli>\u003Ccode>SnapshotUpcasterChain::default()\u003C\u002Fcode> is the shared chain of \u003Ccode>fromSnapshot()\u003C\u002Fcode>; \u003Ccode>useDefault(?SnapshotUpcasterChain $chain)\u003C\u002Fcode> replaces it.\u003C\u002Fli>\n\u003Cli>A snapshot of a newer version than the installed package, an invalid version or a missing upcaster throw a \u003Ccode>SnapshotVersionException\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>The current model is version 1, so no upcaster is needed yet; upcasters matter once a release changes the model. In Laravel, list the upcaster classes in \u003Ccode>snapshots.upcasters\u003C\u002Fcode> (\u003Ca href=\"\u002Fdocs\u002Fconfiguration\">Configuration\u003C\u002Fa>).\u003C\u002Fli>\n\u003C\u002Ful>\n",[111,115,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194,197,200,203,206,209,212,215,218,221,224,227,230,233,236,239,242,245,248,251,254,257,260,263,266,269,272,275,278,281,284],{"id":112,"text":113,"level":114},"overview","Overview",2,{"id":116,"text":117,"level":118},"the-usual-forms","The usual forms",3,{"id":120,"text":121,"level":114},"conventions","Conventions",{"id":123,"text":124,"level":114},"creating-and-building","Creating and building",{"id":126,"text":127,"level":114},"document-type-and-identification","Document type and identification",{"id":129,"text":130,"level":118},"credit-notes-corrected-invoices-and-self-billing","Credit notes, corrected invoices and self-billing",{"id":132,"text":133,"level":118},"type-codes","Type codes",{"id":135,"text":136,"level":114},"dates","Dates",{"id":138,"text":139,"level":114},"parties","Parties",{"id":141,"text":142,"level":118},"seller-and-buyer","Seller and buyer",{"id":144,"text":145,"level":118},"payee-tax-representative-and-delivery","Payee, tax representative and delivery",{"id":147,"text":148,"level":114},"lines","Lines",{"id":150,"text":151,"level":118},"lines-as-arrays","Lines as arrays",{"id":153,"text":154,"level":118},"line-identifiers","Line identifiers",{"id":156,"text":157,"level":118},"linebuilder","LineBuilder",{"id":159,"text":160,"level":118},"prices","Prices",{"id":162,"text":163,"level":114},"vat","VAT",{"id":165,"text":166,"level":118},"default-vat","Default VAT",{"id":168,"text":169,"level":118},"categories","Categories",{"id":171,"text":172,"level":118},"exemption-reasons-in-the-vat-breakdown","Exemption reasons in the VAT breakdown",{"id":174,"text":175,"level":118},"tax-presets","Tax presets",{"id":177,"text":178,"level":114},"payment","Payment",{"id":180,"text":181,"level":118},"payment-instructions","Payment instructions",{"id":183,"text":184,"level":118},"payment-terms","Payment terms",{"id":186,"text":187,"level":118},"prepaid-amounts-and-rounding","Prepaid amounts and rounding",{"id":189,"text":190,"level":114},"references","References",{"id":192,"text":193,"level":114},"notes","Notes",{"id":195,"text":196,"level":114},"supporting-documents","Supporting documents",{"id":198,"text":199,"level":114},"presentation-and-metadata","Presentation and metadata",{"id":201,"text":202,"level":114},"application-models","Application models",{"id":204,"text":205,"level":114},"currency-and-exchange-rate","Currency and exchange rate",{"id":207,"text":208,"level":114},"allowances-and-charges","Allowances and charges",{"id":210,"text":211,"level":118},"line-allowances-and-charges","Line allowances and charges",{"id":213,"text":214,"level":118},"document-level-allowances-and-charges","Document level allowances and charges",{"id":216,"text":217,"level":118},"reason-codes","Reason codes",{"id":219,"text":220,"level":114},"sub-lines","Sub lines",{"id":222,"text":223,"level":114},"gross-price-mode","Gross price mode",{"id":225,"text":226,"level":114},"changing-existing-data","Changing existing data",{"id":228,"text":229,"level":114},"cancellations-and-corrections","Cancellations and corrections",{"id":231,"text":232,"level":118},"sign-strategies","Sign strategies",{"id":234,"text":235,"level":118},"partial-cancellations","Partial cancellations",{"id":237,"text":238,"level":118},"cumulative-vat-rounding","Cumulative VAT rounding",{"id":240,"text":241,"level":118},"correction-policy","Correction policy",{"id":243,"text":244,"level":118},"corrected-invoices","Corrected invoices",{"id":246,"text":247,"level":118},"price-reductions","Price reductions",{"id":249,"text":250,"level":114},"extensions","Extensions",{"id":252,"text":253,"level":118},"xrechnung-extension","XRechnung extension",{"id":255,"text":256,"level":114},"macros","Macros",{"id":258,"text":259,"level":114},"calculation","Calculation",{"id":261,"text":262,"level":118},"line-amounts","Line amounts",{"id":264,"text":265,"level":118},"document-totals-and-vat-breakdown","Document totals and VAT breakdown",{"id":267,"text":268,"level":118},"gross-price-conversion","Gross price conversion",{"id":270,"text":271,"level":118},"discount-splitting","Discount splitting",{"id":273,"text":274,"level":118},"declared-amounts","Declared amounts",{"id":276,"text":277,"level":114},"data-model","Data model",{"id":279,"text":280,"level":118},"immutability","Immutability",{"id":282,"text":283,"level":118},"arrays-and-json","Arrays and JSON",{"id":285,"text":286,"level":118},"snapshots","Snapshots","https:\u002F\u002Fgithub.com\u002FQuittio\u002Fquittio\u002Fedit\u002Fmaster\u002Fdocs\u002Fbuilding-invoices.md","\u002Fdocs\u002Fbuilding-invoices.md",{"slug":40,"title":41},{"slug":46,"title":47}]