omine Posted July 31, 2015 Share Posted July 31, 2015 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 More sharing options...
omine Posted July 31, 2015 Author Share Posted July 31, 2015 (edited) 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 September 4, 2015 by omine (see edit history) Link to comment Share on other sites More sharing options...
josias Posted August 10, 2015 Share Posted August 10, 2015 I've the same problem and I dont know how to solve! :-( Link to comment Share on other sites More sharing options...
lucas.alfaro Posted August 12, 2015 Share Posted August 12, 2015 Hi, Same problem here. Using 1.6. However it only happen for customers created after I have updated from 1.5 to 1.6, therefore only recent customers. Link to comment Share on other sites More sharing options...
tuk66 Posted August 12, 2015 Share Posted August 12, 2015 It looks like a bug. Change the address directly in the ps_order_invoice table - invoice_address and delivery_address fields. Link to comment Share on other sites More sharing options...
Smiles Posted September 3, 2015 Share Posted September 3, 2015 Does someone know if this problem is already solved? Link to comment Share on other sites More sharing options...
omine Posted September 4, 2015 Author Share Posted September 4, 2015 no.. the upgrade to 1.6.1.1 didn't fixed.. Link to comment Share on other sites More sharing options...
Smiles Posted September 5, 2015 Share Posted September 5, 2015 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 More sharing options...
omine Posted September 7, 2015 Author Share Posted September 7, 2015 i have some free time now.. i will try to fix and share Link to comment Share on other sites More sharing options...
omine Posted September 7, 2015 Author Share Posted September 7, 2015 (edited) 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 September 7, 2015 by omine (see edit history) 3 Link to comment Share on other sites More sharing options...
Smiles Posted September 7, 2015 Share Posted September 7, 2015 Great solution, i hope it becomes a setting in the BO so wen regulations need to have it on it can be on in daily use, but when not needed it can be switched of... Link to comment Share on other sites More sharing options...
LavoroInSicurezza Posted November 25, 2015 Share Posted November 25, 2015 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 More sharing options...
LavoroInSicurezza Posted November 26, 2015 Share Posted November 26, 2015 Dear All I found this post in French Language that seems to solve the problem. https://www.prestashop.com/forums/topic/468205-changer-les-adresses-de-livraison-et-facturation-impossible/?hl=%2Binvoice_address&do=findComment&comment=2156854 Best regards Link to comment Share on other sites More sharing options...
omine Posted November 27, 2015 Author Share Posted November 27, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now