CIF/NIF NUMBER INTO INVOICE

Phoca PDF - creating PDF documents in Joomla! CMS
Sckubba
Phoca Member
Phoca Member
Posts: 12
Joined: 13 Oct 2011, 03:53

CIF/NIF NUMBER INTO INVOICE

Post by Sckubba »

Is Spain a legal invoice has to show a CIF (tax identification number of a company) or NIF (tax identification number of a person).
Phoca PDF does not display this parameter.
How can I add?

Thanks in advance,
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: CIF/NIF NUMBER INTO INVOICE

Post by Jan »

If you find Phoca extensions useful, please support the project
Sckubba
Phoca Member
Phoca Member
Posts: 12
Joined: 13 Oct 2011, 03:53

Re: CIF/NIF NUMBER INTO INVOICE

Post by Sckubba »

Hi,
this article has obsolete, was a solution for VM 1.1.0, but I have the new solution.

There are modify the tmpl.invoice.php, tmpl.deliverynote.php, and virtuemartpdfoutput.php files.
This files are in the path: "..plugins\phocapdf\virtuemart\"

In tmpl.invoice.php and tmpl.deliverynote.php files you have to modify the same lines in both files, the line is the 166:
Original code:

Code: Select all

if ($a['extra_field_1'] != '') {
		$o .= '<span class="extrafield">'.$a['l_extra_field_1'] . ': '.$a['extra_field_1']. '</span><br />';
	}
New code

Code: Select all

if ($a['vm_extrafield'] != '') {
		$o .= '<span class="extrafield">'.$a['l_vm_extrafield'] . ': '.$a['vm_extrafield']. '</span><br />';
	}
Because "vm_extrafield" is the variable (for VAT number) in the VM 1.1.5 and latest.

In virtuemartpdfoutput.php file the code to modify is in line 313:
Original code:

Code: Select all

	$var	= array('extra_field' => 'extra_field_1');
		$dbuf1	= PhocaPDFVirtueMartHelper::dbQ('dbuf', $var);
New code:

Code: Select all

$var	= array('extra_field' => 'vm_extrafield');
		$dbuf1	= PhocaPDFVirtueMartHelper::dbQ('dbuf', $var);
and in line 414
Original code:

Code: Select all

$a['l_extra_field_1'] = '';
		if (isset($dbuf1->title)) {$a['l_extra_field_1']	= $dbuf1->title;}
New code:

Code: Select all

$a['l_vm_extrafield'] = '';
		if (isset($dbuf1->title_)) {$a['l_vm_extrafield'] = $dbuf1->title;}
Excuse me for my bad english.
Post Reply