// stock management : Supplier order is now supply order, employee and product is now historized for sttock movements and supply order

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10121 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-11-14 18:58:02 +00:00
parent 35150997c7
commit 5719c43481
20 changed files with 656 additions and 570 deletions
+44 -31
View File
@@ -1965,9 +1965,11 @@ CREATE TABLE `PREFIX_stock_mvt` (
`id_stock_mvt` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_stock` INT(11) UNSIGNED NOT NULL,
`id_order` INT(11) UNSIGNED DEFAULT NULL,
`id_supplier_order` INT(11) UNSIGNED DEFAULT NULL,
`id_supply_order` INT(11) UNSIGNED DEFAULT NULL,
`id_stock_mvt_reason` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`physical_quantity` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
`sign` tinyint(1) NOT NULL DEFAULT 1,
@@ -2001,6 +2003,9 @@ CREATE TABLE `PREFIX_stock` (
`id_warehouse` INT(11) UNSIGNED NOT NULL,
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) NOT NULL,
`ean13` VARCHAR(13) DEFAULT NULL,
`upc` VARCHAR(12) DEFAULT NULL,
`physical_quantity` INT(11) UNSIGNED NOT NULL,
`usable_quantity` INT(11) UNSIGNED NOT NULL,
`price_te` DECIMAL(20,6) DEFAULT '0.000000',
@@ -2063,15 +2068,15 @@ CREATE TABLE `PREFIX_stock_available` (
KEY `id_product_attribute` (`id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order` (
`id_supplier_order` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
CREATE TABLE `PREFIX_supply_order` (
`id_supply_order` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
`id_supplier_order_state` INT(11) UNSIGNED NOT NULL,
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`id_ref_currency` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) DEFAULT NULL,
`reference` VARCHAR(32) NOT NULL,
`date_add` DATETIME NOT NULL,
`date_upd` DATETIME NOT NULL,
`date_delivery_expected` DATETIME DEFAULT NULL,
@@ -2081,18 +2086,22 @@ CREATE TABLE `PREFIX_supplier_order` (
`total_ti` DECIMAL(20,6) DEFAULT '0.000000',
`discount_rate` DECIMAL(20,6) DEFAULT '0.000000',
`discount_value_te` DECIMAL(20,6) DEFAULT '0.000000',
PRIMARY KEY (`id_supplier_order`),
PRIMARY KEY (`id_supply_order`),
KEY `id_supplier` (`id_supplier`),
KEY `id_warehouse` (`id_warehouse`),
KEY `reference` (`reference`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order_detail` (
`id_supplier_order_detail` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier_order` INT(11) UNSIGNED NOT NULL,
CREATE TABLE `PREFIX_supply_order_detail` (
`id_supply_order_detail` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) NOT NULL,
`name` varchar(128) NOT NULL,
`ean13` VARCHAR(13) DEFAULT NULL,
`upc` VARCHAR(12) DEFAULT NULL,
`exchange_rate` DECIMAL(20,6) DEFAULT '0.000000',
`unit_price_te` DECIMAL(20,6) DEFAULT '0.000000',
`quantity_expected` INT(11) UNSIGNED NOT NULL,
@@ -2106,53 +2115,57 @@ CREATE TABLE `PREFIX_supplier_order_detail` (
`price_ti` DECIMAL(20,6) DEFAULT '0.000000',
`tax_value_with_order_discount` DECIMAL(20,6) DEFAULT '0.000000',
`price_with_order_discount_te` DECIMAL(20,6) DEFAULT '0.000000',
PRIMARY KEY (`id_supplier_order_detail`),
KEY `id_supplier_order` (`id_supplier_order`),
PRIMARY KEY (`id_supply_order_detail`),
KEY `id_supply_order` (`id_supply_order`),
KEY `id_product` (`id_product`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_product_product_attribute` (`id_product`, `id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order_history` (
`id_supplier_order_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier_order` INT(11) UNSIGNED NOT NULL,
CREATE TABLE `PREFIX_supply_order_history` (
`id_supply_order_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`id_state` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_supplier_order_history`),
KEY `id_supplier_order` (`id_supplier_order`),
PRIMARY KEY (`id_supply_order_history`),
KEY `id_supply_order` (`id_supply_order`),
KEY `id_employee` (`id_employee`),
KEY `id_state` (`id_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order_state` (
`id_supplier_order_state` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
CREATE TABLE `PREFIX_supply_order_state` (
`id_supply_order_state` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`delivery_note` tinyint(1) NOT NULL DEFAULT 0,
`editable` tinyint(1) NOT NULL DEFAULT 0,
`receipt_state` tinyint(1) NOT NULL DEFAULT 0,
`pending_receipt` tinyint(1) NOT NULL DEFAULT 0,
`enclosed` tinyint(1) NOT NULL DEFAULT 0,
`color` VARCHAR(32) DEFAULT NULL,
PRIMARY KEY (`id_supplier_order_state`)
PRIMARY KEY (`id_supply_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order_state_lang` (
`id_supplier_order_state` INT(11) UNSIGNED NOT NULL,
CREATE TABLE `PREFIX_supply_order_state_lang` (
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`name` VARCHAR(128) DEFAULT NULL,
PRIMARY KEY (`id_supplier_order_state`, `id_lang`)
PRIMARY KEY (`id_supply_order_state`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_order_receipt_history` (
`id_supplier_order_receipt_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier_order_detail` INT(11) UNSIGNED NOT NULL,
CREATE TABLE `PREFIX_supply_order_receipt_history` (
`id_supply_order_receipt_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order_detail` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`id_supplier_order_state` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`quantity` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_supplier_order_receipt_history`),
KEY `id_supplier_order_detail` (`id_supplier_order_detail`),
KEY `id_supplier_order_state` (`id_supplier_order_state`)
PRIMARY KEY (`id_supply_order_receipt_history`),
KEY `id_supply_order_detail` (`id_supply_order_detail`),
KEY `id_supply_order_state` (`id_supply_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_rates` (
+10 -10
View File
@@ -333,7 +333,7 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
(157, 'PS_STOCK_MVT_TRANSFER_TO', '7', NOW(), NOW()),
(158, 'PS_STOCK_MVT_TRANSFER_FROM', '6', NOW(), NOW()),
(159, 'PS_CARRIER_DEFAULT_ORDER', '0', NOW(), NOW()),
(160, 'PS_STOCK_MVT_SUPPLIER_ORDER', '8', NOW(), NOW()),
(160, 'PS_STOCK_MVT_SUPPLY_ORDER', '8', NOW(), NOW()),
(161, 'PS_STOCK_CUSTOMER_ORDER_REASON', '3', NOW(), NOW());
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES
@@ -950,7 +950,7 @@ INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUE
(97, 'AdminStockManagement', 95, 2),
(98, 'AdminStockInstantState', 95, 4),
(99, 'AdminStockCover', 95, 5),
(100, 'AdminSupplierOrders', 95, 6),
(100, 'AdminSupplyOrders', 95, 6),
(101, 'AdminAttributeGenerator', -1, 0),
(102, 'AdminAccounting', 0, 16),
(103, 'AdminAccountingManagement', 102, 1),
@@ -979,7 +979,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(1, 97, 'Stock Management'),
(1, 98, 'Stock instant state'),
(1, 99, 'Stock cover'),
(1, 100, 'Supplier orders'),
(1, 100, 'Supply orders'),
(1, 101, 'Combinations generator'),
(1, 102, 'Accounting'),
(1, 103, 'Account Number Management'),
@@ -1032,7 +1032,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(3, 97, 'Stock Management'),
(3, 98, 'Stock instant state'),
(3, 99, 'Stock cover'),
(3, 100, 'Supplier orders'),
(3, 100, 'Supply orders'),
(3, 101, 'Combinations generator'),
(3, 102, 'Accounting'),
(3, 103, 'Account Number Management'),
@@ -1472,11 +1472,11 @@ INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `n
(7, 3, 'Transfer from another warehouse'),
(7, 4, 'Transfer from another warehouse'),
(7, 5, 'Transfer from another warehouse'),
(8, 1, 'Supplier Order'),
(8, 1, 'Supply Order'),
(8, 2, 'Commande fournisseur'),
(8, 3, 'Supplier Order'),
(8, 4, 'Supplier Order'),
(8, 5, 'Supplier Order');
(8, 3, 'Supply Order'),
(8, 4, 'Supply Order'),
(8, 5, 'Supply Order');
INSERT INTO `PREFIX_warehouse` (`id_warehouse`, `id_currency`, `id_address`, `id_employee`, `reference`, `name`, `management_type`) VALUES
(1, 1, 0, 1, 'default_warehouse', 'default warehouse', 'WA');
@@ -1539,7 +1539,7 @@ city State:name postcode
Country:name
phone' WHERE `PREFIX_address_format`.`id_country` = 4;
INSERT INTO `PREFIX_supplier_order_state` (`id_supplier_order_state`, `delivery_note`, `editable`, `receipt_state`, `pending_receipt`, `enclosed`, `color`) VALUES
INSERT INTO `PREFIX_supply_order_state` (`id_supply_order_state`, `delivery_note`, `editable`, `receipt_state`, `pending_receipt`, `enclosed`, `color`) VALUES
(1, 0, 1, 0, 0, 0, '#faab00'),
(2, 1, 0, 0, 0, 0, '#273cff'),
(3, 0, 0, 0, 1, 0, '#ff37f5'),
@@ -1547,7 +1547,7 @@ INSERT INTO `PREFIX_supplier_order_state` (`id_supplier_order_state`, `delivery_
(5, 0, 0, 1, 0, 1, '#00d60c'),
(6, 0, 0, 0, 0, 1, '#666666');
INSERT INTO `PREFIX_supplier_order_state_lang` (`id_supplier_order_state`, `id_lang`, `name`) VALUES
INSERT INTO `PREFIX_supply_order_state_lang` (`id_supply_order_state`, `id_lang`, `name`) VALUES
(1, 1, 'creation in progress'),
(1, 2, 'Création en cours'),
(1, 3, 'Création in progress'),