Page 1 of 1

CIF/NIF NUMBER INTO INVOICE

Posted: 14 Oct 2011, 10:44
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,

Re: CIF/NIF NUMBER INTO INVOICE

Posted: 19 Oct 2011, 00:43
by Jan

Re: CIF/NIF NUMBER INTO INVOICE

Posted: 03 Nov 2011, 03:59
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.