Compare commits
No commits in common. "master" and "2.0.0" have entirely different histories.
@ -11,7 +11,6 @@
|
|||||||
namespace D3\PdfDocuments\Application\Controller;
|
namespace D3\PdfDocuments\Application\Controller;
|
||||||
|
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\noPdfHandlerFoundException;
|
use D3\PdfDocuments\Application\Model\Exceptions\noPdfHandlerFoundException;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\wrongPdfGeneratorInterface;
|
|
||||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||||
use D3\PdfDocuments\Application\Model\Registries\registryOrderoverview;
|
use D3\PdfDocuments\Application\Model\Registries\registryOrderoverview;
|
||||||
use OxidEsales\Eshop\Application\Model\Order;
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
@ -23,9 +22,8 @@ class orderOverviewPdfGenerator
|
|||||||
* @param Order $order
|
* @param Order $order
|
||||||
* @param int $iSelLang
|
* @param int $iSelLang
|
||||||
* @throws noPdfHandlerFoundException
|
* @throws noPdfHandlerFoundException
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
*/
|
||||||
public function generatePdf(Order $order, int $iSelLang = 0)
|
public function generatePdf(Order $order, $iSelLang = 0)
|
||||||
{
|
{
|
||||||
$Pdf= $this->getPdfClass();
|
$Pdf= $this->getPdfClass();
|
||||||
|
|
||||||
@ -36,7 +34,6 @@ class orderOverviewPdfGenerator
|
|||||||
/**
|
/**
|
||||||
* @return pdfdocumentsOrderInterface
|
* @return pdfdocumentsOrderInterface
|
||||||
* @throws noPdfHandlerFoundException
|
* @throws noPdfHandlerFoundException
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
*/
|
||||||
public function getPdfClass()
|
public function getPdfClass()
|
||||||
{
|
{
|
||||||
|
@ -11,19 +11,22 @@
|
|||||||
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
|
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
|
||||||
|
|
||||||
use Assert\InvalidArgumentException;
|
use Assert\InvalidArgumentException;
|
||||||
|
use D3\ModCfg\Application\Model\d3filesystem;
|
||||||
use D3\PdfDocuments\Application\Model\Constants;
|
use D3\PdfDocuments\Application\Model\Constants;
|
||||||
|
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
|
||||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface;
|
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface;
|
||||||
use OxidEsales\Eshop\Core\Base;
|
use OxidEsales\Eshop\Core\Base;
|
||||||
use OxidEsales\Eshop\Core\Exception\StandardException;
|
use OxidEsales\Eshop\Core\Exception\StandardException;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\Eshop\Core\UtilsView;
|
use OxidEsales\Eshop\Core\UtilsView;
|
||||||
|
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
|
||||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateEngineInterface;
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRenderer;
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRenderer;
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
||||||
use OxidEsales\Twig\Resolver\TemplateChain\TemplateNotInChainException;
|
use OxidEsales\Twig\Resolver\TemplateChain\TemplateNotInChainException;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Smarty;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
|
||||||
use Spipu\Html2Pdf\Exception\Html2PdfException;
|
use Spipu\Html2Pdf\Exception\Html2PdfException;
|
||||||
use Spipu\Html2Pdf\Html2Pdf;
|
use Spipu\Html2Pdf\Html2Pdf;
|
||||||
use Twig\Error\Error;
|
use Twig\Error\Error;
|
||||||
@ -42,9 +45,38 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
|
|
||||||
public $filenameExtension = 'pdf';
|
public $filenameExtension = 'pdf';
|
||||||
|
|
||||||
|
/** @var Smarty */
|
||||||
|
public $oTemplateEngine;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $filename;
|
public $filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pdfDocumentsGeneric constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->oTemplateEngine = $this->d3GetTemplateEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function d3GetTemplateEngine() :TemplateEngineInterface
|
||||||
|
{
|
||||||
|
$renderer = $this->d3GetTemplateRendererBridge()->getTemplateRenderer();
|
||||||
|
return $renderer->getTemplateEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function d3GetTemplateRendererBridge(): TemplateRendererBridgeInterface
|
||||||
|
{
|
||||||
|
return ContainerFactory::getInstance()->getContainer()
|
||||||
|
->get(TemplateRendererBridgeInterface::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function runPreAction()
|
public function runPreAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -54,14 +86,11 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sFilename
|
* @param $sFilename
|
||||||
* @param int $iSelLang
|
* @param int $iSelLang
|
||||||
* @param string $target
|
* @param string $target
|
||||||
*
|
* @return mixed|string|null
|
||||||
* @return string|null
|
|
||||||
* @throws ContainerExceptionInterface
|
|
||||||
* @throws Html2PdfException
|
* @throws Html2PdfException
|
||||||
* @throws NotFoundExceptionInterface
|
|
||||||
*/
|
*/
|
||||||
public function genPdf($sFilename, $iSelLang = 0, $target = self::PDF_DESTINATION_STDOUT)
|
public function genPdf($sFilename, $iSelLang = 0, $target = self::PDF_DESTINATION_STDOUT)
|
||||||
{
|
{
|
||||||
@ -69,10 +98,10 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$oPdf->setTestIsImage(false);
|
$oPdf->setTestIsImage(false);
|
||||||
$htmlContent = $this->getHTMLContent($iSelLang);
|
$htmlContent = $this->getHTMLContent($iSelLang);
|
||||||
$oPdf->writeHTML($htmlContent);
|
$oPdf->writeHTML($htmlContent);
|
||||||
$oPdf->pdf->setAuthor( Registry::getConfig()->getActiveShop()->getFieldData( 'oxname'));
|
$oPdf->pdf->SetAuthor(Registry::getConfig()->getActiveShop()->getFieldData('oxname'));
|
||||||
$oPdf->pdf->setTitle( Registry::getLang()->translateString( $this->getTitleIdent()));
|
$oPdf->pdf->SetTitle(Registry::getLang()->translateString($this->getTitleIdent()));
|
||||||
$oPdf->pdf->setCreator( 'DÂł PDF Documents for OXID eShop');
|
$oPdf->pdf->SetCreator('DÂł PDF Documents for OXID eShop');
|
||||||
$oPdf->pdf->setSubject( NULL);
|
$oPdf->pdf->SetSubject(NULL);
|
||||||
return $this->output($oPdf, $sFilename, $target, $htmlContent);
|
return $this->output($oPdf, $sFilename, $target, $htmlContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,15 +109,6 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
* @throws Html2PdfException
|
* @throws Html2PdfException
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $iLanguage
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @throws ContainerExceptionInterface
|
|
||||||
* @throws Html2PdfException
|
|
||||||
* @throws NotFoundExceptionInterface
|
|
||||||
*/
|
|
||||||
public function downloadPdf($iLanguage = 0)
|
public function downloadPdf($iLanguage = 0)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -97,20 +117,20 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$this->genPdf($sFilename, $iLanguage, self::PDF_DESTINATION_DOWNLOAD);
|
$this->genPdf($sFilename, $iLanguage, self::PDF_DESTINATION_DOWNLOAD);
|
||||||
$this->runPostAction();
|
$this->runPostAction();
|
||||||
Registry::getUtils()->showMessageAndExit('');
|
Registry::getUtils()->showMessageAndExit('');
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||||
Registry::getLogger()->error($e);
|
|
||||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
|
Registry::getLogger()->error($e);
|
||||||
|
} catch (InvalidArgumentException $e) {
|
||||||
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
|
Registry::getLogger()->error($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
* @throws ContainerExceptionInterface
|
|
||||||
* @throws Html2PdfException
|
* @throws Html2PdfException
|
||||||
* @throws NotFoundExceptionInterface
|
|
||||||
*/
|
*/
|
||||||
public function savePdfFile($path, $iLanguage = 0)
|
public function savePdfFile($path, $iLanguage = 0)
|
||||||
{
|
{
|
||||||
@ -123,6 +143,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
self::PDF_DESTINATION_FILE
|
self::PDF_DESTINATION_FILE
|
||||||
);
|
);
|
||||||
$this->runPostAction();
|
$this->runPostAction();
|
||||||
|
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||||
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
|
Registry::getLogger()->error($e);
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error($e);
|
Registry::getLogger()->error($e);
|
||||||
@ -132,10 +155,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
/**
|
/**
|
||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return null|string
|
||||||
* @throws ContainerExceptionInterface
|
|
||||||
* @throws Html2PdfException
|
* @throws Html2PdfException
|
||||||
* @throws NotFoundExceptionInterface
|
|
||||||
*/
|
*/
|
||||||
public function getPdfContent($iLanguage = 0)
|
public function getPdfContent($iLanguage = 0)
|
||||||
{
|
{
|
||||||
@ -145,6 +166,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$ret = $this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STRING );
|
$ret = $this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STRING );
|
||||||
$this->runPostAction();
|
$this->runPostAction();
|
||||||
return $ret;
|
return $ret;
|
||||||
|
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||||
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
|
Registry::getLogger()->error($e);
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
Registry::getLogger()->error($e);
|
Registry::getLogger()->error($e);
|
||||||
@ -153,26 +177,52 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTemplateEngineVars(int $iSelLang): array
|
/**
|
||||||
|
* @param int $iSelLang
|
||||||
|
*/
|
||||||
|
public function setTemplateEngineVars($iSelLang)
|
||||||
{
|
{
|
||||||
unset($iSelLang);
|
unset($iSelLang);
|
||||||
|
|
||||||
return [
|
$this->oTemplateEngine->addGlobal('config', Registry::getConfig());
|
||||||
'config' => Registry::getConfig(),
|
$this->oTemplateEngine->addGlobal('sAlternativePdfLogo', $this->getAlternativePdfLogoFileName());
|
||||||
'oViewConf' => Registry::getConfig()->getActiveView()->getViewConfig(),
|
$this->oTemplateEngine->addGlobal('oViewConf', Registry::getConfig()->getActiveView()->getViewConfig());
|
||||||
'shop' => Registry::getConfig()->getActiveShop(),
|
$this->oTemplateEngine->addGlobal('shop', Registry::getConfig()->getActiveShop());
|
||||||
'lang' => Registry::getLang(),
|
$this->oTemplateEngine->addGlobal('lang', Registry::getLang());
|
||||||
'document' => $this
|
$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
|
* @param int $iSelLang
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function getHTMLContent(int $iSelLang = 0)
|
public function getHTMLContent($iSelLang = 0)
|
||||||
{
|
{
|
||||||
$blCurrentRenderFromAdmin = self::$_blIsAdmin;
|
$blCurrentRenderFromAdmin = self::$_blIsAdmin;
|
||||||
self::$_blIsAdmin = $this->renderTemplateFromAdmin();
|
self::$_blIsAdmin = $this->renderTemplateFromAdmin();
|
||||||
@ -182,16 +232,16 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$currTplLang = $lang->getTplLanguage();
|
$currTplLang = $lang->getTplLanguage();
|
||||||
$lang->setTplLanguage($iSelLang);
|
$lang->setTplLanguage($iSelLang);
|
||||||
|
|
||||||
|
$this->setTemplateEngineVars($iSelLang);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$content = $this->getTemplateRenderer()->renderTemplate(
|
$content = $this->oTemplateEngine->render($this->getTemplate(), $this->d3GetTemplateEngine()->getGlobals());
|
||||||
$this->getTemplate(),
|
|
||||||
$this->getTemplateEngineVars($iSelLang)
|
|
||||||
);
|
|
||||||
} catch (Error|TemplateNotInChainException $error) {
|
} catch (Error|TemplateNotInChainException $error) {
|
||||||
|
|
||||||
//Registry::getLogger()->error(dumpVar(__METHOD__." ".__LINE__), [$error->getFile()]);
|
//Registry::getLogger()->error(dumpVar(__METHOD__." ".__LINE__), [$error->getFile()]);
|
||||||
|
|
||||||
throw oxNew(StandardException::class, $error->getMessage());
|
$error = oxNew(StandardException::class, $error->getMessage());
|
||||||
|
throw $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
$lang->setTplLanguage($currTplLang);
|
$lang->setTplLanguage($currTplLang);
|
||||||
@ -201,13 +251,6 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTemplateRenderer(): TemplateRenderer
|
|
||||||
{
|
|
||||||
return ContainerFactory::getInstance()->getContainer()
|
|
||||||
->get(TemplateRendererBridgeInterface::class)
|
|
||||||
->getTemplateRenderer();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* arguments for Html2Pdf class constructor
|
* arguments for Html2Pdf class constructor
|
||||||
* - $orientation = 'P',
|
* - $orientation = 'P',
|
||||||
@ -279,66 +322,14 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
/**
|
/**
|
||||||
* Gets proper file name
|
* Gets proper file name
|
||||||
*
|
*
|
||||||
* @param $filename
|
* @param string $sFilename file name
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function makeValidFileName($filename)
|
public function makeValidFileName($sFilename)
|
||||||
{
|
{
|
||||||
// sanitize filename
|
$fs = oxNew(d3filesystem::class);
|
||||||
$filename = preg_replace(
|
return $fs->filterFilename($sFilename);
|
||||||
'~
|
|
||||||
[<>:"/\\\\|?*]| # 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);
|
|
||||||
return mb_strcut(
|
|
||||||
pathinfo($filename, PATHINFO_FILENAME),
|
|
||||||
0,
|
|
||||||
255 - ($ext ? strlen($ext) + 1 : 0),
|
|
||||||
mb_detect_encoding($filename)
|
|
||||||
) . ($ext ? '.' . $ext : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -351,19 +342,15 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Html2Pdf $oPdf
|
* @param Html2Pdf $oPdf
|
||||||
* @param $sFilename
|
* @param $sFilename
|
||||||
* @param $target
|
* @param $target
|
||||||
* @param $html
|
* @param $html
|
||||||
*
|
|
||||||
* @return string|null
|
* @return string|null
|
||||||
* @throws Html2PdfException
|
* @throws Html2PdfException
|
||||||
* @throws ContainerExceptionInterface
|
|
||||||
* @throws NotFoundExceptionInterface
|
|
||||||
*/
|
*/
|
||||||
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
|
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
|
||||||
{
|
{
|
||||||
$moduleSettings = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
|
if ((bool) Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') === true) {
|
||||||
if ($moduleSettings->getBoolean( 'd3PdfDocumentsbDev', Constants::OXID_MODULE_ID )) {
|
|
||||||
return $this->outputDev($oPdf, $sFilename, $target, $html);
|
return $this->outputDev($oPdf, $sFilename, $target, $html);
|
||||||
} else {
|
} else {
|
||||||
return $oPdf->output($sFilename, $target);
|
return $oPdf->output($sFilename, $target);
|
||||||
|
@ -57,22 +57,19 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
|||||||
* @param int $iSelLang
|
* @param int $iSelLang
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function getTemplateEngineVars($iSelLang): array
|
public function setTemplateEngineVars($iSelLang)
|
||||||
{
|
{
|
||||||
|
parent::setTemplateEngineVars($iSelLang);
|
||||||
|
|
||||||
|
$this->oTemplateEngine->addGlobal('order', $this->getOrder());
|
||||||
|
|
||||||
$oUser = oxNew(User::Class);
|
$oUser = oxNew(User::Class);
|
||||||
$oUser->load($this->getOrder()->getFieldData('oxuserid'));
|
$oUser->load($this->getOrder()->getFieldData('oxuserid'));
|
||||||
|
$this->oTemplateEngine->addGlobal('user', $oUser);
|
||||||
|
|
||||||
$oPayment = oxNew(Payment::class);
|
$oPayment = oxNew(Payment::class);
|
||||||
$oPayment->loadInLang($iSelLang, $this->getOrder()->getFieldData('oxpaymenttype'));
|
$oPayment->loadInLang($iSelLang, $this->getOrder()->getFieldData('oxpaymenttype'));
|
||||||
|
$this->oTemplateEngine->addGlobal('payment', $oPayment);
|
||||||
return array_merge(
|
|
||||||
parent::getTemplateEngineVars($iSelLang),
|
|
||||||
[
|
|
||||||
'order' => $this->getOrder(),
|
|
||||||
'user' => $oUser,
|
|
||||||
'payment' => $oPayment
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,7 +116,7 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return false|int
|
* @return false|string
|
||||||
* @throws InvalidArgumentException
|
* @throws InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function getPayableUntilDate()
|
public function getPayableUntilDate()
|
||||||
|
@ -39,8 +39,7 @@ class invoicewithoutlogoPdf extends invoicePdf
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTemplate()
|
public function getTemplate(){
|
||||||
{
|
|
||||||
return '@d3PdfDocuments/documents/invoice/invoiceNoLogo';
|
return '@d3PdfDocuments/documents/invoice/invoiceNoLogo';
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -35,29 +35,29 @@ interface pdfdocumentsGenericInterface
|
|||||||
/**
|
/**
|
||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
*/
|
*/
|
||||||
public function downloadPdf(int $iLanguage = 0);
|
public function downloadPdf($iLanguage = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function getPdfContent(int $iLanguage = 0);
|
public function getPdfContent($iLanguage = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param int $iLanguage
|
* @param int $iLanguage
|
||||||
*/
|
*/
|
||||||
public function savePdfFile(string $path, int $iLanguage = 0);
|
public function savePdfFile($path, $iLanguage = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sFilename
|
* @param $sFilename
|
||||||
* @param int $iSelLang
|
* @param int $iSelLang
|
||||||
* @param string $target
|
* @param string $target
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function genPdf(string $sFilename, int $iSelLang = 0, string $target = 'I');
|
public function genPdf($sFilename, $iSelLang = 0, $target = 'I');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
|
@ -28,12 +28,10 @@ abstract class registryAbstract implements registryGenericInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $className
|
* @param $className
|
||||||
*
|
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
*/
|
||||||
public function addGenerator($className)
|
public function addGenerator($className)
|
||||||
{
|
{
|
||||||
if ( ! $this->hasGenerator( $className ) ) {
|
if (false == $this->hasGenerator($className)) {
|
||||||
/** @var pdfdocumentsGenericInterface $generator */
|
/** @var pdfdocumentsGenericInterface $generator */
|
||||||
$generator = oxNew( $className );
|
$generator = oxNew( $className );
|
||||||
|
|
||||||
@ -46,13 +44,12 @@ abstract class registryAbstract implements registryGenericInterface
|
|||||||
/**
|
/**
|
||||||
* @param $className * generator fully qualified class name
|
* @param $className * generator fully qualified class name
|
||||||
* @param pdfdocumentsGenericInterface $item
|
* @param pdfdocumentsGenericInterface $item
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
*/
|
||||||
protected function addItem($className, pdfdocumentsGenericInterface $item)
|
protected function addItem($className, pdfdocumentsGenericInterface $item)
|
||||||
{
|
{
|
||||||
$requiredInterface = $this->getRequiredGeneratorInterfaceClassName();
|
$requiredInterface = $this->getRequiredGeneratorInterfaceClassName();
|
||||||
|
|
||||||
if ( ! $item instanceof $requiredInterface ) {
|
if (false == $item instanceof $requiredInterface) {
|
||||||
throw oxNew(wrongPdfGeneratorInterface::class, $requiredInterface);
|
throw oxNew(wrongPdfGeneratorInterface::class, $requiredInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,14 +14,10 @@ use D3\PdfDocuments\Application\Model\Documents\deliverynotePdf;
|
|||||||
use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
||||||
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
||||||
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\wrongPdfGeneratorInterface;
|
|
||||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||||
|
|
||||||
class registryOrdermanagerActions extends registryAbstract implements registryOrdermanagerActionsInterface
|
class registryOrdermanagerActions extends registryAbstract implements registryOrdermanagerActionsInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->addGenerator(invoicePdf::class);
|
$this->addGenerator(invoicePdf::class);
|
||||||
|
@ -14,14 +14,10 @@ use D3\PdfDocuments\Application\Model\Documents\deliverynotePdf;
|
|||||||
use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
||||||
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
||||||
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\wrongPdfGeneratorInterface;
|
|
||||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||||
|
|
||||||
class registryOrderoverview extends registryAbstract implements registryOrderoverviewInterface
|
class registryOrderoverview extends registryAbstract implements registryOrderoverviewInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @throws wrongPdfGeneratorInterface
|
|
||||||
*/
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->addGenerator(invoicePdf::class);
|
$this->addGenerator(invoicePdf::class);
|
||||||
|
@ -8,14 +8,16 @@
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use D3\PdfDocuments\Application\Model\Constants;
|
|
||||||
|
|
||||||
$sLangName = "Deutsch";
|
$sLangName = "Deutsch";
|
||||||
$aLang = array(
|
$aLang = array(
|
||||||
'charset' => 'utf-8',
|
'charset' => 'utf-8',
|
||||||
|
|
||||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
|
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
|
||||||
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
|
'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>',
|
||||||
|
|
||||||
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
|
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
|
||||||
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
|
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
|
||||||
|
@ -8,14 +8,16 @@
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use D3\PdfDocuments\Application\Model\Constants;
|
|
||||||
|
|
||||||
$sLangName = "English";
|
$sLangName = "English";
|
||||||
$aLang = array(
|
$aLang = array(
|
||||||
'charset' => 'utf-8',
|
'charset' => 'utf-8',
|
||||||
|
|
||||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
|
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
|
||||||
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
|
'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>',
|
||||||
|
|
||||||
'D3_PDFDOCUMENTS' => 'PDF Documents',
|
'D3_PDFDOCUMENTS' => 'PDF Documents',
|
||||||
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
||||||
|
@ -15,7 +15,11 @@ $aLang = array(
|
|||||||
'charset' => 'utf-8',
|
'charset' => 'utf-8',
|
||||||
|
|
||||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
|
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
|
||||||
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Entwicklermodus',
|
'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>',
|
||||||
|
|
||||||
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
|
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
|
||||||
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
|
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
|
||||||
|
@ -8,14 +8,16 @@
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use D3\PdfDocuments\Application\Model\Constants;
|
|
||||||
|
|
||||||
$sLangName = "English";
|
$sLangName = "English";
|
||||||
$aLang = array(
|
$aLang = array(
|
||||||
'charset' => 'utf-8',
|
'charset' => 'utf-8',
|
||||||
|
|
||||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
|
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
|
||||||
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'bDev' => 'Developer mode',
|
'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>',
|
||||||
|
|
||||||
'D3_PDFDOCUMENTS' => 'PDF Documents',
|
'D3_PDFDOCUMENTS' => 'PDF Documents',
|
||||||
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
||||||
|
@ -13,59 +13,38 @@ namespace D3\PdfDocuments\Modules\Application\Controller;
|
|||||||
use D3\PdfDocuments\Application\Controller\orderOverviewPdfGenerator;
|
use D3\PdfDocuments\Application\Controller\orderOverviewPdfGenerator;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\noPdfHandlerFoundException;
|
use D3\PdfDocuments\Application\Model\Exceptions\noPdfHandlerFoundException;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
|
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
|
||||||
use D3\PdfDocuments\Application\Model\Exceptions\wrongPdfGeneratorInterface;
|
|
||||||
use D3\PdfDocuments\Application\Model\Registries\registryOrderoverview;
|
use D3\PdfDocuments\Application\Model\Registries\registryOrderoverview;
|
||||||
use Doctrine\DBAL\Driver\Exception;
|
use OxidEsales\Eshop\Application\Controller\Admin\OrderOverview;
|
||||||
use Doctrine\DBAL\Exception as DBALException;
|
|
||||||
use Doctrine\DBAL\ParameterType;
|
|
||||||
use Doctrine\DBAL\Query\QueryBuilder;
|
|
||||||
use OxidEsales\Eshop\Application\Model\Order;
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\Eshop\Core\TableViewNameGenerator;
|
use OxidEsales\Eshop\Core\TableViewNameGenerator;
|
||||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface;
|
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
|
||||||
|
|
||||||
class d3_overview_controller_pdfdocuments extends d3_overview_controller_pdfdocuments_parent
|
class d3_overview_controller_pdfdocuments extends d3_overview_controller_pdfdocuments_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws Exception
|
* @throws DatabaseConnectionException
|
||||||
*/
|
*/
|
||||||
public function d3CanExport(): bool
|
public function d3CanExport()
|
||||||
{
|
{
|
||||||
try {
|
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
|
||||||
$sOrderId = $this->getEditObjectId();
|
$masterDb = DatabaseProvider::getMaster();
|
||||||
|
$sOrderId = $this->getEditObjectId();
|
||||||
|
|
||||||
$viewNameGenerator = Registry::get( TableViewNameGenerator::class );
|
$viewNameGenerator = Registry::get(TableViewNameGenerator::class);
|
||||||
$sTable = $viewNameGenerator->getViewName( "oxorderarticles" );
|
$sTable = $viewNameGenerator->getViewName("oxorderarticles");
|
||||||
|
|
||||||
/** @var QueryBuilder $queryBuilder */
|
$sQ = "select count(oxid) from $sTable where oxorderid = " . $masterDb->quote($sOrderId) . " and oxstorno = 0";
|
||||||
$queryBuilder = ContainerFactory::getInstance()->getContainer()->get( QueryBuilderFactoryInterface::class )->create();
|
return (bool) $masterDb->getOne($sQ);
|
||||||
$queryBuilder
|
|
||||||
->select( 'oxid' )
|
|
||||||
->from( $sTable )
|
|
||||||
->where(
|
|
||||||
$queryBuilder->expr()->and(
|
|
||||||
$queryBuilder->expr()->eq( 'oxorderid', $queryBuilder->createNamedParameter( $sOrderId ) ),
|
|
||||||
$queryBuilder->expr()->eq( 'oxstorno', $queryBuilder->createNamedParameter( 0, ParameterType::INTEGER ) )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return $queryBuilder->execute()->fetchOne();
|
|
||||||
} catch (NotFoundExceptionInterface|ContainerExceptionInterface|DBALException) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws noPdfHandlerFoundException
|
* @throws noPdfHandlerFoundException
|
||||||
* @throws pdfGeneratorExceptionAbstract
|
* @throws pdfGeneratorExceptionAbstract
|
||||||
*/
|
*/
|
||||||
public function d3CreatePDF(): void
|
public function d3CreatePDF()
|
||||||
{
|
{
|
||||||
$soxId = $this->getEditObjectId();
|
$soxId = $this->getEditObjectId();
|
||||||
if ($soxId != "-1" && isset($soxId)) {
|
if ($soxId != "-1" && isset($soxId)) {
|
||||||
@ -79,10 +58,9 @@ class d3_overview_controller_pdfdocuments extends d3_overview_controller_pdfdocu
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return registryOrderoverview
|
* @return registryOrderoverview
|
||||||
* @throws wrongPdfGeneratorInterface
|
*/
|
||||||
*/
|
public function d3getGeneratorList()
|
||||||
public function d3getGeneratorList(): registryOrderoverview
|
|
||||||
{
|
{
|
||||||
return oxNew(registryOrderoverview::class);
|
return oxNew(registryOrderoverview::class);
|
||||||
}
|
}
|
||||||
|
14
README.en.md
14
README.en.md
@ -1,15 +1,10 @@
|
|||||||

|
> [german version](README.md)
|
||||||
[](https://packagist.org/packages/d3/pdfdocuments)
|
|
||||||

|
|
||||||
|
|
||||||
[](README.md)
|
|
||||||
[](README.en.md)
|
|
||||||
|
|
||||||
# PDF Documents
|
# PDF Documents
|
||||||
|
|
||||||
PDF document generator for OXID eShop
|
PDF document generator for OXID eShop
|
||||||
|
|
||||||
Create a wide variety of static or dynamic PDF documents at the touch of a button. The document content is created from templates (Smarty or Twig).
|
Create a wide variety of static or dynamic PDF documents at the touch of a button. The document content is created from Smarty templates.
|
||||||
|
|
||||||
At the orders of your OXID shop you have the option of creating an invoice and delivery note.
|
At the orders of your OXID shop you have the option of creating an invoice and delivery note.
|
||||||
|
|
||||||
@ -17,7 +12,7 @@ The module can be easily extended to adapt existing documents or add new ones. E
|
|||||||
|
|
||||||
## System requirements:
|
## System requirements:
|
||||||
|
|
||||||
- installed OXID eShop version 7.x
|
- installed OXID eShop version from 7.0 - 7.1
|
||||||
- PHP version for which installation packages are available (PHP 8)
|
- PHP version for which installation packages are available (PHP 8)
|
||||||
- Installation via Composer
|
- Installation via Composer
|
||||||
|
|
||||||
@ -43,8 +38,7 @@ Detailed installation instructions can be found [online](https://docs.oxidmodule
|
|||||||
|
|
||||||
## Credits:
|
## Credits:
|
||||||
|
|
||||||
- PDF logo made by Dimitriy Morilubov by www.flaticon.com
|
- PDF logo made by Dimitriy Morilubov from www.flaticon.com
|
||||||
- example company logo by https://www.logologo.com/
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
12
README.md
12
README.md
@ -1,15 +1,10 @@
|
|||||||

|
> [english version](README.en.md)
|
||||||
[](https://packagist.org/packages/d3/pdfdocuments)
|
|
||||||

|
|
||||||
|
|
||||||
[](README.md)
|
|
||||||
[](README.en.md)
|
|
||||||
|
|
||||||
# PDF-Dokumente
|
# PDF-Dokumente
|
||||||
|
|
||||||
PDF-Dokumentgenerator fĂĽr OXID eShop
|
PDF-Dokumentgenerator fĂĽr OXID eShop
|
||||||
|
|
||||||
Erstellen Sie unterschiedliche statische oder dynamische PDF-Dokumente auf Knopfdruck. Der Dokumentinhalt wird aus Templates (Smarty bzw. Twig) erstellt.
|
Erstellen Sie unterschiedliche statische oder dynamische PDF-Dokumente auf Kopfdruck. Der Dokumentinhalt wird aus Smartytemplates erstellt.
|
||||||
|
|
||||||
An den Bestellungen Ihres OXID-Shops steht Ihnen die Erstellung von Rechnung und Lieferschein zur VerfĂĽgung.
|
An den Bestellungen Ihres OXID-Shops steht Ihnen die Erstellung von Rechnung und Lieferschein zur VerfĂĽgung.
|
||||||
|
|
||||||
@ -17,7 +12,7 @@ Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder
|
|||||||
|
|
||||||
## Systemanforderungen:
|
## Systemanforderungen:
|
||||||
|
|
||||||
- installierter OXID eShop in Version 7.x
|
- installierter OXID eShop in Version ab 7.0 - 7.1
|
||||||
- PHP-Version, fĂĽr die Installationspakete verfĂĽgbar sind (PHP 8)
|
- PHP-Version, fĂĽr die Installationspakete verfĂĽgbar sind (PHP 8)
|
||||||
- Installation via Composer
|
- Installation via Composer
|
||||||
|
|
||||||
@ -44,7 +39,6 @@ Eine detaillierte Installationsanleitung finden Sie [online](https://docs.oxidmo
|
|||||||
## Danksagung:
|
## Danksagung:
|
||||||
|
|
||||||
- PDF-Logo erstellt von Dimitriy Morilubov von www.flaticon.com
|
- PDF-Logo erstellt von Dimitriy Morilubov von www.flaticon.com
|
||||||
- Beispielfirmenlogo von https://www.logologo.com/
|
|
||||||
|
|
||||||
## Lizenz
|
## Lizenz
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.4 KiB |
@ -7,18 +7,13 @@
|
|||||||
"modules",
|
"modules",
|
||||||
"eShop",
|
"eShop",
|
||||||
"d3",
|
"d3",
|
||||||
"PDF",
|
"PDF"
|
||||||
"documents",
|
|
||||||
"invoice",
|
|
||||||
"delivery note",
|
|
||||||
"d3dependencycheck",
|
|
||||||
"id_d3PdfDocuments"
|
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||||
"email": "info@shopmodule.com",
|
"email": "info@shopmodule.com",
|
||||||
"homepage": "https://www.d3data.de",
|
"homepage": "http://www.d3data.de",
|
||||||
"role": "Owner"
|
"role": "Owner"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -26,10 +21,19 @@
|
|||||||
"license": [
|
"license": [
|
||||||
"GPL-3.0-or-later"
|
"GPL-3.0-or-later"
|
||||||
],
|
],
|
||||||
|
"extra": {
|
||||||
|
"oxideshop": {
|
||||||
|
"blacklist-filter": [
|
||||||
|
"composer.json",
|
||||||
|
"docs/**/*.*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.0",
|
"php": "^8.0",
|
||||||
"oxid-esales/oxideshop-ce": "7.0 - 7.2",
|
"oxid-esales/oxideshop-ce": "7.0 - 7.1",
|
||||||
"spipu/html2pdf": "~5.2.8",
|
"spipu/html2pdf": "~5.2.8",
|
||||||
|
"d3/modcfg": "^7.1",
|
||||||
"beberlei/assert": "^3.3.2"
|
"beberlei/assert": "^3.3.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
# 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.
|
|
@ -7,38 +7,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased](https://git.d3data.de/D3Public/pdfdokumente/compare/2.0.2.0...rel_2.x)
|
## [Unreleased](https://git.d3data.de/D3Public/pdfdokumente/compare/2.0.0...rel_2.x)
|
||||||
|
|
||||||
## [2.0.2.0](https://git.d3data.de/D3Public/pdfdokumente/compare/2.0.1.1...2.0.2.0) - 2025-01-21
|
## [2.0.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.4.0...2.0.0) - 2024-08-XX
|
||||||
### Added
|
|
||||||
- installierbar in OXID 7.2
|
|
||||||
### Fixed
|
|
||||||
- Syntaxfehler in Twig Templates
|
|
||||||
- Wiederverwendung von Captures in unterschiedlichen Templates der selben Rendererinstanz in Smarty behoben
|
|
||||||
### Changed
|
|
||||||
- Template Renderer Verwendung
|
|
||||||
|
|
||||||
## [2.0.1.1](https://git.d3data.de/D3Public/pdfdokumente/compare/2.0.1.0...2.0.1.1) - 2024-10-04
|
|
||||||
### Fixed
|
|
||||||
- Syntax der Steuerangaben in Twig-Templates
|
|
||||||
|
|
||||||
## [2.0.1.0](https://git.d3data.de/D3Public/pdfdokumente/compare/2.0.0.0...2.0.1.0) - 2024-10-01
|
|
||||||
### Added
|
|
||||||
- Entwicklungshandbuch
|
|
||||||
- Ăśberladungsblock fĂĽr Unternehmenslogo
|
|
||||||
### Fixed
|
|
||||||
- CSS wird nicht als Referenz sondern inline eingebunden
|
|
||||||
- Entwicklermodus kann konfiguriert werden
|
|
||||||
- Smarty Templates
|
|
||||||
### Removed
|
|
||||||
- Modul Connector Bedingung
|
|
||||||
|
|
||||||
## [2.0.0.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.4.0...2.0.0.0) - 2024-09-12
|
|
||||||
### Added
|
### Added
|
||||||
- installierbar in OXID 7.0 && 7.1 (CE 7.0.x - 7.1.x)
|
- installierbar in OXID 7.0 && 7.1 (CE 7.0.x - 7.1.x)
|
||||||
- Support fĂĽr Smarty- und Twig-Templates
|
|
||||||
### Removed
|
|
||||||
- Support fĂĽr OXID < 7.0
|
|
||||||
|
|
||||||
## [1.0.4.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.3.1...1.0.4.0) - 2023-12-22
|
## [1.0.4.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.3.1...1.0.4.0) - 2023-12-22
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"title": "<i class='fab fa-d3 d3fa-color-blue'></i> PDF Dokumente",
|
"title": "<i class='fab fa-d3 d3fa-color-blue'></i> PDF Dokumente",
|
||||||
"moduleversion": "2.0.2.0",
|
"moduleversion": "2.0.0",
|
||||||
"titledesc": "fĂĽr den Oxid eShop",
|
"titledesc": "fĂĽr den Oxid eShop",
|
||||||
"author": "DÂł Data Development",
|
"author": "DÂł Data Development",
|
||||||
"moduledate": "21.01.2025",
|
"moduledate": "12.09.2024",
|
||||||
"editors": "",
|
"editors": "",
|
||||||
"tagline": "",
|
"tagline": "",
|
||||||
"image": "",
|
"image": "",
|
||||||
|
@ -8,10 +8,10 @@ title: Systemanforderungen
|
|||||||
* OXID eShop Community Edition (CE), Professional Edition (PE) oder Enterprise Edition (EE) in Compilation Version
|
* OXID eShop Community Edition (CE), Professional Edition (PE) oder Enterprise Edition (EE) in Compilation Version
|
||||||
* 7.0.x
|
* 7.0.x
|
||||||
* 7.1.x
|
* 7.1.x
|
||||||
* 7.2.x
|
|
||||||
* Themes
|
* Themes
|
||||||
* Diese Modul bindet sich nicht in Frontendthemes ein und ist daher davon unabhängig
|
* Diese Modul bindet sich nicht in Frontendthemes ein und ist daher davon unabhängig
|
||||||
|
* (D3) Modul-Connector ([kostenfrei bei D3 erhältlich](https://www.oxidmodule.com/connector/)) ab Version 7.1
|
||||||
* Template-Engine
|
* Template-Engine
|
||||||
* Smarty
|
* Smarty ( Ungetestet! )
|
||||||
* Twig
|
* Twig
|
||||||
* Installation via [Composer](https://getcomposer.org)
|
* Installation via [Composer](https://getcomposer.org)
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
title: Kompatibilität mit anderen Modulen
|
title: Kompatibilität mit anderen Modulen
|
||||||
---
|
---
|
||||||
|
|
||||||
Das PDF Dokumente-Modul integriert sich auch in die Erweiterung "Auftragsmanager" von (D3) Data Development, sofern dieses im Shop installiert wurde. Diese Integration wurde fĂĽr die Version 6.0.0.0 des "Auftragsmanager"-Moduls entwickelt.
|
Das PDF Dokumente-Modul integriert sich auch in die Erweiterung "Auftragsmanager" von (D3) Data Development, sofern dieses im Shop installiert wurde. Diese Integration wurde fĂĽr die Version 4.0.0.0 des "Auftragsmanager"-Moduls entwickelt.
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
title: Dateien löschen
|
title: Dateien löschen
|
||||||
---
|
---
|
||||||
|
|
||||||
Sofern nötig, bestätigen Sie im Shopadmin unter [ Erweiterungen ] -> [ Module ] -> [ Installierte Shop-Module ] die Nachricht:
|
Löschen Sie den Ordner `{$modulefolder}` und seine enthaltenen Elemente aus dem Verzeichnis `source/modules/d3` Ihres Shops.
|
||||||
|
Bestätigen Sie anschließend im Shopadmin unter [ Erweiterungen ] -> [ Module ] -> [ Installierte Shop-Module ] die Nachricht:
|
||||||
|
|
||||||
> Es gibt registrierte Erweiterungen im eShop, deren Verzeichnis nicht vorhanden ist.
|
> Es gibt registrierte Erweiterungen im eShop, deren Verzeichnis nicht vorhanden ist.
|
||||||
> Möchten Sie alle Modulinformationen einschließlich Konfigurationseinstellungen und Blockinformationen für Templates löschen?
|
> Möchten Sie alle Modulinformationen einschließlich Konfigurationseinstellungen und Blockinformationen für Templates löschen?
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
title: Funktionen
|
title: Funktionen
|
||||||
---
|
---
|
||||||
|
|
||||||
Erstellen Sie unterschiedlichste statische oder dynamische PDF-Dokument auf Kopfdruck. Der Dokumentinhalt wird aus Templates (Smarty bzw. Twig) erstellt.
|
Erstellen Sie unterschiedlichste statische oder dynamische PDF-Dokument auf Kopfdruck. Der Dokumentinhalt wird aus Twigtemplates erstellt.
|
||||||
|
|
||||||
An den Bestellungen Ihres OXID-Shops steht Ihnen die Erstellung von Rechnung und Lieferschein zur VerfĂĽgung.
|
An den Bestellungen Ihres OXID-Shops steht Ihnen die Erstellung von Rechnung und Lieferschein zur VerfĂĽgung.
|
||||||
|
|
||||||
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder Neue hinzuzufĂĽgen.
|
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder Neue hinzuzufĂĽgen.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
title: Anpassungen an bestehenden Dokumenten
|
title: Anpassungen an bestehenden Dokumenten
|
||||||
---
|
---
|
||||||
|
|
||||||
Die Dokumente werden aus Templates (Smarty bzw. Twig) erstellt, die Sie im Ordner `views/smarty/documents` bzw. `views/twig/documents` finden.
|
Die Dokumente werden aus Twigtemplates erstellt, die Sie im `views/twig/documents` finden. Die entsprechenden Smarty Pendants sind unter `views/smarty/documents`.
|
||||||
|
|
||||||
Für Änderungen einzelner Dokumentbereiche können Sie die darin notierten Templateblöcke in einem eigenen Modul überladen und deren Inhalt so verändern oder ergänzen. So müssen Sie das Originalmodul nicht verändern.
|
Für Änderungen einzelner Dokumentbereiche können Sie die darin notierten Templateblöcke in einem eigenen Modul überladen und deren Inhalt so verändern oder ergänzen. So müssen Sie das Originalmodul nicht verändern.
|
||||||
|
|
||||||
|
@ -14,9 +14,10 @@ Layouts können mit inline CSS-Styles definiert werden. Die Einbindung externer
|
|||||||
|
|
||||||
Beachten Sie bitte, dass auch nur ein CSS-Subset unterstützt wird. Mit etwas CSS-Kreativität sollten sich die üblichen Formatierungen dennoch deutlich einfacher umsetzen lassen, als dies direkt in PHP-Programmierung möglich wäre.
|
Beachten Sie bitte, dass auch nur ein CSS-Subset unterstützt wird. Mit etwas CSS-Kreativität sollten sich die üblichen Formatierungen dennoch deutlich einfacher umsetzen lassen, als dies direkt in PHP-Programmierung möglich wäre.
|
||||||
|
|
||||||
## Templates
|
## Twig
|
||||||
|
|
||||||
Innerhalb der Templates steht Ihnen die komplette Twig- bzw. Smarty-Funktionalität zur Verfügung.
|
Innerhalb der Templates steht Ihnen die komplette Twig-Funktionalität zur Verfügung.
|
||||||
|
Smarty wird perspektivisch noch nachgereich.
|
||||||
|
|
||||||
## Debug
|
## Debug
|
||||||
|
|
||||||
|
72
metadata.php
72
metadata.php
@ -12,16 +12,24 @@ use D3\PdfDocuments\Application\Model\Constants as Constants;
|
|||||||
use D3\PdfDocuments\Modules\Application\Controller\d3_overview_controller_pdfdocuments;
|
use D3\PdfDocuments\Modules\Application\Controller\d3_overview_controller_pdfdocuments;
|
||||||
use OxidEsales\Eshop\Application\Controller\Admin\OrderOverview;
|
use OxidEsales\Eshop\Application\Controller\Admin\OrderOverview;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Metadata version
|
||||||
|
*/
|
||||||
$sMetadataVersion = '2.1';
|
$sMetadataVersion = '2.1';
|
||||||
|
|
||||||
|
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module information
|
||||||
|
*/
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => Constants::OXID_MODULE_ID,
|
'id' => Constants::OXID_MODULE_ID,
|
||||||
'title' => [
|
'title' => [
|
||||||
'de' => '(D3) PDF-Dokumente',
|
'de' => $logo.' PDF-Dokumente',
|
||||||
'en' => '(D3) PDF documents',
|
'en' => $logo.' PDF documents',
|
||||||
],
|
],
|
||||||
'version' => '2.0.2.0',
|
'version' => '2.0.0',
|
||||||
'author' => 'D3 Data Development (Inh.: Thomas Dartsch)',
|
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
'extend' => [
|
'extend' => [
|
||||||
@ -34,41 +42,41 @@ $aModule = [
|
|||||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3orderoverview_pdfform.tpl' => 'views/smarty/admin/orderoverview_pdfform.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/admin/d3orderoverview_pdfform.tpl' => 'views/smarty/admin/orderoverview_pdfform.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Deliverynote
|
// Frontend - Flow - Deliverynote
|
||||||
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/deliverynote.tpl' => 'views/smarty/documents/deliverynote/deliverynote.tpl',
|
'@' . 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/documents/deliverynote/deliverynoteNoLogo.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/documents/deliverynote/inc/informations.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/documents/deliverynote/inc/recipientAddress.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/documents/deliverynote/inc/salutation.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/documents/deliverynote/inc/conclusion.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/documents/deliverynote/conclusion.tpl' => 'views/smarty/flow/documents/deliverynote/inc/conclusion.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Invoice
|
// Frontend - Flow - Invoice
|
||||||
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/invoice.tpl' => 'views/smarty/documents/invoice/invoice.tpl',
|
'@' . 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/documents/invoice/invoiceNoLogo.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/documents/invoice/inc/informations.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/documents/invoice/inc/salutation.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/documents/invoice/inc/conclusion.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/documents/invoice/inc/payinfo.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/documents/invoice/payinfo.tpl' => 'views/smarty/flow/documents/invoice/inc/payinfo.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Inc - Page
|
// Frontend - Flow - Inc - Page
|
||||||
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/base.tpl' => 'views/smarty/documents/inc/page/base.tpl',
|
'@' . 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/documents/inc/page/header.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/documents/inc/page/footer.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/documents/inc/page/returnaddress.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/documents/inc/page/returnaddress.tpl' => 'views/smarty/flow/documents/inc/page/returnaddress.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Inc - Elements
|
// Frontend - Flow - Inc - Elements
|
||||||
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/addressarea.tpl' => 'views/smarty/documents/inc/elements/addressarea.tpl',
|
'@' . 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/documents/inc/elements/recipientAddress.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/documents/inc/elements/informations.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/documents/inc/elements/deliveryaddress.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/documents/inc/elements/articlelist.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/documents/inc/elements/articlecostssummary.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/documents/inc/elements/foldmarks.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/documents/inc/elements/foldmarks.tpl' => 'views/smarty/flow/documents/inc/elements/foldmarks.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Inc - Helper
|
// Frontend - Flow - Inc - Helper
|
||||||
'@' . Constants::OXID_MODULE_ID . '/documents/inc/helper/rulers.tpl' => 'views/smarty/documents/inc/helper/rulers.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/documents/inc/helper/rulers.tpl' => 'views/smarty/flow/documents/inc/helper/rulers.tpl',
|
||||||
|
|
||||||
// Frontend - Flow - Inc - Styles
|
// Frontend - Flow - Inc - Styles
|
||||||
'@' . Constants::OXID_MODULE_ID . '/assets/d3pdfstyles.css.tpl' => 'views/smarty/assets/pdfStyling.css.tpl',
|
'@' . Constants::OXID_MODULE_ID . '/assets/d3pdfstyles.css' => 'assets/out/src/css/pdfStyling.css',
|
||||||
],
|
],
|
||||||
'events' => [],
|
'events' => [],
|
||||||
'blocks' => [
|
'blocks' => [
|
||||||
@ -84,6 +92,12 @@ $aModule = [
|
|||||||
'name' => Constants::OXID_MODULE_ID.'bDev',
|
'name' => Constants::OXID_MODULE_ID.'bDev',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => false
|
'value' => false
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'group' => Constants::OXID_MODULE_ID.'main',
|
||||||
|
'name' => Constants::OXID_MODULE_ID.'_sAlternativePdfLogoName',
|
||||||
|
'type' => 'str',
|
||||||
|
'value' => ''
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
[{assign var="pagePadding" value=","|explode:"45,15,30,25"}] [{* top, right, bottom, left *}]
|
[{assign var="pagePadding" value=","|explode:"45,15,30,25"}] [{* top, right, bottom, left *}]
|
||||||
[{assign var="showLogo" value=$showLogo|default:true}]
|
[{assign var="showLogo" value=$showLogo|default:true}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_style"}]
|
[{capture append="pdfBlock_style"}]
|
||||||
[{block name="pdfStyles"}]
|
[{block name="pdfStyles"}]
|
||||||
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}]
|
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_header"}]
|
[{capture append="pdfBlock_header"}]
|
||||||
[{block name="pdfHeader"}]
|
[{block name="pdfHeader"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/header.tpl" showLogo=$showLogo}]
|
[{include file="@d3PdfDocuments/documents/inc/page/header" showLogo=$showLogo}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_content"}]
|
[{capture append="pdfBlock_content"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks" pagePadding=$pagePadding}]
|
||||||
|
|
||||||
[{block name="pdfAddressArea"}]
|
[{block name="pdfAddressArea"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea.tpl" addressfile="@d3PdfDocuments/documents/deliverynote/recipientAddress.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea" addressfile="@d3PdfDocuments/documents/deliverynote/recipientAddress"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfInformations"}]
|
[{block name="pdfInformations"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/informations.tpl" documentinformationfile="@d3PdfDocuments/documents/deliverynote/informations.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/informations" documentinformationfile="@d3PdfDocuments/documents/deliverynote/informations"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfSalutation"}]
|
[{block name="pdfSalutation"}]
|
||||||
[{include file="@d3PdfDocuments/documents/deliverynote/salutation.tpl"}]
|
[{include file="@d3PdfDocuments/documents/deliverynote/salutation"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfArticleList"}]
|
[{block name="pdfArticleList"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist.tpl" showPrices=false}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist" showPrices=false}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfConclusion"}]
|
[{block name="pdfConclusion"}]
|
||||||
@ -37,10 +37,10 @@
|
|||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_footer"}]
|
[{capture append="pdfBlock_footer"}]
|
||||||
[{block name="pdfFooter"}]
|
[{block name="pdfFooter"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/footer.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/page/footer" pagePadding=$pagePadding}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/base.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/page/base" pagePadding=$pagePadding}]
|
@ -1 +1 @@
|
|||||||
[{include file="@d3PdfDocuments/documents/deliverynote/deliverynote.tpl" showLogo=false}]
|
[{include file="@d3PdfDocuments/documents/deliverynote/deliverynote" showLogo=false}]
|
@ -1,5 +1,5 @@
|
|||||||
[{assign var="backaddressfile" value=$backaddressfile|default:"@d3PdfDocuments/documents/inc/page/returnaddress.tpl"}]
|
[{assign var="backaddressfile" value=$backaddressfile|default:"@d3PdfDocuments/documents/inc/page/returnaddress"}]
|
||||||
[{assign var="addressfile" value=$addressfile|default:"@d3PdfDocuments/documents/inc/elements/recipientAddress.tpl"}]
|
[{assign var="addressfile" value=$addressfile|default:"@d3PdfDocuments/documents/inc/elements/recipientAddress"}]
|
||||||
|
|
||||||
<div class="addressarea">
|
<div class="addressarea">
|
||||||
<div class="returnAddress">
|
<div class="returnAddress">
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
<nobreak>
|
<nobreak>
|
||||||
<table class="article_costs_table">
|
<table class="article_costs_table">
|
||||||
[{block name="d3_article_costs_summary"}]
|
[{block name="d3_article_costs_summary"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/articlecostssummary.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/articlecostssummary"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
</table>
|
</table>
|
||||||
</nobreak>
|
</nobreak>
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
[{block name="pdfHeader"}]
|
[{block name="pdfHeader"}]
|
||||||
<div class="header">
|
<div class="header">
|
||||||
[{if $showLogo}]
|
[{if $showLogo}]
|
||||||
[{block name="pdfHeaderLogo"}]
|
[{* pdf logo is available only in non admin theme *}]
|
||||||
<img class="logo" alt="Logo" src="[{$oViewConf->getModulePath('d3PdfDocuments', 'out/img/clogo.jpg')}]">
|
[{assign var="isAdmin" value=$viewConfig->isAdmin()}]
|
||||||
[{/block}]
|
[{$viewConfig->setAdminMode(false)}]
|
||||||
|
<img class="logo" alt="Logo" src="[{$viewConfig->getImageUrl('pdf_logo.jpg')}]">
|
||||||
|
[{$viewConfig->setAdminMode($isAdmin)}]
|
||||||
[{/if}]
|
[{/if}]
|
||||||
</div>
|
</div>
|
||||||
[{/block}]
|
[{/block}]
|
@ -5,7 +5,7 @@
|
|||||||
[{oxmultilang ident="D3_PDFDOCUMENTS_USED_PAYMENTMETHOD" suffix="COLON"}]
|
[{oxmultilang ident="D3_PDFDOCUMENTS_USED_PAYMENTMETHOD" suffix="COLON"}]
|
||||||
[{$payment->getFieldData('oxdesc')}]<br>
|
[{$payment->getFieldData('oxdesc')}]<br>
|
||||||
|
|
||||||
[{include file="@d3PdfDocuments/documents/invoice/payinfo.tpl"}]
|
[{include file="@d3PdfDocuments/documents/invoice/payinfo"}]
|
||||||
</div>
|
</div>
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
[{assign var="pagePadding" value=","|explode:"45,15,30,25"}] [{* top, right, bottom, left *}]
|
[{assign var="pagePadding" value=","|explode:"45,15,30,25"}] [{* top, right, bottom, left *}]
|
||||||
[{assign var="showLogo" value=$showLogo|default:true}]
|
[{assign var="showLogo" value=$showLogo|default:true}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_style"}]
|
[{capture append="pdfBlock_style"}]
|
||||||
[{block name="pdfStyles"}]
|
[{block name="pdfStyles"}]
|
||||||
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css.tpl"}]
|
[{include file="@d3PdfDocuments/assets/d3pdfstyles.css"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_header"}]
|
[{capture append="pdfBlock_header"}]
|
||||||
[{block name="pdfHeader"}]
|
[{block name="pdfHeader"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/header.tpl" showLogo=$showLogo}]
|
[{include file="@d3PdfDocuments/documents/inc/page/header" showLogo=$showLogo}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_content"}]
|
[{capture append="pdfBlock_content"}]
|
||||||
[{* include file="@d3PdfDocuments/documents/inc/helper/rulers" pagePadding=$pagePadding *}]
|
[{* include file="@d3PdfDocuments/documents/inc/helper/rulers" pagePadding=$pagePadding *}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/foldmarks" pagePadding=$pagePadding}]
|
||||||
|
|
||||||
[{block name="pdfAddressArea"}]
|
[{block name="pdfAddressArea"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/addressarea"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfInformations"}]
|
[{block name="pdfInformations"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/informations.tpl" documentinformationfile="@d3PdfDocuments/documents/invoice/informations.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/informations" documentinformationfile="@d3PdfDocuments/documents/invoice/informations"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfDeliveryAddress"}]
|
[{block name="pdfDeliveryAddress"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/deliveryaddress.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/deliveryaddress"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfSalutation"}]
|
[{block name="pdfSalutation"}]
|
||||||
[{include file="@d3PdfDocuments/documents/invoice/salutation.tpl"}]
|
[{include file="@d3PdfDocuments/documents/invoice/salutation"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfArticleList"}]
|
[{block name="pdfArticleList"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist.tpl"}]
|
[{include file="@d3PdfDocuments/documents/inc/elements/articlelist"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
|
|
||||||
[{block name="pdfConclusion"}]
|
[{block name="pdfConclusion"}]
|
||||||
[{include file="@d3PdfDocuments/documents/invoice/conclusion.tpl"}]
|
[{include file="@d3PdfDocuments/documents/invoice/conclusion"}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{capture assign="pdfBlock_footer"}]
|
[{capture append="pdfBlock_footer"}]
|
||||||
[{block name="pdfFooter"}]
|
[{block name="pdfFooter"}]
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/footer.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/page/footer" pagePadding=$pagePadding}]
|
||||||
[{/block}]
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
|
|
||||||
[{include file="@d3PdfDocuments/documents/inc/page/base.tpl" pagePadding=$pagePadding}]
|
[{include file="@d3PdfDocuments/documents/inc/page/base" pagePadding=$pagePadding}]
|
||||||
|
@ -1 +1 @@
|
|||||||
[{include file="@d3PdfDocuments/documents/invoice/invoice.tpl" showLogo=false}]
|
[{include file="@d3PdfDocuments/documents/invoice/invoice" showLogo=false}]
|
@ -1,219 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
{% set pdfBlock_style %}
|
{% set pdfBlock_style %}
|
||||||
{% block pdfStyles %}
|
{% block pdfStyles %}
|
||||||
{% include "@d3PdfDocuments/assets/pdfStyling.css.twig" %}
|
{{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }}
|
||||||
|
{{ style() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endset %}
|
{% endset %}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% block pdfDocumentInformations %}
|
{% block pdfDocumentInformations %}
|
||||||
<div>
|
<div>
|
||||||
{% set dateFormat = 'D3_PDFDOCUMENTS_DATE_FORMAT'|translate %}
|
{% set dateFormat = 'D3_PDFDOCUMENTS_DATE_FORMAT'|translate %}
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_DATE", suffix: "COLON" }) }} {{ "now"|date_format(dateFormat) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_DATE", suffix: "COLON" }) }} {{ smarty.now|date_format(dateFormat) }}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<tr class="producttax">
|
<tr class="producttax">
|
||||||
<td class="indent"></td>
|
<td class="indent"></td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", suffix: "COLON" }) | format( VatKey ) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", args: VatKey, suffix: "COLON" }) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="values">
|
<td class="values">
|
||||||
{{ lang.formatCurrency(oVat, currency) }} {{ currency.name }}
|
{{ lang.formatCurrency(oVat, currency) }} {{ currency.name }}
|
||||||
@ -104,7 +104,7 @@
|
|||||||
<td class="indent"></td>
|
<td class="indent"></td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
{% if config.getConfigParam('sAdditionalServVATCalcMethod') != 'proportional' %}
|
{% if config.getConfigParam('sAdditionalServVATCalcMethod') != 'proportional' %}
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", suffix: "COLON" }) | format( order.getFieldData('oxdelvat') ) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", args: order.getFieldData('oxdelvat'), suffix: "COLON" }) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_PROPORTIONAL_TAX", suffix: "COLON" }) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_PROPORTIONAL_TAX", suffix: "COLON" }) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -142,7 +142,7 @@
|
|||||||
<td class="indent"></td>
|
<td class="indent"></td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
{% if config.getConfigParam('sAdditionalServVATCalcMethod') != 'proportional' %}
|
{% if config.getConfigParam('sAdditionalServVATCalcMethod') != 'proportional' %}
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", suffix: "COLON" }) | format( order.getFieldData('oxpayvat') ) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_TAX", args: order.getFieldData('oxpayvat'), suffix: "COLON" }) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ translate({ ident: "D3_PDFDOCUMENTS_PROPORTIONAL_TAX", suffix: "COLON" }) }}
|
{{ translate({ ident: "D3_PDFDOCUMENTS_PROPORTIONAL_TAX", suffix: "COLON" }) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -22,15 +22,15 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
{# horizontal #}
|
{# horizontal #}
|
||||||
{% for rulerItemsHorizontal in range(10, 600, 10) %}
|
{% for rulerItemsHorizontal in 10..600 %}
|
||||||
<div class="rulerItemHorizontal" style="left: {{ loop.index0 - pagePadding.3 }}mm">
|
<div class="rulerItemHorizontal" style="left: {{ smarty.section.rulerItemsHorizontal.index - pagePadding.3 }}mm">
|
||||||
{{ loop.index0 }}
|
{{ loop.index0 }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{# vertical #}
|
{# vertical #}
|
||||||
{% for rulerItemsVertical in range(0, 600, 10) %}
|
{% for rulerItemsVertical in 0..600 %}
|
||||||
<div class="rulerItemVertical" style="top: {{ loop.index0 - pagePadding.0 }}mm">
|
<div class="rulerItemVertical" style="top: {{ smarty.section.rulerItemsVertical.index - pagePadding.0 }}mm">
|
||||||
{{ loop.index0 }}
|
{{ loop.index0 }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
{% set showLogo = showLogo|default(1) %}
|
{% set showLogo = showLogo|default(1) %}
|
||||||
|
{% set sPdfLogo = sAlternativePdfLogo %}
|
||||||
|
|
||||||
{% block pdfHeader %}
|
{% block pdfHeader %}
|
||||||
<div class="header">
|
<div class="header">
|
||||||
{% if showLogo %}
|
{% if showLogo %}
|
||||||
{% block pdfHeaderLogo %}
|
{# pdf logo is available only in non admin theme #}
|
||||||
<img class="logo" alt="Logo" src="{{ oViewConf.getModulePath('d3PdfDocuments', 'out/img/clogo.jpg') }}">
|
{% set isAdmin = oViewConf.isAdmin() %}
|
||||||
{% endblock %}
|
{{ oViewConf.setAdminMode(false) }}
|
||||||
|
{% if sPdfLogo %}
|
||||||
|
<img class="logo" alt="Logo" src="{{ sPdfLogo }}">
|
||||||
|
{% endif %}
|
||||||
|
{{ oViewConf.setAdminMode(isAdmin) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
{% set pdfBlock_style %}
|
{% set pdfBlock_style %}
|
||||||
{% block pdfStyles %}
|
{% block pdfStyles %}
|
||||||
{% include "@d3PdfDocuments/assets/pdfStyling.css.twig" %}
|
{{ style({ include: oViewConf.getModuleUrl('d3PdfDocuments', 'out/src/css/pdfStyling.css') }) }}
|
||||||
|
{{ style() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endset %}
|
{% endset %}
|
||||||
|
|
||||||
@ -14,7 +15,6 @@
|
|||||||
{% endset %}
|
{% endset %}
|
||||||
|
|
||||||
{% set pdfBlock_content %}
|
{% set pdfBlock_content %}
|
||||||
{# {% include "@d3PdfDocuments/documents/inc/helper/rulers.html.twig" with {pagePadding: pagePadding} %}#}
|
|
||||||
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks.html.twig" with {pagePadding: pagePadding} %}
|
{% include "@d3PdfDocuments/documents/inc/elements/foldmarks.html.twig" with {pagePadding: pagePadding} %}
|
||||||
|
|
||||||
{% block pdfAddressArea %}
|
{% block pdfAddressArea %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user