// Format definitions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11184 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -142,10 +142,6 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
*/
|
||||
public $price_with_order_discount_te = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -153,65 +149,31 @@ class SupplyOrderDetailCore extends ObjectModel
|
||||
'table' => 'supply_order_detail',
|
||||
'primary' => 'id_supply_order_detail',
|
||||
'fields' => array(
|
||||
'id_supply_order' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product_attribute' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'reference' => array('type' => 'FILL_ME', 'validate' => 'isReference'),
|
||||
'supplier_reference' => array('type' => 'FILL_ME', 'validate' => 'isReference'),
|
||||
'name' => array('type' => 'FILL_ME', 'validate' => 'isGenericName', 'required' => true),
|
||||
'ean13' => array('type' => 'FILL_ME', 'validate' => 'isEan13'),
|
||||
'upc' => array('type' => 'FILL_ME', 'validate' => 'isUpc'),
|
||||
'id_currency' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'exchange_rate' => array('type' => 'FILL_ME', 'validate' => 'isFloat', 'required' => true),
|
||||
'unit_price_te' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'quantity_expected' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'quantity_received' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedInt'),
|
||||
'price_te' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'discount_rate' => array('type' => 'FILL_ME', 'validate' => 'isFloat', 'required' => true),
|
||||
'discount_value_te' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'price_with_discount_te' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'tax_rate' => array('type' => 'FILL_ME', 'validate' => 'isFloat', 'required' => true),
|
||||
'tax_value' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'price_ti' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'tax_value_with_order_discount' => array('type' => 'FILL_ME', 'validate' => 'isFloat', 'required' => true),
|
||||
'price_with_order_discount_te' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
|
||||
'id_supply_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference'),
|
||||
'supplier_reference' => array('type' => self::TYPE_STRING, 'validate' => 'isReference'),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||
'ean13' => array('type' => self::TYPE_STRING, 'validate' => 'isEan13'),
|
||||
'upc' => array('type' => self::TYPE_STRING, 'validate' => 'isUpc'),
|
||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'exchange_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||
'unit_price_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'quantity_expected' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'quantity_received' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'price_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'discount_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||
'discount_value_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'price_with_discount_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'tax_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||
'tax_value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'price_ti' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
'tax_value_with_order_discount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||
'price_with_order_discount_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getFields()
|
||||
*/
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_supply_order'] = (int)$this->id_supply_order;
|
||||
$fields['id_product'] = (int)$this->id_product;
|
||||
$fields['id_product_attribute'] = (int)$this->id_product_attribute;
|
||||
$fields['reference'] = pSQL($this->reference);
|
||||
$fields['supplier_reference'] = pSQL($this->supplier_reference);
|
||||
$fields['name'] = pSQL($this->name);
|
||||
$fields['ean13'] = pSQL($this->ean13);
|
||||
$fields['upc'] = pSQL($this->upc);
|
||||
$fields['id_currency'] = (int)$this->id_currency;
|
||||
$fields['exchange_rate'] = (float)$this->exchange_rate;
|
||||
$fields['unit_price_te'] = (float)$this->unit_price_te;
|
||||
$fields['quantity_expected'] = (int)$this->quantity_expected;
|
||||
$fields['quantity_received'] = (int)$this->quantity_received;
|
||||
$fields['price_te'] = (float)$this->price_te;
|
||||
$fields['discount_rate'] = (float)$this->discount_rate;
|
||||
$fields['discount_value_te'] = (float)$this->discount_value_te;
|
||||
$fields['price_with_discount_te'] = (float)$this->price_with_discount_te;
|
||||
$fields['tax_rate'] = (float)$this->tax_rate;
|
||||
$fields['tax_value'] = (float)$this->tax_value;
|
||||
$fields['price_ti'] = (float)$this->price_ti;
|
||||
$fields['tax_value_with_order_discount'] = (float)$this->tax_value_with_order_discount;
|
||||
$fields['price_with_order_discount_te'] = (float)$this->price_with_order_discount_te;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ObjectModel::update()
|
||||
*/
|
||||
|
||||
@@ -60,10 +60,6 @@ class SupplyOrderHistoryCore extends ObjectModel
|
||||
*/
|
||||
public $date_add;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -71,27 +67,12 @@ class SupplyOrderHistoryCore extends ObjectModel
|
||||
'table' => 'supply_order_history',
|
||||
'primary' => 'id_supply_order_history',
|
||||
'fields' => array(
|
||||
'id_supply_order' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_employee' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'employee_firstname' => array('type' => 'FILL_ME', 'validate' => 'isName'),
|
||||
'employee_lastname' => array('type' => 'FILL_ME', 'validate' => 'isName'),
|
||||
'id_state' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'date_add' => array('type' => 'FILL_ME', 'validate' => 'isDate', 'required' => true),
|
||||
'id_supply_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'employee_firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
'employee_lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_supply_order'] = (int)$this->id_supply_order;
|
||||
$fields['id_employee'] = (int)$this->id_employee;
|
||||
$fields['employee_lastname'] = pSQL($this->employee_lastname);
|
||||
$fields['employee_firstname'] = pSQL(Tools::ucfirst($this->employee_firstname));
|
||||
$fields['id_state'] = (int)$this->id_state;
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
@@ -65,10 +65,6 @@ class SupplyOrderReceiptHistoryCore extends ObjectModel
|
||||
*/
|
||||
public $date_add;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -76,30 +72,13 @@ class SupplyOrderReceiptHistoryCore extends ObjectModel
|
||||
'table' => 'supply_order_receipt_history',
|
||||
'primary' => 'id_supply_order_receipt_history',
|
||||
'fields' => array(
|
||||
'id_supply_order_detail' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_supply_order_state' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_employee' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'employee_firstname' => array('type' => 'FILL_ME', 'validate' => 'isName'),
|
||||
'employee_lastname' => array('type' => 'FILL_ME', 'validate' => 'isName'),
|
||||
'quantity' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'date_add' => array('type' => 'FILL_ME', 'validate' => 'isDate'),
|
||||
'id_supply_order_detail' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_supply_order_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'employee_firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
'employee_lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName'),
|
||||
'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_supply_order_detail'] = (int)$this->id_supply_order_detail;
|
||||
$fields['id_supply_order_state'] = (int)$this->id_supply_order_state;
|
||||
$fields['id_employee'] = (int)$this->id_employee;
|
||||
$fields['employee_lastname'] = pSQL($this->employee_lastname);
|
||||
$fields['employee_firstname'] = pSQL(Tools::ucfirst($this->employee_firstname));
|
||||
$fields['quantity'] = (int)$this->quantity;
|
||||
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
@@ -65,12 +65,6 @@ class SupplyOrderStateCore extends ObjectModel
|
||||
*/
|
||||
public $color;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -79,33 +73,18 @@ class SupplyOrderStateCore extends ObjectModel
|
||||
'primary' => 'id_supply_order_state',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'delivery_note' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'editable' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'receipt_state' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'pending_receipt' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'enclosed' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'color' => array('type' => 'FILL_ME', 'validate' => 'isColor'),
|
||||
'name' => array('type' => 'FILL_ME', 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
|
||||
'delivery_note' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'editable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'receipt_state' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'pending_receipt' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'enclosed' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'),
|
||||
|
||||
// Lang fields
|
||||
'name' => array('type' => 'FILL_ME', 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getFields()
|
||||
*/
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
$fields['delivery_note'] = (bool)$this->delivery_note;
|
||||
$fields['editable'] = (bool)$this->editable;
|
||||
$fields['receipt_state'] = (bool)$this->receipt_state;
|
||||
$fields['pending_receipt'] = (bool)$this->pending_receipt;
|
||||
$fields['enclosed'] = (bool)$this->enclosed;
|
||||
$fields['color'] = pSQL($this->color);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ObjectModel::getTranslationsFieldsChild()
|
||||
*/
|
||||
|
||||
@@ -59,12 +59,6 @@ class WarehouseCore extends ObjectModel
|
||||
*/
|
||||
public $management_type;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -72,31 +66,16 @@ class WarehouseCore extends ObjectModel
|
||||
'table' => 'warehouse',
|
||||
'primary' => 'id_warehouse',
|
||||
'fields' => array(
|
||||
'id_address' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'reference' => array('type' => 'FILL_ME', 'validate' => 'isString', 'required' => true, 'size' => 45),
|
||||
'name' => array('type' => 'FILL_ME', 'validate' => 'isName', 'required' => true, 'size' => 45),
|
||||
'id_employee' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'management_type' => array('type' => 'FILL_ME', 'validate' => 'isStockManagement', 'required' => true),
|
||||
'id_currency' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'stock_management' => array('type' => 'FILL_ME', 'size' => 32),
|
||||
'id_address' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 45),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 45),
|
||||
'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'management_type' => array('type' => self::TYPE_STRING, 'validate' => 'isStockManagement', 'required' => true),
|
||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'deleted' => array('type' => self::TYPE_BOOL),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
$fields['id_address'] = (int)$this->id_address;
|
||||
$fields['reference'] = $this->reference;
|
||||
$fields['name'] = pSQL($this->name);
|
||||
$fields['deleted'] = (int)$this->deleted;
|
||||
$fields['id_employee'] = (int)$this->id_employee;
|
||||
$fields['management_type'] = pSQL($this->management_type);
|
||||
$fields['id_currency'] = (int)$this->id_currency;
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the shops (id and name) associated to the current warehouse
|
||||
*
|
||||
|
||||
@@ -49,10 +49,6 @@ class WarehouseProductLocationCore extends ObjectModel
|
||||
* */
|
||||
public $location;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -60,26 +56,13 @@ class WarehouseProductLocationCore extends ObjectModel
|
||||
'table' => 'warehouse_product_location',
|
||||
'primary' => 'id_warehouse_product_location',
|
||||
'fields' => array(
|
||||
'location' => array('type' => 'FILL_ME', 'validate' => 'isReference', 'size' => 64),
|
||||
'id_product' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product_attribute' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_warehouse' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'location' => array('type' => self::TYPE_STRING, 'validate' => 'isReference', 'size' => 64),
|
||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_product'] = (int)$this->id_product;
|
||||
$fields['id_product_attribute'] = (int)$this->id_product_attribute;
|
||||
$fields['id_warehouse'] = (int)$this->id_warehouse;
|
||||
$fields['location'] = pSQL($this->location);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a given product and warehouse, get the location
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user