News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Check if invoice or delivery note

Started by livekrimi, February 05, 2018, 14:01:57 PM

Previous topic - Next topic

livekrimi

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:

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 if ($this->doctype == 'invoice') { but it didn't work.

Can anyone help me?