-
Notifications
You must be signed in to change notification settings - Fork 9.4k
After invoicing an item Print Invoices returns a 'no printable documents' error. #4974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also when choosing Print All it seams to print the invoice twice and the second one printed is messed up. |
Hi @pynej, |
According to contributor guide, tickets without response for two weeks should be closed. |
This is still a problem in 2.1. Please re-open, and I will test with extension disabled. |
I've now reproduced this using the same steps as the original poster on a clean installation of 2.1.0 with just the fix to add the base_grand_total column to the sales_invoice_grid. The mass-action in the order view -> invoice grid works. Print from the invoice view page works. It's the mass action in the order grid that is not working. |
Hi @maderlock, |
Reproduced on a clear installation of 2.1 in incogneto running on PHP 7.0.7. I would have been surprised if that had made a difference as the error is displayed in the notifications area so it should not be relevant given that packing slips etc. can be printed this way. |
To confirm, I can go to the invoice and print it directly. The problem is not related to the actual generation of the pdf - just the mass action. |
Is there still an update needed? Clear steps to reproduce... |
This is happening because of incorrect collection being passed to PdfInvoices massAction. The consequence is that the invoice collection is filtered (incorrectly) by orderId. To reproduce the issue, you shall invoice some of the orders, leave some orders not invoiced, then invoice some others in a random order. The issue is not reproducible if orders are invoices in the same order as they're placed. Another consequence would be wrong (unrelated to selected orders in Sales Orders grid) invoices being printed. As soon as order entity_ids diverge from invoice entity_ids, you will experience these issues when trying to print invoices on orders that have been invoices but there's no invoice with the same entity_id as the order's entity_id. Magento\Ui\Component\MassAction\Filter::getCollection() returns ids from query "SELECT
The applies selection (order_ids!!!) to the resulting collection, where mentioned order_id was selected in order admin grid (Magento\Ui\Component\MassAction\Filter::applySelection() method), which results in something like:
(note the last part is an order id from massaction filter, not an invoice id!!!) Next step, in Magento\Sales\Controller\Adminhtml\Order::massAction(), $collection->getAllIds() returns NULL (of course) and the invoice query clearly results in something like:
Which obviously is returning count of 0, hence the error message... |
I am experiencing this problem as well after migrating data to 2.1.1 |
I also have this problem on 2.0.7. Individual printing of an invoice works well, but the mass action gives the error 'There are no printable documents related to selected orders.'. |
Hi, this issue was fixed in develop branch (see commit). Also fix will be delivered in 2.1 with 2.1.3 release in the end of November |
Magento2 filters in Admin grid are all affected by this bug, had to bypass the filter applied to collection in my custom MassAction, implementing my own version of the filter's applySelection($collection) method. See example:
|
Steps to reproduce
2.0.7
branch.Expected result
Actual result
The invoice exists and if i go to Sales->Invoices I can print it there fine.
The text was updated successfully, but these errors were encountered: