Skip to content

Commit

Permalink
Feature/aba vendas clientes (#2169)
Browse files Browse the repository at this point in the history
* Add dependencia faker

* dependencies update

* Update Clientes View

- Adicionado aba de vendas na visão do cliente.

* Update composer.json

Removendo necessidade do Faker para produção, mantendo-o somente como dependência para desenvolvimento.
  • Loading branch information
lukasabino authored Sep 16, 2023
1 parent 9936010 commit 229d5c0
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 247 deletions.
65 changes: 64 additions & 1 deletion application/views/clientes/visualizar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab1">Dados do Cliente</a></li>
<li><a data-toggle="tab" href="#tab2">Ordens de Serviço</a></li>

<li><a data-toggle="tab" href="#tab3">Vendas</a></li>
</ul>
</div>
<div class="widget-content tab-content">
Expand Down Expand Up @@ -213,6 +213,69 @@
<?php
} ?>
</div>
<!--Tab 3-->
<div id="tab3" class="tab-pane" style="min-height: 300px">
<?php if (!$result_vendas) { ?>
<table class="table table-bordered ">
<thead>
<tr>
<th>N° Venda</th>
<th>Data</th>
<th>Faturado</th>
<th>Total</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="6">Nenhuma OS Cadastrada</td>
</tr>
</tbody>
</table>
<?php
} else { ?>
<table class="table table-bordered ">
<thead>
<tr>
<th>N° Venda</th>
<th>Data</th>
<th>Faturado</th>
<th>Total</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($result_vendas as $r) {
$dataVenda = date(('d/m/Y'), strtotime($r->dataVenda));
if ($r->faturado == 1) {
$faturado = 'Sim';
} else {
$faturado = 'Não';
}
echo '<tr>';
echo '<td>' . $r->idVendas . '</td>';
echo '<td>' . $dataVenda . '</td>';
echo '<td>' . $faturado . '</td>';
echo '<td>R$' . $r->valorTotal. '</td>';

echo '<td>';
if ($this->permission->checkPermission($this->session->userdata('permissao'), 'vOs')) {
echo '<a href="' . base_url() . 'index.php/vendas/visualizar/' . $r->idVendas . '" style="margin-right: 1%" class="btn tip-top" title="Ver mais detalhes"><i class="fas fa-eye"></i></a>';
}
if ($this->permission->checkPermission($this->session->userdata('permissao'), 'eOs')) {
echo '<a href="' . base_url() . 'index.php/vendas/editar/' . $r->idVendas . '" class="btn btn-info tip-top" title="Editar OS"><i class="fas fa-edit"></i></a>';
}
echo '</td>';
echo '</tr>';
} ?>
<tr>
</tr>
</tbody>
</table>
<?php
} ?>
</div>
</div>
<div class="modal-footer" style="display:flex;justify-content: center">
<?php if ($this->permission->checkPermission($this->session->userdata('permissao'), 'eCliente')) {
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"symfony/var-dumper": "^5.0"
"symfony/var-dumper": "^5.0",
"fakerphp/faker": "^1.23"
},
"scripts": {
"format": [
Expand All @@ -37,4 +38,4 @@
"url": "https://github.com/map-os/asaas-sdk"
}
]
}
}
Loading

0 comments on commit 229d5c0

Please sign in to comment.