[OST726416][Upgrade] smarty-templates to twig
whole rework of the files + readjusting
This commit is contained in:
bovenliggende
5c0f3b1f77
commit
84225165de
@ -1 +0,0 @@
|
||||
new content here
|
@ -1,46 +0,0 @@
|
||||
{% set pagePadding = ","|explode("45,15,30,25") %} {# top, right, bottom, left #}
|
||||
{% set showLogo = showLogo|default(true) %}
|
||||
|
||||
{% capture append = "pdfBlock_style" %}
|
||||
{% block pdfStyles %}
|
||||
{% include "@d3PdfDocuments/assets/d3pdfstyles.css" %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_header" %}
|
||||
{% block pdfHeader %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/header" with {showLogo: showLogo} %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_content" %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks" with {pagePadding: pagePadding} %}
|
||||
|
||||
{% block pdfAddressArea %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/addressarea" with {addressfile: "@d3PdfDocuments/documents/deliverynote/recipientAddress"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfInformations %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/informations" with {documentinformationfile: "@d3PdfDocuments/documents/deliverynote/informations"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfSalutation %}
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/salutation" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfArticleList %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlelist" with {showPrices: false} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfConclusion %}
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/conclusion" %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_footer" %}
|
||||
{% block pdfFooter %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/footer" with {pagePadding: pagePadding} %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% include "@d3PdfDocuments/documents/inc/page/base" with {pagePadding: pagePadding} %}
|
@ -1 +0,0 @@
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/deliverynote" with {showLogo: false} %}
|
@ -1,13 +0,0 @@
|
||||
{% set showLogo = showLogo|default(true) %}
|
||||
|
||||
{% block pdfHeader %}
|
||||
<div class="header">
|
||||
{% if showLogo %}
|
||||
{# pdf logo is available only in non admin theme #}
|
||||
{% set isAdmin = viewConfig.isAdmin() %}
|
||||
{{ viewConfig.setAdminMode(false) }}
|
||||
<img class="logo" alt="Logo" src="{{ viewConfig.getImageUrl('pdf_logo.jpg') }}">
|
||||
{{ viewConfig.setAdminMode(isAdmin) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,51 +0,0 @@
|
||||
{% set pagePadding = ","|explode("45,15,30,25") %} {# top, right, bottom, left #}
|
||||
{% set showLogo = showLogo|default(true) %}
|
||||
|
||||
{% capture append = "pdfBlock_style" %}
|
||||
{% block pdfStyles %}
|
||||
{% include "@d3PdfDocuments/assets/d3pdfstyles.css" %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_header" %}
|
||||
{% block pdfHeader %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/header" with {showLogo: showLogo} %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_content" %}
|
||||
{# include file="@d3PdfDocuments/documents/inc/helper/rulers" pagePadding=$pagePadding #}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks" with {pagePadding: pagePadding} %}
|
||||
|
||||
{% block pdfAddressArea %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/addressarea" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfInformations %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/informations" with {documentinformationfile: "@d3PdfDocuments/documents/invoice/informations"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfDeliveryAddress %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/deliveryaddress" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfSalutation %}
|
||||
{% include "@d3PdfDocuments/documents/invoice/salutation" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfArticleList %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlelist" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfConclusion %}
|
||||
{% include "@d3PdfDocuments/documents/invoice/conclusion" %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture append = "pdfBlock_footer" %}
|
||||
{% block pdfFooter %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/footer" with {pagePadding: pagePadding} %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
|
||||
{% include "@d3PdfDocuments/documents/inc/page/base" with {pagePadding: pagePadding} %}
|
@ -1 +0,0 @@
|
||||
{% include "@d3PdfDocuments/documents/invoice/invoice" with {showLogo: false} %}
|
47
views/twig/documents/deliverynote/deliverynote.html.twig
Normal file
47
views/twig/documents/deliverynote/deliverynote.html.twig
Normal file
@ -0,0 +1,47 @@
|
||||
{% set pagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set showLogo = showLogo|default(1) %}
|
||||
|
||||
{% set pdfBlock_style %}
|
||||
{% block pdfStyles %}
|
||||
{{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }}
|
||||
{{ style() }}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_header %}
|
||||
{% block pdfHeader %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/header.html.twig" with {showLogo: showLogo} %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_content %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks.html.twig" with {pagePadding: pagePadding} %}
|
||||
|
||||
{% block pdfAddressArea %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/addressarea.html.twig" with {addressfile: "@d3PdfDocuments/documents/deliverynote/inc/recipientAddress.html.twig"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfInformations %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/informations.html.twig" with {documentinformationfile: "@d3PdfDocuments/documents/deliverynote/inc/informations.html.twig"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfSalutation %}
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/inc/salutation.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfArticleList %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlelist.html.twig" with {showPrices: 0} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfConclusion %}
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/inc/conclusion.html.twig" %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_footer %}
|
||||
{% block pdfFooter %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/footer.html.twig" with {pagePadding: pagePadding} %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% include "@d3PdfDocuments/documents/inc/page/base.html.twig" with {pagePadding: pagePadding} %}
|
@ -0,0 +1 @@
|
||||
{% include "@d3PdfDocuments/documents/deliverynote/deliverynote.html.twig" with {showLogo: 0} %}
|
@ -5,7 +5,7 @@
|
||||
|
||||
{% set dateFormat = 'D3_PDFDOCUMENTS_DATE_FORMAT'|translate %}
|
||||
{% set sArgs = order.getFieldData('oxorderdate')|date_format(dateFormat)|cat("//")|cat(shop.getFieldData('oxname')) %}
|
||||
{% set aArgs = "//"|explode(sArgs) %}
|
||||
{% set aArgs = sArgs|split("//") %}
|
||||
|
||||
<div>{{ translate({ ident: "D3_PDFDOCUMENTS_ORDER_FROM_AT", args: aArgs }) }}</div>
|
||||
</div>
|
@ -1,13 +1,13 @@
|
||||
{% set backaddressfile = backaddressfile|default("@d3PdfDocuments/documents/inc/page/returnaddress") %}
|
||||
{% set addressfile = addressfile|default("@d3PdfDocuments/documents/inc/elements/recipientAddress") %}
|
||||
{% set backaddressfile = backaddressfile|default("@d3PdfDocuments/documents/inc/page/returnaddress.html.twig") %}
|
||||
{% set addressfile = addressfile|default("@d3PdfDocuments/documents/inc/elements/recipientAddress.html.twig") %}
|
||||
|
||||
<div class="addressarea">
|
||||
<div class="returnAddress">
|
||||
<div>
|
||||
{% include $backaddressfile %}
|
||||
{% include backaddressfile %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="recipientAddress">
|
||||
{% include $addressfile %}
|
||||
{% include addressfile %}
|
||||
</div>
|
||||
</div>
|
@ -1,4 +1,4 @@
|
||||
{% capture name = "sumnetto" %}
|
||||
{% set sumnetto %}
|
||||
{% block sumnetto %}
|
||||
<tr class="sumnetto">
|
||||
<td class="indent"></td>
|
||||
@ -10,9 +10,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
{% endset %}
|
||||
|
||||
{% capture name = "discount" %}
|
||||
{% set discount %}
|
||||
{% block discount %}
|
||||
<tr class="discount">
|
||||
<td class="indent"></td>
|
||||
@ -24,9 +24,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
{% endset %}
|
||||
|
||||
{% capture name = "producttax" %}
|
||||
{% set producttax %}
|
||||
{% block producttax %}
|
||||
{% for VatKey, oVat in order.getProductVats(false) %}
|
||||
<tr class="producttax">
|
||||
@ -35,14 +35,14 @@
|
||||
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", args: VatKey, suffix: "COLON" }) }}
|
||||
</td>
|
||||
<td class="values">
|
||||
{{ lang.formatCurrency($oVat, currency) }} {{ currency.name }}
|
||||
{{ lang.formatCurrency(oVat, currency) }} {{ currency.name }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
{% endset %}
|
||||
|
||||
{% capture name = "sumbrutto" %}
|
||||
{% set sumbrutto %}
|
||||
{% block sumbrutto %}
|
||||
<tr class="sumbrutto">
|
||||
<td class="indent"></td>
|
||||
@ -54,24 +54,24 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endcapture %}
|
||||
{% endset %}
|
||||
|
||||
{% if order.getFieldData('oxdiscount') %}
|
||||
{% if order.isNettoMode() %}
|
||||
{{ smarty.capture.sumnetto }}
|
||||
{{ smarty.capture.discount }}
|
||||
{{ smarty.capture.producttax }}
|
||||
{{ smarty.capture.sumbrutto }}
|
||||
{{ sumnetto }}
|
||||
{{ discount }}
|
||||
{{ producttax }}
|
||||
{{ sumbrutto }}
|
||||
{% else %}
|
||||
{{ smarty.capture.sumbrutto }}
|
||||
{{ smarty.capture.discount }}
|
||||
{{ smarty.capture.sumnetto }}
|
||||
{{ smarty.capture.producttax }}
|
||||
{{ sumbrutto }}
|
||||
{{ discount }}
|
||||
{{ sumnetto }}
|
||||
{{ producttax }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ smarty.capture.sumnetto }}
|
||||
{{ smarty.capture.producttax }}
|
||||
{{ smarty.capture.sumbrutto }}
|
||||
{{ sumnetto }}
|
||||
{{ producttax }}
|
||||
{{ sumbrutto }}
|
||||
{% endif %}
|
||||
|
||||
{% if order.getFieldData('oxvoucherdiscount') %}
|
@ -1,5 +1,5 @@
|
||||
{% set currency = order.getOrderCurrency() %}
|
||||
{% set showPrices = showPrices|default(true) %}
|
||||
{% set showPrices = showPrices|default(1) %}
|
||||
|
||||
{% block articlelist %}
|
||||
<table class="article_table{% if showPrices %}_prices{% endif %}">
|
||||
@ -54,7 +54,7 @@
|
||||
<nobreak>
|
||||
<table class="article_costs_table">
|
||||
{% block d3_article_costs_summary %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlecostssummary" %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlecostssummary.html.twig" %}
|
||||
{% endblock %}
|
||||
</table>
|
||||
</nobreak>
|
@ -1,10 +1,10 @@
|
||||
{% set defaultPagePadding = ","|explode("45,15,25,25") %} {# top, right, bottom, left #}
|
||||
{% set defaultPagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set pagePadding = pagePadding|default(defaultPagePadding) %}
|
||||
|
||||
<style>
|
||||
.marks {
|
||||
position: absolute;
|
||||
left: {{ 5 - pagePadding.3 }}mm ;
|
||||
left: {{ 5 - pagePadding.3|number_format }}mm ;
|
||||
margin-left: 0;
|
||||
width: 7px;
|
||||
height: 0;
|
||||
@ -12,15 +12,15 @@
|
||||
}
|
||||
|
||||
.foldtop {
|
||||
top: {{ 105 - pagePadding.0 }}mm
|
||||
top: {{ 105 - pagePadding.0|number_format }}mm
|
||||
}
|
||||
|
||||
.foldbottom {
|
||||
top: {{ 210 - pagePadding.0 }}mm
|
||||
top: {{ 210 - pagePadding.0|number_format }}mm
|
||||
}
|
||||
|
||||
.punch {
|
||||
top: {{ 148.5 - pagePadding.0 }}mm
|
||||
top: {{ 148.5 - pagePadding.0|number_format }}mm
|
||||
}
|
||||
</style>
|
||||
|
@ -34,6 +34,6 @@
|
||||
</div>
|
||||
|
||||
{% if documentinformationfile %}
|
||||
{% include $documentinformationfile %}
|
||||
{% include documentinformationfile %}
|
||||
{% endif %}
|
||||
</div>
|
@ -1,9 +1,6 @@
|
||||
{% set defaultPagePadding = ","|explode("45,15,25,25") %} {# top, right, bottom, left #}
|
||||
{% set defaultPagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set pagePadding = pagePadding|default(defaultPagePadding) %}
|
||||
|
||||
{# rulers #}
|
||||
{# include file="@d3PdfDocuments/documents/inc/helper/rulers" pagePadding=$pagePadding #}
|
||||
|
||||
<style>
|
||||
.rulerItemHorizontal {
|
||||
position: absolute;
|
@ -1,29 +1,21 @@
|
||||
{% set pageset = pageset|default("new") %}
|
||||
{% set orientation = orientation|default("P") %}
|
||||
{% set format = format|default("A4") %}
|
||||
{% set defaultPagePadding = ","|explode("45,15,25,25") %} {# top, right, bottom, left #}
|
||||
{% set defaultPagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set pagePadding = pagePadding|default(defaultPagePadding) %}
|
||||
|
||||
<style>
|
||||
{% for _block in pdfBlock_style %}
|
||||
{{ _block }}
|
||||
{% endfor %}
|
||||
{{ pdfBlock_style }}
|
||||
</style>
|
||||
|
||||
<page backtop="{{ pagePadding.0 }}mm" backright="{{ pagePadding.1 }}mm" backbottom="{{ pagePadding.2 }}mm" backleft="{{ pagePadding.3 }}mm" pageset="{{ pageset }}" orientation="{{ orientation }}" format="{{ format }}">
|
||||
<page_header>
|
||||
{% for _block in pdfBlock_header %}
|
||||
{{ _block }}
|
||||
{% endfor %}
|
||||
{{ pdfBlock_header }}
|
||||
</page_header>
|
||||
|
||||
<page_footer>
|
||||
{% for _block in pdfBlock_footer %}
|
||||
{{ _block }}
|
||||
{% endfor %}
|
||||
{{ pdfBlock_footer }}
|
||||
</page_footer>
|
||||
|
||||
{% for _block in pdfBlock_content %}
|
||||
{{ _block }}
|
||||
{% endfor %}
|
||||
{{ pdfBlock_content }}
|
||||
</page>
|
@ -1,4 +1,4 @@
|
||||
{% set defaultPagePadding = ","|explode("45,15,25,25") %} {# top, right, bottom, left #}
|
||||
{% set defaultPagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set pagePadding = pagePadding|default(defaultPagePadding) %}
|
||||
|
||||
{% block pdfFooter %}
|
13
views/twig/documents/inc/page/header.html.twig
Normal file
13
views/twig/documents/inc/page/header.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% set showLogo = showLogo|default(1) %}
|
||||
|
||||
{% block pdfHeader %}
|
||||
<div class="header">
|
||||
{% if showLogo %}
|
||||
{# pdf logo is available only in non admin theme #}
|
||||
{% set isAdmin = oViewConf.isAdmin() %}
|
||||
{{ oViewConf.setAdminMode(false) }}
|
||||
<img class="logo" alt="Logo" src="{{ oViewConf.getImageUrl('pdf_logo.jpg') }}">
|
||||
{{ oViewConf.setAdminMode(isAdmin) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
@ -5,7 +5,7 @@
|
||||
{{ translate({ ident: "D3_PDFDOCUMENTS_USED_PAYMENTMETHOD", suffix: "COLON" }) }}
|
||||
{{ payment.getFieldData('oxdesc') }}<br>
|
||||
|
||||
{% include "@d3PdfDocuments/documents/invoice/payinfo" %}
|
||||
{% include "@d3PdfDocuments/documents/invoice/inc/payinfo.html.twig" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
{% set dateFormat = 'D3_PDFDOCUMENTS_DATE_FORMAT'|translate %}
|
||||
{% set sArgs = order.getFieldData('oxorderdate')|date_format(dateFormat)|cat("//")|cat(shop.getFieldData('oxname')) %}
|
||||
{% set aArgs = "//"|explode(sArgs) %}
|
||||
{% set aArgs = sArgs|split("//") %}
|
||||
|
||||
<div>{{ translate({ ident: "D3_PDFDOCUMENTS_ORDER_FROM_AT", args: aArgs }) }}</div>
|
||||
</div>
|
51
views/twig/documents/invoice/invoice.html.twig
Normal file
51
views/twig/documents/invoice/invoice.html.twig
Normal file
@ -0,0 +1,51 @@
|
||||
{% set pagePadding = "45,15,25,25"|split(",") %} {# top, right, bottom, left #}
|
||||
{% set showLogo = showLogo|default(1) %}
|
||||
|
||||
{% set pdfBlock_style %}
|
||||
{% block pdfStyles %}
|
||||
{{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }}
|
||||
{{ style() }}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_header %}
|
||||
{% block pdfHeader %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/header.html.twig" with {showLogo: showLogo} %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_content %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks.html.twig" with {pagePadding: pagePadding} %}
|
||||
|
||||
{% block pdfAddressArea %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/addressarea.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfInformations %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/informations.html.twig" with {documentinformationfile: "@d3PdfDocuments/documents/invoice/inc/informations.html.twig"} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfDeliveryAddress %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/deliveryaddress.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfSalutation %}
|
||||
{% include "@d3PdfDocuments/documents/invoice/inc/salutation.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfArticleList %}
|
||||
{% include "@d3PdfDocuments/documents/inc/elements/articlelist.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block pdfConclusion %}
|
||||
{% include "@d3PdfDocuments/documents/invoice/inc/conclusion.html.twig" %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% set pdfBlock_footer %}
|
||||
{% block pdfFooter %}
|
||||
{% include "@d3PdfDocuments/documents/inc/page/footer.html.twig" with {pagePadding: pagePadding} %}
|
||||
{% endblock %}
|
||||
{% endset %}
|
||||
|
||||
{% include "@d3PdfDocuments/documents/inc/page/base.html.twig" with {pagePadding: pagePadding} %}
|
1
views/twig/documents/invoice/invoiceNoLogo.html.twig
Normal file
1
views/twig/documents/invoice/invoiceNoLogo.html.twig
Normal file
@ -0,0 +1 @@
|
||||
{% include "@d3PdfDocuments/documents/invoice/invoice.html.twig" with {showLogo: 0} %}
|
Laden…
Verwijs in nieuw issue
Block a user