Merge branch 'ticket-14716-AppData' into develop
This commit is contained in:
commit
bc60df4a4d
@ -675,7 +675,7 @@ class AdminOrders extends AdminTab
|
||||
$this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>';
|
||||
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
|
||||
<br />
|
||||
<fieldset style="width: 400px">
|
||||
<legend><img src="../img/admin/details.gif" /> '.$this->l('Order details').'</legend>
|
||||
<label>'.$this->l('Depuis l\'Appli :').' </label>
|
||||
<div style="margin: 2px 0 1em 50px;">'.($order->appli?'OUI':'NON').'</div>
|
||||
<label>'.$this->l('Original cart:').' </label>
|
||||
<div style="margin: 2px 0 1em 190px;"><a href="?tab=AdminCarts&id_cart='.$cart->id.'&viewcart&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)($cookie->id_employee)).'">'.$this->l('Cart #').sprintf('%06d', $cart->id).'</a></div>
|
||||
<label>'.$this->l('Payment mode:').' </label>
|
||||
|
@ -1,5 +1,74 @@
|
||||
<?php
|
||||
class Order extends OrderCore {
|
||||
|
||||
/** @var boolean True if the order comes from app */
|
||||
public $appli = 0;
|
||||
|
||||
protected $fieldsValidate = array(
|
||||
'id_address_delivery' => '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`)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user