Skip to content

Commit

Permalink
Merge pull request #709 from RamonSilva20/fix/os-total
Browse files Browse the repository at this point in the history
Fix/os total
  • Loading branch information
Pr3d4dor authored May 2, 2020
2 parents f65cfb9 + b02033e commit d143860
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.7.2] - 2020-05-02

## Fixed
- Corrigido valor total de OS incorreto por conta de JOINS. [@Pr3d4dor](https://github.com/Pr3d4dor)

## [4.7.1] - 2020-05-01

## Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

![MapOS](https://raw.githubusercontent.com/RamonSilva20/mapos/master/assets/img/logo.png)

![version](https://img.shields.io/badge/version-4.7.1-blue.svg?longCache=true&style=flat-square)
![version](https://img.shields.io/badge/version-4.7.2-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)
Expand Down
2 changes: 1 addition & 1 deletion application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* App current version
*/
$config['app_version'] = '4.7.1';
$config['app_version'] = '4.7.2';

/**
* Nome do sistema
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/Os.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function gerenciar()
$this->data['results'] = $this->os_model->getOs(
'os',
'os.*,
COALESCE(SUM(produtos_os.preco * produtos_os.quantidade), 0) + COALESCE(SUM(servicos_os.preco * servicos_os.quantidade), 0) as total',
COALESCE((SELECT SUM(produtos_os.preco * produtos_os.quantidade ) FROM produtos_os WHERE produtos_os.os_id = os.idOs), 0) totalProdutos,
COALESCE((SELECT SUM(servicos_os.preco * servicos_os.quantidade ) FROM servicos_os WHERE servicos_os.os_id = os.idOs), 0) totalServicos',
$where_array,
$this->data['configuration']['per_page'],
$this->uri->segment(3)
Expand Down
2 changes: 1 addition & 1 deletion application/views/os/os.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
echo '<td>' . $dataInicial . '</td>';
echo '<td>' . $dataFinal . '</td>';
echo '<td>' . $vencGarantia. '</td>';
echo '<td>R$ ' . number_format($r->total, 2, ',', '.') . '</td>';
echo '<td>R$ ' . number_format($r->totalProdutos + $r->totalServicos, 2, ',', '.') . '</td>';
echo '<td>R$ ' . number_format($r->valorTotal, 2, ',', '.') . '</td>';
echo '<td><span class="badge" style="background-color: ' . $cor . '; border-color: ' . $cor . '">' . $r->status . '</span> </td>';
echo '<td>' . $r->refGarantia . '</td>';
Expand Down

0 comments on commit d143860

Please sign in to comment.