[-] Classes : fixed bug #PSTEST-550 - Add current_state attribute on Order class

[~] Deprecated : OrderHistory::getLastOrderState()

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12898 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2012-02-01 14:34:17 +00:00
parent 558efddd17
commit 5615dca5c1
7 changed files with 48 additions and 35 deletions
+4 -4
View File
@@ -158,7 +158,7 @@ class AdminOrdersControllerCore extends AdminController
public function printPDFIcons($id_order, $tr)
{
$order = new Order($id_order);
$order_state = OrderHistory::getLastOrderState($id_order);
$order_state = $order->getCurrentOrderState();
if (!Validate::isLoadedObject($order_state) || !Validate::isLoadedObject($order))
die(Tools::displayError('Invalid objects'));
@@ -239,7 +239,7 @@ class AdminOrdersControllerCore extends AdminController
$this->errors[] = Tools::displayError('Invalid new order status');
else
{
$current_order_state = OrderHistory::getLastOrderState($order->id);
$current_order_state = $order->getCurrentOrderState();
if ($current_order_state->id != $order_state->id)
{
// Create new OrderHistory
@@ -1092,7 +1092,7 @@ class AdminOrdersControllerCore extends AdminController
'states' => OrderState::getOrderStates($this->context->language->id),
'warehouse_list' => $warehouse_list,
'sources' => ConnectionsSource::getOrderSources($order->id),
'currentState' => OrderHistory::getLastOrderState($order->id),
'currentState' => $order->getCurrentOrderState(),
'currency' => new Currency($order->id_currency),
'currencies' => Currency::getCurrencies(),
'previousOrder' => $order->getPreviousOrderId(),
@@ -1398,7 +1398,7 @@ class AdminOrdersControllerCore extends AdminController
// Create Order detail information
$order_detail = new OrderDetail();
$order_detail->createList($order, $cart, OrderHistory::getLastOrderState($order->id), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
$order_detail->createList($order, $cart, $order->getCurrentOrderState(), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
// update totals amount of order
$order->total_products += (float)$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS);