From d06c8221262fd42bf64af7104f7a59f85eeb9f8a Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Sat, 13 Jun 2020 22:43:57 +0200 Subject: [PATCH] change invoice templates --- .../AbstractClasses/pdfdocumentsGeneric.php | 2 +- .../views/tpl/documents/inc/din5008.tpl | 17 ---- .../inc/{ => elements}/addressarea.tpl | 6 +- .../tpl/documents/inc/elements/foldmarks.tpl | 32 +++++++ .../views/tpl/documents/inc/header.tpl | 9 -- .../views/tpl/documents/inc/helper/rulers.tpl | 39 +++++++++ .../tpl/documents/inc/{ => page}/base.tpl | 4 +- .../tpl/documents/inc/{ => page}/footer.tpl | 0 .../views/tpl/documents/inc/page/header.tpl | 9 ++ .../returnaddress.tpl} | 0 .../views/tpl/documents/inc/rulers.tpl | 33 -------- .../views/tpl/documents/invoice/invoice.tpl | 28 +++---- metadata.php | 23 ++--- out/src/css/pdfStyling.css | 83 +++++++++---------- 14 files changed, 154 insertions(+), 131 deletions(-) delete mode 100644 Application/views/tpl/documents/inc/din5008.tpl rename Application/views/tpl/documents/inc/{ => elements}/addressarea.tpl (69%) create mode 100644 Application/views/tpl/documents/inc/elements/foldmarks.tpl delete mode 100644 Application/views/tpl/documents/inc/header.tpl create mode 100644 Application/views/tpl/documents/inc/helper/rulers.tpl rename Application/views/tpl/documents/inc/{ => page}/base.tpl (64%) rename Application/views/tpl/documents/inc/{ => page}/footer.tpl (100%) create mode 100644 Application/views/tpl/documents/inc/page/header.tpl rename Application/views/tpl/documents/inc/{backaddress.tpl => page/returnaddress.tpl} (100%) delete mode 100644 Application/views/tpl/documents/inc/rulers.tpl diff --git a/Application/Model/AbstractClasses/pdfdocumentsGeneric.php b/Application/Model/AbstractClasses/pdfdocumentsGeneric.php index a628ba9..090a547 100644 --- a/Application/Model/AbstractClasses/pdfdocumentsGeneric.php +++ b/Application/Model/AbstractClasses/pdfdocumentsGeneric.php @@ -249,7 +249,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface */ public function renderTemplateFromAdmin() { - return false; + return true; } public function output(Html2Pdf $oPdf, $sFilename, $target, $html) diff --git a/Application/views/tpl/documents/inc/din5008.tpl b/Application/views/tpl/documents/inc/din5008.tpl deleted file mode 100644 index 97c2aab..0000000 --- a/Application/views/tpl/documents/inc/din5008.tpl +++ /dev/null @@ -1,17 +0,0 @@ -[{* fold marks *}] -
-
- -[{* punch mark *}] -
- - \ No newline at end of file diff --git a/Application/views/tpl/documents/inc/addressarea.tpl b/Application/views/tpl/documents/inc/elements/addressarea.tpl similarity index 69% rename from Application/views/tpl/documents/inc/addressarea.tpl rename to Application/views/tpl/documents/inc/elements/addressarea.tpl index 8228061..93338a2 100644 --- a/Application/views/tpl/documents/inc/addressarea.tpl +++ b/Application/views/tpl/documents/inc/elements/addressarea.tpl @@ -1,12 +1,12 @@ -[{assign var="backaddressfile" value=$backaddressfile|default:"d3pdfbackaddress.tpl"}] +[{assign var="backaddressfile" value=$backaddressfile|default:"d3pdfreturnaddress.tpl"}]
-
+
[{include file=$backaddressfile}]
-
+
[{include file=$addressfile}]
\ No newline at end of file diff --git a/Application/views/tpl/documents/inc/elements/foldmarks.tpl b/Application/views/tpl/documents/inc/elements/foldmarks.tpl new file mode 100644 index 0000000..4b6ea3c --- /dev/null +++ b/Application/views/tpl/documents/inc/elements/foldmarks.tpl @@ -0,0 +1,32 @@ +[{assign var="defaultPagePadding" value=","|explode:"45,20,20,25"}] +[{assign var="pagePadding" value=$pagePadding|default:$defaultPagePadding}] + +[{* fold marks *}] +
a
+
b
+ +[{* punch mark *}] +
c
+ + \ No newline at end of file diff --git a/Application/views/tpl/documents/inc/header.tpl b/Application/views/tpl/documents/inc/header.tpl deleted file mode 100644 index 8886cc3..0000000 --- a/Application/views/tpl/documents/inc/header.tpl +++ /dev/null @@ -1,9 +0,0 @@ -[{assign var="showLogo" value=$showLogo|default:true}] - -[{block name="pdfToping"}] -
- [{if $showLogo}] - - [{/if}] -
-[{/block}] \ No newline at end of file diff --git a/Application/views/tpl/documents/inc/helper/rulers.tpl b/Application/views/tpl/documents/inc/helper/rulers.tpl new file mode 100644 index 0000000..b855f46 --- /dev/null +++ b/Application/views/tpl/documents/inc/helper/rulers.tpl @@ -0,0 +1,39 @@ +[{assign var="defaultPagePadding" value=","|explode:"45,20,20,25"}] +[{assign var="pagePadding" value=$pagePadding|default:$defaultPagePadding}] + +[{* rulers *}] +[{* include file="d3pdfrulers.tpl" pagePadding=$pagePadding *}] + + + +[{* horizontal *}] +[{section name=rulerItemsHorizontal start=10 step=10 loop=600}] +
+ [{$smarty.section.rulerItemsHorizontal.index}] +
+[{/section}] + +[{* vertical *}] +[{section name=rulerItemsVertical start=0 step=10 loop=600}] +
[{$smarty.section.rulerItemsVertical.index}]
+[{/section}] + + diff --git a/Application/views/tpl/documents/inc/base.tpl b/Application/views/tpl/documents/inc/page/base.tpl similarity index 64% rename from Application/views/tpl/documents/inc/base.tpl rename to Application/views/tpl/documents/inc/page/base.tpl index cd71271..6c2013a 100644 --- a/Application/views/tpl/documents/inc/base.tpl +++ b/Application/views/tpl/documents/inc/page/base.tpl @@ -1,6 +1,8 @@ [{assign var="pageset" value=$pageset|default:"new"}] [{assign var="orientation" value=$orientation|default:"P"}] [{assign var="format" value=$format|default:"A4"}] +[{assign var="defaultPagePadding" value=","|explode:"45,20,20,25"}] +[{assign var="pagePadding" value=$pagePadding|default:$defaultPagePadding}] - + [{foreach from=$pdfBlock_header item="_block"}] [{$_block}] diff --git a/Application/views/tpl/documents/inc/footer.tpl b/Application/views/tpl/documents/inc/page/footer.tpl similarity index 100% rename from Application/views/tpl/documents/inc/footer.tpl rename to Application/views/tpl/documents/inc/page/footer.tpl diff --git a/Application/views/tpl/documents/inc/page/header.tpl b/Application/views/tpl/documents/inc/page/header.tpl new file mode 100644 index 0000000..6c8a11e --- /dev/null +++ b/Application/views/tpl/documents/inc/page/header.tpl @@ -0,0 +1,9 @@ +[{assign var="showLogo" value=$showLogo|default:true}] + +[{block name="pdfHeader"}] +
+ [{if $showLogo}] + + [{/if}] +
+[{/block}] \ No newline at end of file diff --git a/Application/views/tpl/documents/inc/backaddress.tpl b/Application/views/tpl/documents/inc/page/returnaddress.tpl similarity index 100% rename from Application/views/tpl/documents/inc/backaddress.tpl rename to Application/views/tpl/documents/inc/page/returnaddress.tpl diff --git a/Application/views/tpl/documents/inc/rulers.tpl b/Application/views/tpl/documents/inc/rulers.tpl deleted file mode 100644 index 6eb998d..0000000 --- a/Application/views/tpl/documents/inc/rulers.tpl +++ /dev/null @@ -1,33 +0,0 @@ -[{* rulers *}] - - - -[{* horizontal *}] -[{section name=rulerItemsHo start=10 step=10 loop=600}] -
[{$smarty.section.rulerItemsHo.index}]
-[{/section}] - -[{* vertical *}] -[{section name=rulerItemsVe start=0 step=10 loop=600}] -
[{$smarty.section.rulerItemsVe.index}]
-[{/section}] - - diff --git a/Application/views/tpl/documents/invoice/invoice.tpl b/Application/views/tpl/documents/invoice/invoice.tpl index 0a28a23..b673ee9 100644 --- a/Application/views/tpl/documents/invoice/invoice.tpl +++ b/Application/views/tpl/documents/invoice/invoice.tpl @@ -1,33 +1,31 @@ [{assign var="currency" value=$order->getOrderCurrency()}] [{assign var="deliveryPrice" value= $order->getOrderDeliveryPrice()}] [{assign var="productVats" value= $order->getProductVats(false)}] +[{assign var="pagePadding" value=","|explode:"45,20,20,25"}] [{capture append="pdfBlock_style"}] - [{include file="d3pdfstyle.css"}] + [{block name="pdfStyles"}] + [{include file="d3pdfstyles.css"}] + [{/block}] [{/capture}] [{capture append="pdfBlock_header"}] - [{block name="pdfTopingFile"}] + [{block name="pdfHeader"}] [{include file="d3pdfheader.tpl" showLogo=true}] [{/block}] [{/capture}] [{capture append="pdfBlock_content"}] - [{include file="d3pdfrulers.tpl"}] - [{include file="d3din5008.tpl"}] + [{*include file="d3pdfrulers.tpl" pagePadding=$pagePadding*}] + [{include file="d3foldmarks.tpl" pagePadding=$pagePadding}] - [{* +++++ main page part +++++ *}] - [{block name="pdfHeadingFile"}] - [{block name="pdfHeaderFile"}] - [{include file="d3pdfaddressarea.tpl" addressfile="d3invoice_pdf_addressarea.tpl"}] - [{/block}] + [{block name="pdfAddressArea"}] + [{include file="d3pdfaddressarea.tpl" addressfile="d3invoice_pdf_addressarea.tpl"}] [{/block}] - - - [{block name="pdfHeading"}] + [{block name="pdfInformations"}] - [{block name="heading_owner_information"}] + [{block name="pdfContactInformations"}]
[{oxmultilang ident="D3_ORDER_OVERVIEW_PDF_GET_IN_CONTACT"}]
@@ -116,9 +114,9 @@ [{/capture}] [{capture append="pdfBlock_footer"}] - [{block name="pdfFooterFile"}] + [{block name="pdfFooter"}] [{include file="d3pdffooter.tpl"}] [{/block}] [{/capture}] -[{include file="d3pdfbase.tpl"}] +[{include file="d3pdfbase.tpl" pagePadding=$pagePadding}] diff --git a/metadata.php b/metadata.php index 5a61d66..e844446 100644 --- a/metadata.php +++ b/metadata.php @@ -35,8 +35,8 @@ $sModuleId = 'd3PdfDocuments'; $aModule = [ 'id' => $sModuleId, 'title' => [ - 'de' => $logo.' PDF-Dokumente aus HTML-Templates', - 'en' => $logo.' PDF documents from HTML templates', + 'de' => $logo.' PDF-Dokumente', + 'en' => $logo.' PDF documents', ], 'version' => '1.0', 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)', @@ -62,14 +62,17 @@ $aModule = [ 'd3invoice_pdf_conclusion.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/invoice/includingFiles/pdfPastThank.tpl', 'd3_article_costs_summary.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/invoice/includingFiles/d3_article_costs_summary.tpl', - 'd3pdfbase.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/base.tpl', - 'd3pdfheader.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/header.tpl', - 'd3pdffooter.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/footer.tpl', - 'd3pdfaddressarea.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/addressarea.tpl', - 'd3pdfbackaddress.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/backaddress.tpl', - 'd3din5008.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/din5008.tpl', - 'd3pdfrulers.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/rulers.tpl', - 'd3pdfstyle.css' => 'd3/pdfdocuments/out/src/css/pdfStyling.css' + 'd3pdfbase.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/page/base.tpl', + 'd3pdfheader.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/page/header.tpl', + 'd3pdffooter.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/page/footer.tpl', + 'd3pdfreturnaddress.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/page/returnaddress.tpl', + + 'd3pdfaddressarea.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/elements/addressarea.tpl', + 'd3foldmarks.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/elements/foldmarks.tpl', + + 'd3pdfstyles.css' => 'd3/pdfdocuments/out/src/css/pdfStyling.css', + + 'd3pdfrulers.tpl' => 'd3/pdfdocuments/Application/views/tpl/documents/inc/helper/rulers.tpl', ], 'events' => [], 'blocks' => [ diff --git a/out/src/css/pdfStyling.css b/out/src/css/pdfStyling.css index da6d6ad..6f48574 100644 --- a/out/src/css/pdfStyling.css +++ b/out/src/css/pdfStyling.css @@ -1,3 +1,44 @@ +.header { + padding: 5mm; + height: 35mm; + width: 100%; + background-color: lightgreen; + position: relative; +} + +.header img.logo { + float: right; + margin: 10mm; +} + +.addressarea { + left: 0; + width: 80mm; + height: 45mm; + background-color: lightpink; + position: relative; +} + +.addressarea .returnAddress, +.addressarea .recipientAddress { + position: relative; +} + +.addressarea .returnAddress { + height: 17.7mm; + background-color: lightyellow; + font-size: 8px; +} + +.addressarea .returnAddress div { + padding-top: 3mm; +} + +.addressarea .recipientAddress { + height: 27.3mm; + background-color: lightcyan; +} + /*debug hilfe*/ .eraseBug{ border: dashed blueviolet 1px; @@ -35,48 +76,6 @@ table{ padding-top: 5px; } -/*pdf_header*/ -.pdf_header_positioning{ - padding: 5mm; - height: 35mm; - width: 100%; - background-color: lightgreen; - position: relative; -} - -.pdf_header_positioning img { - float: right; - margin: 10mm; -} - -.addressarea { - left: 20mm; - width: 85mm; - height: 45mm; - background-color: lightpink; - position: relative; -} - -page .addressarea .backaddress, -page .addressarea .recipientaddress { - position: relative; - margin-left: 5mm; -} - -page .addressarea .backaddress { - height: 17.7mm; - background-color: lightyellow; - font-size: 8px; -} - -page .addressarea .backaddress div { - padding-top: 3mm; -} - -page .addressarea .recipientaddress { - height: 27.3mm; - background-color: lightcyan; -} /*pdf_footer*/ .pdf_footer_table{