Jump to content

PDF INVOICE - not showing Phone and Email


Recommended Posts

Hello,

 

In 1.6.1.0 i have problem with Invoices. In adress is not shown phone number and email. My address format setting in Countries->xyz(State) looks like:

firstname lastname
company
vat_number
address1
address2
postcode city
Country:name
phone
phone_mobile

 

In 1.6.0.13 it was working fine... I tried it on clean install, and the problem is the same.

 

Thanks for fast help. I think that this is another bug in 1.6.1.0 ...

 

Link to comment
Share on other sites

There are 2 new configuration options:

 

PS_INVCE_INVOICE_ADDR_RULES
PS_INVCE_DELIVERY_ADDR_RULES

 

where address format exceptions are set. Currently: ["vat_number","phone","phone_mobile"]

 

 

I like (hidden) surprises!

  • Like 1
Link to comment
Share on other sites

I'm sharing something that worked for me.

PS 1.6.1.0

select * from ps_configuration WHERE `name` LIKE '%PS_INVCE%';

This query returns the parameters below:

PS_INVCE_INVOICE_ADDR_RULES
PS_INVCE_DELIVERY_ADDR_RULES

Both parameters have same value: 

{"avoid":["vat_number","phone","phone_mobile"]}

Change both parameters values to

{"avoid":["vat_number"]}

If wish, can run this query:

update ps_configuration set value = '{"avoid":["vat_number"]}' where `name` = 'PS_INVCE_INVOICE_ADDR_RULES';
update ps_configuration set value = '{"avoid":["vat_number"]}' where `name` = 'PS_INVCE_DELIVERY_ADDR_RULES';

Once done, go to BackOffice

 

1. Address format per country

Localization -> Countries -> [select the country you wish to edit]. Click on button "[edit]"

Into the textarea "Address format", you can edit the parameters to be printed on PDF invoices, etc.

For customers phone, just add "phone" and/or "phone_mobile".
For customer email, add "Customer:email".

On the right side, there's a table with useful buttons. Just click on these buttons to add the codes or type manually.

For my case, this is the complete format:
 

firstname lastname
company
vat_number
Country:name
postcode
State:name city
address1
address2
phone
phone_mobile
Customer:email

Save the changes.

 

 

2. Clear the cache
Advanced Parameters -> Performance -> Click on button located on top right (clear cache)
 

All done.

Download any order invoice to ensure if working well.

 

 

thanks @tuk66

Edited by omine (see edit history)
  • Like 3
Link to comment
Share on other sites

Thank you for valuable info . but we unable to find this location

 

select * from ps_configuration WHERE `name` LIKE '%PS_INVCE%';

 

This query returns the parameters below:

PS_INVCE_INVOICE_ADDR_RULES
PS_INVCE_DELIVERY_ADDR_RULES

 

where is it? kindly help to solve this problem

Link to comment
Share on other sites

Actually

 

we need explain sir, how to add the query ,

 

This query returns the parameters below:

 

PS_INVCE_INVOICE_ADDR_RULES
PS_INVCE_DELIVERY_ADDR_RULES

 

Both parameters have same value: 

{"avoid":["vat_number","phone","phone_mobile"]}

 

 

 

in our control panel when can we find this query .

 

kindly explain sir

 

Thank you

Link to comment
Share on other sites

I think this is only for version 1.6.1.0 and higher.

 

What is your PrestaShop version?

 

 

And, please, try to be clear and detailed on what are you doing, what are your conditions, etc.. so, we can help more effectively..

Your answers are so vague and bit confused.. 

Link to comment
Share on other sites

  • 3 weeks later...

Hello,
 
I have an other solution :
 
It's to override the PDF class HTMLTemplatesInvoice.php to change this :

 

$formatted_delivery_address = $this->order_invoice->delivery_address;

 

by this :

 

                $delivery_address = new Address((int)$this->order->id_address_delivery);
                $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');

 

and on your invoices you can see the phone number in delivry adress.

 

And this new params PS_INVCE_INVOICE_ADDR_RULES and PS_INVCE_DELIVERY_ADDR_RULES it is not use in the HTMLTemplateDelivrySlip.php Why ? Good question ?

 

Bye

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Hi to all..this option (@tuk66) works perfect for me now...finally I have telephone number in my Invoice..great :)

 

but I have another problem...

 

When someone try to order some product's (e.g 5 or more that that number) in one order,Im recieve

 

this order in two separate pdf invoice (e.g WIIXJXNUI or WIIXJXNUI#1 ) ..why? Thanx for help...Regards..Milorad

Edited by mstevanic (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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...