Skip to content

Commit

Permalink
Melhorias e correções em visualizar os, imprimir os e views os (#2455)
Browse files Browse the repository at this point in the history
* Correção bug ao Faturar Vendas

* Melhorias em OS.

* Visualizar Campos Vendedor e Valor em vendas

* Retirando linhas desnecessárias
  • Loading branch information
cabralwms authored Jul 1, 2024
1 parent f12bb17 commit 02caff1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
5 changes: 0 additions & 5 deletions application/controllers/Vendas.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,6 @@ public function faturar()
$this->db->set('valorTotal', $this->input->post('valor'));
$this->db->set('status', 'Faturado');
$this->db->where('idVendas', $venda_id);
$this->db->update('vendas');

// Atualizar o status da venda para "Faturado"
$this->db->set('status', 'Faturado');
$this->db->where('idVendas', $venda_id);
$this->db->update('vendas');

log_info('Faturou uma venda.');
Expand Down
52 changes: 27 additions & 25 deletions application/views/os/imprimirOs.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,52 +132,54 @@
</li>
</ul>
</td>
<?php if ($result->status == 'Finalizado' || $result->status == 'Orçamento') { ?>
<?php if ($qrCode) : ?>
<td style="width: 25%; padding: 0;text-align:center;">
<img style="margin:12px 0px 0px 0px" src="<?php echo base_url(); ?>assets/img/logo_pix.png" width="64px" alt="QR Code de Pagamento" /></br>
<img style="margin:5px 0px 0px 0px" width="94px" src="<?= $qrCode ?>" alt="QR Code de Pagamento" /></br>
<?php echo '<span style="margin:0px;font-size: 80%;text-align:center;">Chave PIX: ' . $chaveFormatada . '</span>' ;?>
</td>
<?php endif ?>
<?php } ?>
<?php if (in_array($result->status, ['Finalizado', 'Orçamento', 'Faturado', 'Aberto', 'Em Andamento', 'Aguardando Peças']) && $qrCode): ?>
<td style="width: 25%; padding: 0; text-align: center;">
<img style="margin: 12px 0 0 0;" src="<?= base_url(); ?>assets/img/logo_pix.png" width="64px" alt="QR Code de Pagamento" /><br>
<img style="margin: 5px 0 0 0;" width="94px" src="<?= $qrCode ?>" alt="QR Code de Pagamento" /><br>
<span style="margin: 0; font-size: 80%; text-align: center;">Chave PIX: <?= $chaveFormatada ?></span>
</td>
<?php endif; ?>
</tr>
</tbody>
</table>
</div>
<div style="margin-top: 0; padding-top: 0">
<table class="table table-condensed">
<tbody>
<?php if ($result->dataInicial != null) { ?>
<?php if ($result->dataInicial != null): ?>
<tr>
<td>
<b>STATUS OS: </b>
<?php echo $result->status ?>
<?= $result->status ?>
</td>
<td>
<b>DATA INICIAL: </b>
<?php echo date('d/m/Y', strtotime($result->dataInicial)); ?>
<?= date('d/m/Y', strtotime($result->dataInicial)); ?>
</td>
<td>
<b>DATA FINAL: </b>
<?php echo $result->dataFinal ? date('d/m/Y', strtotime($result->dataFinal)) : ''; ?>
<?= $result->dataFinal ? date('d/m/Y', strtotime($result->dataFinal)) : ''; ?>
</td>
<?php if ($result->garantia) {
?>
<td>
<b>GARANTIA: </b>
<?php echo $result->garantia . ' dia(s)'; ?>
</td>
<?php
} ?>
<?php if ($result->garantia): ?>
<td>
<b>GARANTIA: </b>
<?= $result->garantia . ' dia(s)'; ?>
</td>
<?php endif; ?>
<td>
<b>
<?php if ($result->status == 'Finalizado') { ?>
<?php if (in_array($result->status, ['Finalizado', 'Faturado', 'Orçamento', 'Aberto', 'Em Andamento', 'Aguardando Peças'])): ?>
VENC. DA GARANTIA:
</b>
<?php echo dateInterval($result->dataFinal, $result->garantia); ?><?php } ?>
</tr>
<?php } ?>
<?= dateInterval($result->dataFinal, $result->garantia); ?>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>

<?php if ($result->descricaoProduto != null) { ?>
<tr>
<td colspan="5">
Expand Down
2 changes: 2 additions & 0 deletions application/views/os/os.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@

if ($this->permission->checkPermission($this->session->userdata('permissao'), 'vOs')) {
echo '<a style="margin-right: 1%" href="' . base_url() . 'index.php/os/visualizar/' . $r->idOs . '" class="btn-nwe" title="Ver mais detalhes"><i class="bx bx-show"></i></a>';
echo '<a style="margin-right: 1%" href="' . base_url() . 'index.php/os/imprimir/' . $r->idOs . '" target="_blank" class="btn-nwe6" title="Imprimir A4"><i class="bx bx-printer bx-xs"></i></a>';
echo '<a style="margin-right: 1%" href="' . base_url() . 'index.php/os/imprimirTermica/' . $r->idOs . '" target="_blank" class="btn-nwe6" title="Imprimir Não Fiscal"><i class="bx bx-printer bx-xs"></i></a>';
}
if ($editavel) {
echo '<a style="margin-right: 1%" href="' . base_url() . 'index.php/os/editar/' . $r->idOs . '" class="btn-nwe3" title="Editar OS"><i class="bx bx-edit"></i></a>';
Expand Down
11 changes: 6 additions & 5 deletions application/views/os/visualizarOs.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@
<?php } ?>
</td>

<td>
<?php if ($result->status == 'Finalizado') { ?>
<b>VENC. DA GARANTIA:</b><?php echo dateInterval($result->dataFinal, $result->garantia); ?>
<?php } ?>
</td>
<?php if (in_array($result->status, ['Finalizado', 'Faturado', 'Orçamento', 'Aberto'])): ?>
<td>
<b>VENC. DA GARANTIA:</b>
<?= dateInterval($result->dataFinal, $result->garantia); ?>
</td>
<?php endif; ?>
</tr>
<?php } ?>

Expand Down

0 comments on commit 02caff1

Please sign in to comment.