ivanpav Posted February 6, 2019 Share Posted February 6, 2019 (edited) Hello. I have one problem. If I go to Order detail and generate invoice, all is ok, it is downloadable. But from Orders > Invoices .. only the spin is running and nothing happens, no file download offer. It only refreshes the backoffice and nothing happens. Can you help me please? I also tried debug mode and no error messages. Thak you very much. Edited February 6, 2019 by ivanpav (see edit history) Link to comment Share on other sites More sharing options...
ogoossens Posted November 12, 2020 Share Posted November 12, 2020 Did you solve it somehow? Exactly the same - the invoices are there to be downloaded via order, but not via Export But "Generating PDF" click - worksbut nothing happens (page with invoice export just refreshes) Enabling DebugMode broke my admin - like 20 errors dooh PrestaShop version: 1.7.6.4 I could download the invoice one by one but I still would like to have it solved Link to comment Share on other sites More sharing options...
smrkiki1 Posted November 13, 2020 Share Posted November 13, 2020 i have same problem, version 1.7.6.8 I have to download the invoice one by one but I it is not solution for hundreds of invoices Link to comment Share on other sites More sharing options...
tuk66 Posted November 24, 2020 Share Posted November 24, 2020 If you have too much invoices, it can simply fail due to the server timeout which is usually 30 seconds on shared hostings. Link to comment Share on other sites More sharing options...
smrkiki1 Posted November 25, 2020 Share Posted November 25, 2020 No, it is not this case I try only 1, 12 and 20. Each download was less than 30s. The result is the same, only refresh the page Link to comment Share on other sites More sharing options...
ovlcek Posted January 14, 2021 Share Posted January 14, 2021 Have any of you found out where the problem is? I have discovered it might be a hosting issue, because when I moved the site to another host, it started working. But I have no idea whats wrong with the old hosting, because there are no errors, it just does not work. Link to comment Share on other sites More sharing options...
smrkiki1 Posted January 15, 2021 Share Posted January 15, 2021 On 1/14/2021 at 12:25 PM, ovlcek said: Have any of you found out where the problem is? I have discovered it might be a hosting issue, because when I moved the site to another host, it started working. But I have no idea whats wrong with the old hosting, because there are no errors, it just does not work. hm, i tried update for 1.7.7 but generate invoices dont work Link to comment Share on other sites More sharing options...
beshop Posted May 24, 2021 Share Posted May 24, 2021 On 1/15/2021 at 12:58 PM, smrkiki1 said: hm, i tried update for 1.7.7 but generate invoices dont work have you solved it? Link to comment Share on other sites More sharing options...
ovlcek Posted June 28, 2021 Share Posted June 28, 2021 @smrkiki1 @beshop Try this link if it does work: https://www.YOURDOMAIN.COM/ADMIN/index.php?controller=AdminPdf&date_from=2021-01-01&date_to=2021-01-21&submitAction=generateInvoicesPDF&token=TOKEN if you login to your prestashop administration, you can get token from URL. just replace TOKEN with the actual token. Link to comment Share on other sites More sharing options...
beshop Posted June 29, 2021 Share Posted June 29, 2021 6 hours ago, ovlcek said: @smrkiki1 @beshop Try this link if it does work: https://www.YOURDOMAIN.COM/ADMIN/index.php?controller=AdminPdf&date_from=2021-01-01&date_to=2021-01-21&submitAction=generateInvoicesPDF&token=TOKEN if you login to your prestashop administration, you can get token from URL. just replace TOKEN with the actual token. YES this work fine. but why doesnt work if i click to button, ? Link to comment Share on other sites More sharing options...
smrkiki1 Posted June 30, 2021 Share Posted June 30, 2021 On 6/29/2021 at 12:07 AM, ovlcek said: @smrkiki1 @beshop Try this link if it does work: https://www.YOURDOMAIN.COM/ADMIN/index.php?controller=AdminPdf&date_from=2021-01-01&date_to=2021-01-21&submitAction=generateInvoicesPDF&token=TOKEN if you login to your prestashop administration, you can get token from URL. just replace TOKEN with the actual token. hi, when i replace YOURDOMAIN.COM/ADMIN and TOKEN (token from orders > invoices) every time prestashop redirect to admin login page and i dont know what i do wrong Link to comment Share on other sites More sharing options...
Les Vikings Posted September 15, 2021 Share Posted September 15, 2021 Has anyone found an answer to this problem? I'm experiencing the same on PS 1.7.6.1. The POST request is made correctly, the request headers indicate that a file transfer is to be initiated with the correct invoice filename, but it returns a 302 response code and redirects to the invoices screen without downloading anything... Link to comment Share on other sites More sharing options...
smrkiki1 Posted September 18, 2021 Share Posted September 18, 2021 This link work correctly https://www.YOURDOMAIN.COM/ADMIN/index.php?controller=AdminPdf&date_from=2021-01-01&date_to=2021-01-21&submitAction=generateInvoicesPDF&token=TOKEN Link to comment Share on other sites More sharing options...
Les Vikings Posted September 20, 2021 Share Posted September 20, 2021 On 9/18/2021 at 8:46 PM, smrkiki1 said: This link work correctly https://www.YOURDOMAIN.COM/ADMIN/index.php?controller=AdminPdf&date_from=2021-01-01&date_to=2021-01-21&submitAction=generateInvoicesPDF&token=TOKEN Yes, it does, but that's not a solution, that's a cumbersome workaround at best. Regular users will never prefer that method. Link to comment Share on other sites More sharing options...
rado111 Posted April 15, 2022 Share Posted April 15, 2022 (edited) On 9/20/2021 at 8:57 AM, Les Vikings said: Yes, it does, but that's not a solution, that's a cumbersome workaround at best. Regular users will never prefer that method. I have same problem on 1.7.8.5, link is working, but button not. However generate of order slips working fine via button. Edited April 15, 2022 by rado111 (see edit history) Link to comment Share on other sites More sharing options...
beshop Posted April 19, 2022 Share Posted April 19, 2022 Hello, I also made a quick module. https://becrea.sk/blog/prestashop-1-7-negeneruje-hromadne-faktury/ Link to comment Share on other sites More sharing options...
ovlcek Posted November 22, 2022 Share Posted November 22, 2022 I've managed to fix this. I believe it has to do something with hosting configuration, because Invoice PDF generating work in Prestashop demo. You need FTP access to edit this file: /src/PrestaShopBundle/Controller/Admin/Sell/Order/InvoicesController.php Find this method public function generatePdfByDateAction(Request $request) { $formHandler = $this->get('prestashop.admin.order.invoices.by_date.form_handler'); $this->processForm($formHandler, $request); return $this->redirectToRoute('admin_order_invoices'); } and replace it with this method (working on PS 1.7.8.7) public function generatePdfByDateAction(Request $request) { $formHandler = $this->get('prestashop.admin.order.invoices.by_date.form_handler'); $form = $formHandler->getForm(); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $errors = $formHandler->save($form->getData()); if (empty($errors)) { $by_date = $form->getData(); return $this->redirect( $this->get('prestashop.adapter.legacy.context')->getAdminLink( 'AdminPdf', true, [ 'date_from' => $by_date['date_from'], 'date_to' => $by_date['date_to'], 'submitAction' => 'generateInvoicesPDF', ] ) ); } } if (!empty($errors)) { $this->flashErrors($errors); } return $this->redirectToRoute('admin_order_invoices'); } if it does not work for you, try to replace it with this one (working on PS 1.7.6.7) public function generatePdfByDateAction(Request $request) { $formHandler = $this->get('prestashop.admin.order.invoices.by_date.form_handler'); $form = $formHandler->getForm(); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $errors = $formHandler->save($form->getData()); if (empty($errors)) { $by_date = $form->get('generate_by_date')->getData(); return $this->redirect( $this->get('prestashop.adapter.legacy.context')->getAdminLink( 'AdminPdf', true, [ 'date_from' => $by_date['date_from'], 'date_to' => $by_date['date_to'], 'submitAction' => 'generateInvoicesPDF', ] ) ); } } if (!empty($errors)) { $this->flashErrors($errors); } return $this->redirectToRoute('admin_order_invoices'); } Bear in mind these files will be overriden with every Prestashop update. 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