| 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 : |
<div class="row">
<div class="col-md-12">
<table class="table table-bordered" style="margin-bottom: 0px;">
<thead>
<tr>
<th class="no-sort text-center">
<input type="checkbox" name="selecionar_todos" value="<?php echo e($transportadora->id); ?>" data-id="<?php echo e($transportadora->id); ?>" />
</th>
<th class="text-center">Pedido</th>
<th class="text-center">Data Solicitação</th>
<th>Cliente</th>
<th class="hidden">Frete</th>
<th class="text-center">NF</th>
<th class="text-center">Expedição Erp</th>
<th class="text-center">Agrupamento</th>
<th class="text-center">Status</th>
<th class="text-left">Mensagem</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $pedidos[$transportadora->id]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pedido): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
$key = "{$pedido->transportadora_id}_{$pedido->id}_{$pedido->id_nota_fiscal_erp}";
$item = false;
if(isset($itens[$key])){
$item = $itens[$key];
}
?>
<tr>
<td class="text-center">
<?php if(!empty($pedido->id_transportadora)): ?>
<?php if(!$item || (isset($item) && (empty($item->sucesso) || $item->sucesso == 0))): ?>
<input type="checkbox" name="item_pedido[]" value="<?php echo e($pedido->id); ?>" class="item_pedido_<?php echo e($transportadora->id); ?>" />
<?php endif; ?>
<?php endif; ?>
<input type="hidden" value="<?php echo e($pedido->id_nota_fiscal_erp); ?>" id="id_nota_fiscal_erp_<?php echo e($pedido->id); ?>" />
</td>
<td class="text-center"><?php echo e($pedido->id); ?></td>
<td class="text-center"><?php echo e(!empty($pedido->data_solicitacao) ? date('d/m/Y H:i:s', strtotime($pedido->data_solicitacao)) : ''); ?></td>
<td><?php echo e($pedido->cliente_nome); ?> <?php echo e($pedido->cliente_sobrenome); ?></td>
<td class="hidden">
<?php
$status = ($pedido->status_frete == 2 || $pedido->status_frete == 7 || $pedido->status_frete == 3) ? 'Aprovado' : 'Em aberto';
if($pedido->retirada_local){
echo "<strong>RETIRADA NO LOCAL: " . date('d/m/Y', strtotime($pedido->data_retirada)) . " - " . date('H:i', strtotime($pedido->data_retirada))."h</strong>";
}else{
echo $pedido->valor_frete ? 'R$ '.number_format($pedido->valor_frete,2,',','.').' ('.$status.')' : 'Gratuito';
echo ($pedido->cotacao_valor ? ' | R$ ' . number_format($pedido->cotacao_valor, 2, ',', '.') : '');
}
?>
</td>
<td class="text-center"><?php echo e($pedido->nota_fiscal_erp); ?></td>
<td class="text-center"><?php echo (isset($item->expedicao_erp) ? $item->expedicao_erp : '')?></td>
<td class="text-center"><?php echo (isset($item->agrupamento) ? $item->agrupamento : '')?></td>
<td class="text-center"><?php echo (isset($item->sucesso) ? ($item->sucesso ? '<span style="color:green; font-weight: bold">Ok</span>' : '<span style="color:red; font-weight: bold">Erro</span>') : '')?></td>
<td class="text-left">
<?php
$observacao = '';
if(isset($item->sucesso)){
$observacao = ($item->sucesso ? '' : $item->observacao);
}elseif(empty($pedido->id_transportadora)){
$observacao = '<span style="color:red; font-weight: bold">Cotação não finalizada!</span>';
}
echo $observacao;
?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('[name="selecionar_todos"]').click(function(){
var $id = $(this).data('id');
console.log($id);
if($(this).is(':checked')){
$('.item_pedido_' + $id).prop('checked', true);
}else{
$('.item_pedido_' + $id).prop('checked', false);
}
});
});
</script>