Merge branch 'dev_2.x_OXID7' into rel_2.x

This commit is contained in:
Daniel Seifert 2024-10-01 08:51:15 +02:00
commit 146b68ef1c
24 changed files with 391 additions and 135 deletions

View File

@ -11,7 +11,6 @@
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
use Assert\InvalidArgumentException;
use D3\ModCfg\Application\Model\d3filesystem;
use D3\PdfDocuments\Application\Model\Constants;
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface;
@ -26,6 +25,8 @@ use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateEngineInterf
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRenderer;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
use OxidEsales\Twig\Resolver\TemplateChain\TemplateNotInChainException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Smarty;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Html2Pdf;
@ -185,37 +186,12 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
unset($iSelLang);
$this->oTemplateEngine->addGlobal('config', Registry::getConfig());
$this->oTemplateEngine->addGlobal('sAlternativePdfLogo', $this->getAlternativePdfLogoFileName());
$this->oTemplateEngine->addGlobal('oViewConf', Registry::getConfig()->getActiveView()->getViewConfig());
$this->oTemplateEngine->addGlobal('shop', Registry::getConfig()->getActiveShop());
$this->oTemplateEngine->addGlobal('lang', Registry::getLang());
$this->oTemplateEngine->addGlobal('document', $this);
}
/**
* @return string
*/
public function getAlternativePdfLogoFileName() :string
{
$sStandardLogoFile = 'pdf_logo.jpg';
$oViewConf = Registry::getConfig()->getActiveView()->getViewConfig();
$moduleSettingService = ContainerFacade::get(ModuleSettingServiceInterface::class);
$sAlternativePdfLogoName = $moduleSettingService->getString(Constants::OXID_MODULE_ID."_sAlternativePdfLogoName", Constants::OXID_MODULE_ID);
$sAlternativePdfLogoName = trim($sAlternativePdfLogoName) ?: $sStandardLogoFile;
$bAlternativeFileExists = file_exists(Registry::getConfig()->getImagePath($sAlternativePdfLogoName));
$bFileExists = file_exists(Registry::getConfig()->getImagePath($sStandardLogoFile));
return $bAlternativeFileExists
? $oViewConf->getImageUrl($sAlternativePdfLogoName, true)
: (
$bFileExists
? $oViewConf->getImageUrl($sStandardLogoFile, true)
: ""
);
}
/**
* @param int $iSelLang
*
@ -322,14 +298,68 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
/**
* Gets proper file name
*
* @param string $sFilename file name
* @param $filename
*
* @return string
*/
public function makeValidFileName($sFilename)
public function makeValidFileName($filename)
{
$fs = oxNew(d3filesystem::class);
return $fs->filterFilename($sFilename);
// sanitize filename
$filename = preg_replace(
'~
[<>:"/\\\\|?*]| # file system reserved
[\x00-\x1F]| # control characters
[\x7F\xA0\xAD]| # non-printing characters DEL, NO-BREAK SPACE, SOFT HYPHEN
[#\[\]@!$&\'()+,;=]| # URI reserved
[{}^\~`] # URL unsafe characters
~x',
'-',
$filename
);
// avoids ".", ".." or ".hiddenFiles"
$filename = ltrim($filename, '.-');
$filename = $this->beautifyFilename($filename);
// maximize filename length to 255 bytes
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$filename = mb_strcut(
pathinfo($filename, PATHINFO_FILENAME),
0,
255 - ($ext ? strlen($ext) + 1 : 0),
mb_detect_encoding($filename)
) . ($ext ? '.' . $ext : '');
return $filename;
}
public function beautifyFilename($filename)
{
// reduce consecutive characters
$filename = preg_replace([
// "file name.zip" becomes "file-name.zip"
'/ +/',
// "file___name.zip" becomes "file-name.zip"
'/_{2,}/',
// "file---name.zip" becomes "file-name.zip"
'/-+/',
], '-', $filename);
$filename = preg_replace([
// "file--.--.-.--name.zip" becomes "file.name.zip"
'/-*\.-*/',
// "file...name..zip" becomes "file.name.zip"
'/\.{2,}/',
], '.', $filename);
// lowercase for windows/unix interoperability
$filename = mb_strtolower($filename, mb_detect_encoding($filename));
// ".file-name.-" becomes "file-name"
$filename = trim($filename, '.-');
return trim($filename);
}
/**
@ -342,15 +372,19 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
/**
* @param Html2Pdf $oPdf
* @param $sFilename
* @param $target
* @param $html
* @param $sFilename
* @param $target
* @param $html
*
* @return string|null
* @throws Html2PdfException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
{
if ((bool) Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') === true) {
$moduleSettings = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
if ($moduleSettings->getBoolean( 'd3PdfDocumentsbDev', Constants::OXID_MODULE_ID )) {
return $this->outputDev($oPdf, $sFilename, $target, $html);
} else {
return $oPdf->output($sFilename, $target);

View File

@ -8,16 +8,14 @@
* @link http://www.oxidmodule.com
*/
use D3\PdfDocuments\Application\Model\Constants;
$sLangName = "Deutsch";
$aLang = array(
'charset' => 'utf-8',
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName' => 'Alternativer PDF-Logo Name<br><br>
Ohne Angabe ( leer ) wird <u style="color: orangered">automatisch</u> folgender Datei-Name gewählt: <b>pdf_logo.jpg</b><br>
Diese Datei muss sich im <b>source/out/THEME/img/</b> Ordner befinden <b>und muss aus technischen Gründen PNG/ JPG sein</b>.<br><br>
<u>Notfalls wird kein Bild eingefügt!</u>',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',

View File

@ -8,16 +8,14 @@
* @link http://www.oxidmodule.com
*/
use D3\PdfDocuments\Application\Model\Constants;
$sLangName = "English";
$aLang = array(
'charset' => 'utf-8',
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName' => 'Alternative PDF Logo Name<br><br>
Without specification (empty) the following file name will be <u style="color: orangered">automatically</u> selected: <b>pdf_logo.jpg</b><br>
This file must be located in the <b>source/out/THEME/img/</b> folder <b>and must be PNG or JPG for technical reasons</b>.<br><br>
<u>If necessary, no image will be inserted!</u>',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
'D3_PDFDOCUMENTS' => 'PDF Documents',
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',

View File

@ -15,11 +15,7 @@ $aLang = array(
'charset' => 'utf-8',
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName' => 'Alternativer PDF-Logo Name<br><br>
Ohne Angabe ( leer ) wird <u style="color: orangered">automatisch</u> folgender Datei-Name gewählt: <b>pdf_logo.jpg</b><br>
Diese Datei muss sich im <b>source/out/THEME/img/</b> Ordner befinden <b>und muss aus technischen Gründen PNG oder JPG sein</b>.<br><br>
<u>Notfalls wird kein Bild eingefügt!</u>',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',

View File

@ -8,16 +8,14 @@
* @link http://www.oxidmodule.com
*/
use D3\PdfDocuments\Application\Model\Constants;
$sLangName = "English";
$aLang = array(
'charset' => 'utf-8',
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName' => 'Alternative PDF Logo Name<br><br>
Without specification (empty) the following file name will be <u style="color: orangered">automatically</u> selected: <b>pdf_logo.jpg</b><br>
This file must be located in the <b>source/out/THEME/img/</b> folder <b>and must be PNG/ JPG for technical reasons</b>.<br><br>
<u>If necessary, no image will be inserted!</u>',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
'D3_PDFDOCUMENTS' => 'PDF Documents',
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',

View File

@ -38,7 +38,8 @@ Detailed installation instructions can be found [online](https://docs.oxidmodule
## Credits:
- PDF logo made by Dimitriy Morilubov from www.flaticon.com
- PDF logo made by Dimitriy Morilubov by www.flaticon.com
- example company logo by https://www.logologo.com/
## License

View File

@ -39,6 +39,7 @@ Eine detaillierte Installationsanleitung finden Sie [online](https://docs.oxidmo
## Danksagung:
- PDF-Logo erstellt von Dimitriy Morilubov von www.flaticon.com
- Beispielfirmenlogo von https://www.logologo.com/
## Lizenz

BIN
assets/out/img/clogo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -33,7 +33,6 @@
"php": "^8.0",
"oxid-esales/oxideshop-ce": "7.0 - 7.1",
"spipu/html2pdf": "~5.2.8",
"d3/modcfg": "^7.1",
"beberlei/assert": "^3.3.2"
},
"autoload": {

29
development.md Normal file
View File

@ -0,0 +1,29 @@
# Entwicklungen
Um das Modul anzupassen, gibt es verschiedene Möglichkeiten:
## Grundsätzliches
Wir empfehlen dringend, alle Veränderungen bestehender Dokumente und auch neue Dokumente in einem eigenen Modul abzulegen,
um die Updatefähigkeit zu behalten.
## neue Dokumente hinzufügen
Neue Dokumente können analog zu den Bestehenden angelegt werden. Jedes Dokument besteht aus der entsprechenden
PHP-Klasse (unter Application/Model/Documents) und deren Template (unter views/.../documents). Verwenden Sie die
Bestandsdokumente als Implementierungsreferenz.
Dokumentlisten sind für den Bestellbereich im Shopadmin sowie für die Generierung über den D3 Auftragsmanagers
enthalten (unter Application/Model/Registries). Überladen Sie die Klassen und ergänzen Sie im Konstruktor Ihre neuen
Dokumente.
## bestehende Dokumente verändern
Die Grundangaben eines Dokuments sind in dessen PHP-Datei definiert. Überladen Sie diese bei Bedarf und ändern die
Einstellung.
Die Inhalte der Dokumente sind in Templates definiert. In den Templates sind Blöcke eingerichtet, die mit den
Überladungsmöglichkeiten des Shops ergänzt oder ersetzt werden können.
Bei umfangreichen Anpassungen kann es sinnvoll sein, eigene Templates anzulegen, die in der PHP-Klasse des Dokuments als
Quelle definiert wird.

View File

@ -17,19 +17,17 @@ use OxidEsales\Eshop\Application\Controller\Admin\OrderOverview;
*/
$sMetadataVersion = '2.1';
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
/**
* Module information
*/
$aModule = [
'id' => Constants::OXID_MODULE_ID,
'title' => [
'de' => $logo.' PDF-Dokumente',
'en' => $logo.' PDF documents',
'de' => '(D3) PDF-Dokumente',
'en' => '(D3) PDF documents',
],
'version' => '2.0.0',
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'author' => 'D3 Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'extend' => [
@ -42,41 +40,41 @@ $aModule = [
'@' . Constants::OXID_MODULE_ID . '/admin/d3orderoverview_pdfform.tpl' => 'views/smarty/admin/orderoverview_pdfform.tpl',
// Frontend - Flow - Deliverynote
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/deliverynote.tpl' => 'views/smarty/flow/documents/deliverynote/deliverynote.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/deliverynoteNoLogo.tpl' => 'views/smarty/flow/documents/deliverynote/deliverynoteNoLogo.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/informations.tpl' => 'views/smarty/flow/documents/deliverynote/inc/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/recipientAddress.tpl' => 'views/smarty/flow/documents/deliverynote/inc/recipientAddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/salutation.tpl' => 'views/smarty/flow/documents/deliverynote/inc/salutation.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/conclusion.tpl' => 'views/smarty/flow/documents/deliverynote/inc/conclusion.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/deliverynote.tpl' => 'views/smarty/documents/deliverynote/deliverynote.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/deliverynoteNoLogo.tpl' => 'views/smarty/documents/deliverynote/deliverynoteNoLogo.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/informations.tpl' => 'views/smarty/documents/deliverynote/inc/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/recipientAddress.tpl' => 'views/smarty/documents/deliverynote/inc/recipientAddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/salutation.tpl' => 'views/smarty/documents/deliverynote/inc/salutation.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/conclusion.tpl' => 'views/smarty/documents/deliverynote/inc/conclusion.tpl',
// Frontend - Flow - Invoice
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/invoice.tpl' => 'views/smarty/flow/documents/invoice/invoice.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/invoiceNoLogo.tpl' => 'views/smarty/flow/documents/invoice/invoiceNoLogo.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/informations.tpl' => 'views/smarty/flow/documents/invoice/inc/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/salutation.tpl' => 'views/smarty/flow/documents/invoice/inc/salutation.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/conclusion.tpl' => 'views/smarty/flow/documents/invoice/inc/conclusion.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/payinfo.tpl' => 'views/smarty/flow/documents/invoice/inc/payinfo.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/invoice.tpl' => 'views/smarty/documents/invoice/invoice.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/invoiceNoLogo.tpl' => 'views/smarty/documents/invoice/invoiceNoLogo.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/informations.tpl' => 'views/smarty/documents/invoice/inc/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/salutation.tpl' => 'views/smarty/documents/invoice/inc/salutation.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/conclusion.tpl' => 'views/smarty/documents/invoice/inc/conclusion.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/payinfo.tpl' => 'views/smarty/documents/invoice/inc/payinfo.tpl',
// Frontend - Flow - Inc - Page
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/base.tpl' => 'views/smarty/flow/documents/inc/page/base.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/header.tpl' => 'views/smarty/flow/documents/inc/page/header.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/footer.tpl' => 'views/smarty/flow/documents/inc/page/footer.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/returnaddress.tpl' => 'views/smarty/flow/documents/inc/page/returnaddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/base.tpl' => 'views/smarty/documents/inc/page/base.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/header.tpl' => 'views/smarty/documents/inc/page/header.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/footer.tpl' => 'views/smarty/documents/inc/page/footer.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/returnaddress.tpl' => 'views/smarty/documents/inc/page/returnaddress.tpl',
// Frontend - Flow - Inc - Elements
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/addressarea.tpl' => 'views/smarty/flow/documents/inc/elements/addressarea.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/recipientAddress.tpl' => 'views/smarty/flow/documents/inc/elements/recipientAddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/informations.tpl' => 'views/smarty/flow/documents/inc/elements/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/deliveryaddress.tpl' => 'views/smarty/flow/documents/inc/elements/deliveryaddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/articlelist.tpl' => 'views/smarty/flow/documents/inc/elements/articlelist.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/articlecostssummary.tpl' => 'views/smarty/flow/documents/inc/elements/articlecostssummary.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/foldmarks.tpl' => 'views/smarty/flow/documents/inc/elements/foldmarks.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/addressarea.tpl' => 'views/smarty/documents/inc/elements/addressarea.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/recipientAddress.tpl' => 'views/smarty/documents/inc/elements/recipientAddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/informations.tpl' => 'views/smarty/documents/inc/elements/informations.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/deliveryaddress.tpl' => 'views/smarty/documents/inc/elements/deliveryaddress.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/articlelist.tpl' => 'views/smarty/documents/inc/elements/articlelist.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/articlecostssummary.tpl' => 'views/smarty/documents/inc/elements/articlecostssummary.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/foldmarks.tpl' => 'views/smarty/documents/inc/elements/foldmarks.tpl',
// Frontend - Flow - Inc - Helper
'@' . Constants::OXID_MODULE_ID . '/documents/inc/helper/rulers.tpl' => 'views/smarty/flow/documents/inc/helper/rulers.tpl',
'@' . Constants::OXID_MODULE_ID . '/documents/inc/helper/rulers.tpl' => 'views/smarty/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' => [
@ -92,12 +90,6 @@ $aModule = [
'name' => Constants::OXID_MODULE_ID.'bDev',
'type' => 'bool',
'value' => false
],
[
'group' => Constants::OXID_MODULE_ID.'main',
'name' => Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName',
'type' => 'str',
'value' => ''
]
]
];

View File

@ -3,33 +3,33 @@
[{capture append="pdfBlock_style"}]
[{block name="pdfStyles"}]
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}]
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}]
[{/block}]
[{/capture}]
[{capture append="pdfBlock_header"}]
[{block name="pdfHeader"}]
[{include file="@d3PdfDocuments/documents/inc/page/header" showLogo=$showLogo}]
[{include file="@d3PdfDocuments/documents/inc/page/header.tpl" showLogo=$showLogo}]
[{/block}]
[{/capture}]
[{capture append="pdfBlock_content"}]
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks.tpl" pagePadding=$pagePadding}]
[{block name="pdfAddressArea"}]
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea" addressfile="@d3PdfDocuments/documents/deliverynote/recipientAddress"}]
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea.tpl" addressfile="@d3PdfDocuments/documents/deliverynote/recipientAddress.tpl"}]
[{/block}]
[{block name="pdfInformations"}]
[{include file="@d3PdfDocuments/documents/inc/elements/informations" documentinformationfile="@d3PdfDocuments/documents/deliverynote/informations"}]
[{include file="@d3PdfDocuments/documents/inc/elements/informations.tpl" documentinformationfile="@d3PdfDocuments/documents/deliverynote/informations.tpl"}]
[{/block}]
[{block name="pdfSalutation"}]
[{include file="@d3PdfDocuments/documents/deliverynote/salutation"}]
[{include file="@d3PdfDocuments/documents/deliverynote/salutation.tpl"}]
[{/block}]
[{block name="pdfArticleList"}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist" showPrices=false}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist.tpl" showPrices=false}]
[{/block}]
[{block name="pdfConclusion"}]
@ -39,8 +39,8 @@
[{capture append="pdfBlock_footer"}]
[{block name="pdfFooter"}]
[{include file="@d3PdfDocuments/documents/inc/page/footer" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/page/footer.tpl" pagePadding=$pagePadding}]
[{/block}]
[{/capture}]
[{include file="@d3PdfDocuments/documents/inc/page/base" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/page/base.tpl" pagePadding=$pagePadding}]

View File

@ -1 +1 @@
[{include file="@d3PdfDocuments/documents/deliverynote/deliverynote" showLogo=false}]
[{include file="@d3PdfDocuments/documents/deliverynote/deliverynote.tpl" showLogo=false}]

View File

@ -1,5 +1,5 @@
[{assign var="backaddressfile" value=$backaddressfile|default:"@d3PdfDocuments/documents/inc/page/returnaddress"}]
[{assign var="addressfile" value=$addressfile|default:"@d3PdfDocuments/documents/inc/elements/recipientAddress"}]
[{assign var="backaddressfile" value=$backaddressfile|default:"@d3PdfDocuments/documents/inc/page/returnaddress.tpl"}]
[{assign var="addressfile" value=$addressfile|default:"@d3PdfDocuments/documents/inc/elements/recipientAddress.tpl"}]
<div class="addressarea">
<div class="returnAddress">

View File

@ -54,7 +54,7 @@
<nobreak>
<table class="article_costs_table">
[{block name="d3_article_costs_summary"}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlecostssummary"}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlecostssummary.tpl"}]
[{/block}]
</table>
</nobreak>

View File

@ -3,11 +3,9 @@
[{block name="pdfHeader"}]
<div class="header">
[{if $showLogo}]
[{* pdf logo is available only in non admin theme *}]
[{assign var="isAdmin" value=$viewConfig->isAdmin()}]
[{$viewConfig->setAdminMode(false)}]
<img class="logo" alt="Logo" src="[{$viewConfig->getImageUrl('pdf_logo.jpg')}]">
[{$viewConfig->setAdminMode($isAdmin)}]
[{block name="pdfHeaderLogo"}]
<img class="logo" alt="Logo" src="[{$oViewConf->getModulePath('d3PdfDocuments', 'out/img/clogo.jpg')}]">
[{/block}]
[{/if}]
</div>
[{/block}]

View File

@ -5,7 +5,7 @@
[{oxmultilang ident="D3_PDFDOCUMENTS_USED_PAYMENTMETHOD" suffix="COLON"}]
[{$payment->getFieldData('oxdesc')}]<br>
[{include file="@d3PdfDocuments/documents/invoice/payinfo"}]
[{include file="@d3PdfDocuments/documents/invoice/payinfo.tpl"}]
</div>
[{/block}]

View File

@ -3,49 +3,49 @@
[{capture append="pdfBlock_style"}]
[{block name="pdfStyles"}]
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}]
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}]
[{/block}]
[{/capture}]
[{capture append="pdfBlock_header"}]
[{block name="pdfHeader"}]
[{include file="@d3PdfDocuments/documents/inc/page/header" showLogo=$showLogo}]
[{include file="@d3PdfDocuments/documents/inc/page/header.tpl" showLogo=$showLogo}]
[{/block}]
[{/capture}]
[{capture append="pdfBlock_content"}]
[{* include file="@d3PdfDocuments/documents/inc/helper/rulers" pagePadding=$pagePadding *}]
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks.tpl" pagePadding=$pagePadding}]
[{block name="pdfAddressArea"}]
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea"}]
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea.tpl"}]
[{/block}]
[{block name="pdfInformations"}]
[{include file="@d3PdfDocuments/documents/inc/elements/informations" documentinformationfile="@d3PdfDocuments/documents/invoice/informations"}]
[{include file="@d3PdfDocuments/documents/inc/elements/informations.tpl" documentinformationfile="@d3PdfDocuments/documents/invoice/informations.tpl"}]
[{/block}]
[{block name="pdfDeliveryAddress"}]
[{include file="@d3PdfDocuments/documents/inc/elements/deliveryaddress"}]
[{include file="@d3PdfDocuments/documents/inc/elements/deliveryaddress.tpl"}]
[{/block}]
[{block name="pdfSalutation"}]
[{include file="@d3PdfDocuments/documents/invoice/salutation"}]
[{include file="@d3PdfDocuments/documents/invoice/salutation.tpl"}]
[{/block}]
[{block name="pdfArticleList"}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist"}]
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist.tpl"}]
[{/block}]
[{block name="pdfConclusion"}]
[{include file="@d3PdfDocuments/documents/invoice/conclusion"}]
[{include file="@d3PdfDocuments/documents/invoice/conclusion.tpl"}]
[{/block}]
[{/capture}]
[{capture append="pdfBlock_footer"}]
[{block name="pdfFooter"}]
[{include file="@d3PdfDocuments/documents/inc/page/footer" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/page/footer.tpl" pagePadding=$pagePadding}]
[{/block}]
[{/capture}]
[{include file="@d3PdfDocuments/documents/inc/page/base" pagePadding=$pagePadding}]
[{include file="@d3PdfDocuments/documents/inc/page/base.tpl" pagePadding=$pagePadding}]

View File

@ -1 +1 @@
[{include file="@d3PdfDocuments/documents/invoice/invoice" showLogo=false}]
[{include file="@d3PdfDocuments/documents/invoice/invoice.tpl" showLogo=false}]

View File

@ -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;
}

View File

@ -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 %}

View File

@ -1,16 +1,11 @@
{% set showLogo = showLogo|default(1) %}
{% set sPdfLogo = sAlternativePdfLogo %}
{% block pdfHeader %}
<div class="header">
{% if showLogo %}
{# pdf logo is available only in non admin theme #}
{% set isAdmin = oViewConf.isAdmin() %}
{{ oViewConf.setAdminMode(false) }}
{% if sPdfLogo %}
<img class="logo" alt="Logo" src="{{ sPdfLogo }}">
{% endif %}
{{ oViewConf.setAdminMode(isAdmin) }}
{% block pdfHeaderLogo %}
<img class="logo" alt="Logo" src="{{ oViewConf.getModulePath('d3PdfDocuments', 'out/img/clogo.jpg') }}">
{% endblock %}
{% endif %}
</div>
{% endblock %}

View File

@ -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 %}