Author Topic: Check if invoice or delivery note  (Read 162 times)

livekrimi

  • Beginner
  • *
  • Posts: 4
  • A beginner
Check if invoice or delivery note
« on: February 05, 2018, 14:01:57 pm »
Hi,

I want the header logo only to be displayed in invoices but not in delivery notes.

I found this code in components/com_virtuemart/helpers/vmpdf.php, which sets the logo in the header:

Code: [Select]
if (($headerdata['logo']) AND ($headerdata['logo'] != K_BLANK_IMAGE)) {

if (!class_exists ('JFile')) {
require(VMPATH_LIBS . DS . 'joomla' . DS . 'filesystem' . DS . 'file.php');
}
if($this->tcpdf6){
if (!class_exists ('TCPDF_IMAGES')) {
require(VMPATH_LIBS.DS.'tcpdf'.DS.'include'.DS.'tcpdf_images.php');
}

$imgtype = TCPDF_IMAGES::getImageFileType(VMPATH_ROOT.DS.$headerdata['logo']);
} else {
$imgtype = $this->getImageFileType(VMPATH_ROOT.DS.$headerdata['logo']);
}

if (($imgtype == 'eps') OR ($imgtype == 'ai')) {
$this->ImageEps(VMPATH_ROOT.DS.$headerdata['logo'], '', '', $headerdata['logo_width']);
} elseif ($imgtype == 'svg') {
$this->ImageSVG(VMPATH_ROOT.DS.$headerdata['logo'], '', '', $headerdata['logo_width']);
} else {
$this->Image(VMPATH_ROOT.DS.$headerdata['logo'], '', '', $headerdata['logo_width']);
}
$imgy = $this->getImageRBY();
$header_x +=  ($headerdata['logo_width'] * 1.1);
$cw -= ($headerdata['logo_width'] * 1.1);
} else {
$imgy = $this->y;
}

Is there a possibility to check if the created pdf is an invoice or a delivery note on top of this code?

I tried it with
Code: [Select]
if ($this->doctype == 'invoice') { but it didn't work.

Can anyone help me?