From ec6a0920d07e4c9709f4d23f18e2925da2d051af Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Mon, 9 Sep 2024 14:48:01 +0200 Subject: [PATCH] don't include stylesheet as file reference, use it as included template --- metadata.php | 2 +- .../smarty/assets/pdfStyling.css.tpl | 0 .../documents/deliverynote/deliverynote.tpl | 2 +- views/smarty/documents/invoice/invoice.tpl | 2 +- views/twig/assets/pdfStyling.css.twig | 219 ++++++++++++++++++ .../deliverynote/deliverynote.html.twig | 3 +- .../twig/documents/invoice/invoice.html.twig | 3 +- 7 files changed, 224 insertions(+), 7 deletions(-) rename assets/out/src/css/pdfStyling.css => views/smarty/assets/pdfStyling.css.tpl (100%) create mode 100644 views/twig/assets/pdfStyling.css.twig diff --git a/metadata.php b/metadata.php index c6c34b2..3aa8547 100644 --- a/metadata.php +++ b/metadata.php @@ -76,7 +76,7 @@ $aModule = [ '@' . Constants::OXID_MODULE_ID . '/documents/inc/helper/rulers.tpl' => 'views/smarty/flow/documents/inc/helper/rulers.tpl', // Frontend - Flow - Inc - Styles - '@' . Constants::OXID_MODULE_ID . '/assets/d3pdfstyles.css' => 'assets/out/src/css/pdfStyling.css', + '@' . Constants::OXID_MODULE_ID . '/assets/d3pdfstyles.css.tpl' => 'views/smarty/assets/pdfStyling.css.tpl', ], 'events' => [], 'blocks' => [ diff --git a/assets/out/src/css/pdfStyling.css b/views/smarty/assets/pdfStyling.css.tpl similarity index 100% rename from assets/out/src/css/pdfStyling.css rename to views/smarty/assets/pdfStyling.css.tpl diff --git a/views/smarty/documents/deliverynote/deliverynote.tpl b/views/smarty/documents/deliverynote/deliverynote.tpl index 76a1b21..8bd8d6e 100644 --- a/views/smarty/documents/deliverynote/deliverynote.tpl +++ b/views/smarty/documents/deliverynote/deliverynote.tpl @@ -3,7 +3,7 @@ [{capture append="pdfBlock_style"}] [{block name="pdfStyles"}] - [{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}] + [{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}] [{/block}] [{/capture}] diff --git a/views/smarty/documents/invoice/invoice.tpl b/views/smarty/documents/invoice/invoice.tpl index a801998..f4034c8 100644 --- a/views/smarty/documents/invoice/invoice.tpl +++ b/views/smarty/documents/invoice/invoice.tpl @@ -3,7 +3,7 @@ [{capture append="pdfBlock_style"}] [{block name="pdfStyles"}] - [{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}] + [{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}] [{/block}] [{/capture}] diff --git a/views/twig/assets/pdfStyling.css.twig b/views/twig/assets/pdfStyling.css.twig new file mode 100644 index 0000000..315fa53 --- /dev/null +++ b/views/twig/assets/pdfStyling.css.twig @@ -0,0 +1,219 @@ +table{ + font-family: "helvetica"; +} + +.header { + padding: 5mm; + height: 35mm; + width: 100%; + position: relative; +} +.header img.logo { + float: right; + margin: 10mm; + margin-right: 0; +} + +.addressarea, +.deliveryaddress { + left: 0; + width: 80mm; + height: 45mm; + position: relative; +} +.deliveryaddress { + margin-top: 10mm; + height: 27.3mm; +} +.addressarea .returnAddress, +.addressarea .recipientAddress { + position: relative; +} +.addressarea .returnAddress { + height: 17.7mm; + font-size: 8px; +} +.addressarea .returnAddress div { + padding-top: 3mm; +} +.addressarea .recipientAddress { + height: 27.3mm; +} +.addressarea .recipientAddress .location, +.deliveryaddress .location { + font-weight: bold; +} +.addressarea .recipientAddress .country { + padding-top: 5mm; +} +.deliveryaddress .headline { + font-size: 10px; + padding-bottom: 2mm; +} + +.informations { + width: 75mm; + right: 0; + top: 5mm; + position: absolute; +} +.contactinformations, +.bankaccountinformations, +.documentinformations { + margin-bottom: 5mm; +} +.contactinformations div, +.bankaccountinformations div, +.documentinformations div { + text-align: right; + font-size: 11px; +} +.contactinformations div.headline, +.bankaccountinformations div.headline, +.documentinformations div.headline { + font-weight: bold; +} + +.salutation { + margin-top: 5mm; +} +.salutation .documenttype { + font-weight: bold; + margin-bottom: 5mm; +} + +.article_table, +.article_table_prices { + width: 100%; + margin-top: 5mm; + border-spacing: 0; + border-collapse: collapse; +} +.article_table th, +.article_table td, +.article_table_prices th, +.article_table_prices td { + padding-bottom: 2mm; + vertical-align: top; +} +.article_table th, +.article_table_prices th { + border-bottom: solid 0.75pt #000; + font-weight: normal; + font-size: 11px; +} +.article_table td, +.article_table_prices td { + padding-top: 2mm; + font-size: 12px; +} +.article_table th.amount, +.article_table td.amount { + width: 10%; +} +.article_table_prices th.amount, +.article_table_prices td.amount, +.article_table_prices th.tax, +.article_table_prices td.tax { + width: 10%; +} +.article_table_prices th.tax, +.article_table_prices td.tax { + text-align: right; + padding-right: 0; +} +.article_table th.description, +.article_table td.description { + width: 90%; +} +.article_table_prices th.description, +.article_table_prices td.description { + width: 50%; +} +.article_table td.description .artnr, +.article_table_prices td.description .artnr { + font-size: 9px; +} +.article_table_prices th.unitPrice, +.article_table_prices td.unitPrice, +.article_table_prices th.totalPrice, +.article_table_prices td.totalPrice { + width: 15%; + text-align: right; +} +.article_table td.amount, +.article_table_prices td.amount { + text-align: right; + padding-right: 10mm; +} +.article_table_prices td.unitPrice, +.article_table_prices td.totalPrice { + text-align: right; + padding-right: 0; +} + +.article_costs_table{ + width: 100%; + border-spacing: 0; + border-collapse: collapse; +} +.article_costs_table .indent { + width: 10%; +} +.article_costs_table .description { + width: 75%; +} +.article_costs_table td { + padding-bottom: 5px; + padding-top: 5px; + font-size: 12px; +} +.article_costs_table .values { + width: 15%; + margin-right: -2.2px; + text-align: right; +} +.article_costs_table .sumnetto td { + border-top: 0.75pt solid #000; +} +.article_costs_table .voucherdiscount td, +.article_costs_table .sumbrutto td { + border-bottom: solid 0.75pt #000; +} +.article_costs_table .totalseparator td { + height: 0; + line-height: 0; +} +.article_costs_table .totalseparator td, +.article_costs_table .totalsum td { + border-bottom: solid 0.75pt #000; + font-weight: bold; +} +.article_costs_table .totalsum td { + border-bottom: double 2pt #000; +} + +.conclusion_payment, +.conclusion_thankyou { + margin-top: 5mm; + font-size: 12px; +} + +.footer{ + width: 173mm; + font-size: 9px; + position: relative; + margin: 0; + padding: 0; +} +.footer table { + border-top: solid 0.75pt #000; + width: 100%; + position: relative; +} +.footerLeft, +.footerCenter, +.footerRight { + width: 33%; + padding: 0 2mm; +} \ No newline at end of file diff --git a/views/twig/documents/deliverynote/deliverynote.html.twig b/views/twig/documents/deliverynote/deliverynote.html.twig index 312b082..7645ebe 100644 --- a/views/twig/documents/deliverynote/deliverynote.html.twig +++ b/views/twig/documents/deliverynote/deliverynote.html.twig @@ -3,8 +3,7 @@ {% set pdfBlock_style %} {% block pdfStyles %} - {{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }} - {{ style() }} + {% include "@d3PdfDocuments/assets/pdfStyling.css.twig" %} {% endblock %} {% endset %} diff --git a/views/twig/documents/invoice/invoice.html.twig b/views/twig/documents/invoice/invoice.html.twig index 5d70c83..b7402a2 100644 --- a/views/twig/documents/invoice/invoice.html.twig +++ b/views/twig/documents/invoice/invoice.html.twig @@ -3,8 +3,7 @@ {% set pdfBlock_style %} {% block pdfStyles %} - {{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }} - {{ style() }} + {% include "@d3PdfDocuments/assets/pdfStyling.css.twig" %} {% endblock %} {% endset %}