I will answer my own question:
I changed the core so that the delivery slip generator get a list of slips in date order
in OrderInvoice.php
was:
public static function getByDeliveryDateInterval($date_from, $date_to)
{
$order_invoice_list = Db::getInstance()->executeS('
SELECT oi.*
FROM `' . _DB_PREFIX_ . 'order_invoice` oi
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON (o.`id_order` = oi.`id_order`)
WHERE DATE_ADD(oi.delivery_date, INTERVAL -1 DAY) <= \'' . pSQL($date_to) . '\'
AND oi.delivery_date >= \'' . pSQL($date_from) . '\'
' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . '
ORDER BY oi.delivery_date ASC
');
return ObjectModel::hydrateCollection('OrderInvoice', $order_invoice_list);
}
becomes:
public static function getByDeliveryDateInterval($date_from, $date_to)
{
$order_invoice_list = Db::getInstance()->executeS('
SELECT oi.*
FROM `' . _DB_PREFIX_ . 'order_invoice` oi
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON (o.`id_order` = oi.`id_order`)
WHERE DATE_ADD(oi.date_add, INTERVAL -1 DAY) <= \'' . pSQL($date_to) . '\'
AND oi.date_add >= \'' . pSQL($date_from) . '\'
' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . '
AND oi.delivery_number > 0
ORDER BY oi.date_add ASC, oi.delivery_date ASC
');
return ObjectModel::hydrateCollection('OrderInvoice', $order_invoice_list);
}
Ultimately never a good idea to change the core. Could have done a module but I had a time constraint.