[Invoices] Bulk printing of invoices not reflecting sort applied in Orders screen #12340
Labels
bug-s2
The bug is affecting any of the non-critical features described in S1 and there is no workaround.
Description
A user contacted support as they use the Bulk Actions - Print Invoices tool as packing slips for their orders. Since Tuesday 4th April, the user noticed an issue with the generated PDF where sorting applied to Orders was not being reflected in the PDF file. The user usually sorts the Orders page by name alphabetically, then clicks Print Invoices, and the generated PDF is also sorted alphabetically. Since Tuesday, the generated PDF is sorted differently (see Possible Fix below). The user is a hub which had 88 orders over 130 pages in their latest order cycle, so sorting the printed PDF manually is not practical.
Expected Behavior
Generated PDFs should reflect sorting applied on the Orders screen, in the same way that filters (e.g. order cycle/name) are reflected in the generated PDF.
Actual Behaviour
Generated PDF is sorted in one way, irrespective of sorting applied on Orders screen. Sorting by date or name does not change the generated PDF.
Steps to Reproduce
Animated Gif/Screenshot
First order in list when sorted alphabetically:
First order in generated PDF:
Workaround
I've tried adding dummy company name/legal address into enterprise settings, which didn't work.
I've also tested with other enterprises and seen the same issue, as well as using the date range filter vs. the order cycle filter.
I've also tested on new admin and seen the same issue.
Same issue when viewing 15 per page.
Severity
bug-s2: a non-critical feature is broken, no workaround
Your Environment
Possible Fix
The sorting of orders in the PDF appears to be via the id field within spree_orders. Running this query on UK prod:
select * from spree_orders where distributor_id=202005 and order_cycle_id=215923 and state='complete' order by id asc
Returns the orders in the same order they appear in the PDF.
PDF:
SQL query:
The text was updated successfully, but these errors were encountered: