| Server IP : 54.94.228.101 / Your IP : 172.28.1.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/vinumday2_0/storage/framework/views/ |
Upload File : |
<?php $__env->startSection('content'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Pedido Venda
<small>Listagem</small>
</h1>
<ol class="breadcrumb">
<li><a href="<?php echo e(url('admin')); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li class="active">Pedido Venda</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<div class="row">
<div class="col-md-6">
<?php if($current_role->hasAccess($current_module->nome_tabela.'.create')){ ?>
<a href="<?php echo e(url('admin/pedido-venda/add')); ?>" class="btn btn-success"><i class="fa fa-plus"></i> Adicionar</a>
<?php } ?>
<a data-toggle="modal" data-target="#modalExportarExcel" href="#" class="btn btn-primary exportar-excel"><i class="fa fa-file-excel fa-fw"></i> Exportar Pedidos Excel</a>
</div>
<div class="col-md-6 pull-right">
<?php //echo $pagination->total_rows . " registro(s) encontrado(s)"; ?>
</div>
</div>
<hr>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="topmenu">
<?php foreach ($filtros as $filtro): ?>
<a href="<?php echo e(url('admin/pedido-venda?filtro='.$filtro->id)); ?>" class="item <?php echo ($filtro->id == $filtro_atual) ? 'active' : (($filtro_atual) ? 'inactive' : '' ); ?>" style="width:<?php echo 100/count($filtros); ?>%">
<i class="fa fa-angle-double-right fa-fw"></i>
<?php echo $filtro->nome; ?>
<?php if($filtro->id == $filtro_atual){ ?>
<span data-href="<?php echo e(url('admin/pedido-venda')); ?>" class="close"> <i class="fa fa-times"></i></span>
<?php } ?>
</a>
<?php endforeach ?>
</div>
<div class="row">
<div class="col-md-12">
<div class="row">
<form class="relatorio-pedidos-filtros" action="<?php echo url('admin/pedido-venda'); ?>" method="GET">
<div class="col-md-3">
Total Registros :
<select name="term_limit" id="term_limit">
<option value="1000" <?php echo (isset($termos['term_limit']) && $termos['term_limit'] == 1000 ? 'selected="selected"' : "")?>>1000</option>
<option value="5000" <?php echo (isset($termos['term_limit']) && $termos['term_limit'] == 5000 ? 'selected="selected"' : "")?>>5000</option>
<option value="10000" <?php echo (isset($termos['term_limit']) && $termos['term_limit'] == 10000 ? 'selected="selected"' : "")?>>10000</option>
</select>
</div>
<div class="col-md-3">
Empresa :
<select name="term_empresa_id" id="term_empresa_id">
<option value="0">Todas</option>
<?php foreach($empresas as $empresa):
echo '<option value="' . $empresa->id . '" '.(isset($termos['term_empresa_id']) && $termos['term_empresa_id'] == $empresa->id ? 'selected="selected"' : '').'>' . $empresa->nome . '</option>';
endforeach;
?>
</select>
</div>
<div class="col-md-3">
Data:
<input value="<?php echo (isset($_GET['term_data_inicio'])) ? $_GET['term_data_inicio'] : '' ?>" type="date" name="term_data_inicio">
a
<input value="<?php echo (isset($_GET['term_data_fim'])) ? $_GET['term_data_fim'] : '' ?>" type="date" name="term_data_fim">
</div>
<div class="col-md-3">
Filtro:
<input type="hidden" name="filtro" value="<?php echo (isset($_GET['filtro'])) ? $_GET['filtro'] : '' ?>">
<input value="<?php echo (isset($_GET['term'])) ? $_GET['term'] : '' ?>" type="text" name="term">
<button class="btn btn-primary">Buscar</button>
</div>
</form>
<br><br>
</div>
</div>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Número</th>
<th width="15%">Data \ Hora</th>
<th>Cliente</th>
<th>Confraria</th>
<th>Qtd. Produtos</th>
<th>Status</th>
<th width="10%">Valor</th>
<th>Pagamento</th>
<th>Empresa</th>
<th>Unidade</th>
<th class="th-action">Ação</th>
</tr>
</thead>
<tbody>
<?php foreach ($pedido_vendas as $item): ?>
<?php $qtd_produtos = 0; ?>
<?php foreach ($item->produtos as $produto): ?>
<?php $qtd_produtos += $produto->quantidade; ?>
<?php endforeach ?>
<tr>
<td><?php echo $item->id; ?></td>
<td><?php echo date('d/m/Y H:i', strtotime($item->data_fechamento)); ?></td>
<td><?php echo $item->cliente->nome.' '.$item->cliente->sobrenome; ?></td>
<td><?php echo (isset($item->confraria) ? $item->confraria->nome : '')?></td>
<!--<td><?php echo $item->frete == 0 ? '<span onmouseover="hoverdiv(event,\'items-pedido\')" onmouseout="hoverdiv(event,\'items-pedido\')">'.$qtd_produtos.'</span>' : 'Frete'; ?></td>-->
<td><?php echo $item->frete == 0 ? '<span style="color: '.($qtd_produtos == 0 ? 'red' : 'black').'; font-weight: '.($qtd_produtos == 0 ? 'bold' : 'normal').'">'.$qtd_produtos.'</span>' : 'Frete'; ?></td>
<td><?php echo $item->status->nome; ?></td>
<td class="text-right">R$ <?php echo number_format($item->total,2,',','.'); ?></td>
<td><?php echo $item->tipo_deposito ? 'Depósito' : 'Cartão'; ?>
<?php if($item->tipo_deposito){ ?>
<?php if($item->comprovante){ ?>
<a target="_blank" class="comprovante" href="<?php echo get_file_s3($item->comprovante, 'pedido-venda/comprovante'); ?>">Ver Comprovante</a>
<?php }else{ ?>
<form class="form-comprovante">
<input type="hidden" name="pagamento" value="<?php echo $item->id; ?>">
<a target="_blank" href="#" class="comprovante enviarComprovanteButton">Enviar comprovante</a>
<input type="file" class="hidden" name="enviar-comprovante">
</form>
<?php } ?>
<?php } ?>
</td>
<td><?php echo (isset($item->empresa) ? $item->empresa->nome : ''); ?></td>
<td><?php echo (isset($item->unidadeNegocio) ? $item->unidadeNegocio->nome : ''); ?></td>
<td>
<?php if($current_role->hasAccess($current_module->nome_tabela.'.update')){ ?>
<a href="/admin/pedido-venda/edit/<?php echo $item->id; ?>" title="editar" class="btn btn-primary"><i class="fa fa-pencil-alt"></i></a>
<a href="/admin/pedido-venda/duplicar/<?php echo $item->id; ?>" title="clonar" class="btn btn-primary"><i class="fa fa-copy"></i></a>
<?php } ?>
<?php /*if($current_role->hasAccess($current_module->nome_tabela.'.delete')){ ?>
<a href="/admin/pedido-venda/delete/<?php echo $item->id; ?>" class="btn btn-danger deletar"><i class="fa fa-trash"></i></a>
<?php } */?>
</td>
</tr>
<?php endforeach ?>
</tbody>
<tfoot>
<tr>
<th>ID</th>
<th width="15%">Data \ Hora</th>
<th>Cliente</th>
<th>Qtd. Produtos</th>
<th>Status</th>
<th width="10%">Valor</th>
<th>Pagamento</th>
<th>Empresa</th>
<th>Unidade</th>
<th>Ação</th>
</tr>
</tfoot>
</table>
<div class="text-center">
<?php echo $__env->make('component.pagination', ['pagination' => $pagination], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<?php if($current_role->hasAccess($current_module->nome_tabela.'.create')){ ?>
<a href="<?php echo e(url('admin/pedido-venda/add')); ?>" class="table-add"><i class="fa fa-plus"></i> Adicionar</a>
<?php } ?>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<div id="items-pedido" style="position: fixed;display:none;"></div>
<div class="modal fade" id="modalExportarExcel" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<form method="GET" action="<?php echo url('admin/pedido-venda/exportar-excel'); ?>">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Exportar Pedidos Excel</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<label for="data_inicial">Data Inicial:</label>
<input type="date" id="data_inicial" name="data_inicial" class="form-control">
</div>
<div class="col-md-6">
<label for="data_final">Data Final:</label>
<input type="date" id="data_final" name="data_final" class="form-control">
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success">Exportar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</form>
</div>
</div>
</div>
<script>
function hoverdiv(e,divid){
var left = e.clientX + "px";
var top = e.clientY + "px";
var div = document.getElementById(divid);
div.style.left = left;
div.style.top = top;
$("#"+divid).toggle();
return false;
}
$(document).on('click', '.enviarComprovanteButton', function(e){
e.preventDefault();
$(this).next().trigger('click');
});
$('[name="enviar-comprovante"]').change(function(){
var td = $(this).closest('td');
var form = new FormData($(this).closest('.form-comprovante')[0]);
form.append('fileUpload', $(this)[0].files[0]);
$.ajax({
url:'/perfil/enviar-comprovante',
type:'POST',
processData: false,
contentType: false,
data:form,
beforeSend:function(){
$('.carregando').fadeIn();
},
success:function(data){
if(data.status){
td.find('a').attr('href', data.url);
if ($(window).width() <= 700) {
td.find('a').html('Ver');
}
else {
td.find('a').html('Ver comprovante');
}
td.find('a').removeClass('enviarComprovanteButton');
alertUtil.alertSuccess(data.message);
}else{
alertUtil.alertError(data.message);
}
$('.carregando').fadeOut();
},
error:function(data){
alertUtil.alertError('Erro ao processar a compra. Tente novamente mais tarde.');
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make($current_template, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>