Merge branch 'master' of https://github.com/thelia/thelia into coupon

# By Etienne Roudeix (7) and Manuel Raynaud (7)
# Via Etienne Roudeix (2) and Manuel Raynaud (1)
* 'master' of https://github.com/thelia/thelia:
  tax in loops
  remove test
  finish simple list customer page in backoffice
  debug bar
  mock getTotalAmoutn in order class
  tax engine
  escae output only if it's not an object
  tax faker
  insert 19.6 tva
  create admin customer view and add output info in customer loop
  update format smarty plugin
  tax engine model
  tax engine model
  create customer admin controller and index controller
This commit is contained in:
gmorel
2013-09-09 16:41:11 +02:00
37 changed files with 1113 additions and 626 deletions

View File

@@ -383,6 +383,7 @@ function createProduct($faker, $category, $position, &$productIdList)
$product->addCategory($category);
$product->setVisible(rand(1, 10)>7 ? 0 : 1);
$product->setPosition($position);
$product->setTaxRuleId(1);
setI18n($faker, $product);
$product->save();

View File

@@ -1109,3 +1109,25 @@ INSERT INTO `country_i18n` (`id`, `locale`, `title`, `description`, `chapo`, `po
(268, 'en_UK', 'USA - Alabama', '', '', ''),
(268, 'es_ES', 'USA - Alabama', '', '', ''),
(268, 'fr_FR', 'USA - Alabama', '', '', '');
INSERT INTO `tax` (`id`, `rate`, `created_at`, `updated_at`)
VALUES
(1, '19.6', NOW(), NOW());
INSERT INTO `tax_i18n` (`id`, `locale`, `title`)
VALUES
(1, 'fr_FR', 'TVA française à 19.6%'),
(1, 'en_UK', 'french 19.6% tax');
INSERT INTO `tax_rule` (`id`, `created_at`, `updated_at`)
VALUES
(1, NOW(), NOW());
INSERT INTO `tax_rule_i18n` (`id`, `locale`, `title`)
VALUES
(1, 'fr_FR', 'TVA française à 19.6%'),
(1, 'en_UK', 'french 19.6% tax');
INSERT INTO `tax_rule_country` (`tax_rule_id`, `country_id`, `tax_id`, `position`, `created_at`, `updated_at`)
VALUES
(1, 64, 1, 1, NOW(), NOW());

View File

@@ -126,9 +126,6 @@ DROP TABLE IF EXISTS `tax_rule`;
CREATE TABLE `tax_rule`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`code` VARCHAR(45),
`title` VARCHAR(255),
`description` TEXT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
@@ -142,14 +139,13 @@ DROP TABLE IF EXISTS `tax_rule_country`;
CREATE TABLE `tax_rule_country`
(
`id` INTEGER NOT NULL,
`tax_rule_id` INTEGER,
`country_id` INTEGER,
`tax_id` INTEGER,
`none` TINYINT,
`tax_rule_id` INTEGER NOT NULL,
`country_id` INTEGER NOT NULL,
`tax_id` INTEGER NOT NULL,
`position` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
PRIMARY KEY (`tax_rule_id`,`country_id`,`tax_id`),
INDEX `idx_tax_rule_country_tax_id` (`tax_id`),
INDEX `idx_tax_rule_country_tax_rule_id` (`tax_rule_id`),
INDEX `idx_tax_rule_country_country_id` (`country_id`),
@@ -157,7 +153,7 @@ CREATE TABLE `tax_rule_country`
FOREIGN KEY (`tax_id`)
REFERENCES `tax` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
ON DELETE CASCADE,
CONSTRAINT `fk_tax_rule_country_tax_rule_id`
FOREIGN KEY (`tax_rule_id`)
REFERENCES `tax_rule` (`id`)
@@ -1574,6 +1570,8 @@ CREATE TABLE `tax_rule_i18n`
(
`id` INTEGER NOT NULL,
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
`title` VARCHAR(255),
`description` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `tax_rule_i18n_FK_1`
FOREIGN KEY (`id`)