[+] BO : add new feature, Order edition

This commit is contained in:
dMetzger
2011-11-23 17:45:52 +00:00
parent f5de69ad84
commit d902a38ec8
31 changed files with 3349 additions and 846 deletions
+44 -4
View File
@@ -1047,16 +1047,36 @@ CREATE TABLE `PREFIX_orders` (
INDEX `date_add`(`date_add`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `PREFIX_order_detail_tax` (
CREATE TABLE `PREFIX_order_detail_tax` (
`id_order_detail` int(11) NOT NULL,
`id_tax` int(11) NOT NULL,
`unit_amount` DECIMAL( 10,6 ) NOT NULL default '0.00',
`total_amount` DECIMAL( 10, 6 ) NOT NULL default '0.00'
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_order_invoice` (
`id_order_invoice` int(11) NOT NULL AUTO_INCREMENT,
`id_order` int(11) NOT NULL,
`number` int(11) NOT NULL,
`total_discount_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_discount_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_paid_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_paid_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_products` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_products_wt` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_shipping_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_shipping_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_invoice`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_order_detail` (
`id_order_detail` int(10) unsigned NOT NULL auto_increment,
`id_order` int(10) unsigned NOT NULL,
`id_order_invoice` int(11) default NULL,
`product_id` int(10) unsigned NOT NULL,
`product_attribute_id` int(10) unsigned default NULL,
`product_name` varchar(255) NOT NULL,
@@ -1183,6 +1203,8 @@ CREATE TABLE `PREFIX_order_slip` (
`id_customer` int(10) unsigned NOT NULL,
`id_order` int(10) unsigned NOT NULL,
`shipping_cost` tinyint(3) unsigned NOT NULL default '0',
`amount` DECIMAL(10,2) NOT NULL,
`shipping_cost_amount` DECIMAL(10,2) NOT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order_slip`),
@@ -1194,6 +1216,7 @@ CREATE TABLE `PREFIX_order_slip_detail` (
`id_order_slip` int(10) unsigned NOT NULL,
`id_order_detail` int(10) unsigned NOT NULL,
`product_quantity` int(10) unsigned NOT NULL default '0',
`amount` DECIMAL(10,2) NOT NULL,
PRIMARY KEY (`id_order_slip`,`id_order_detail`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
@@ -1250,18 +1273,21 @@ CREATE TABLE `PREFIX_page_viewed` (
PRIMARY KEY (`id_page`, `id_date_range`, `id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_payment_cc` (
`id_payment_cc` INT NOT NULL auto_increment,
CREATE TABLE `PREFIX_order_payment` (
`id_order_payment` INT NOT NULL auto_increment,
`id_order_invoice` INT UNSIGNED NULL,
`id_order` INT UNSIGNED NULL,
`id_currency` INT UNSIGNED NOT NULL,
`amount` DECIMAL(10,2) NOT NULL,
`payment_method` varchar(255) NOT NULL,
`conversion_rate` decimal(13,6) NOT NULL DEFAULT 1,
`transaction_id` VARCHAR(254) NULL,
`card_number` VARCHAR(254) NULL,
`card_brand` VARCHAR(254) NULL,
`card_expiration` CHAR(7) NULL,
`card_holder` VARCHAR(254) NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_payment_cc`),
PRIMARY KEY (`id_order_payment`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
@@ -2245,3 +2271,17 @@ CREATE TABLE `PREFIX_accounting_product_zone_shop` (
PRIMARY KEY (`id_accounting_product_zone_shop`),
UNIQUE KEY `id_product` (`id_product`,`id_shop`,`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_order_carrier` (
`id_order` int(11) unsigned NOT NULL,
`id_carrier` int(11) unsigned NOT NULL,
`id_order_invoice` int(11) unsigned DEFAULT NULL,
`weight` float DEFAULT NULL,
`shipping_cost_tax_excl` decimal(20,6) DEFAULT NULL,
`shipping_cost_tax_incl` decimal(20,6) DEFAULT NULL,
`tracking_number` int(11) unsigned DEFAULT NULL,
`date_add` datetime NOT NULL,
KEY `id_order` (`id_order`,`id_carrier`),
KEY `id_order_2` (`id_order`),
KEY `id_order_invoice` (`id_order_invoice`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
+6
View File
@@ -180,8 +180,11 @@ INSERT INTO `PREFIX_order_detail` (`id_order_detail`, `id_order`, `product_id`,
VALUES (1, 1, 7, 23, 'iPod touch - Capacité: 32Go', 1, 0, '392.140500', '0.000000', NULL, NULL, NULL, 0, '0.00', '', 0, '0000-00-00 00:00:00', '');
INSERT INTO `PREFIX_order_detail` (`id_order_detail`, `id_order`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_return`, `product_price`, `product_quantity_discount`, `product_ean13`, `product_reference`, `product_supplier_reference`, `product_weight`, `ecotax`, `download_hash`, `download_nb`, `download_deadline`, `tax_name`)
VALUES (2, 1, 9, 0, 'Écouteurs à isolation sonore Shure SE210', 1, 0, '124.581900', '0.000000', NULL, NULL, NULL, 0, '0.00', '', 0, '0000-00-00 00:00:00', '');
INSERT INTO `PREFIX_order_history` (`id_order_history`, `id_employee`, `id_order`, `id_order_state`, `date_add`) VALUES (1, 0, 1, 1, NOW());
INSERT INTO `PREFIX_order_payment` (`id_order`, `id_currency`, `amount`, `payment_method`, `date_add`) VALUES (1, 1, '625.98', 'Chèque', NOW());
INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'Apple Computer, Inc', NOW(), NOW(), 1);
INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES(2, 'Shure Incorporated', NOW(), NOW(), 1);
@@ -1367,3 +1370,6 @@ INSERT INTO `PREFIX_stock_available` (`id_stock_available`, `id_product`, `id_pr
(28, 6, 0, 1, 4, 0, 2),
(29, 8, 0, 1, 8, 0, 2),
(30, 9, 0, 1, 15, 0, 2);
INSERT INTO `PREFIX_order_carrier` (`id_order`, `id_carrier`, `date_add`) VALUES
(1, 2, NOW());
+46 -2
View File
@@ -239,6 +239,33 @@ ALTER TABLE `PREFIX_carrier` ADD `position` INT( 10 ) UNSIGNED NOT NULL DEFAULT
ALTER TABLE `PREFIX_order_state` ADD COLUMN `shipped` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `delivery`;
UPDATE `PREFIX_order_state` SET `shipped` = 1 WHERE id_order_states IN (4, 5);
CREATE TABLE `PREFIX_order_invoice` (
`id_order_invoice` int(11) NOT NULL AUTO_INCREMENT,
`id_order` int(11) NOT NULL,
`number` int(11) NOT NULL,
`total_discount_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_discount_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_paid_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_paid_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_products` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_products_wt` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_shipping_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_shipping_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_incl` decimal(17,2) NOT NULL DEFAULT '0.00',
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_invoice`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
ALTER TABLE `PREFIX_order_detail` ADD `id_order_invoice` int(11) NULL AFTER `id_order`;
ALTER TABLE `PREFIX_payment_cc` CHANGE `id_payment_cc` `id_order_payment` INT NOT NULL auto_increment;
ALTER TABLE `PREFIX_payment_cc` ADD `id_order_invoice` varchar(255) NOT NULL AFTER `id_order_payment`;
ALTER TABLE `PREFIX_payment_cc` ADD `payment_method` varchar(255) NOT NULL AFTER `amount`;
ALTER TABLE `PREFIX_payment_cc` ADD `conversion_rate` decimal(13,6) NOT NULL DEFAULT 1 AFTER `payment_method`;
RENAME TABLE `PREFIX_payment_cc` TO `PREFIX_order_payment`;
ALTER TABLE `PREFIX_carrier`
ADD COLUMN `max_width` int(10) DEFAULT 0 AFTER `position`,
@@ -264,7 +291,6 @@ ALTER TABLE `PREFIX_customization` ADD COLUMN `id_address_delivery` int(10) UNSI
DROP PRIMARY KEY,
ADD PRIMARY KEY USING BTREE(`id_customization`, `id_cart`, `id_product`, `id_address_delivery`);
CREATE TABLE `PREFIX_cart_rule` (
`id_cart_rule` int(10) unsigned NOT NULL auto_increment,
`id_customer` int unsigned NOT NULL default 0,
@@ -581,4 +607,22 @@ UPDATE `PREFIX_employee` SET `bo_theme` = 'default';
UPDATE `PREFIX_tab` SET `class_name` = 'AdminCmsContent' WHERE `class_name` = 'AdminCMSContent';
UPDATE `PREFIX_tab` SET `class_name` = 'AdminCms' WHERE `class_name` = 'AdminCMS';
UPDATE `PREFIX_tab` SET `class_name` = 'AdminCmsCategories' WHERE `class_name` = 'AdminCMSCategories';
UPDATE `PREFIX_tab` SET `class_name` = 'AdminPdf' WHERE `class_name` = 'AdminPDF';
UPDATE `PREFIX_tab` SET `class_name` = 'AdminPdf' WHERE `class_name` = 'AdminPDF';
CREATE TABLE `PREFIX_order_carrier` (
`id_order` int(11) unsigned NOT NULL,
`id_carrier` int(11) unsigned NOT NULL,
`id_order_invoice` int(11) unsigned DEFAULT NULL,
`weight` float DEFAULT NULL,
`shipping_cost_tax_excl` decimal(20,6) DEFAULT NULL,
`shipping_cost_tax_incl` decimal(20,6) DEFAULT NULL,
`tracking_number` int(11) unsigned DEFAULT NULL,
`date_add` datetime NOT NULL,
KEY `id_order` (`id_order`,`id_carrier`),
KEY `id_order_2` (`id_order`),
KEY `id_order_invoice` (`id_order_invoice`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
ALTER TABLE `PREFIX_order_slip` ADD COLUMN `amount` DECIMAL(10,2) NOT NULL AFTER `shipping_cost`;
ALTER TABLE `PREFIX_order_slip` ADD COLUMN `shipping_cost_amount` DECIMAL(10,2) NOT NULL AFTER `amount`;
ALTER TABLE `PREFIX_order_slip_detail` ADD COLUMN `amount` DECIMAL(10,2) NOT NULL AFTER `product_quantity`;