Page 1 of 1

[HACK] Listing products on invoices by SKU

Posted: Tue Apr 26, 2011 6:13 am
by Brandeline
If you are like me and have more than 1300 different SKU's for a warehouse to manage the picking and packing of, you might have noticed that sometimes, products do not appear sensibly in SKU order on the invoices. This makes it fairly hard for warehouse staff to get everything they need for a large order in one trip to an area and wastes steps. This tiny hack is for 6.1.1, to print invoices with products in sku order per shipment address.

Open lib/order.printing.php
1. Around line 272 inside the function generatePrintableInvoice find this line of code

Code: Select all

ORDER BY op.order_address_id
and change it to the following:

Code: Select all

ORDER BY op.order_address_id, p.prodcode ASC
To make the same change for packing slips:

Around line 763 inside the function generateOrderPackingSlip find the following:

Code: Select all

WHERE orderorderid='".(int)$orderId."'
and add this line below it

Code: Select all

ORDER BY ordprodsku ASC

Re: [HACK] Listing products on invoices by SKU

Posted: Tue Apr 26, 2011 9:18 pm
by meules
Great, it was exactly one minute ago that I was frustrated while picking an order that products were not ordered on name. Had to go back to the same rack four times :evil: I assume that the same order can be done on name?

Anyway thx

Re: [HACK] Listing products on invoices by SKU

Posted: Tue Apr 26, 2011 11:49 pm
by Martin
meules wrote:Great, it was exactly one minute ago that I was frustrated while picking an order that products were not ordered on name. Had to go back to the same rack four times :evil: I assume that the same order can be done on name?
Yup..

Just go with:

Code: Select all

ORDER BY ordprodname ASC 
instead of:

Code: Select all

ORDER BY ordprodsku ASC 

Thanks to Brandeline for that simple but effective little hack.. :ugeek:

Re: [HACK] Listing products on invoices by SKU

Posted: Thu Mar 01, 2012 5:20 am
by noticz
OK I got one for you, how about printing multiple invoices IN ORDER by product name or sku?

Hell if you are going to do the individual invoice items by SKU might as well do all them and have them ordered in a row so your guys and pull them and save more time there.

Re: [HACK] Listing products on invoices by SKU

Posted: Sun Mar 04, 2012 3:19 am
by noticz
Actually what I mentioned above was pretty simple to figure out. Instead of having the invoices sorted I just created another db query then changed up the order before it displays the invoice template for each. If anyone is interested I can post it however I am on 5.0.2