[-] BO : Credit slips now appear in document section
This commit is contained in:
+26
-3
@@ -1394,10 +1394,18 @@ class OrderCore extends ObjectModel
|
||||
*/
|
||||
public function getDocuments()
|
||||
{
|
||||
// TODO
|
||||
$invoices = $this->getInvoicesCollection();
|
||||
$invoices = $this->getInvoicesCollection()->getResults();
|
||||
$order_slips = $this->getOrderSlipsCollection()->getResults();
|
||||
$documents = array_merge($invoices, $order_slips);
|
||||
function sortDocuments($a, $b)
|
||||
{
|
||||
if ($a->date_add == $b->date_add)
|
||||
return 0;
|
||||
return ($a->date_add < $b->date_add) ? -1 : 1;
|
||||
}
|
||||
usort($documents, "sortDocuments");
|
||||
|
||||
return $invoices;
|
||||
return $documents;
|
||||
}
|
||||
|
||||
public function getReturn()
|
||||
@@ -1424,6 +1432,21 @@ class OrderCore extends ObjectModel
|
||||
WHERE o.`id_order` = '.(int)$this->id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Get all order_slips for the current order
|
||||
* @since 1.5.0.1
|
||||
* @return Collection of Order slip
|
||||
*/
|
||||
public function getOrderSlipsCollection()
|
||||
{
|
||||
$order_slips = new Collection('OrderSlip');
|
||||
$order_slips->where('id_order', '=', $this->id);
|
||||
return $order_slips;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Get all invoices for the current order
|
||||
|
||||
Reference in New Issue
Block a user