Jump to content

[SOLVED] How to insert VAT number in PDF invoice


FilipeJPS

Recommended Posts

You'll need to edit classes/PDF.php. You can add your VAT number on lines 193-197 of Footer() function:

$this->Cell(0, 5, $conf['PS_SHOP_NAME_UPPER'].
(!empty($conf['PS_SHOP_ADDR1']) ? ' - '.self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '').' '.$conf['PS_SHOP_COUNTRY'] : ''), 0, 1, 'C', 1);
$this->Cell(0, 5,
(!empty($conf['PS_SHOP_DETAILS']) ? self::l('Details:').' '.$conf['PS_SHOP_DETAILS'].' - ' : '').
(!empty($conf['PS_SHOP_PHONE']) ? self::l('PHONE:').' '.$conf['PS_SHOP_PHONE'] : ''), 0, 1, 'C', 1);



For example:

$this->Cell(0, 5, $conf['PS_SHOP_NAME_UPPER'].
(!empty($conf['PS_SHOP_ADDR1']) ? ' - VAT Number: 12345678 - '.self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '').' '.$conf['PS_SHOP_COUNTRY'] : ''), 0, 1, 'C', 1);
$this->Cell(0, 5,
(!empty($conf['PS_SHOP_DETAILS']) ? self::l('Details:').' '.$conf['PS_SHOP_DETAILS'].' - ' : '').
(!empty($conf['PS_SHOP_PHONE']) ? self::l('PHONE:').' '.$conf['PS_SHOP_PHONE'] : ''), 0, 1, 'C', 1);



Change 12345678 to your VAT number.

Link to comment
Share on other sites

  • 2 months later...

Yes, it is possible. The invoice() function of classes/PDF.php gets the customer information on line 379:

$invoice_customer = new Customer(intval($invoice_address->id_customer));



Anywhere after that line in the function, you can use intval($invoice_customer->id) to get the customer ID and $invoice_customer->email to get the email. You just have to decide where you want it displayed.

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
  • 4 months later...
And how can I display the Identication number on the invoice what my customer fill in when it order something?
<br/><br/>Have you find out how to add a customers VAT number on invoice?

 

Any news about how to show customers VAT number on invoice (below the address)?? Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...