// Suppliers : Manage multiple suppliers for a product / product attribute + integration with supply orders

This commit is contained in:
dSevere
2011-11-18 16:29:50 +00:00
parent 95a3c021f7
commit 12e7f3a0b4
18 changed files with 1196 additions and 568 deletions
+14 -4
View File
@@ -2100,6 +2100,7 @@ CREATE TABLE `PREFIX_stock_available` (
CREATE TABLE `PREFIX_supply_order` (
`id_supply_order` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier` INT(11) UNSIGNED NOT NULL,
`supplier_name` VARCHAR(64) NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
@@ -2128,6 +2129,7 @@ CREATE TABLE `PREFIX_supply_order_detail` (
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) NOT NULL,
`supplier_reference` VARCHAR(32) NOT NULL,
`name` varchar(128) NOT NULL,
`ean13` VARCHAR(13) DEFAULT NULL,
`upc` VARCHAR(12) DEFAULT NULL,
@@ -2197,15 +2199,23 @@ CREATE TABLE `PREFIX_supply_order_receipt_history` (
KEY `id_supply_order_state` (`id_supply_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_product_supplier` (
`id_product_supplier` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_product` int(11) UNSIGNED NOT NULL,
`id_product_attribute` int(11) UNSIGNED NOT NULL DEFAULT '0',
`id_supplier` int(11) UNSIGNED NOT NULL,
`product_supplier_reference` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id_product_supplier`),
UNIQUE KEY `id_product` (`id_product`,`id_product_attribute`,`id_supplier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_supplier_rates` (
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`id_supplier` INT(11) UNSIGNED NOT NULL,
`id_product_supplier` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`quantity_min` INT(11) UNSIGNED NOT NULL,
`quantity_max` INT(11) UNSIGNED NOT NULL,
`price_te` DECIMAL(20,6) DEFAULT '0.000000',
PRIMARY KEY (`id_product`, `id_product_attribute`, `id_supplier`, `quantity_min`, `quantity_max`)
PRIMARY KEY (`id_product_supplier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_accounting_zone_shop` (
+6
View File
@@ -220,6 +220,12 @@ INSERT INTO `PREFIX_product` (`id_product`, `indexed`, `id_supplier`, `id_manufa
(8, 1, 0, 0, 1, 3, 0, 1, '0', 0.00, 0, 25.041806, 0.000000, '', NULL, 0, 2, 0, 0, 0, 0, 1, NOW(), NOW(), '0000-00-00'),
(9, 1, 2, 2, 1, 3, 0, 1, '0', 0.00, 0, 124.581940, 0.000000, '', NULL, 0, 2, 0, 0, 0, 0, 1, NOW(), NOW(), '0000-00-00');
INSERT INTO `PREFIX_product_supplier` (`id_product_supplier`, `id_product`, `id_product_attribute`, `id_supplier`, `product_supplier_reference`) VALUES
(1, 1, 0, 1, ''),
(2, 2, 0, 1, ''),
(3, 6, 0, 1, ''),
(4, 7, 0, 1, '');
INSERT INTO `PREFIX_product_shop` (`id_product`, `id_shop`) (SELECT `id_product`, 1 FROM `PREFIX_product`);
INSERT INTO `PREFIX_product_lang` (`id_product`, `id_lang`, `description`, `description_short`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`, `available_now`, `available_later`) VALUES