diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index b0173143..e0b4cd77 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -675,7 +675,7 @@ class AdminOrders extends AdminTab $this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' '.$orderDetail->product_name.''; Module::hookExec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail)); } - + if (!sizeof($this->_errors) AND $customizationList) foreach ($customizationList AS $id_customization => $id_order_detail) { @@ -684,7 +684,7 @@ class AdminOrders extends AdminTab if (!$order->deleteCustomization($id_customization, $qtyCancelProduct, $orderDetail)) $this->_errors[] = Tools::displayError('An error occurred during deletion of product customization.').' '.$id_customization; } - + // E-mail params if ((isset($_POST['generateCreditSlip']) OR isset($_POST['generateDiscount']) OR isset($_POST['generateDiscount2'])) AND !sizeof($this->_errors)) { @@ -2303,6 +2303,8 @@ class AdminOrders extends AdminTab
'.$this->l('Order details').' + +
'.($order->appli?'OUI':'NON').'
'.$this->l('Cart #').sprintf('%06d', $cart->id).'
diff --git a/override/classes/Order.php b/override/classes/Order.php index 20f4d9db..a9ebff15 100644 --- a/override/classes/Order.php +++ b/override/classes/Order.php @@ -1,5 +1,74 @@ 'isUnsignedId', + 'id_address_invoice' => 'isUnsignedId', + 'id_cart' => 'isUnsignedId', + 'id_currency' => 'isUnsignedId', + 'id_lang' => 'isUnsignedId', + 'id_customer' => 'isUnsignedId', + 'id_carrier' => 'isUnsignedId', + 'secure_key' => 'isMd5', + 'payment' => 'isGenericName', + 'recyclable' => 'isBool', + 'gift' => 'isBool', + 'gift_message' => 'isMessage', + 'total_discounts' => 'isPrice', + 'total_paid' => 'isPrice', + 'total_paid_real' => 'isPrice', + 'total_products' => 'isPrice', + 'total_products_wt' => 'isPrice', + 'total_shipping' => 'isPrice', + 'carrier_tax_rate' => 'isFloat', + 'total_wrapping' => 'isPrice', + 'shipping_number' => 'isUrl', + 'conversion_rate' => 'isFloat', + 'appli' => 'isBool' + ); + + public function getFields() + { + ObjectModel::validateFields(); + + $fields['id_address_delivery'] = (int)($this->id_address_delivery); + $fields['id_address_invoice'] = (int)($this->id_address_invoice); + $fields['id_cart'] = (int)($this->id_cart); + $fields['id_currency'] = (int)($this->id_currency); + $fields['id_lang'] = (int)($this->id_lang); + $fields['id_customer'] = (int)($this->id_customer); + $fields['id_carrier'] = (int)($this->id_carrier); + $fields['secure_key'] = pSQL($this->secure_key); + $fields['payment'] = pSQL($this->payment); + $fields['module'] = pSQL($this->module); + $fields['conversion_rate'] = (float)($this->conversion_rate); + $fields['recyclable'] = (int)($this->recyclable); + $fields['gift'] = (int)($this->gift); + $fields['gift_message'] = pSQL($this->gift_message); + $fields['shipping_number'] = pSQL($this->shipping_number); + $fields['total_discounts'] = (float)($this->total_discounts); + $fields['total_paid'] = (float)($this->total_paid); + $fields['total_paid_real'] = (float)($this->total_paid_real); + $fields['total_products'] = (float)($this->total_products); + $fields['total_products_wt'] = (float)($this->total_products_wt); + $fields['total_shipping'] = (float)($this->total_shipping); + $fields['carrier_tax_rate'] = (float)($this->carrier_tax_rate); + $fields['total_wrapping'] = (float)($this->total_wrapping); + $fields['invoice_number'] = (int)($this->invoice_number); + $fields['delivery_number'] = (int)($this->delivery_number); + $fields['invoice_date'] = pSQL($this->invoice_date); + $fields['delivery_date'] = pSQL($this->delivery_date); + $fields['valid'] = (int)($this->valid) ? 1 : 0; + $fields['appli'] = (int)($this->appli) ? 1 : 0; + $fields['date_add'] = pSQL($this->date_add); + $fields['date_upd'] = pSQL($this->date_upd); + + return $fields; + } + public function printMixedSale($value, $params) { return Db::getInstance()->getValue(' SELECT COUNT(DISTINCT `id_sale`) diff --git a/override/classes/PaymentModule.php b/override/classes/PaymentModule.php index 030ac2c4..9fa02aa1 100755 --- a/override/classes/PaymentModule.php +++ b/override/classes/PaymentModule.php @@ -21,6 +21,7 @@ // Copying data from cart $order = new Order(); + $order->appli = Tools::isApi()?1:0; $order->id_carrier = (int)($cart->id_carrier); $order->id_customer = (int)($cart->id_customer); $order->id_address_invoice = (int)($cart->id_address_invoice);