%PDF-
%PDF-
Mini Shell
Mini Shell
<?php $__env->startSection('title'); ?>
Liste des commandes
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="container">
<?php if(session()->has('status')): ?>
<div class="alert alert-success" role="alert">
<?php echo e(session()->get('status')); ?>
</div>
<?php elseif(session()->has('error')): ?>
<div class="alert alert-danger" role="alert">
<?php echo e(session()->get('error')); ?>
</div>
<?php endif; ?>
<div class="card">
<div class="card-header">
<ul class="nav nav-pills card-header-pills">
<li class="nav-item">
<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#addCommandeModal">
<i class="fas fa-plus"></i>Ajouter Commande</button>
</li>
<li class="d-flex">
<input class="form-control me-2" type="search" id="searchInput" placeholder="Search" aria-label="Search">
</li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title text-primary">Liste des Commandes</h5>
<div class="table-responsive">
<table class="table table-hover table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Livreur</th>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit employers')): ?>
<th scope="col">Commercial</th>
<?php endif; ?>
<th scope="col">Client</th>
<th scope="col">Etat</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $commandes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $commande): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr id="commande">
<td><?php echo e($commande->id); ?></td>
<td><?php echo e(( $commande->livreur == 'Autres') ? $commande->autre_livraison : $commande->livreur); ?></td>
<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit employers')): ?>
<td><span class="badge badge-pill badge-warning"><?php echo e($commande->commercial->name); ?></span></td>
<?php endif; ?>
<td><?php echo e($commande->facture->user?$commande->facture->user->name:''); ?></td>
<td>
<?php if (isset($component)) { $__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\CommandeStatus::class, ['commande' => $commande]); ?>
<?php $component->withName('commande-status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php if (isset($__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d)): ?>
<?php $component = $__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d; ?>
<?php unset($__componentOriginal8f49a694751c65167e72e58534a4d46b63b0b64d); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
</td>
<td><button class="btn btn-info btn-sm" data-toggle="collapse"
data-target="#commande_products-<?php echo e($commande->id); ?>">voir</button>
<?php if($commande->status == 'pending' || $commande->status == 'unstocked' || $commande->status == 'validated'): ?>
<button type="button" class="btn btn-secondary btn-sm" data-commande-object="<?php echo e(@json_encode($commande->toArray())); ?>">Modifier</button>
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal"
data-target="#confirmModal"
data-delete-id="<?php echo e($commande->id); ?>">Annuler</button>
<?php endif; ?>
<?php if($commande->status == 'pending'): ?>
<a type="button"
href="<?php echo e(route('valider_commande', ['id' => $commande->id])); ?>"
class="btn btn-success btn-sm">Valider</a>
<?php endif; ?>
<?php if($commande->status == 'delivered'): ?>
<button type="button" class="btn btn-primary btn-sm" data-toggle="modal"
data-target="#confirm"
data-delete-id="<?php echo e($commande->id); ?>">retourné</button>
<?php endif; ?>
</td>
</tr>
<tr id="commande_products-<?php echo e($commande->id); ?>" class="collapse collapsed">
<td colspan="4">
<ul>
<?php $__currentLoopData = $commande->commande_products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $com_prod): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><span><?php echo e($com_prod->product->parent ? $com_prod->product->parent->name_prod : $com_prod->product->name_prod); ?></span> -
<span><?php echo e($com_prod->product->ref_prod); ?></span> -
<span><?php echo e($com_prod->product->prixvente - $com_prod->remise); ?>DH</span>
</li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<div class="d-flex flex-row justify-content-center"><?php echo e($commandes->links()); ?></div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<?php if (isset($component)) { $__componentOriginal21805d7034e29224f9ff68c3f9497df00d4fea27 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AddCommandeModal::class, []); ?>
<?php $component->withName('add-commande-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php if (isset($__componentOriginal21805d7034e29224f9ff68c3f9497df00d4fea27)): ?>
<?php $component = $__componentOriginal21805d7034e29224f9ff68c3f9497df00d4fea27; ?>
<?php unset($__componentOriginal21805d7034e29224f9ff68c3f9497df00d4fea27); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal8463d6b817edcdac902c95d78bf64225942e2549 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\EditCommandeModal::class, []); ?>
<?php $component->withName('edit-commande-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php if (isset($__componentOriginal8463d6b817edcdac902c95d78bf64225942e2549)): ?>
<?php $component = $__componentOriginal8463d6b817edcdac902c95d78bf64225942e2549; ?>
<?php unset($__componentOriginal8463d6b817edcdac902c95d78bf64225942e2549); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($component)) { $__componentOriginal3f4adf806c7ab8d3cf8a2e7856c93c221fc9d659 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\AnnulerCommande::class, []); ?>
<?php $component->withName('annuler-commande'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php if (isset($__componentOriginal3f4adf806c7ab8d3cf8a2e7856c93c221fc9d659)): ?>
<?php $component = $__componentOriginal3f4adf806c7ab8d3cf8a2e7856c93c221fc9d659; ?>
<?php unset($__componentOriginal3f4adf806c7ab8d3cf8a2e7856c93c221fc9d659); ?>
<?php endif; ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<div class="modal fade" id="confirm" tabindex="-1" role="dialog" aria-labelledby="DeleteCommModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<form class="modal-content" action="<?php echo e(route('Returned')); ?>" method="post">
<div class="modal-header">
<h5 class="modal-title">Confirmation :</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Etes-vous sûr que vous voulez retourné la commande ?</p>
</div>
<div class="modal-footer">
<input type="hidden" name="id">
<?php echo csrf_field(); ?>
<button type="submit" id="returned" name="OK_button" class="btn btn-primary">OK</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
</div>
</form>
</div>
</div>
<script>
$(document).ready(function() {
$("#confirmModal").on('show.bs.modal', function(e) {
var id = parseInt($(e.relatedTarget).attr('data-delete-id'));
$(this).find('input[name="id"]').val(id);
});
$("#confirm").on('show.bs.modal', function(e) {
var id = parseInt($(e.relatedTarget).attr('data-delete-id'));
$(this).find('input[name="id"]').val(id);
});
$('#livreur').on('change', function() {
var type = $(this).val();
$('[data-livr-type]').addClass('d-none');
$('[data-livr-type=' + type + ']').removeClass('d-none');
}).trigger('change');
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\gestionstock\resources\views/commandes/Encours.blade.php ENDPATH**/ ?>
Zerion Mini Shell 1.0