[-] BO : fixed bug on Delivery slip generation in AdminDeliverySlip

This commit is contained in:
aFolletete
2012-01-02 18:16:09 +00:00
parent 3056e7c943
commit 4cd3d5699f
5 changed files with 46 additions and 24 deletions
+11 -11
View File
@@ -851,17 +851,17 @@ class OrderCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
/**
* @deprecated since 1.5.0.2
*
* @static
* @param $date_from
* @param $date_to
* @param $id_customer
* @param $type
*
* @return array
*/
/**
* @deprecated since 1.5.0.2
*
* @static
* @param $date_from
* @param $date_to
* @param $id_customer
* @param $type
*
* @return array
*/
public static function getOrdersIdInvoiceByDate($date_from, $date_to, $id_customer = NULL, $type = NULL)
{
Tools::displayAsDeprecated();
+24 -2
View File
@@ -422,8 +422,8 @@ class OrderInvoiceCore extends ObjectModel
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).'\'
'.Context::getContext()->shop->addSqlRestriction().
' ORDER BY oi.date_add ASC
'.Context::getContext()->shop->addSqlRestriction().'
ORDER BY oi.date_add ASC
');
return ObjectModel::hydrateCollection('OrderInvoice', $order_invoice_list);
@@ -455,6 +455,28 @@ class OrderInvoiceCore extends ObjectModel
return ObjectModel::hydrateCollection('OrderInvoice', $order_invoice_list);
}
/**
* @since 1.5.0.3
* @static
* @param $date_from
* @param $date_to
* @return array collection of invoice
*/
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.date_add >= \''.pSQL($date_from).'\'
'.Context::getContext()->shop->addSqlRestriction().'
ORDER BY oi.delivery_date ASC
');
return ObjectModel::hydrateCollection('OrderInvoice', $order_invoice_list);
}
/**
* @since 1.5
* @static