Skip to content

Commit

Permalink
[ENH] Added enhanced default template, added missing unitcode transla…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
HorstOeko committed Dec 23, 2024
1 parent c94d37b commit ce9a2f6
Show file tree
Hide file tree
Showing 4 changed files with 519 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/ZugferdVisualizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ public function setDefaultTemplate(): void
$this->setTemplate(dirname(__FILE__) . "/template/default.tmpl");
}


/**
* Sets the built-in template in an enhanced version (and switch the markup-rendering engine to the default renderer)
*
* @return void
*/
public function setDefaultTemplateEnhanced(): void
{
$this->setRenderer(new ZugferdVisualizerDefaultRenderer());
$this->setTemplate(dirname(__FILE__) . "/template/default-enh.tmpl");
}

/**
* Add an additional directory where the PDF-Engine will
* search for fonts
Expand Down
49 changes: 40 additions & 9 deletions src/assets/translation/de.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,52 @@
<?php

use horstoeko\zugferd\codelists\ZugferdUnitCodes;
use horstoeko\zugferd\codelists\ZugferdInvoiceType;

return [
'unitcodes' => [
ZugferdUnitCodes::REC20_PIECE => 'St.',
ZugferdUnitCodes::REC21_PIECE => 'St.',
ZugferdUnitCodes::REC20_KILOGRAM => 'kg',
ZugferdUnitCodes::REC20_LITRE => 'l',
ZugferdUnitCodes::REC20_SQUARE_METRE => 'm<sup>2</sup>',
ZugferdUnitCodes::REC20_ONE => '',
ZugferdUnitCodes::REC20_DAY => 'Tag',
ZugferdUnitCodes::REC20_MINUTE_UNIT_OF_TIME => 'min',
ZugferdUnitCodes::REC20_KILOWATT_HOUR => 'kWh',
ZugferdUnitCodes::REC20_LUMP_SUM => 'pausch.',
ZugferdUnitCodes::REC20_SQUARE_MILLIMETRE => 'mm<sup>2</sup>',
ZugferdUnitCodes::REC20_MILLIMETRE => 'mm',
ZugferdUnitCodes::REC20_CUBIC_METRE => 'm<sup>3</sup>',
ZugferdUnitCodes::REC20_METRE => 'm',
ZugferdUnitCodes::REC20_NUMBER_OF_ARTICLES => 'mal',
ZugferdUnitCodes::REC20_PERCENT => '%',
ZugferdUnitCodes::REC20_SET => 'Set(s)',
ZugferdUnitCodes::REC20_TONNE_METRIC_TON => 't',
ZugferdUnitCodes::REC20_RECIPROCAL_WEEK => 'Woche',
ZugferdUnitCodes::REC20_HOUR => 'h',
'KTM' => 'km',
],
'documenttype' => [
'380' => 'Rechnung',
'381' => 'Gutschrift',
'384' => 'Rechnungskorrektur',
'386' => 'Vorauszahlungsrechnung',
ZugferdInvoiceType::INVOICE => 'Rechnung',
ZugferdInvoiceType::CREDITNOTE => 'Gutschrift',
ZugferdInvoiceType::CORRECTION => 'Rechnungskorrektur',
ZugferdInvoiceType::PREPAYMENTINVOICE => 'Vorauszahlungsrechnung',
],
'generaltexts' => [
'greeting' => 'Werter Kunde',
'leadingtext1' => 'Wir nehmen die Freiheit, folgende Positionen zu berechnen',
'leadingtext1' => 'Wir erlauben uns, folgende Positionen zu berechnen',
'documentno' => 'Rechnungsnummer',
'documentdate' => 'Rechnungsdatum',
'deliverydate' => 'Lieferdatum',
'customerno' => 'Kundennummer',
'reference' => 'Kundenreferenz',
'postableheader' => [
'posno' => 'Pos.',
'description' => 'Beschreibung',
'quantity' => 'Menge',
'price' => 'Preis',
'linemount' => 'Betrag',
'price' => 'Einzelpreis',
'linemount' => 'Gesamtpreis',
'vatpercent' => 'Steuer %',
],
'chargeindicator' => [
Expand All @@ -36,8 +64,11 @@
'amounttopay' => 'Fälliger Gesamtbetrag',
],
'vattotals' => [
'heading' => 'Steuer',
'heading' => 'Steuerübersicht',
'heading2' => 'Total',
]
],
'formats' => [
'date' => 'd.m.Y',
],
],
];
41 changes: 36 additions & 5 deletions src/assets/translation/en.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
<?php

use horstoeko\zugferd\codelists\ZugferdUnitCodes;
use horstoeko\zugferd\codelists\ZugferdInvoiceType;

return [
'unitcodes' => [
ZugferdUnitCodes::REC20_PIECE => 'pc',
ZugferdUnitCodes::REC21_PIECE => 'pc',
ZugferdUnitCodes::REC20_KILOGRAM => 'kg',
ZugferdUnitCodes::REC20_LITRE => 'l',
ZugferdUnitCodes::REC20_SQUARE_METRE => 'm<sup>2</sup>',
ZugferdUnitCodes::REC20_ONE => '',
ZugferdUnitCodes::REC20_DAY => 'day',
ZugferdUnitCodes::REC20_MINUTE_UNIT_OF_TIME => 'min',
ZugferdUnitCodes::REC20_KILOWATT_HOUR => 'kWh',
ZugferdUnitCodes::REC20_LUMP_SUM => 'lump sum',
ZugferdUnitCodes::REC20_SQUARE_MILLIMETRE => 'mm<sup>2</sup>',
ZugferdUnitCodes::REC20_MILLIMETRE => 'mm',
ZugferdUnitCodes::REC20_CUBIC_METRE => 'm<sup>3</sup>',
ZugferdUnitCodes::REC20_METRE => 'm',
ZugferdUnitCodes::REC20_NUMBER_OF_ARTICLES => 'times',
ZugferdUnitCodes::REC20_PERCENT => '%',
ZugferdUnitCodes::REC20_SET => 'Set(s)',
ZugferdUnitCodes::REC20_TONNE_METRIC_TON => 't',
ZugferdUnitCodes::REC20_RECIPROCAL_WEEK => 'week',
ZugferdUnitCodes::REC20_HOUR => 'h',
'KTM' => 'km',
],
'documenttype' => [
'380' => 'Invoice',
'381' => 'Credit Note',
'384' => 'Corrected Invoice',
'386' => 'Prepayment Invoice',
ZugferdInvoiceType::INVOICE => 'Invoice',
ZugferdInvoiceType::CREDITNOTE => 'Credit Note',
ZugferdInvoiceType::CORRECTION => 'Corrected Invoice',
ZugferdInvoiceType::PREPAYMENTINVOICE => 'Prepayment Invoice',
],
'generaltexts' => [
'greeting' => 'Dear customer',
'leadingtext1' => 'We take the liberty of invoicing you for the following items',
'documentno' => 'Invoice No.',
'documentdate' => 'Invoice date',
'deliverydate' => 'Delivery date',
'customerno' => 'Customer No.',
'reference' => 'Reference',
'postableheader' => [
'posno' => 'Pos.',
'description' => 'Desc.',
Expand All @@ -38,6 +66,9 @@
'vattotals' => [
'heading' => 'VAT Breakdown',
'heading2' => 'Total',
]
],
'formats' => [
'date' => 'd.m.Y',
],
],
];
Loading

0 comments on commit ce9a2f6

Please sign in to comment.