Jump to content

Invoice billing and delivery addresses do not change PS 1.6.1.0


Recommended Posts

PrestaShop version 1.6.1.0

 

The customer changed address after finished an order but the new address do not change on PDF invoices.

 

On FrontOffice, shows correctly, the new address changed.

On BackOffice also, display the new address on customer profile and order details.

 

I tried to clear the cache but didn't worked. Still printing the old address on PDF.

 

The option to cache the invoices are disabled.

 

Thanks for read

Link to comment
Share on other sites

I found the table

select * from ps_order_invoice where id_order = [ORDER_NUMER];

The old address is stored on this table.

 

Is this a bug or misconfiguration?

 

 

I can solve temporarily by override pdf invoice but, if there's proper way to do, i appreciate.

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

  • 2 weeks later...
  • 4 weeks later...

There seems to be a solution out there... i updated to 1.6.1.1. but that did as mentioned already not solve the case.... It is really painfull...

 

As mentioned by Edwin (http://forge.prestashop.com/browse/PSCSX-6524)
 

1. A real example of today, a customer placed an order and has put his invoice address as a memo. He expect us to 'help' him by adding this address to his invoice. However I could not do this. The only way to fix this was to update the ps_order_invoice table by hand and put 2 null values in the record of this order.
2. Real life example 2; a customer had typed in the address of invoice at shipment address and address of shipment at his invoice. I could not correct this for this customer any more.
3. Real life example 3; (happens a lot); a customer forgets his/hers house number, we have to email and ask, and correct the address for the customer.
etc.

 

 

From that topic i tried: 

/**Returns the template's HTML content 
*@return string HTML content 
*/ 
/** public function getContent() 
{ 
$invoiceAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_INVOICE_ADDR_RULES'), true); 
$deliveryAddressPatternRules = Tools::jsonDecode(Configuration::get('PS_INVCE_DELIVERY_ADDR_RULES'), true);$invoice_address = new Address((int)$this->order->id_address_invoice); 
$country = new Country((int)$invoice_address->id_country);
if ($this->order_invoice->invoice_address)
{ $formatted_invoice_address = $this->order_invoice->invoice_address; }
else
{ $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, $invoiceAddressPatternRules, '<br />', ' '); }
$delivery_address = null; 
$formatted_delivery_address = ''; 
if (isset($this->order->id_address_delivery) && $this->order->id_address_delivery) { 
if ($this->order_invoice->delivery_address)
{ $formatted_delivery_address = $this->order_invoice->delivery_address; }
else
{ $delivery_address = new Address((int)$this->order->id_address_delivery); $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, $deliveryAddressPatternRules, '<br />', ' '); }
*/

But it did not work :(

 

 

I can't work with prestashop anymore because of those reasons. It should always be possible to change a invoice address especially before shipment!

 

I also found the terrible commit: https://github.com/PrestaShop/PrestaShop/pull/3032 (or pull request...)

 

 

An other solution could be to buy the module http://addons.prestashop.com/nl/modules-beheertools/17198-edit-invoice.html But I i totaly disagree that a basic functionality is lost and i have to buy a module made by PRESTASHOP alowing this change again. It should not be blocked in the first place!

Link to comment
Share on other sites

Not easy to find where the order_invoice address is changed.

 

The simplest solution is override the class /pdf/HTMLTemplateInvoice.php

See the attached file:

HTMLTemplateInvoice.php

 

Copy this file to path

/override/classes/pdf/

The changes are inside the method getContent().

Starts on line 151 to 164, and line 169 to 174

 

 

 

Delete the file class_index.php on cache folder

/cache/class_index.php

This file will be auto generated.

 

 

Now, try to download some invoice.

You can see the correct address.

 

I don't know if side effects may be caused by this. However, may solve the problem until we find a proper solution.

 

 

 

 

ok.. this is grotesque.. but works.

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

  • 2 months later...
Prestashop 1.6.1.2 same problem

 

I'm new on Prestashop and my experience is very low. 

 

I saw that the delivery slip run correctly. When I change delivery and/or invoice address in the BO the changes are printed in the PDF.

 

I do not know if this information is useful for you. I hope so.

 

I tryed to copy HTMLtemplateinvoice.php as suggested by PrestaShop Entusiast; but it did not work.  :(

 

If anybody has any news, please post it
Link to comment
Share on other sites

 

Prestashop 1.6.1.2 same problem
 
I'm new on Prestashop and my experience is very low. 
 
I saw that the delivery slip run correctly. When I change delivery and/or invoice address in the BO the changes are printed in the PDF.
 
I do not know if this information is useful for you. I hope so.
 
I tryed to copy HTMLtemplateinvoice.php as suggested by PrestaShop Entusiast; but it did not work.  :(
 
If anybody has any news, please post it

 

 

 

just download the file i attached here on post #10.

 

put this file into override folder as described.

 

to make the changes work, you must delete the class_index as described .... 

 

All very well detailed.. Just read and do it..

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