Skip to content

Commit

Permalink
Merge pull request #229 from rafaelpatro/bugfix_new_codes
Browse files Browse the repository at this point in the history
Adicionados novos códigos de serviço
  • Loading branch information
pedro-teixeira committed May 6, 2017
2 parents 2e8425b + 0db29c1 commit ec82e99
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 0 deletions.
121 changes: 121 additions & 0 deletions app/code/community/PedroTeixeira/Correios/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,127 @@
<brasil>00000000,99999999</brasil>
</zips>
</serv_10138>
<serv_41238>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_41238>
<serv_04669>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04669>
<serv_04812>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04812>
<serv_04510>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04510>
<serv_40444>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_40444>
<serv_41440>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_41440>
<serv_41432>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_41432>
<serv_40630>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_40630>
<serv_04316>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04316>
<serv_04014>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04014>
<serv_04162>
<max>
<size>105</size>
<sum>200</sum>
<weight>30</weight>
<volume_weight>50</volume_weight>
</max>
<zips>
<brasil>00000000,99999999</brasil>
</zips>
</serv_04162>
</validate>

<!-- CONFIG -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,40 @@
)
);

$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();
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,40 @@
)
);

$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();
3 changes: 3 additions & 0 deletions app/locale/pt_BR/PedroTeixeira_Correios.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
"40045 - SEDEX A COBRAR SEM CONTRATO","SEDEX à cobrar"
"40215 - SEDEX 10 SEM CONTRATO","SEDEX 10"
"40290 - SEDEX HOJE SEM CONTRATO","SEDEX HOJE"
"04510 - PAC SEM CONTRATO","PAC"
"04014 - SEDEX SEM CONTRATO","SEDEX"
"04162 - SEDEX CONTRATO AGENCIA","SEDEX"

5 comments on commit ec82e99

@femoriam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olá pessoal,

Realizei as mudanças e agora dá o erro: Dimensões dos produtos fora do permitido pelos Correios.

E se eu configuro no backend para não exigi as dimensões, então gera erro 500.

Abraços.
Fernando

@rafaelpatro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atualiza a cache de configurações em Sistema > Gerenciar Cache. Seleciona Configurações e clica em Atualizar/Refresh.
Confere se o arquivo config.xml foi instalado corretamente, se é igual ao deste commit.

@femoriam
Copy link

@femoriam femoriam commented on ec82e99 May 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olá Rafael,

Continua o erro, veja abaixo os casos:

1- Se eu só altero os numero dos códigos do arquivo config.xml dá e o erro: Dimensões dos produtos fora do permitido pelos Correios.

2- Se eu deixo o arquivo igual o do config.xml desse commit apresenta o erro anterior: Não há formas de entregas disponíveis para este pedido no momento.

3- Se eu baixo um novo módulo através do Github e substituo todos os arquivos, apresenta o erro: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dominio_loja.correios_postmethods' doesn't exist

OBS:
Até o dia 04/05 antes dessa mudança dos correios em todas as minhas lojas funcionava.

@rafaelpatro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@femoriam, acredito que sua instalação ou atualização está falhando, devido ao item 3 que descreveu.
Aparentemente o versionamento do módulo está com problema, e ainda não pude parar para descobrir onde foi o erro.

Sugiro realizar este passo-a-passo, que deve resolver qualquer problema com diferentes versões.

  1. Se sua versão já é 4.8.0, precisará alterar esse número para 4.7.0. O número da versão pode ser alterado manualmente na tabela core_resource. Se sua versão é inferior a 4.7.0, pode atualizar sem alterar o release.
  2. Remover (ou limpar) a tabela correios_postmethods.
  3. Baixar o último release 4.8.0 aqui.
  4. Em Sistema > Gerenciar Cache atualizar as caches Configurações, Traduções e Correios.
  5. Após a atualização, acesse as configurações do módulo em Sistema > Configurações > Formas de Entrega, e reajuste os serviços de postagem.
  6. Se utiliza os Serviços por Produto, precisa reconfigurar os produtos também.
  7. Se possui contrato, e possui usuário e senha no SIGEP Web, precisa reconfigurar o módulo, e atualizar os códigos de serviços.

@femoriam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelpatro Eu fiz o passo a passo e não deu certo, então fiz o seguinte:

1- Deletei o registro pedroteixeira_correios_setup que fica na tabela core_resource
2- Deletei todos os arquivos do módulo antigo
3- Hospedei o novo release: https://github.com/pedro-teixeira/correios/releases/tag/v4.8.0

Então deu certo 👍

Obrigado pela ajuda, abraços!

Please sign in to comment.