From 876fa437758e75b049bf652f4dbf645657b5107c Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Fri, 12 May 2017 10:17:46 -0300 Subject: [PATCH 1/3] =?UTF-8?q?#251=20Adicionada=20atualiza=C3=A7=C3=A3o?= =?UTF-8?q?=20mysql=20das=20vers=C3=B5es=204.7.2=20e=204.7.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PedroTeixeira/Correios/etc/config.xml | 2 +- .../install-4.8.1.php | 213 ++++++++++++++++++ .../upgrade-4.7.0-4.8.0.php | 18 -- .../upgrade-4.7.2-4.8.0.php | 91 ++++++++ .../upgrade-4.7.3-4.8.0.php | 91 ++++++++ .../upgrade-4.8.0-4.8.1.php | 18 ++ 6 files changed, 414 insertions(+), 19 deletions(-) create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php diff --git a/app/code/community/PedroTeixeira/Correios/etc/config.xml b/app/code/community/PedroTeixeira/Correios/etc/config.xml index f7997bc..b43ac2a 100644 --- a/app/code/community/PedroTeixeira/Correios/etc/config.xml +++ b/app/code/community/PedroTeixeira/Correios/etc/config.xml @@ -15,7 +15,7 @@ - 4.8.0 + 4.8.1 diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php new file mode 100644 index 0000000..5cad4e2 --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php @@ -0,0 +1,213 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ + +/** @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$installer->startSetup(); + +$status = Mage::getModel('sales/order_status'); +$status->setStatus(PedroTeixeira_Correios_Model_Sro::ORDER_SHIPPED_STATUS) + ->setLabel('Pedido em Transporte') + ->assignState(Mage_Sales_Model_Order::STATE_COMPLETE) + ->save(); + +$status = Mage::getModel('sales/order_status'); +$status->setStatus(PedroTeixeira_Correios_Model_Sro::ORDER_WARNED_STATUS) + ->setLabel('Dificuldade de Entrega') + ->assignState(Mage_Sales_Model_Order::STATE_COMPLETE) + ->save(); + +/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */ +$setup = new Mage_Eav_Model_Entity_Setup('core_setup'); + +// Add volume to prduct attribute set +$codigo = 'volume_comprimento'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Comprimento (cm)', + 'type' => 'int', + 'input' => 'text', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'Comprimento da embalagem do produto (Para cálculo dos Correios)' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +// Add volume to prduct attribute set +$codigo = 'volume_altura'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Altura (cm)', + 'type' => 'int', + 'input' => 'text', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'Altura da embalagem do produto (Para cálculo dos Correios)' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +// Add volume to prduct attribute set +$codigo = 'volume_largura'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Largura (cm)', + 'type' => 'int', + 'input' => 'text', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'Largura da embalagem do produto (Para cálculo dos Correios)' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +$codigo = 'postmethods'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Serviços de Entrega', + 'type' => 'text', + 'input' => 'multiselect', + 'source' => 'pedroteixeira_correios/source_postMethods', + 'backend' => 'eav/entity_attribute_backend_array', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'Selecione os serviços apropriados para o produto.' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +$codigo = 'fit_size'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Diferença do Encaixe (cm)', + 'type' => 'varchar', + 'input' => 'text', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'Exemplo: Se 1 item mede 10cm de altura, e 2 itens encaixados medem 11cm. A diferença é de 1cm.' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +$codigo = 'posting_days'; +$config = array( + 'position' => 1, + 'required' => 0, + 'label' => 'Prazo de Postagem', + 'type' => 'int', + 'input' => 'text', + 'apply_to' => 'simple,bundle,grouped,configurable', + 'note' => 'O prazo total é o Prazo dos Correios acrescido do maior Prazo de Postagem dos produtos no carrinho.' +); + +$setup->addAttribute('catalog_product', $codigo, $config); + +// Add Correios Tab +$setIds = $setup->getAllAttributeSetIds('catalog_product'); + +$attributes = array( + 'volume_comprimento', + 'volume_altura', + 'volume_largura', + 'postmethods', + 'fit_size', + 'posting_days' +); + +foreach ( $setIds as $setId ) { + + $setup->addAttributeGroup('catalog_product', $setId, 'Correios', 2); + $groupId = $setup->getAttributeGroupId('catalog_product', $setId, 'Correios'); + + foreach ( $attributes as $attribute ) { + $attributeId = $setup->getAttributeId('catalog_product', $attribute); + $setup->addAttributeToGroup('catalog_product', $setId, $groupId, $attributeId); + } + +} + +$installer->run( + "CREATE TABLE IF NOT EXISTS {$this->getTable('pedroteixeira_correios/postmethod')} ( + method_id int(11) unsigned NOT NULL auto_increment, + method_code varchar(5) NOT NULL default '0', + method_title varchar(255) NOT NULL default '', + PRIMARY KEY (method_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '3', + 'method_code' => '40045', + 'method_title' => 'SEDEX A COBRAR SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '4', + 'method_code' => '40215', + 'method_title' => 'SEDEX 10 SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '5', + 'method_code' => '40290', + 'method_title' => 'SEDEX HOJE SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '6', + 'method_code' => '04510', + 'method_title' => 'PAC SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '7', + 'method_code' => '04014', + 'method_title' => 'SEDEX SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '8', + 'method_code' => '04669', + 'method_title' => 'PAC CONTRATO AGENCIA', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '9', + 'method_code' => '04162', + 'method_title' => 'SEDEX CONTRATO AGENCIA', + ) +); + +$installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php index dc0bd1e..5faeffb 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php @@ -25,24 +25,6 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" ); -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '1', - 'method_code' => '41106', - 'method_title' => 'PAC SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '2', - 'method_code' => '40010', - 'method_title' => 'SEDEX SEM CONTRATO', - ) -); - $installer->getConnection()->insertForce( $this->getTable('pedroteixeira_correios/postmethod'), array( diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php new file mode 100644 index 0000000..5faeffb --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php @@ -0,0 +1,91 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$installer->startSetup(); + +$installer->run( + "CREATE TABLE IF NOT EXISTS {$this->getTable('pedroteixeira_correios/postmethod')} ( + method_id int(11) unsigned NOT NULL auto_increment, + method_code varchar(5) NOT NULL default '0', + method_title varchar(255) NOT NULL default '', + PRIMARY KEY (method_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '3', + 'method_code' => '40045', + 'method_title' => 'SEDEX A COBRAR SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '4', + 'method_code' => '40215', + 'method_title' => 'SEDEX 10 SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '5', + 'method_code' => '40290', + 'method_title' => 'SEDEX HOJE SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '6', + 'method_code' => '04510', + 'method_title' => 'PAC SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '7', + 'method_code' => '04014', + 'method_title' => 'SEDEX SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '8', + 'method_code' => '04669', + 'method_title' => 'PAC CONTRATO AGENCIA', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '9', + 'method_code' => '04162', + 'method_title' => 'SEDEX CONTRATO AGENCIA', + ) +); + +$installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php new file mode 100644 index 0000000..5faeffb --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php @@ -0,0 +1,91 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$installer->startSetup(); + +$installer->run( + "CREATE TABLE IF NOT EXISTS {$this->getTable('pedroteixeira_correios/postmethod')} ( + method_id int(11) unsigned NOT NULL auto_increment, + method_code varchar(5) NOT NULL default '0', + method_title varchar(255) NOT NULL default '', + PRIMARY KEY (method_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '3', + 'method_code' => '40045', + 'method_title' => 'SEDEX A COBRAR SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '4', + 'method_code' => '40215', + 'method_title' => 'SEDEX 10 SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '5', + 'method_code' => '40290', + 'method_title' => 'SEDEX HOJE SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '6', + 'method_code' => '04510', + 'method_title' => 'PAC SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '7', + 'method_code' => '04014', + 'method_title' => 'SEDEX SEM CONTRATO', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '8', + 'method_code' => '04669', + 'method_title' => 'PAC CONTRATO AGENCIA', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '9', + 'method_code' => '04162', + 'method_title' => 'SEDEX CONTRATO AGENCIA', + ) +); + +$installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php new file mode 100644 index 0000000..e007eb1 --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php @@ -0,0 +1,18 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$installer->startSetup(); +$installer->endSetup(); From fd29844bde625297d8295516a5c7c5cc0e616647 Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sun, 14 May 2017 11:20:57 -0300 Subject: [PATCH 2/3] #252 Corrigidos arquivos de upgrade --- .../upgrade-4.7.0-4.7.1.php | 13 +++ .../upgrade-4.7.0-4.8.0.php | 91 ------------------- .../upgrade-4.7.1-4.7.2.php | 13 +++ .../upgrade-4.7.3-4.8.0.php | 91 ------------------- .../upgrade-4.8.0-4.8.1.php | 5 - 5 files changed, 26 insertions(+), 187 deletions(-) create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.7.1.php delete mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php create mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.1-4.7.2.php delete mode 100644 app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.7.1.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.7.1.php new file mode 100644 index 0000000..0f189ac --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.7.1.php @@ -0,0 +1,13 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php deleted file mode 100644 index 5faeffb..0000000 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.0-4.8.0.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) - * @license http://opensource.org/licenses/MIT MIT - * @link https://github.com/pedro-teixeira/correios - */ - -/* @var $installer Mage_Core_Model_Resource_Setup */ -$installer = $this; -$installer->startSetup(); - -$installer->run( - "CREATE TABLE IF NOT EXISTS {$this->getTable('pedroteixeira_correios/postmethod')} ( - method_id int(11) unsigned NOT NULL auto_increment, - method_code varchar(5) NOT NULL default '0', - method_title varchar(255) NOT NULL default '', - PRIMARY KEY (method_id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '3', - 'method_code' => '40045', - 'method_title' => 'SEDEX A COBRAR SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '4', - 'method_code' => '40215', - 'method_title' => 'SEDEX 10 SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '5', - 'method_code' => '40290', - 'method_title' => 'SEDEX HOJE SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '6', - 'method_code' => '04510', - 'method_title' => 'PAC SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '7', - 'method_code' => '04014', - 'method_title' => 'SEDEX SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '8', - 'method_code' => '04669', - 'method_title' => 'PAC CONTRATO AGENCIA', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '9', - 'method_code' => '04162', - 'method_title' => 'SEDEX CONTRATO AGENCIA', - ) -); - -$installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.1-4.7.2.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.1-4.7.2.php new file mode 100644 index 0000000..0f189ac --- /dev/null +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.1-4.7.2.php @@ -0,0 +1,13 @@ + + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php deleted file mode 100644 index 5faeffb..0000000 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.3-4.8.0.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) - * @license http://opensource.org/licenses/MIT MIT - * @link https://github.com/pedro-teixeira/correios - */ - -/* @var $installer Mage_Core_Model_Resource_Setup */ -$installer = $this; -$installer->startSetup(); - -$installer->run( - "CREATE TABLE IF NOT EXISTS {$this->getTable('pedroteixeira_correios/postmethod')} ( - method_id int(11) unsigned NOT NULL auto_increment, - method_code varchar(5) NOT NULL default '0', - method_title varchar(255) NOT NULL default '', - PRIMARY KEY (method_id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;" -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '3', - 'method_code' => '40045', - 'method_title' => 'SEDEX A COBRAR SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '4', - 'method_code' => '40215', - 'method_title' => 'SEDEX 10 SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '5', - 'method_code' => '40290', - 'method_title' => 'SEDEX HOJE SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '6', - 'method_code' => '04510', - 'method_title' => 'PAC SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '7', - 'method_code' => '04014', - 'method_title' => 'SEDEX SEM CONTRATO', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '8', - 'method_code' => '04669', - 'method_title' => 'PAC CONTRATO AGENCIA', - ) -); - -$installer->getConnection()->insertForce( - $this->getTable('pedroteixeira_correios/postmethod'), - array( - 'method_id' => '9', - 'method_code' => '04162', - 'method_title' => 'SEDEX CONTRATO AGENCIA', - ) -); - -$installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php index e007eb1..0f189ac 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.8.0-4.8.1.php @@ -11,8 +11,3 @@ * @license http://opensource.org/licenses/MIT MIT * @link https://github.com/pedro-teixeira/correios */ - -/* @var $installer Mage_Core_Model_Resource_Setup */ -$installer = $this; -$installer->startSetup(); -$installer->endSetup(); From bb66b65cae05801973c93f9512dfea7bb09750a3 Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Mon, 15 May 2017 09:40:12 -0300 Subject: [PATCH 3/3] =?UTF-8?q?#252=20Adicionada=20valida=C3=A7=C3=A3o=20d?= =?UTF-8?q?o=20novo=20PAC=20GF=20(04693)=20e=20respectiva=20instala=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PedroTeixeira/Correios/etc/config.xml | 151 ++++++++++++++++++ .../install-4.8.0.php | 18 +++ .../install-4.8.1.php | 18 +++ .../upgrade-4.7.2-4.8.0.php | 18 +++ 4 files changed, 205 insertions(+) diff --git a/app/code/community/PedroTeixeira/Correios/etc/config.xml b/app/code/community/PedroTeixeira/Correios/etc/config.xml index b43ac2a..21a2b71 100644 --- a/app/code/community/PedroTeixeira/Correios/etc/config.xml +++ b/app/code/community/PedroTeixeira/Correios/etc/config.xml @@ -394,6 +394,157 @@ 99000000,99100000 + + + 150 + 300 + 30 + 125 + + + 01000000,01599999 + 02000000,05899999 + 06000000,06699999 + 07000000,07299999 + 07750000,07799999 + 08000000,08499999 + 09000000,09999999 + 11010000,11099999 + 12010010,12120999 + 12209000,12248999 + 12400000,12449999 + 12580000,12580999 + 13000000,13139999 + 13140000,13149999 + 13170000,13189999 + 13200000,13219999 + 13295000,13299999 + 13315000,13319999 + 13400000,13433050 + 13440000,13449999 + 13450000,13459999 + 13460000,13460999 + 13465000,13479999 + 13480000,13489999 + 13495000,13499999 + 13520000,13524999 + 13525000,13529999 + 13560000,13579999 + 14000000,14114999 + 14400000,14414999 + 14800000,14811999 + 15000000,15105999 + 16000000,16129999 + 17000000,17110999 + 18000000,18109999 + 19000000,19159999 + 19300000,19349999 + 20000000,20099999 + 20140000,20599999 + 20700000,20999999 + 20710000,20745312 + 20750000,20766840 + 20770000,20785510 + 20910000,20943580 + 20950003,20975210 + 21000000,21099999 + 21130000,21149999 + 21200000,21599999 + 21310000,21341790 + 21350000,21557300 + 21600000,21999999 + 21902710,21941840 + 22000000,23799999 + 24000000,24799999 + 25600000,25779999 + 27165000,27165999 + 27197000,27475999 + 27900000,27999999 + 28000000,28154999 + 29000000,29099999 + 29130000,29130999 + 30000000,30599999 + 30700000,32199999 + 32300000,32399999 + 32920000,32920001 + 34600000,34749999 + 35000001,35099999 + 35160000,35164999 + 35167000,35167999 + 35170000,35174999 + 35180000,35184999 + 36010000,36099999 + 36105000,36105001 + 37000000,37099999 + 38000000,38099999 + 38400000,38415999 + 39400001,39409999 + 40000000,42499999 + 42700000,42705999 + 44000000,44100999 + 45000000,45104999 + 49000000,49099999 + 50000000,50999999 + 52000000,53989998 + 54700000,54799999 + 51000000,51999999 + 54000000,54699999 + 54800000,54999999 + 55590000,55599999 + 57010000,57089999 + 58000001,58099999 + 58400001,58439999 + 59000001,59139999 + 60000000,60999999 + 64000000,64099999 + 65000000,65139999 + 66000000,66599999 + 66600000,67200999 + 68900000,68911639 + 68925000,68939999 + 69000000,69099999 + 69301000,69399999 + 69900001,69924999 + 70000000,71689999 + 71700000,71799999 + 71800000,72399999 + 74000000,74894999 + 74900000,74999999 + 76800001,76834999 + 77000000,77299999 + 78000000,78169999 + 79000000,79124999 + 80000000,81199999 + 81300000,81999999 + 82100000,82299999 + 82500000,83189999 + 83400000,83419999 + 84010000,84073999 + 85800000,85820999 + 85850000,85874999 + 86000000,86099999 + 86180000,86199999 + 87005000,87105999 + 88010000,88123999 + 88130000,88140999 + 88160000,88169999 + 88300000,88319999 + 88330000,88349999 + 88375000,88375999 + 89000000,89099999 + 89200000,89239999 + 90001000,90899999 + 91000000,91499999 + 92000000,92499999 + 93000000,93179999 + 93200000,93299999 + 93300000,93599999 + 95000000,95124999 + 96000000,96099999 + 97000000,97119999 + 99000000,99100000 + + 30 diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.0.php index 85b0699..2d475e0 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.0.php @@ -228,4 +228,22 @@ ) ); +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '10', + 'method_code' => '04693', + 'method_title' => 'PAC CONTRATO GRANDES FORMATOS', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '11', + 'method_code' => '10065', + 'method_title' => 'CARTA COMERCIAL A FATURAR', + ) +); + $installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php index 5cad4e2..9b1794f 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/install-4.8.1.php @@ -210,4 +210,22 @@ ) ); +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '10', + 'method_code' => '04693', + 'method_title' => 'PAC CONTRATO GRANDES FORMATOS', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '11', + 'method_code' => '10065', + 'method_title' => 'CARTA COMERCIAL A FATURAR', + ) +); + $installer->endSetup(); diff --git a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php index 5faeffb..c447d70 100644 --- a/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php +++ b/app/code/community/PedroTeixeira/Correios/sql/pedroteixeira_correios_setup/upgrade-4.7.2-4.8.0.php @@ -88,4 +88,22 @@ ) ); +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '10', + 'method_code' => '04693', + 'method_title' => 'PAC CONTRATO GRANDES FORMATOS', + ) +); + +$installer->getConnection()->insertForce( + $this->getTable('pedroteixeira_correios/postmethod'), + array( + 'method_id' => '11', + 'method_code' => '10065', + 'method_title' => 'CARTA COMERCIAL A FATURAR', + ) +); + $installer->endSetup();