From f8f226914d5b6da58b7c493a1ce95d64c1c2ea2a Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 2 Jul 2020 00:16:45 +0200 Subject: [PATCH] set article summmary --- .../translations/de/pdfdocuments_lang.php | 12 +- .../translations/en/pdfdocuments_lang.php | 12 +- .../documents/deliverynote/deliverynote.tpl | 3 - .../inc/elements/articlecostssummary.tpl | 275 +++++++++++++++--- .../documents/inc/elements/articlelist.tpl | 1 + .../views/tpl/documents/invoice/invoice.tpl | 3 - out/src/css/pdfStyling.css | 24 +- 7 files changed, 265 insertions(+), 65 deletions(-) diff --git a/Application/translations/de/pdfdocuments_lang.php b/Application/translations/de/pdfdocuments_lang.php index b12c04e..65c2781 100644 --- a/Application/translations/de/pdfdocuments_lang.php +++ b/Application/translations/de/pdfdocuments_lang.php @@ -54,7 +54,17 @@ $aLang = array( 'D3_PDFDOCUMENTS_DISCOUNT' => 'Rabatt', 'D3_PDFDOCUMENTS_SUMNETTO' => 'Summe Artikel (netto)', 'D3_PDFDOCUMENTS_TAX' => 'zzgl. MwSt. %1$s %%', - 'D3_PDFDOCUMENTS_DELIVERY' => 'Versandkosten (netto)', + 'D3_PDFDOCUMENTS_UNDEFINED_TAX' => 'zzgl. MwSt.', + 'D3_PDFDOCUMENTS_PROPORTIONAL_TAX' => 'zzgl. MwSt. (anteilig berechnet)', + 'D3_PDFDOCUMENTS_VOUCHERDISCOUNT' => 'Gutschein', + 'D3_PDFDOCUMENTS_DELIVERY_NET' => 'Versandkosten (netto)', + 'D3_PDFDOCUMENTS_DELIVERY' => 'Versandkosten', + 'D3_PDFDOCUMENTS_PAYMENT_NET' => 'Aufschlag Zahlungsart (netto)', + 'D3_PDFDOCUMENTS_PAYMENT' => 'Aufschlag Zahlungsart', + 'D3_PDFDOCUMENTS_WRAPPING_NET' => 'Geschenkverpackung (netto)', + 'D3_PDFDOCUMENTS_WRAPPING' => 'Geschenkverpackung', + 'D3_PDFDOCUMENTS_GIFTCARD_NET' => 'Grußkarte (netto)', + 'D3_PDFDOCUMENTS_GIFTCARD' => 'Grußkarte', 'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Gesamtsumme (brutto)', 'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Ihre gewählte Zahlungsweise', diff --git a/Application/translations/en/pdfdocuments_lang.php b/Application/translations/en/pdfdocuments_lang.php index c686251..dd76647 100644 --- a/Application/translations/en/pdfdocuments_lang.php +++ b/Application/translations/en/pdfdocuments_lang.php @@ -53,7 +53,17 @@ $aLang = array( 'D3_PDFDOCUMENTS_DISCOUNT' => 'Discount', 'D3_PDFDOCUMENTS_SUMNETTO' => 'Total products (excl. tax)', 'D3_PDFDOCUMENTS_TAX' => 'plus VAT %1$s %%', - 'D3_PDFDOCUMENTS_DELIVERY' => 'Shipping costs (net)', + 'D3_PDFDOCUMENTS_UNDEFINED_TAX' => 'plus VAT', + 'D3_PDFDOCUMENTS_PROPORTIONAL_TAX' => 'plus VAT (proportionally calculated)', + 'D3_PDFDOCUMENTS_VOUCHERDISCOUNT' => 'Coupon', + 'D3_PDFDOCUMENTS_DELIVERY_NET' => 'Shipping costs (net)', + 'D3_PDFDOCUMENTS_DELIVERY' => 'Shipping costs', + 'D3_PDFDOCUMENTS_PAYMENT_NET' => 'Additional Charge Payment Method (net)', + 'D3_PDFDOCUMENTS_PAYMENT' => 'Additional Charge Payment Method', + 'D3_PDFDOCUMENTS_WRAPPING_NET' => 'Gift Wrapping (net)', + 'D3_PDFDOCUMENTS_WRAPPING' => 'Gift Wrapping', + 'D3_PDFDOCUMENTS_GIFTCARD_NET' => 'Greeting Card (net)', + 'D3_PDFDOCUMENTS_GIFTCARD' => 'Greeting Card', 'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Total sum (gross)', 'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Your chosen payment method', diff --git a/Application/views/tpl/documents/deliverynote/deliverynote.tpl b/Application/views/tpl/documents/deliverynote/deliverynote.tpl index fa53be1..f0820fa 100644 --- a/Application/views/tpl/documents/deliverynote/deliverynote.tpl +++ b/Application/views/tpl/documents/deliverynote/deliverynote.tpl @@ -1,6 +1,3 @@ -[{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,15,25,25"}] [{* top, right, bottom, left *}] [{assign var="showLogo" value=$showLogo|default:true}] diff --git a/Application/views/tpl/documents/inc/elements/articlecostssummary.tpl b/Application/views/tpl/documents/inc/elements/articlecostssummary.tpl index e79926e..320842f 100644 --- a/Application/views/tpl/documents/inc/elements/articlecostssummary.tpl +++ b/Application/views/tpl/documents/inc/elements/articlecostssummary.tpl @@ -1,68 +1,249 @@ -[{block name="sumbrutto"}] - - - [{oxmultilang ident="D3_PDFDOCUMENTS_SUMBRUTTO" suffix="COLON"}] - - - [{$order->getFormattedTotalBrutSum()}] [{$currency->name}] - - -[{/block}] -[{block name="discount"}] - [{if $order->getFormattedDiscount() != 0}] +[{capture name="sumnetto"}] + [{block name="sumnetto"}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_SUMNETTO" suffix="COLON"}] + + + [{$order->getFormattedTotalNetSum()}] [{$currency->name}] + + + [{/block}] +[{/capture}] + +[{capture name="discount"}] + [{block name="discount"}] + [{oxmultilang ident="D3_PDFDOCUMENTS_DISCOUNT" suffix="COLON"}] - -[{$order->getFormattedDiscount()}] [{$currency->name}] + [{$order->getFormattedDiscount()}] [{$currency->name}] + + + [{/block}] +[{/capture}] + +[{capture name="producttax"}] + [{block name="producttax"}] + [{foreach from=$order->getProductVats(false) key=VatKey item=oVat}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_TAX" args=$VatKey suffix="COLON"}] + + + [{$lang->formatCurrency($oVat, $currency)}] [{$currency->name}] + + + [{/foreach}] + [{/block}] +[{/capture}] + +[{capture name="sumbrutto"}] + [{block name="sumbrutto"}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_SUMBRUTTO" suffix="COLON"}] + + + [{$order->getFormattedTotalBrutSum()}] [{$currency->name}] + + + [{/block}] +[{/capture}] + +[{if $order->getFieldData('oxdiscount')}] + [{if $order->isNettoMode()}] + [{$smarty.capture.sumnetto}] + [{$smarty.capture.discount}] + [{$smarty.capture.producttax}] + [{$smarty.capture.sumbrutto}] + [{else}] + [{$smarty.capture.sumbrutto}] + [{$smarty.capture.discount}] + [{$smarty.capture.sumnetto}] + [{$smarty.capture.producttax}] + [{/if}] +[{else}] + [{$smarty.capture.sumnetto}] + [{$smarty.capture.producttax}] + [{$smarty.capture.sumbrutto}] +[{/if}] + +[{if $order->getFieldData('oxvoucherdiscount')}] + [{block name="voucherdiscount"}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_VOUCHERDISCOUNT" suffix="COLON"}] + + + -[{$order->getFormattedTotalVouchers()}] [{$currency->name}] + + + [{/block}] +[{/if}] + +[{block name="delivery"}] + [{if $oConfig->getConfigParam('blShowVATForDelivery')}] + [{assign var="deliveryPrice" value=$order->getOrderDeliveryPrice()}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_DELIVERY_NET" suffix="COLON"}] + + + [{$lang->formatCurrency($deliveryPrice->getNettoPrice(), $currency)}] [{$currency->name}] + + + + + + [{if $oConfig->getConfigParam('sAdditionalServVATCalcMethod') != 'proportional'}] + [{oxmultilang ident="D3_PDFDOCUMENTS_TAX" args=$order->getFieldData('oxdelvat') suffix="COLON"}] + [{else}] + [{oxmultilang ident="D3_PDFDOCUMENTS_PROPORTIONAL_TAX" suffix="COLON"}] + [{/if}] + + + [{$lang->formatCurrency($deliveryPrice->getVATValue(), $currency)}] [{$currency->name}] + + + [{else}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_DELIVERY" suffix="COLON"}] + + + [{$lang->formatCurrency($order->getFieldData('oxdelcost'), $currency)}] [{$currency->name}] [{/if}] [{/block}] -[{block name="sumnetto"}] - - - [{oxmultilang ident="D3_PDFDOCUMENTS_SUMNETTO" suffix="COLON"}] - - - [{$order->getFormattedTotalNetSum()}] [{$currency->name}] - - -[{/block}] -[{block name="producttax"}] - [{foreach from=$productVats key=VatKey item=oVat}] - + +[{block name="payment"}] + [{if $oConfig->getConfigParam('blShowVATForPayCharge')}] + [{assign var="paymentPrice" value=$order->getOrderPaymentPrice()}] + + - [{oxmultilang ident="D3_PDFDOCUMENTS_TAX" args=$VatKey suffix="COLON"}] + [{oxmultilang ident="D3_PDFDOCUMENTS_PAYMENT_NET" suffix="COLON"}] - [{$lang->formatCurrency($oVat, $currency)}] [{$currency->name}] + [{$lang->formatCurrency($paymentPrice->getNettoPrice(), $currency)}] [{$currency->name}] - [{/foreach}] + + + + [{if $oConfig->getConfigParam('sAdditionalServVATCalcMethod') != 'proportional'}] + [{oxmultilang ident="D3_PDFDOCUMENTS_TAX" args=$order->getFieldData('oxpayvat') suffix="COLON"}] + [{else}] + [{oxmultilang ident="D3_PDFDOCUMENTS_PROPORTIONAL_TAX" suffix="COLON"}] + [{/if}] + + + [{$lang->formatCurrency($paymentPrice->getVATValue(), $currency)}] [{$currency->name}] + + + [{else}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_PAYMENT" suffix="COLON"}] + + + [{$lang->formatCurrency($order->getFieldData('oxpaycost'), $currency)}] [{$currency->name}] + + + [{/if}] [{/block}] -[{block name="delivery"}] - - - [{oxmultilang ident="D3_PDFDOCUMENTS_DELIVERY" suffix="COLON"}] - - - [{$lang->formatCurrency($deliveryPrice->getNettoPrice(), $currency)}] [{$currency->name}] - - - - - [{oxmultilang ident="D3_PDFDOCUMENTS_TAX" args=$VatKey suffix="COLON"}] - - - [{$lang->formatCurrency($deliveryPrice->getVATValue(), $currency)}] [{$currency->name}] - - + +[{block name="wrapping"}] + [{if $order->getFieldData('oxwrapcost')}] + [{if $oConfig->getConfigParam('blShowVATForWrapping')}] + [{assign var="wrappingPrice" value=$order->getOrderWrappingPrice()}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_WRAPPING_NET" suffix="COLON"}] + + + [{$lang->formatCurrency($wrappingPrice->getNettoPrice(), $currency)}] [{$currency->name}] + + + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_UNDEFINED_TAX" suffix="COLON"}] + + + [{$lang->formatCurrency($wrappingPrice->getVATValue(), $currency)}] [{$currency->name}] + + + [{else}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_WRAPPING" suffix="COLON"}] + + + [{$lang->formatCurrency($order->getFieldData('oxwrapcost'), $currency)}] [{$currency->name}] + + + [{/if}] + [{/if}] [{/block}] -[{* ToDo: keine payment costs ??? *}] + +[{block name="giftcard"}] + [{if $order->getFieldData('oxgiftcardcost')}] + [{if $oConfig->getConfigParam('blShowVATForWrapping')}] + [{assign var="giftCardPrice" value=$order->getOrderGiftCardPrice()}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_GIFTCARD_NET" suffix="COLON"}] + + + [{$lang->formatCurrency($giftCardPrice->getNettoPrice(), $currency)}] [{$currency->name}] + + + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_UNDEFINED_TAX" suffix="COLON"}] + + + [{$lang->formatCurrency($giftCardPrice->getVATValue(), $currency)}] [{$currency->name}] + + + [{else}] + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_GIFTCARD" suffix="COLON"}] + + + [{$lang->formatCurrency($order->getFieldData('oxgiftcardcost'), $currency)}] [{$currency->name}] + + + [{/if}] + [{/if}] +[{/block}] + [{block name="totalsum"}] + + + + + + [{oxmultilang ident="D3_PDFDOCUMENTS_TOTALSUMBRUT" suffix="COLON"}] diff --git a/Application/views/tpl/documents/inc/elements/articlelist.tpl b/Application/views/tpl/documents/inc/elements/articlelist.tpl index f260038..7deead4 100644 --- a/Application/views/tpl/documents/inc/elements/articlelist.tpl +++ b/Application/views/tpl/documents/inc/elements/articlelist.tpl @@ -1,3 +1,4 @@ +[{assign var="currency" value=$order->getOrderCurrency()}] [{assign var="showPrices" value=$showPrices|default:true}] [{block name="articlelist"}] diff --git a/Application/views/tpl/documents/invoice/invoice.tpl b/Application/views/tpl/documents/invoice/invoice.tpl index 05a0189..748ffa8 100644 --- a/Application/views/tpl/documents/invoice/invoice.tpl +++ b/Application/views/tpl/documents/invoice/invoice.tpl @@ -1,6 +1,3 @@ -[{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,15,25,25"}] [{* top, right, bottom, left *}] [{assign var="showLogo" value=$showLogo|default:true}] diff --git a/out/src/css/pdfStyling.css b/out/src/css/pdfStyling.css index 1f87933..a841539 100644 --- a/out/src/css/pdfStyling.css +++ b/out/src/css/pdfStyling.css @@ -153,13 +153,14 @@ table{ .article_costs_table{ width: 100%; - padding-left: 300px; border-spacing: 0; border-collapse: collapse; } +.article_costs_table .indent { + width: 10%; +} .article_costs_table .description { - padding-right: -3px; - width: 70%; + width: 75%; } .article_costs_table td { padding-bottom: 5px; @@ -167,21 +168,24 @@ table{ font-size: 12px; } .article_costs_table .values { - width: 30%; + width: 15%; margin-right: -2.2px; text-align: right; } -.article_costs_table .sumbrutto td { +.article_costs_table .sumnetto td { border-top: solid 0.15mm #000; } -.article_costs_table .sumbrutto td, -.article_costs_table .discount td, -.article_costs_table .producttax td, -.article_costs_table .deliverytax td, -.article_costs_table .totalsum td { +.article_costs_table .voucherdiscount td, +.article_costs_table .sumbrutto td { border-bottom: solid 0.15mm #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.3mm #000; font-weight: bold; }