add documents and document classes

This commit is contained in:
Daniel Seifert 2020-05-30 00:48:43 +02:00
parent 7e46a9f064
commit 3fafdb5d2f
7 changed files with 168 additions and 1 deletions

View File

@ -17,6 +17,7 @@
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocuments_generic_interface as genericInterface;
use OxidEsales\Eshop\Core\Registry;
use Smarty;
@ -40,6 +41,7 @@ abstract class pdfDocuments_generic implements genericInterface
* @param $sFilename
* @param int $iSelLang
* @param string $target
* @throws noBaseObjectSetException
*/
public function genPdf($sFilename, $iSelLang = 0, $target = 'I')
{

View File

@ -17,6 +17,7 @@
namespace D3\PdfDocuments\Application\Model\AbstractClasses;
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocuments_order_interface as orderInterface;
use \OxidEsales\Eshop\Application\Model\Order;
use OxidEsales\Eshop\Application\Model\Payment;
@ -72,4 +73,20 @@ abstract class pdfDocuments_order extends pdfDocuments_generic implements orderI
return str_replace($ordernr, $billnr, $sFilename);
}
/**
* @param $sFilename
* @param int $iSelLang
* @param string $target
* @throws noBaseObjectSetException
*/
public function genPdf($sFilename, $iSelLang = 0, $target = 'I')
{
if (false == $this->getOrder()) {
$e = oxNew(noBaseObjectSetException::class);
throw $e;
}
parent::genPdf($sFilename, $iSelLang, $target);
}
}

View File

@ -21,7 +21,27 @@ use D3\PdfDocuments\Application\Model\AbstractClasses\pdfDocuments_order;
class deliverynotePdf extends pdfDocuments_order
{
public function getTemplate(){
/**
* @return string
*/
public function getRequestId()
{
return 'dnote';
}
/**
* @return string
*/
public function getTitleIdent()
{
return "ORDER_OVERVIEW_PDF_DNOTE";
}
/**
* @return string
*/
public function getTemplate()
{
return 'd3deliverynote_pdf.tpl';
}
}

View File

@ -0,0 +1,45 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\PdfDocuments\Application\Model\Documents;
class deliverynotewithoutlogoPdf extends deliverynotePdf
{
/**
* @return string
*/
public function getRequestId()
{
return 'dnote_without_logo';
}
/**
* @return string
*/
public function getTitleIdent()
{
return "ORDER_OVERVIEW_PDF_DNOTE_WITHOUT_LOGO";
}
/**
* @return string
*/
public function getTemplate()
{
return 'd3deliverynote_pdf.tpl';
}
}

View File

@ -18,12 +18,37 @@
namespace D3\PdfDocuments\Application\Model\Documents;
use D3\PdfDocuments\Application\Model\AbstractClasses\pdfDocuments_order;
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocuments_orderinvoice_interface;
class invoicePdf extends pdfDocuments_order implements pdfdocuments_orderinvoice_interface
{
protected $blIsNewOrder = false;
/**
* @return string
*/
public function getRequestId()
{
// same like in OXID PDF module
return 'standart';
}
/**
* @return string
*/
public function getTitleIdent()
{
return "ORDER_OVERVIEW_PDF_STANDART";
}
/**
* @param $sFilename
* @param int $iSelLang
* @param string $target
* @return void
* @throws noBaseObjectSetException
*/
public function genPdf( $sFilename, $iSelLang = 0, $target = 'I' )
{
$this->setInvoiceNumber();

View File

@ -0,0 +1,45 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\PdfDocuments\Application\Model\Documents;
class invoicewithoutlogoPdf extends invoicePdf
{
/**
* @return string
*/
public function getRequestId()
{
// same like in OXID PDF module
return 'standart_without_logo';
}
/**
* @return string
*/
public function getTitleIdent()
{
return "ORDER_OVERVIEW_PDF_STANDART_WITHOUT_LOGO";
}
/**
* @return string
*/
public function getTemplate(){
return 'd3invoice_pdf.tpl';
}
}

View File

@ -17,8 +17,20 @@
namespace D3\PdfDocuments\Application\Model\Interfaces;
use D3\PdfDocuments\Application\Model\Exceptions\noBaseObjectSetException;
interface pdfdocuments_generic_interface
{
/**
* @return string
*/
public function getRequestId();
/**
* @return string
*/
public function getTitleIdent();
/**
* @return string
*/
@ -35,6 +47,7 @@ interface pdfdocuments_generic_interface
* @param string $target
*
* @return mixed
* @throws noBaseObjectSetException
*/
public function genPdf($sFilename, $iSelLang = 0, $target = 'I');
}