Comparer les révisions
18 Révisions
Auteur | SHA1 | Date | |
---|---|---|---|
6859409e93
|
|||
e1f8eb1376
|
|||
f63b326415
|
|||
fdb05bcaed
|
|||
5f0e1cb405
|
|||
2bd2a150b1
|
|||
98bc9a889c
|
|||
79bed94a8b
|
|||
43c5492bd4 | |||
0015d17dc2 | |||
6cc376125a
|
|||
c097e06ac1 | |||
10c08da415 | |||
e9c88117da | |||
1bcad628ec | |||
e9987b5221
|
|||
010dda9050
|
|||
1e91990a28
|
@ -27,6 +27,10 @@ class orderOverviewPdfGenerator
|
||||
{
|
||||
$Pdf= $this->getPdfClass();
|
||||
|
||||
$Pdf->setDevelopmentMode(
|
||||
Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') &&
|
||||
Registry::getRequest()->getRequestEscapedParameter('devmode')
|
||||
);
|
||||
$Pdf->setOrder($order);
|
||||
$Pdf->downloadPdf($iSelLang);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
|
||||
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\ModCfg\Application\Model\d3filesystem;
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
|
||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface;
|
||||
@ -19,6 +20,7 @@ use OxidEsales\Eshop\Core\UtilsView;
|
||||
use Smarty;
|
||||
use Spipu\Html2Pdf\Exception\Html2PdfException;
|
||||
use Spipu\Html2Pdf\Html2Pdf;
|
||||
use Spipu\Html2Pdf\MyPdf;
|
||||
|
||||
abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
{
|
||||
@ -40,6 +42,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
/** @var string */
|
||||
public $filename;
|
||||
|
||||
protected $devMode = false;
|
||||
|
||||
/**
|
||||
* pdfDocumentsGeneric constructor.
|
||||
*/
|
||||
@ -51,6 +55,11 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
$this->oSmarty = Registry::getUtilsView()->getSmarty(true);
|
||||
}
|
||||
|
||||
public function setDevelopmentMode(bool $devMode)
|
||||
{
|
||||
$this->devMode = $devMode;
|
||||
}
|
||||
|
||||
public function runPreAction()
|
||||
{
|
||||
}
|
||||
@ -71,11 +80,14 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
$oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties());
|
||||
$oPdf->setTestIsImage(false);
|
||||
$htmlContent = $this->getHTMLContent($iSelLang);
|
||||
|
||||
$oPdf->writeHTML($htmlContent);
|
||||
$oPdf->pdf->SetAuthor(Registry::getConfig()->getActiveShop()->getFieldData('oxname'));
|
||||
$oPdf->pdf->SetTitle(Registry::getLang()->translateString($this->getTitleIdent()));
|
||||
$oPdf->pdf->SetCreator('D³ PDF Documents for OXID eShop');
|
||||
$oPdf->pdf->SetSubject(NULL);
|
||||
/** @var MyPdf $myPdf */
|
||||
$myPdf = $oPdf->pdf;
|
||||
$myPdf->setAuthor( Registry::getConfig()->getActiveShop()->getFieldData( 'oxname'));
|
||||
$myPdf->setTitle( Registry::getLang()->translateString( $this->getTitleIdent()));
|
||||
$myPdf->setCreator( 'D³ PDF Documents for OXID eShop');
|
||||
$myPdf->setSubject( NULL);
|
||||
return $this->output($oPdf, $sFilename, $target, $htmlContent);
|
||||
}
|
||||
|
||||
@ -94,6 +106,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +132,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,6 +155,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||
Registry::getLogger()->error($e);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -159,6 +180,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
* @param int $iSelLang
|
||||
*
|
||||
* @return mixed
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function getHTMLContent($iSelLang = 0)
|
||||
{
|
||||
@ -178,6 +200,27 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
|
||||
self::$_blIsAdmin = $blCurrentRenderFromAdmin;
|
||||
|
||||
$content = $this->addBasicAuth($content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function addBasicAuth($content)
|
||||
{
|
||||
$username = trim(Registry::getConfig()->getConfigParam('d3PdfDocumentsbasicAuthUserName'));
|
||||
$password = trim(Registry::getConfig()->getConfigParam('d3PdfDocumentsbasicAuthPassword'));
|
||||
|
||||
if ($username && $password) {
|
||||
$shopUrl = parse_url( Registry::getConfig()->getShopCurrentUrl() );
|
||||
$pattern = '/(["|\'])'.
|
||||
'(' . preg_quote( $shopUrl['scheme'], '/' ) . ':\/\/)'.
|
||||
'(' . preg_quote( $shopUrl['host'], '/' ) . '.*?)'.
|
||||
'\1/m';
|
||||
$replace = "$1$2" . urlencode($username). ":" . urlencode($password) . "@$3$1";
|
||||
|
||||
$content = preg_replace( $pattern, $replace, $content );
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@ -242,7 +285,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
{
|
||||
$extension = $this->filenameExtension;
|
||||
$extensionLength = (strlen($extension) + 1) * -1;
|
||||
if ((bool) strlen($extension) && substr($filename, $extensionLength) != '.'.$extension) {
|
||||
if (strlen($extension) && substr($filename, $extensionLength) != '.'.$extension) {
|
||||
$filename .= '.'.$extension;
|
||||
}
|
||||
|
||||
@ -280,7 +323,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
*/
|
||||
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
|
||||
{
|
||||
if ((bool) Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') === true) {
|
||||
if ($this->devMode) {
|
||||
return $this->outputDev($oPdf, $sFilename, $target, $html);
|
||||
} else {
|
||||
return $oPdf->output($sFilename, $target);
|
||||
@ -296,7 +339,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
*/
|
||||
public function outputDev(Html2Pdf $oPdf, $sFilename, $target, $html)
|
||||
{
|
||||
$sFilename = str_replace('.pdf', '.html', $sFilename);
|
||||
$sFilename = str_replace('.pdf', '.sgml', $sFilename);
|
||||
|
||||
switch($target) {
|
||||
case 'I': {
|
||||
@ -321,7 +364,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
break;
|
||||
}
|
||||
case 'D': {
|
||||
// Download PDF as file
|
||||
// Download PDF as a file
|
||||
if (ob_get_contents()) {
|
||||
$oPdf->pdf->Error('Some data has already been output, can\'t send PDF file');
|
||||
}
|
||||
@ -337,7 +380,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
header('Content-Type: application/force-download');
|
||||
header('Content-Type: application/octet-stream', false);
|
||||
header('Content-Type: application/download', false);
|
||||
header('Content-Type: text/html', false);
|
||||
header('Content-Type: text/sgml', false);
|
||||
// use the Content-Disposition header to supply a recommended filename
|
||||
header('Content-Disposition: attachment; filename="'.basename($sFilename).'";');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
@ -366,4 +409,4 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,9 +10,10 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
|
||||
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface as orderInterface;
|
||||
use \OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\Payment;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
@ -22,6 +23,14 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
||||
/** @var Order */
|
||||
public $oOrder;
|
||||
|
||||
/**
|
||||
* don't use order as constructor argument because of same method interface for all document types
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Order $order
|
||||
*/
|
||||
@ -31,15 +40,22 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidArgumentException
|
||||
* @return Order
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
Assert::lazy()
|
||||
->that($this->oOrder)->isInstanceOf(Order::class, 'no order for pdf generator set')
|
||||
->that($this->oOrder->isLoaded())->true('given order is not loaded')
|
||||
->verifyNow();
|
||||
|
||||
return $this->oOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $iSelLang
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setSmartyVars($iSelLang)
|
||||
{
|
||||
@ -58,6 +74,7 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
@ -86,21 +103,6 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $sFilename
|
||||
* @param int $iSelLang
|
||||
* @param string $target
|
||||
* @return mixed|string|null
|
||||
*/
|
||||
public function genPdf($sFilename, $iSelLang = 0, $target = 'I')
|
||||
{
|
||||
if (false == $this->getOrder()) {
|
||||
throw oxNew(noBaseObjectSetException::class);
|
||||
}
|
||||
|
||||
return parent::genPdf($sFilename, $iSelLang, $target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
@ -115,6 +117,7 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
||||
|
||||
/**
|
||||
* @return false|string
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function getPayableUntilDate()
|
||||
{
|
||||
|
@ -10,10 +10,9 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Documents;
|
||||
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\PdfDocuments\Application\Model\AbstractClasses\pdfdocumentsOrder;
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
|
||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderinvoiceInterface;
|
||||
use Spipu\Html2Pdf\Exception\Html2PdfException;
|
||||
|
||||
class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceInterface
|
||||
{
|
||||
@ -43,6 +42,10 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
||||
return 'invoice';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function runPreAction()
|
||||
{
|
||||
parent::runPreAction();
|
||||
@ -52,6 +55,10 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
||||
$this->saveOrderOnChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setInvoiceNumber()
|
||||
{
|
||||
if (!$this->getOrder()->getFieldData('oxbillnr')) {
|
||||
@ -61,6 +68,10 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setInvoiceDate()
|
||||
{
|
||||
if ($this->getOrder()->getFieldData('oxbilldate') == '0000-00-00') {
|
||||
@ -72,6 +83,10 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function saveOrderOnChanges()
|
||||
{
|
||||
if ($this->blIsNewOrder) {
|
||||
@ -85,6 +100,7 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function getFilename()
|
||||
{
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* See LICENSE file for license details.
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class noBaseObjectSetException extends pdfGeneratorExceptionAbstract
|
||||
{
|
||||
public function __construct( $sMessage = "no base object (e.g. order) for pdf generator set", $iCode = 0, Exception $previous = null )
|
||||
{
|
||||
parent::__construct( $sMessage, $iCode, $previous );
|
||||
}
|
||||
}
|
@ -10,10 +10,10 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Interfaces;
|
||||
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
|
||||
|
||||
interface pdfdocumentsGenericInterface
|
||||
{
|
||||
public function setDevelopmentMode(bool $devMode);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@ -58,7 +58,6 @@ interface pdfdocumentsGenericInterface
|
||||
* @param string $target
|
||||
*
|
||||
* @return mixed
|
||||
* @throws noBaseObjectSetException
|
||||
*/
|
||||
public function genPdf($sFilename, $iSelLang = 0, $target = 'I');
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Interfaces;
|
||||
|
||||
use Assert\InvalidArgumentException;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
|
||||
interface pdfdocumentsOrderInterface extends pdfdocumentsGenericInterface
|
||||
@ -20,6 +21,7 @@ interface pdfdocumentsOrderInterface extends pdfdocumentsGenericInterface
|
||||
public function setOrder(Order $order);
|
||||
|
||||
/**
|
||||
* @throws InvalidArgumentException
|
||||
* @return Order
|
||||
*/
|
||||
public function getOrder();
|
||||
|
@ -15,15 +15,21 @@ use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
||||
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
||||
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class registryOrdermanagerActions extends registryAbstract implements registryOrdermanagerActionsInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->addGenerator(invoicePdf::class);
|
||||
$this->addGenerator(deliverynotePdf::class);
|
||||
$this->addGenerator(invoicewithoutlogoPdf::class);
|
||||
$this->addGenerator(deliverynotewithoutlogoPdf::class);
|
||||
$config = Registry::getConfig();
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocInvoice'))
|
||||
$this->addGenerator(invoicePdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNote'))
|
||||
$this->addGenerator(deliverynotePdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocInvoiceNoLogo'))
|
||||
$this->addGenerator(invoicewithoutlogoPdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNoteNoLogo'))
|
||||
$this->addGenerator(deliverynotewithoutlogoPdf::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,15 +15,21 @@ use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
||||
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
||||
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
||||
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class registryOrderoverview extends registryAbstract implements registryOrderoverviewInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->addGenerator(invoicePdf::class);
|
||||
$this->addGenerator(deliverynotePdf::class);
|
||||
$this->addGenerator(invoicewithoutlogoPdf::class);
|
||||
$this->addGenerator(deliverynotewithoutlogoPdf::class);
|
||||
$config = Registry::getConfig();
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocInvoice'))
|
||||
$this->addGenerator(invoicePdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNote'))
|
||||
$this->addGenerator(deliverynotePdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocInvoiceNoLogo'))
|
||||
$this->addGenerator(invoicewithoutlogoPdf::class);
|
||||
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNoteNoLogo'))
|
||||
$this->addGenerator(deliverynotewithoutlogoPdf::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ $aLang = array(
|
||||
'charset' => 'utf-8',
|
||||
|
||||
'D3_PDFDOCUMENTS_THANKYOU_1' => 'Vielen Dank für Ihren Einkauf!',
|
||||
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Ihr Team von %1$s',
|
||||
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Ihr Team von %1$s.',
|
||||
|
||||
'D3_PDFDOCUMENTS_GET_IN_CONTACT' => 'So erreichen Sie uns:',
|
||||
'D3_PDFDOCUMENTS_TELEFON' => 'Telefon',
|
||||
@ -65,7 +65,7 @@ $aLang = array(
|
||||
'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Gesamtsumme (brutto)',
|
||||
|
||||
'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Ihre gewählte Zahlungsweise',
|
||||
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Zahlbar bis zum',
|
||||
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Zahlbar bis zum %s.',
|
||||
'D3_PDFDOCUMENTS_RECEIVED_PAYMENT' => 'Den Rechnungsbetrag haben wir dankend erhalten.',
|
||||
|
||||
'D3_PDFDOCUMENTS_MANAGINGDIRECTOR' => 'Geschäftsführer',
|
||||
|
@ -12,7 +12,7 @@ $aLang = array(
|
||||
'charset' => 'utf-8',
|
||||
|
||||
'D3_PDFDOCUMENTS_THANKYOU_1' => 'Many thanks for your purchase!',
|
||||
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Your team from %1$s',
|
||||
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Your team from %1$s.',
|
||||
|
||||
'D3_PDFDOCUMENTS_GET_IN_CONTACT' => 'You can contact us as follows',
|
||||
'D3_PDFDOCUMENTS_TELEFON' => 'Telephone',
|
||||
@ -33,8 +33,8 @@ $aLang = array(
|
||||
|
||||
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
||||
'D3_PDFDOCUMENTS_INVOICE_WITHOUT_LOGO' => 'Invoice without logo',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Deliverynote',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Deliverynote without logo',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Delivery note',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Delivery note without logo',
|
||||
'D3_PDFDOCUMENTS_ORDERNR' => 'Order No.',
|
||||
'D3_PDFDOCUMENTS_ORDER_FROM_AT' => 'Your order from %1$s at "%2$s"',
|
||||
|
||||
@ -64,7 +64,7 @@ $aLang = array(
|
||||
'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Total sum (gross)',
|
||||
|
||||
'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Your chosen payment method',
|
||||
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Billing till',
|
||||
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Billing till %s.',
|
||||
'D3_PDFDOCUMENTS_RECEIVED_PAYMENT' => 'We have received the invoice amount with thanks.',
|
||||
|
||||
'D3_PDFDOCUMENTS_MANAGINGDIRECTOR' => 'Managing director',
|
||||
|
@ -9,11 +9,32 @@
|
||||
*/
|
||||
|
||||
$sLangName = "Deutsch";
|
||||
|
||||
$basicAuthHelp = <<<HELP
|
||||
Befindet sich der aktuelle Shop hinter einem BasicAuth, können beim Generieren des PDFs die Bilder nicht geladen werden. Tragen Sie hier die Zugangsdaten ein, um die Bilder zu sehen.
|
||||
HELP;
|
||||
|
||||
$aLang = array(
|
||||
'charset' => 'utf-8',
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
|
||||
'SHOP_MODULE_d3PdfDocumentsbDev' => 'Entwicklermodus',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'Mit aktiviertem Entwicklermodus kann das Dokument im '.
|
||||
'SGML-Format ausgegeben werden. Inhaltliche Fehler können so besser nachvollzogen werden.',
|
||||
'SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => 'BasicAuth des Shops - Benutzername (optional)',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => $basicAuthHelp,
|
||||
'SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => 'BasicAuth des Shops - Passwort (optional)',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => $basicAuthHelp,
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentscontents' => 'Inhalte',
|
||||
'SHOP_MODULE_d3PdfDocumentsLogoUrl' => 'Logo-Grafik URL',
|
||||
'SHOP_MODULE_d3PdfDocumentsBackgroundUrl' => 'Hintergrund-Grafik URL',
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentsdocuments' => 'Dokumente',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocInvoice' => 'Rechnung',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocInvoiceNoLogo' => 'Rechnung ohne Logo',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNote' => 'Lieferschein',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNoteNoLogo' => 'Lieferschein ohne Logo',
|
||||
|
||||
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
|
||||
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
|
||||
@ -23,5 +44,6 @@ $aLang = array(
|
||||
|
||||
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Dokument',
|
||||
'D3_PDFDOCUMENTS_LANGUAGE' => 'Sprache',
|
||||
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'SGML erstellen',
|
||||
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Dokument erstellen',
|
||||
);
|
||||
|
@ -9,19 +9,41 @@
|
||||
*/
|
||||
|
||||
$sLangName = "English";
|
||||
|
||||
$basicAuthHelp = <<<HELP
|
||||
If the current shop is protected by a BasicAuth, the images cannot be loaded when the PDF is generated. Enter the access data here to view the images.
|
||||
HELP;
|
||||
|
||||
$aLang = array(
|
||||
'charset' => 'utf-8',
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
|
||||
'SHOP_MODULE_d3PdfDocumentsbDev' => 'Developer mode',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'If developer mode is activated, the document can exported '.
|
||||
'in SGML format. This makes it much easier to trace content errors.',
|
||||
'SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => 'BasicAuth of the shop - user name (optional)',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => $basicAuthHelp,
|
||||
'SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => 'BasicAuth of the shop - password (optional)',
|
||||
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => $basicAuthHelp,
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentscontents' => 'Contents',
|
||||
'SHOP_MODULE_d3PdfDocumentsLogoUrl' => 'Logo image URL',
|
||||
'SHOP_MODULE_d3PdfDocumentsBackgroundUrl' => 'Background image URL',
|
||||
|
||||
'SHOP_MODULE_GROUP_d3PdfDocumentsdocuments' => 'Documents',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocInvoice' => 'Invoice',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocInvoiceNoLogo' => 'Invoice without logo',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNote' => 'Delivery note',
|
||||
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNoteNoLogo' => 'Delivery note without logo',
|
||||
|
||||
'D3_PDFDOCUMENTS' => 'PDF Documents',
|
||||
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
|
||||
'D3_PDFDOCUMENTS_INVOICE_WITHOUT_LOGO' => 'Invoice without logo',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Deliverynote',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Deliverynote without logo',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Delivery note',
|
||||
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Delivery note without logo',
|
||||
|
||||
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Document',
|
||||
'D3_PDFDOCUMENTS_LANGUAGE' => 'Language',
|
||||
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'Create SGML',
|
||||
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Create Document',
|
||||
);
|
||||
|
@ -1,10 +1,14 @@
|
||||
[{if $edit && $oView->d3CanExport()}]
|
||||
<br>
|
||||
[{assign var="config" value=$oViewConf->getConfig()}]
|
||||
[{assign var="devmode" value=$config->getConfigParam('d3PdfDocumentsbDev')}]
|
||||
|
||||
<form name="d3CreatePdf" id="d3CreatePdf" action="[{$oViewConf->getSelfLink()}]" method="post" target="d3ExpPDF">
|
||||
[{$oViewConf->getHiddenSid()}]
|
||||
<input type="hidden" name="cl" value="order_overview">
|
||||
<input type="hidden" name="fnc" value="d3CreatePDF">
|
||||
<input type="hidden" name="oxid" value="[{$oxid}]">
|
||||
[{if $devmode}]<input type="hidden" id="devmode" name="devmode" value="0">[{/if}]
|
||||
<fieldset style="padding: 5px">
|
||||
<legend>[{oxmultilang ident="D3_PDFDOCUMENTS"}]</legend>
|
||||
<table style="width: 100%">
|
||||
@ -14,7 +18,7 @@
|
||||
</td>
|
||||
<td style="vertical-align: top; text-align: right" class="edittext">
|
||||
<label for="pdftype">[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_TYPE" suffix="COLON"}]</label>:
|
||||
<select id="pdftype" name="pdftype" class="editinput" style="width:80px;">
|
||||
<select id="pdftype" name="pdftype" class="editinput" style="min-width:80px;">
|
||||
[{block name="d3_pdfdocuments_order_overview_pdfTypeOptions"}]
|
||||
[{assign var="generatorList" value=$oView->d3getGeneratorList()}]
|
||||
[{foreach from=$generatorList->getList() item="generator"}]
|
||||
@ -27,7 +31,7 @@
|
||||
<tr>
|
||||
<td style="text-align: right" class="edittext">
|
||||
<label for="pdflanguage">[{oxmultilang ident="D3_PDFDOCUMENTS_LANGUAGE" suffix="COLON"}]</label>
|
||||
<select id="pdflanguage" name="pdflanguage" class="saveinnewlanginput" style="width:80px;">
|
||||
<select id="pdflanguage" name="pdflanguage" class="saveinnewlanginput" style="width:150px;">
|
||||
[{foreach from=$alangs key=lang item=slang}]
|
||||
<option value="[{$lang}]" [{if $lang == "0"}]SELECTED[{/if}]>[{$slang}]</option>
|
||||
[{/foreach}]
|
||||
@ -35,8 +39,11 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right" class="edittext"><br/>
|
||||
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_GENERATE"}]">
|
||||
<td style="text-align: right" class="edittext" colspan="2"><br/>
|
||||
[{if $devmode}]
|
||||
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_SGML_GENERATE"}]" onclick="document.getElementById('devmode').value = 1;">
|
||||
[{/if}]
|
||||
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_GENERATE"}]" [{if $devmode}] onclick="document.getElementById('devmode').value = 0;"[{/if}]>
|
||||
<iframe name="d3ExpPDF" style="width: 0; height: 0; border: none; display:none;"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1,7 +1,7 @@
|
||||
[{assign var="defaultPagePadding" value=","|explode:"45,15,25,25"}] [{* top, right, bottom, left *}]
|
||||
[{assign var="pagePadding" value=$pagePadding|default:$defaultPagePadding}]
|
||||
|
||||
<style type="text/css">
|
||||
<style>
|
||||
.marks {
|
||||
position: absolute;
|
||||
left: [{math equation="left - padding" left=5 padding=$pagePadding.3}]mm ;
|
||||
|
@ -4,7 +4,7 @@
|
||||
[{* rulers *}]
|
||||
[{* include file="d3pdfrulers.tpl" pagePadding=$pagePadding *}]
|
||||
|
||||
<style type="text/css">
|
||||
<style>
|
||||
.rulerItemHorizontal {
|
||||
position: absolute;
|
||||
top: -[{$pagePadding.0}]mm;
|
||||
|
@ -4,13 +4,30 @@
|
||||
[{assign var="defaultPagePadding" value=","|explode:"45,15,25,25"}] [{* top, right, bottom, left *}]
|
||||
[{assign var="pagePadding" value=$pagePadding|default:$defaultPagePadding}]
|
||||
|
||||
<style type="text/css">
|
||||
<style>
|
||||
[{foreach from=$pdfBlock_style item="_block"}]
|
||||
[{$_block}]
|
||||
[{/foreach}]
|
||||
</style>
|
||||
|
||||
<page backtop="[{$pagePadding.0}]mm" backright="[{$pagePadding.1}]mm" backbottom="[{$pagePadding.2}]mm" backleft="[{$pagePadding.3}]mm" pageset="[{$pageset}]" orientation="[{$orientation}]" format="[{$format}]">
|
||||
<page
|
||||
[{block name="pageSettings"}]
|
||||
backtop="[{$pagePadding.0}]mm"
|
||||
backright="[{$pagePadding.1}]mm"
|
||||
backbottom="[{$pagePadding.2}]mm"
|
||||
backleft="[{$pagePadding.3}]mm"
|
||||
pageset="[{$pageset}]"
|
||||
orientation="[{$orientation}]"
|
||||
format="[{$format}]"
|
||||
[{if $showLogo && $config->getConfigParam('d3PdfDocumentsBackgroundUrl')}]
|
||||
backimg="[{$config->getConfigParam('d3PdfDocumentsBackgroundUrl')}]"
|
||||
[{/if}]
|
||||
[{* backcolor="#FFF" *}]
|
||||
[{* backimgx="center" *}]
|
||||
[{* backimgy="middle" *}]
|
||||
[{* backimgw="100%" *}]
|
||||
[{/block}]
|
||||
>
|
||||
<page_header>
|
||||
[{foreach from=$pdfBlock_header item="_block"}]
|
||||
[{$_block}]
|
||||
|
@ -3,36 +3,43 @@
|
||||
|
||||
[{block name="pdfFooter"}]
|
||||
<div class="footer" style="margin: 0 [{$pagePadding.1}]mm 10mm [{$pagePadding.3}]mm">
|
||||
<table>
|
||||
<tr>
|
||||
[{block name="pdfFooterLeft"}]
|
||||
<td class="footerLeft">
|
||||
<div>[{$shop->getFieldData('oxname')}]</div>
|
||||
<div>[{$shop->getFieldData('oxstreet')}]</div>
|
||||
<div>[{$shop->getFieldData('oxzip')}] [{$shop->getFieldData('oxcity')}]</div>
|
||||
<div>[{$shop->getFieldData('oxcountry')}]</div>
|
||||
<div>[{$shop->getFieldData('oxurl')}]</div>
|
||||
<div>[{$shop->getFieldData('oxinfoemail')}]</div>
|
||||
</td>
|
||||
[{/block}]
|
||||
[{block name="pdfFooterCenter"}]
|
||||
<td class="footerCenter">
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_MANAGINGDIRECTOR" suffix="COLON"}] [{$shop->getFieldData('oxfname')}] [{$shop->getFieldData('oxlname')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_COURT" suffix="COLON"}] [{$shop->getFieldData('oxcourt')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_HRBNR" suffix="COLON"}] [{$shop->getFieldData('oxhrbnr')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_USTID" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]</div>
|
||||
</td>
|
||||
[{/block}]
|
||||
[{block name="pdfFooterRight"}]
|
||||
<td class="footerRight">
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_ACCOUNT"}]</div>
|
||||
<div>[{$shop->getFieldData('oxbankname')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_ACCOUNTNR" suffix="COLON"}] [{$shop->getFieldData('oxibannumber')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_BANKCODE" suffix="COLON"}] [{$shop->getFieldData('oxbiccode')}]</div>
|
||||
</td>
|
||||
[{/block}]
|
||||
</tr>
|
||||
</table>
|
||||
[{block name="pdfFooterTable"}]
|
||||
<table>
|
||||
<tr>
|
||||
[{block name="pdfFooterLeft"}]
|
||||
<td class="footerLeft">
|
||||
<div>[{$shop->getFieldData('oxname')}]</div>
|
||||
<div>[{$shop->getFieldData('oxstreet')}]</div>
|
||||
<div>[{$shop->getFieldData('oxzip')}] [{$shop->getFieldData('oxcity')}]</div>
|
||||
<div>[{$shop->getFieldData('oxcountry')}]</div>
|
||||
<div>[{$shop->getFieldData('oxurl')}]</div>
|
||||
<div>[{$shop->getFieldData('oxinfoemail')}]</div>
|
||||
</td>
|
||||
[{/block}]
|
||||
[{block name="pdfFooterCenter"}]
|
||||
<td class="footerCenter">
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_MANAGINGDIRECTOR" suffix="COLON"}] [{$shop->getFieldData('oxfname')}] [{$shop->getFieldData('oxlname')}]</div>
|
||||
[{if $shop->getFieldData('oxcourt')}]
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_COURT" suffix="COLON"}] [{$shop->getFieldData('oxcourt')}]</div>
|
||||
[{/if}]
|
||||
[{if $shop->getFieldData('oxhrbnr')}]
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_HRBNR" suffix="COLON"}] [{$shop->getFieldData('oxhrbnr')}]</div>
|
||||
[{/if}]
|
||||
[{if $shop->getFieldData('oxvatnumber')}]
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_USTID" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]</div>
|
||||
[{/if}]
|
||||
</td>
|
||||
[{/block}]
|
||||
[{block name="pdfFooterRight"}]
|
||||
<td class="footerRight">
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_ACCOUNT"}]</div>
|
||||
<div>[{$shop->getFieldData('oxbankname')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_ACCOUNTNR" suffix="COLON"}] [{$shop->getFieldData('oxibannumber')}]</div>
|
||||
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_BANK_BANKCODE" suffix="COLON"}] [{$shop->getFieldData('oxbiccode')}]</div>
|
||||
</td>
|
||||
[{/block}]
|
||||
</tr>
|
||||
</table>
|
||||
[{/block}]
|
||||
</div>
|
||||
|
||||
[{/block}]
|
@ -6,7 +6,8 @@
|
||||
[{* 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')}]">
|
||||
[{assign var="logoUrl" value=$config->getConfigParam('d3PdfDocumentsLogoUrl')|default:$viewConfig->getImageUrl('pdf_logo.jpg')}]
|
||||
<img class="logo" alt="Logo" src="[{$logoUrl}]">
|
||||
[{$viewConfig->setAdminMode($isAdmin)}]
|
||||
[{/if}]
|
||||
</div>
|
||||
|
@ -11,9 +11,11 @@
|
||||
[{assign var="dateFormat" value='D3_PDFDOCUMENTS_DATE_FORMAT'|oxmultilangassign}]
|
||||
[{oxmultilang ident="D3_PDFDOCUMENTS_DATE" suffix="COLON"}] [{$order->getFieldData('oxbilldate')|date_format:$dateFormat}]
|
||||
</div>
|
||||
<div>
|
||||
[{oxmultilang ident="D3_PDFDOCUMENTS_USTIDNR" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]
|
||||
</div>
|
||||
[{if $shop->getFieldData('oxvatnumber')}]
|
||||
<div>
|
||||
[{oxmultilang ident="D3_PDFDOCUMENTS_USTIDNR" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]
|
||||
</div>
|
||||
[{/if}]
|
||||
[{/block}]
|
||||
</div>
|
||||
[{/block}]
|
@ -2,8 +2,7 @@
|
||||
[{if $payment->getId() == 'oxidinvoice'}]
|
||||
[{block name="payinfo_billable_till"}]
|
||||
[{assign var="dateFormat" value='D3_PDFDOCUMENTS_DATE_FORMAT'|oxmultilangassign}]
|
||||
[{oxmultilang ident="D3_PDFDOCUMENTS_PAYABLEUNTIL"}]
|
||||
[{$document->getPayableUntilDate()|date_format:$dateFormat}]
|
||||
[{oxmultilang ident="D3_PDFDOCUMENTS_PAYABLEUNTIL" args=$document->getPayableUntilDate()|date_format:$dateFormat}]
|
||||
[{/block}]
|
||||
[{elseif $payment->getId() == 'oxidpayadvance' || $payment->getId() == 'oxidcreditcard'}]
|
||||
[{block name="payinfo_payed"}]
|
||||
|
8
IntelliSenseHelper.php
Fichier normal
8
IntelliSenseHelper.php
Fichier normal
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace D3\PdfDocuments\Modules\Application\Controller {
|
||||
|
||||
use OxidEsales\EshopCommunity\Application\Controller\Admin\OrderOverview;
|
||||
|
||||
class d3_overview_controller_pdfdocuments_parent extends OrderOverview{}
|
||||
}
|
@ -11,11 +11,10 @@
|
||||
namespace D3\PdfDocuments\Modules\Application\Controller;
|
||||
|
||||
use D3\PdfDocuments\Application\Controller\orderOverviewPdfGenerator;
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\noPdfHandlerFoundException;
|
||||
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
|
||||
use D3\PdfDocuments\Application\Model\Registries\registryOrderoverview;
|
||||
use D3\PdfDocuments\Modules\Application\Model\d3_Order_PdfDocuments;
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\OrderOverview;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||
@ -23,15 +22,36 @@ use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\TableViewNameGenerator;
|
||||
|
||||
if (false) {
|
||||
class_alias(
|
||||
d3_overview_controller_pdfdocuments_parent::class,
|
||||
OrderOverview::class
|
||||
);
|
||||
}
|
||||
|
||||
class d3_overview_controller_pdfdocuments extends d3_overview_controller_pdfdocuments_parent
|
||||
{
|
||||
private $generatorError = false;
|
||||
|
||||
public function render()
|
||||
{
|
||||
if ($this->generatorError) {
|
||||
echo <<<HTML
|
||||
<html lang="de">
|
||||
<body>
|
||||
<script>
|
||||
let form = top.basefrm.edit.document.getElementById("transfer");
|
||||
let input = document.createElement("input");
|
||||
input.setAttribute("type", "hidden");
|
||||
input.setAttribute("name", "generatorError");
|
||||
input.setAttribute("value", encodeURIComponent('{$this->generatorError}'));
|
||||
form.appendChild(input);
|
||||
form.submit();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
Registry::getUtils()->showMessageAndExit('PDF-Datei konnte nicht erstellt werden');
|
||||
} elseif ($generatorError = Registry::getRequest()->getRequestParameter('generatorError')) {
|
||||
Registry::getUtilsView()->addErrorToDisplay(urldecode($generatorError));
|
||||
}
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws DatabaseConnectionException
|
||||
@ -45,25 +65,29 @@ class d3_overview_controller_pdfdocuments extends d3_overview_controller_pdfdocu
|
||||
$viewNameGenerator = Registry::get(TableViewNameGenerator::class);
|
||||
$sTable = $viewNameGenerator->getViewName("oxorderarticles");
|
||||
|
||||
$sQ = "select count(oxid) from {$sTable} where oxorderid = " . $masterDb->quote($sOrderId) . " and oxstorno = 0";
|
||||
$sQ = "select count(oxid) from $sTable where oxorderid = " . $masterDb->quote($sOrderId) . " and oxstorno = 0";
|
||||
return (bool) $masterDb->getOne($sQ);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws noBaseObjectSetException
|
||||
* @throws noPdfHandlerFoundException
|
||||
* @throws pdfGeneratorExceptionAbstract
|
||||
*/
|
||||
public function d3CreatePDF()
|
||||
{
|
||||
$soxId = $this->getEditObjectId();
|
||||
if ($soxId != "-1" && isset($soxId)) {
|
||||
/** @var d3_Order_PdfDocuments $oOrder */
|
||||
$oOrder = oxNew(Order::class);
|
||||
if ($oOrder->load($soxId)) {
|
||||
$generator = oxNew( orderOverviewPdfGenerator::class );
|
||||
$generator->generatePdf($oOrder, Registry::getRequest()->getRequestEscapedParameter("pdflanguage"));
|
||||
try {
|
||||
$soxId = $this->getEditObjectId();
|
||||
if ( $soxId != "-1" && isset( $soxId ) ) {
|
||||
/** @var Order $oOrder */
|
||||
$oOrder = oxNew( Order::class );
|
||||
if ( $oOrder->load( $soxId ) ) {
|
||||
$generator = oxNew( orderOverviewPdfGenerator::class );
|
||||
$generator->generatePdf( $oOrder, Registry::getRequest()->getRequestEscapedParameter( "pdflanguage" ) );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $exception) {
|
||||
Registry::getLogger()->error($exception->getMessage(), [ 'exception' => $exception ] );
|
||||
$this->generatorError = 'PDF documents: ' . $exception->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
PDF-Dokumentgenerator für OXID eShop
|
||||
|
||||
Erstellen Sie unterschiedlichste statische oder dynamische PDF-Dokument auf Kopfdruck. Der Dokumentinhalt wird aus Smartytemplates 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.
|
||||
|
||||
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder Neue hinzuzufügen. Auch komplett andere Dokumentarten (z.B. Artikeldatenblätter) sind einfach möglich.
|
||||
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder neue hinzuzufügen. Auch komplett andere Dokumentarten (z.B. Artikeldatenblätter) sind einfach möglich.
|
||||
|
||||
## Systemanforderungen:
|
||||
|
||||
|
@ -33,8 +33,9 @@
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0",
|
||||
"oxid-esales/oxideshop-ce": "6.3 - 6.14",
|
||||
"spipu/html2pdf": "^5.2",
|
||||
"d3/modcfg": "^5.3.6.000 || ^6"
|
||||
"spipu/html2pdf": "~5.2.8",
|
||||
"d3/modcfg": "^5.3.6.000 || ^6",
|
||||
"beberlei/assert": "^3.3.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -2,22 +2,30 @@
|
||||
title: Changelog
|
||||
---
|
||||
|
||||
## 1.0.3.1 - (2023-05-09)
|
||||
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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.4.0...rel_1.x)
|
||||
|
||||
## [1.0.4.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.3.1...1.0.4.0) - 2023-12-22
|
||||
### Added
|
||||
- installierbar in OXID 6.5.2 + 6.5.3 (CE 6.14)
|
||||
- Modullogo
|
||||
|
||||
### Changed
|
||||
- behandelt fehlende Bestellung bei auf Bestellungen basierenden Dokumenten
|
||||
|
||||
## [1.0.3.1](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.3.0...1.0.3.1) - 2023-05-09
|
||||
### Fixed
|
||||
- fix multiple documents at once
|
||||
|
||||
---
|
||||
|
||||
## 1.0.3.0 - (2023-01-04)
|
||||
- kann mehrere Dokumente auf einmal generieren
|
||||
|
||||
## [1.0.3.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.2.0...1.0.3.0) - 2023-01-04
|
||||
### Added
|
||||
- installierbar in OXID 6.4 und 6.5
|
||||
|
||||
---
|
||||
|
||||
## 1.0.2.0 - (2021-04-30)
|
||||
|
||||
## [1.0.2.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.1.0...1.0.2.0) - 2021-04-30
|
||||
### Added
|
||||
- installierbar in OXID 6.2.4 und 6.3.0
|
||||
- Dateinamen werden auf Gültigkeit hin korrigiert
|
||||
@ -25,17 +33,11 @@ title: Changelog
|
||||
### Fixed
|
||||
- Setzen der Rechnungsnummer setzt den "neue Bestellung"-Status nicht zurück
|
||||
|
||||
---
|
||||
|
||||
## 1.0.1.0 - (2020-08-20)
|
||||
|
||||
## [1.0.1.0](https://git.d3data.de/D3Public/pdfdokumente/compare/1.0.0.0...1.0.1.0) - 2020-08-20
|
||||
### Changed
|
||||
- Dokumentid für "Rechnung ohne Logo" angepasst
|
||||
|
||||
---
|
||||
|
||||
## 1.0.0.0 - (2020-08-13)
|
||||
|
||||
## [1.0.1.0](https://git.d3data.de/D3Public/pdfdokumente/tag/1.0.0.0) - 2020-08-13
|
||||
#### Added
|
||||
- Framework zur Erstellung unterschiedlichster PDF Dokumente
|
||||
- ermöglicht Generierung von Rechnungen und Lieferscheinen für Bestellungen aus dem Adminbereich
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"title": "<i class='fab fa-d3 d3fa-color-blue'></i> PDF Dokumente",
|
||||
"moduleversion": "1.0.3.1",
|
||||
"moduleversion": "1.0.4.0",
|
||||
"titledesc": "für den Oxid eShop",
|
||||
"author": "D³ Data Development",
|
||||
"moduledate": "09.05.2023",
|
||||
"moduledate": "22.12.2023",
|
||||
"editors": "",
|
||||
"tagline": "",
|
||||
"image": "",
|
||||
|
BIN
logo.png
BIN
logo.png
Fichier binaire non affiché.
Avant Largeur: | Hauteur: | Taille: 4.3 KiB |
50
metadata.php
50
metadata.php
@ -28,15 +28,15 @@ $aModule = [
|
||||
'de' => $logo.' PDF-Dokumente',
|
||||
'en' => $logo.' PDF documents',
|
||||
],
|
||||
'version' => '1.0.3.1',
|
||||
'version' => '1.0.4.0',
|
||||
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'http://www.oxidmodule.com/',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'extend' => [
|
||||
OrderOverview::class => d3_overview_controller_pdfdocuments::class
|
||||
],
|
||||
'controllers' => [],
|
||||
'thumbnail' => 'logo.png',
|
||||
'thumbnail' => 'picture.svg',
|
||||
'templates' => [
|
||||
'd3orderoverview_pdfform.tpl' => 'd3/pdfdocuments/Application/views/tpl/admin/orderoverview_pdfform.tpl',
|
||||
|
||||
@ -85,6 +85,50 @@ $aModule = [
|
||||
'name' => $sModuleId.'bDev',
|
||||
'type' => 'bool',
|
||||
'value' => false
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'main',
|
||||
'name' => $sModuleId.'basicAuthUserName',
|
||||
'type' => 'str'
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'main',
|
||||
'name' => $sModuleId.'basicAuthPassword',
|
||||
'type' => 'password'
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'contents',
|
||||
'name' => $sModuleId.'LogoUrl',
|
||||
'type' => 'str'
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'contents',
|
||||
'name' => $sModuleId.'BackgroundUrl',
|
||||
'type' => 'str'
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'documents',
|
||||
'name' => $sModuleId.'DocInvoice',
|
||||
'type' => 'bool',
|
||||
'value' => true
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'documents',
|
||||
'name' => $sModuleId.'DocInvoiceNoLogo',
|
||||
'type' => 'bool',
|
||||
'value' => true
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'documents',
|
||||
'name' => $sModuleId.'DocDeliveryNote',
|
||||
'type' => 'bool',
|
||||
'value' => true
|
||||
],
|
||||
[
|
||||
'group' => $sModuleId.'documents',
|
||||
'name' => $sModuleId.'DocDeliveryNoteNoLogo',
|
||||
'type' => 'bool',
|
||||
'value' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
|
57
picture.svg
Fichier normal
57
picture.svg
Fichier normal
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="201px" height="124px" viewBox="0 0 201 124" enable-background="new 0 0 201 124" xml:space="preserve">
|
||||
<g>
|
||||
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="47.0591" y1="67.5117" x2="47.0591" y2="54.6143">
|
||||
<stop offset="0.0056" style="stop-color:#3266A9"/>
|
||||
<stop offset="1" style="stop-color:#0099FF"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_1_)" d="M50.282,55.502c-0.784-0.592-2.104-0.888-3.961-0.888h-1.376l-2.283,12.898h1.779
|
||||
c3.76,0,6.032-2.245,6.815-6.733c0.134-0.871,0.202-1.642,0.202-2.313C51.457,57.081,51.064,56.093,50.282,55.502z"/>
|
||||
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="65.9609" y1="49.104" x2="65.9609" y2="36.9434">
|
||||
<stop offset="0.0056" style="stop-color:#3266A9"/>
|
||||
<stop offset="1" style="stop-color:#0099FF"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_2_)" d="M65.72,40.482c1.074,0,1.611,0.381,1.611,1.143c0,0.701-0.321,1.201-0.962,1.5
|
||||
c-0.209,0.119-0.366,0.194-0.471,0.224c-0.065,0.019-0.158,0.037-0.271,0.056c1.98,1.621,3.702,3.544,5.097,5.699
|
||||
c0.117-0.321,0.21-0.658,0.277-1.013l0.09-1.008c0-1.223-0.568-2.081-1.701-2.574c0.776-0.402,1.376-0.94,1.801-1.611
|
||||
c0.425-0.672,0.638-1.418,0.638-2.239c0-0.642-0.198-1.265-0.593-1.868c-0.396-0.605-0.98-1.049-1.757-1.333
|
||||
c-0.433-0.193-0.876-0.328-1.332-0.402c-0.456-0.075-1.003-0.113-1.645-0.113c-0.82,0-1.663,0.124-2.529,0.37
|
||||
c-0.865,0.246-1.6,0.563-2.204,0.952s-1.13,0.907-1.578,1.557c-0.036,0.052-0.066,0.109-0.101,0.163
|
||||
c1.196,0.534,2.341,1.163,3.426,1.874C63.947,40.943,64.68,40.482,65.72,40.482z"/>
|
||||
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="50.0576" y1="87.0566" x2="50.0576" y2="37.8525">
|
||||
<stop offset="0.0056" style="stop-color:#3266A9"/>
|
||||
<stop offset="1" style="stop-color:#0099FF"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_3_)" d="M70.725,49.104c-0.433,1.189-1.208,2.147-2.331,2.871c-1.425,0.918-3.182,1.377-5.271,1.377
|
||||
c-1.179,0-2.175-0.176-2.988-0.525c-0.813-0.35-1.444-0.864-1.891-1.543c-0.448-0.678-0.671-1.481-0.671-2.405l0.022-0.694
|
||||
l0.156-0.693h4.367l-0.028,0.179v0.179v0.246c0,1.164,0.628,1.746,1.884,1.746c0.635,0,1.201-0.217,1.696-0.649
|
||||
c0.495-0.434,0.742-0.94,0.742-1.522c0-0.522-0.194-0.887-0.582-1.097c-0.329-0.208-1.007-0.313-2.036-0.313l0.47-2.754
|
||||
l1.141-0.067c0.083-0.011,0.154-0.022,0.221-0.033c-0.674-0.551-1.378-1.067-2.11-1.546c-0.044,0.096-0.087,0.195-0.125,0.302
|
||||
h-4.185c0.192-0.837,0.49-1.56,0.884-2.175c-3.064-1.372-6.46-2.133-10.034-2.133c-13.588,0-24.603,11.014-24.603,24.601
|
||||
c0,13.59,11.015,24.604,24.603,24.604S74.66,76.043,74.66,62.453C74.66,57.532,73.214,52.949,70.725,49.104z M59.413,59.233
|
||||
l-0.168,1.275c-0.538,2.953-1.511,5.404-2.921,7.35c-1.298,1.835-3.016,3.179-5.153,4.028c-2.138,0.851-4.494,1.274-7.067,1.274
|
||||
H33.731l4.264-24.198h10.441c1.141,0,2.204,0.073,3.189,0.218c0.984,0.146,1.868,0.364,2.651,0.655
|
||||
c1.611,0.537,2.887,1.471,3.827,2.802c0.94,1.332,1.41,2.992,1.41,4.984L59.413,59.233z"/>
|
||||
</g>
|
||||
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="107.3027" y1="105.8555" x2="93.0727" y2="16.0106">
|
||||
<stop offset="0" style="stop-color:#B2B2B2;stop-opacity:0"/>
|
||||
<stop offset="0.2" style="stop-color:#B2B2B2"/>
|
||||
<stop offset="0.8" style="stop-color:#B2B2B2"/>
|
||||
<stop offset="1" style="stop-color:#B2B2B2;stop-opacity:0"/>
|
||||
</linearGradient>
|
||||
<rect x="99.875" y="14.933" fill="url(#SVGID_4_)" width="0.625" height="92"/>
|
||||
<script xmlns=""></script>
|
||||
<path d="M126.531,43.25c0-3.446,2.801-6.25,6.25-6.25h15.624v12.5c0,1.729,1.398,3.125,3.126,3.125h12.5v14.063h-20.313
|
||||
c-3.448,0-6.25,2.801-6.25,6.25V87h-4.688c-3.449,0-6.25-2.801-6.25-6.248V43.25z M164.031,49.5h-12.5V37L164.031,49.5z
|
||||
M143.719,71.375h3.125c3.018,0,5.469,2.451,5.469,5.469s-2.451,5.471-5.469,5.471h-1.563v3.123c0,0.861-0.702,1.563-1.563,1.563
|
||||
c-0.861,0-1.563-0.701-1.563-1.563v-4.686v-7.814C142.156,72.076,142.857,71.375,143.719,71.375z M146.844,79.188
|
||||
c1.3,0,2.343-1.043,2.343-2.344c0-1.299-1.043-2.344-2.343-2.344h-1.563v4.688H146.844z M156.218,71.375h3.125
|
||||
c2.589,0,4.688,2.102,4.688,4.688v6.252c0,2.586-2.1,4.686-4.688,4.686h-3.125c-0.86,0-1.562-0.701-1.562-1.563v-12.5
|
||||
C154.656,72.076,155.357,71.375,156.218,71.375z M159.343,83.875c0.861,0,1.563-0.703,1.563-1.561v-6.252
|
||||
c0-0.861-0.702-1.563-1.563-1.563h-1.563v9.375H159.343z M167.155,72.938c0-0.861,0.703-1.563,1.563-1.563h4.688
|
||||
c0.861,0,1.563,0.701,1.563,1.563s-0.701,1.563-1.563,1.563h-3.124v3.125h3.124c0.861,0,1.563,0.703,1.563,1.563
|
||||
s-0.701,1.564-1.563,1.564h-3.124v4.686c0,0.861-0.703,1.563-1.563,1.563c-0.859,0-1.563-0.701-1.563-1.563v-6.25V72.938z"/>
|
||||
</svg>
|
Après Largeur: | Hauteur: | Taille: 4.8 KiB |
Référencer dans un nouveau ticket
Bloquer un utilisateur