diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b62257d7..8ca04b776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ Todas as alterações serão documentadas neste arquivo Formato baseado em [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), e [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.14.1] - 2020-09-20 +## [4.15.0] - 2020-09-21 + +## Added +- Adicionado observacões em vendas. [@Pr3d4dor](https://github.com/Pr3d4dor) + +## [4.14.1] - 2020-09-21 ## Fixed - Corrigido busca de calendário de OS. [@Pr3d4dor](https://github.com/Pr3d4dor) diff --git a/README.md b/README.md index 3b8c675ea..08274e03d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![MapOS](https://raw.githubusercontent.com/RamonSilva20/mapos/master/assets/img/logo.png) -![version](https://img.shields.io/badge/version-4.14.1-blue.svg?longCache=true&style=flat-square) +![version](https://img.shields.io/badge/version-4.15.0-blue.svg?longCache=true&style=flat-square) ![license](https://img.shields.io/badge/license-MIT-green.svg?longCache=true&style=flat-square) ![theme](https://img.shields.io/badge/theme-Matrix--Admin-lightgrey.svg?longCache=true&style=flat-square) ![issues](https://img.shields.io/github/issues/RamonSilva20/mapos.svg?longCache=true&style=flat-square) diff --git a/application/config/config.php b/application/config/config.php index 5413acc46..9e05e086b 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -4,7 +4,7 @@ /** * App current version */ -$config['app_version'] = '4.14.1'; +$config['app_version'] = '4.15.0'; /** * Nome do sistema diff --git a/application/config/form_validation.php b/application/config/form_validation.php index 1440f9c0b..be3e613b6 100644 --- a/application/config/form_validation.php +++ b/application/config/form_validation.php @@ -357,6 +357,11 @@ 'label' => 'Data da Venda', 'rules' => 'required|trim', ], + [ + 'field' => 'observacoes', + 'label' => 'Observacoes', + 'rules' => 'trim', + ], [ 'field' => 'clientes_id', 'label' => 'clientes', diff --git a/application/controllers/Vendas.php b/application/controllers/Vendas.php index 75d9b7744..a5ecfd8ae 100644 --- a/application/controllers/Vendas.php +++ b/application/controllers/Vendas.php @@ -69,6 +69,7 @@ public function adicionar() $data = [ 'dataVenda' => $dataVenda, + 'observacoes' => $this->input->post('observacoes'), 'clientes_id' => $this->input->post('clientes_id'), 'usuarios_id' => $this->input->post('usuarios_id'), 'faturado' => 0, @@ -116,6 +117,7 @@ public function editar() $data = [ 'dataVenda' => $dataVenda, + 'observacoes' => $this->input->post('observacoes'), 'usuarios_id' => $this->input->post('usuarios_id'), 'clientes_id' => $this->input->post('clientes_id'), ]; @@ -276,7 +278,7 @@ public function adicionarProduto() if ($this->vendas_model->add('itens_de_vendas', $data) == true) { $this->load->model('produtos_model'); - + if ($this->data['configuration']['control_estoque']) { $this->produtos_model->updateEstoque($produto, $quantidade, '-'); } @@ -303,7 +305,7 @@ public function excluirProduto() $produto = $this->input->post('produto'); $this->load->model('produtos_model'); - + if ($this->data['configuration']['control_estoque']) { $this->produtos_model->updateEstoque($produto, $quantidade, '+'); } diff --git a/application/database/migrations/20200921012421_add_observacoes_to_vendas_table.php b/application/database/migrations/20200921012421_add_observacoes_to_vendas_table.php new file mode 100644 index 000000000..9e64af9d8 --- /dev/null +++ b/application/database/migrations/20200921012421_add_observacoes_to_vendas_table.php @@ -0,0 +1,20 @@ +dbforge->add_column('vendas', [ + 'observacoes' => [ + 'type' => 'TEXT', + 'null' => true, + 'default' => null, + ], + ]); + } + + public function down() + { + $this->dbforge->drop_column('vendas', 'observacoes'); + } +} diff --git a/application/views/vendas/adicionarVenda.php b/application/views/vendas/adicionarVenda.php index c1e854bf0..c6c5e76b6 100644 --- a/application/views/vendas/adicionarVenda.php +++ b/application/views/vendas/adicionarVenda.php @@ -1,6 +1,10 @@ + + + +