Hallo Leute,
Ich versuche grade das Invoicepdf Modul für Angebote zu erweitern also es soll ein Punkt hinzukommen entweder, Rechnung, Angebot oder Lieferschein.
dazu habe ich hier:
// adding info data
switch ( oxConfig::getParameter( 'pdftype' ) ) {
case 'angebot':
$this->exportAngebot( $oPdf );
break;
case 'dnote':
$this->exportDeliveryNote( $oPdf );
break;
default:
$this->exportStandart( $oPdf );
}
hinzugefügt und die Funktion dazu Angelegt
public function exportAngebot( $oPdf )
{
// preparing order curency info
$myConfig = $this->getConfig();
$oPdfBlock = new PdfBlock();
$this->_oCur = $myConfig->getCurrencyObject( $this->oxorder__oxcurrency->value );
if ( !$this->_oCur ) {
$this->_oCur = $myConfig->getActShopCurrencyObject();
}
// loading active shop
$oShop = $this->_getActShop();
// shop information
$oPdf->setFont( $oPdfBlock->getFont(), '', 6 );
$oPdf->text( 15, 55, $oShop->oxshops__oxname->getRawValue().' - '.$oShop->oxshops__oxstreet->getRawValue().' - '.$oShop->oxshops__oxzip->value.' - '.$oShop->oxshops__oxcity->getRawValue() );
// billing address
$this->_setBillingAddressToPdf( $oPdf );
// delivery address
if ( $this->oxorder__oxdelsal->value ) {
$this->_setDeliveryAddressToPdf( $oPdf );
}
// loading user
$oUser = oxNew( 'oxuser' );
$oUser->load( $this->oxorder__oxuserid->value );
// user info
$sText = $this->translate( 'ORDER_OVERVIEW_PDF_FILLONPAYMENT' );
$oPdf->setFont( $oPdfBlock->getFont(), '', 5 );
$oPdf->text( 195 - $oPdf->getStringWidth( $sText ), 55, $sText );
// customer number
$sCustNr = $this->translate( 'ORDER_OVERVIEW_PDF_CUSTNR').' '.$oUser->oxuser__oxcustnr->value;
$oPdf->setFont( $oPdfBlock->getFont(), '', 7 );
$oPdf->text( 195 - $oPdf->getStringWidth( $sCustNr ), 59, $sCustNr );
// setting position if delivery address is used
if ( $this->oxorder__oxdelsal->value ) {
$iTop = 115;
} else {
$iTop = 91;
}
// shop city
$sText = $oShop->oxshops__oxcity->getRawValue().', '.date( 'd.m.Y' );
$oPdf->setFont( $oPdfBlock->getFont(), '', 10 );
$oPdf->text( 195 - $oPdf->getStringWidth( $sText ), $iTop + 8, $sText );
// shop VAT number
if ( $oShop->oxshops__oxvatnumber->value ) {
$sText = $this->translate( 'ORDER_OVERVIEW_PDF_TAXIDNR' ).' '.$oShop->oxshops__oxvatnumber->value;
$oPdf->text( 195 - $oPdf->getStringWidth( $sText ), $iTop + 12, $sText );
$iTop += 8;
} else {
$iTop += 4;
}
// invoice number
$sText = $this->translate( 'ORDER_OVERVIEW_PDF_COUNTNR' ).' '.$this->oxorder__oxbillnr->value;
$oPdf->text( 195 - $oPdf->getStringWidth( $sText ), $iTop + 8, $sText );
// marking if order is canceled
if ( $this->oxorder__oxstorno->value == 1 ) {
$this->oxorder__oxordernr->setValue( $this->oxorder__oxordernr->getRawValue() . ' '.$this->translate( 'ORDER_OVERVIEW_PDF_STORNO' ), oxField::T_RAW );
}
// order number
$oPdf->setFont( $oPdfBlock->getFont(), '', 12 );
$oPdf->text( 15, 108, $this->translate( 'ORDER_OVERVIEW_PDF_ANGNOTE' ).' '.$this->oxorder__oxordernr->value );
// order date
$oPdf->setFont( $oPdfBlock->getFont(), '', 10 );
$aOrderDate = explode( ' ', $this->oxorder__oxorderdate->value );
$sOrderDate = oxUtilsDate::getInstance()->formatDBDate( $aOrderDate[0]);
$oPdf->text( 15, $iTop + 8, $this->translate( 'ORDER_OVERVIEW_PDF_ORDERSFROM' ).$sOrderDate.$this->translate( 'ORDER_OVERVIEW_PDF_ORDERSAT' ).$oShop->oxshops__oxurl->value );
$iTop += 16;
// product info header
$oPdf->setFont( $oPdfBlock->getFont(), '', 8 );
$oPdf->text( 15, $iTop, $this->translate( 'ORDER_OVERVIEW_PDF_AMOUNT' ) );
$oPdf->text( 30, $iTop, $this->translate( 'ORDER_OVERVIEW_PDF_ARTID' ) );
$oPdf->text( 45, $iTop, $this->translate( 'ORDER_OVERVIEW_PDF_DESC' ) );
$oPdf->text( 145, $iTop, $this->translate( 'ORDER_OVERVIEW_PDF_VAT' ) );
$oPdf->text( 158, $iTop, $this->translate( 'ORDER_OVERVIEW_PDF_UNITPRICE' ) );
$sText = $this->translate( 'ORDER_OVERVIEW_PDF_ALLPRICE' );
$oPdf->text( 195 - $oPdf->getStringWidth( $sText ), $iTop, $sText );
// separator line
$iTop += 2;
$oPdf->line( 15, $iTop, 195, $iTop );
// #345
$siteH = $iTop;
$oPdf->setFont( $oPdfBlock->getFont(), '', 10 );
// order articles
$this->_setOrderArticlesToPdf( $oPdf, $siteH, true );
// generating pdf file
$oArtSumm = new PdfArticleSummary( $this, $oPdf );
$iHeight = $oArtSumm->generate( $siteH );
if ( $siteH + $iHeight > 258 ) {
$this->pdfFooter( $oPdf );
$iTop = $this->pdfHeader( $oPdf );
$oArtSumm->ajustHeight( $iTop - $siteH );
$siteH = $iTop;
}
$oArtSumm->run( $oPdf );
$siteH += $iHeight + 8;
$oPdf->text( 15, $siteH, $this->translate( 'ORDER_OVERVIEW_PDF_GREETINGS' ) );
}
Die Funktion ist noch dieselbe wie bei Standard nur eben Standard auf Angebot abgeändert.
Leider erscheint im Backend keine 3te Auswahl was habe ich vergessen?