%PDF- %PDF-
Direktori : /var/www/html/storage/framework/views/ |
Current File : //var/www/html/storage/framework/views/aaa795b863ca2c4c39bf203e28d899dfa06b7f3c.php |
<?php $__env->startSection('title'); ?> Liste des Commandes <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <form class="container fluid" method="post" action="<?php echo e(URL::current()); ?>"> <?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 elseif(session()->has('message')): ?> <div class="alert alert-success" role="alert"> <?php echo e(session()->get('message')); ?> </div> <?php endif; ?> <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="alert alert-danger"> <?php echo e($message); ?> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <div class="card mb-3"> <div class="card-header"> <h5 class="card-title font-weight-bold text-primary">Informations :</h5> </div> <div class="card-body"> <ul class="list-group"> <li class="list-group-item d-flex justify-content-between align-items-center"> <span style="font-weight: bold">Commercial(e) : </span> <span><?php echo e($commande->commercial->name); ?></span> </li> <li class="list-group-item d-flex justify-content-between align-items-center"> <span style="font-weight: bold">Client : </span> <span data-client-name><?php echo e(!$commande->facture->user?'':$commande->facture->user->name); ?></span> </li> <?php $__currentLoopData = $commande->commande_products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $comm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <li class="list-group-item d-flex justify-content-between align-items-center"> <?php echo e($comm->product->parent ? $comm->product->parent->name_prod : $comm->product->name_prod); ?> | <?php echo e($comm->product->ref_prod); ?> <div> <span class="badge badge-success badge-pill"><?php echo e($comm->product->prixvente); ?> DH</span> <span class="badge badge-warning badge-pill">-<?php echo e($comm->remise); ?> DH</span> <span class="badge badge-info badge-pill"><?php echo e(($comm->product->prixvente - $comm->remise)?: 'Gratuit'); ?></span> </div> </li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <li class="list-group-item d-flex justify-content-between align-items-center"> <span style="font-weight: bold">Total : </span> <span class="badge badge-primary badge-pill"><?php echo e($commande->total); ?> DH</span> </li> </ul> <div class="text-right"></div> </div> </div> <div class="card"> <div class="card-header"> <h5 class="card-title font-weight-bold text-primary">Valider la commande</h5> </div> <div class="card-body"> <?php echo csrf_field(); ?> <div class="row"> <div class="col-6"> <div class="form-group mb-3"> <select id="facture_type" name="type_facture" class="form-control form-control-user" <?php if($commande->status == 'unstocked' || $commande->status == 'validated'): ?> disabled <?php endif; ?>> <option value="0">Sélectionnez le type : </option> <option value="facture" <?php if($commande->facture->type == 'facture'): ?> selected <?php endif; ?>>Facture</option> <option value="livraison" <?php if($commande->facture->type == 'livraison'): ?> selected <?php endif; ?>>Bon de livraison</option> <option value="commande" <?php if($commande->facture->type == 'commande'): ?> selected <?php endif; ?>>Bon de commande</option> <option value="sortie" <?php if($commande->facture->type == 'sortie'): ?> selected <?php endif; ?>>Bon de sortie</option> <option value="devis" <?php if($commande->facture->type == 'devis'): ?> selected <?php endif; ?>>Devis</option> </select> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="num_facture" placeholder="Numéro de facture" value="<?php echo e($commande->facture->num_facture); ?>" <?php if($commande->facture->num_facture): ?> data-stop-api="facture" data-stop-num="<?php echo e($commande->facture->num_facture); ?>" <?php endif; ?> readonly> </div> </div> <div data-facture-type="facture" class="col-6"> <div class="form-group mb-3"> <select name="taux_id" class="form-control form-control-user"> <option value="0">Sélectionnez TVA :</option> <?php $__currentLoopData = $taux; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tva): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($tva->id); ?>" <?php if($commande->facture->taux_id == $tva->id): ?> selected <?php endif; ?>><?php echo e($tva->taux); ?> %</option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <div class="input-group"> <select name="client_id" class="form-control form-control-user"> <option value="0">Sélectionnez client :</option> <?php $__currentLoopData = $clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($id); ?>" data-client-option="<?php echo e($name); ?>" <?php if($commande->facture->client_id == $id): ?> selected <?php endif; ?>><?php echo e($name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <a class="btn btn-primary" data-toggle="modal" data-target="#addClientModal" href="#"><i class="fas fa-plus" aria-hidden="true"></i></a> </div> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <select name="livreur" id="livreur" class="form-control form-control-user"> <option value="CTM" <?php if($commande->livreur == 'CTM'): ?> selected <?php endif; ?>> CTM </option> <option value="Amana" <?php if($commande->livreur == 'Amana'): ?> selected <?php endif; ?>>Amana</option> <option value="J2HB" <?php if($commande->livreur == 'J2HB'): ?> selected <?php endif; ?>>J2HB</option> <option value="wataniya" <?php if($commande->livreur == 'wataniya'): ?> selected <?php endif; ?>>wataniya</option> <option value="Autres" <?php if($commande->livreur == 'Autres'): ?> selected <?php endif; ?>>Autres</option> </select> </div> </div> <div class="col-6" data-livr-type="Autres"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="autre_livraison" placeholder="Autre livreur" value="<?php echo e($commande->autre_livraison); ?>"> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="livraison_ref" placeholder="Référence livraison" value="<?php echo e($commande->livraison_ref); ?>"> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <select name="frais_livraison" class="form-control form-control-user"> <option value="port paye" <?php if($commande->frais_livraison == 'port paye'): ?> selected <?php endif; ?>>port payé</option> <option value="port du" <?php if($commande->frais_livraison == 'port du'): ?> selected <?php endif; ?>>port du</option> <option value="normal" <?php if($commande->frais_livraison == 'normal'): ?> selected <?php endif; ?>>Normal</option> </select> </div> </div> </div> </div> </div> <br> <div class="card"> <div class="card-header"> <h5 class="card-title text-primary">Paiments</h5> </div> <div class="card-body"> <div class="row col-12"> <div id="regl-array" class="col-12"> <?php $__currentLoopData = $commande->reglements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reglement): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="form-group mb-3 regl-array"> <div class="input-group"> <select name="type[]" class="form-control form-control-user hide-disabled"> <option value="avance" <?php if($reglement->type =='avance'): ?> selected <?php endif; ?>>Avance</option> <option value="reste" <?php if($reglement->type =='reste'): ?> selected <?php endif; ?>>Reste</option> </select> <input type="text" class="form-control form-control-user" name="montant[]" placeholder="montant" value="<?php echo e($reglement->montant); ?>"> <select name="method[]" class="form-control form-control-user hide-disabled"> <option value="espece" <?php if($reglement->method =='espece'): ?> selected <?php endif; ?>>Espéce</option> <option value="virement" <?php if($reglement->method =='virement'): ?> selected <?php endif; ?>>Virement</option> <option value="versement" <?php if($reglement->method =='versement'): ?> selected <?php endif; ?>>Versement</option> <option value="cheque" <?php if($reglement->method =='cheque'): ?> selected <?php endif; ?>>Chéque</option> <option value="cr" <?php if($reglement->method =='cr'): ?> selected <?php endif; ?>>Contre remboursement</option> </select> <input type="text" class="form-control form-control-user" name="num[]" placeholder="Num" value="<?php echo e($reglement->num); ?>"> </div> <div class="input-group"> <select name="banque[]" class="form-control form-control-user"> <option value="watania" <?php if($reglement->banque =='watania'): ?> selected <?php endif; ?>>Watania</option> <option value="CIH" <?php if($reglement->banque =='CIH'): ?> selected <?php endif; ?>>CIH</option> <option value="ste" <?php if($reglement->banque =='ste'): ?> selected <?php endif; ?>>Société générale</option> <option value="populaire" <?php if($reglement->banque =='populaire'): ?> selected <?php endif; ?>>Banque populaire</option> <option value="Attijari" <?php if($reglement->banque =='Attijari'): ?> selected <?php endif; ?>>Attijari WafaBanque</option> <option value="BMCE" <?php if($reglement->banque =='BMCE'): ?> selected <?php endif; ?>>BMCE</option> <option value="BMCI" <?php if($reglement->banque =='BMCI'): ?> selected <?php endif; ?>>BMCI</option> <option value="Barid" <?php if($reglement->banque =='Barid'): ?> selected <?php endif; ?>>Barid Banque</option> <option value="wafacash" <?php if($reglement->banque =='wafacash'): ?> selected <?php endif; ?>>Wafacash</option> </select> <input type="date" class="form-control form-control-user" name="date_reglement[]" value="<?php echo e($reglement->date_reglement->format('Y-m-d')); ?>"> <select name="status[]" class="form-control form-control-user"> <option value="payed" <?php if($reglement->status =='payed'): ?> selected <?php endif; ?>>Payé</option> <option value="nonpayed" <?php if($reglement->status =='nonpayed'): ?> selected <?php endif; ?>>Non payé</option> </select> <button type="button" class="btn btn-primary regl-array-remove"> <i class="fa fa-plus" aria-hidden="true"></i><i class="fa fa-times" aria-hidden="true"></i></button> </div> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <div class="form-group mb-3 regl-array"> <div class="input-group"> <select name="type[]" class="form-control form-control-user hide-disabled"> <option value="avance">Avance</option> <option value="reste">Reste</option> </select> <input type="text" class="form-control form-control-user" name="montant[]" placeholder="montant"> <select name="method[]" class="form-control form-control-user hide-disabled"> <option value="espece">Espéce</option> <option value="virement">Virement</option> <option value="versement">Versement</option> <option value="cheque">Chéque</option> <option value="cr">Contre remboursement</option> </select> <input type="text" class="form-control form-control-user" name="num[]" placeholder="Num" value="0"> </div> <div class="input-group"> <select name="banque[]" class="form-control form-control-user"> <option value="watania">Watania</option> <option value="CIH">CIH</option> <option value="ste">Société générale</option> <option value="populaire">Banque populaire</option> <option value="Attijari">Attijari WafaBanque</option> <option value="BMCE">BMCE</option> <option value="BMCI">BMCI</option> <option value="Barid">Barid Banque</option> <option value="wafacash">Wafacash</option> </select> <input type="date" class="form-control form-control-user" name="date_reglement[]"> <select name="status[]" class="form-control form-control-user"> <option value="payed">Payé</option> <option value="nonpayed">Non payé</option> </select> <button type="button" class="btn btn-primary regl-array-add"> <i class="fa fa-plus" aria-hidden="true"></i><i class="fa fa-times" aria-hidden="true"></i></button> </div> </div> </div> <div class="col-12"> <ul class="list-group w-100"> <li class="list-group-item d-flex justify-content-between align-items-center"> <span style="font-weight: bold">Le reste: </span> <span class="badge badge-success badge-pill"><span id="commande-reste-price"></span> DH</span> </li> </ul> </div> </div> </div> </div> <?php if($commande->status == 'pending'): ?> <div class="row col-12 justify-content-center pt-3"> <button type="submit" class="btn btn-success btn-user">Valider</button> </div> <?php endif; ?> </form> <?php $__env->stopSection(); ?> <?php $__env->startSection('scripts'); ?> <?php if(session()->has('show_client_modal')): ?> <script> $(document).ready(function() { $('#addClientModal').modal('show'); }); </script> <?php endif; ?> <div class="modal fade" id="addClientModal" tabindex="-1" role="dialog" aria-labelledby="addClientModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="addClientModalLabel"> J2HB | Ajouter Clients </h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form method="POST" action="<?php echo e(route('store_client')); ?>" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <input type="hidden" name="from_route" value="<?php echo e(URL::current()); ?>"> <div class="modal-body"> <div class="container-fluid"> <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="alert alert-danger"><?php echo e($error); ?></div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <div class="row col-12"> <div class="col-12"> <div class="form-group mb-3"> <input type="number" class="form-control form-control-user" name="nbdossier" id="nbdossier" placeholder="Numéro du dossier" value="<?php echo e(@old('nbdossier')); ?>" required> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="name" id="name" placeholder="Client" value="<?php echo e(@old('name')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="manager" id="manager" placeholder="Gérant" value="<?php echo e(@old('manager')); ?>" required> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="tel" class="form-control form-control-user" name="phone" id="phone" placeholder="Téléphone" value="<?php echo e(@old('phone')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="email" class="form-control form-control-user" name="email" id="email" placeholder="E-mail" value="<?php echo e(@old('email')); ?>" required> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="adress" id="adress" placeholder="Adresse" value="<?php echo e(@old('adress')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="ville" id="ville" placeholder="Ville" value="<?php echo e(@old('ville')); ?>" required> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="date" class="form-control form-control-user" name="date_j" id="date_j" value="<?php echo e(@old('date_j')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="url" class="form-control form-control-user" name="website" id="website" value="<?php echo e(@old('website')); ?>" placeholder="Siteweb"> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="cin" id="cin" placeholder="CIN" value="<?php echo e(@old('cin')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="agrement_number" id="agrement_number" placeholder="Nombre d'agrément" value="<?php echo e(@old('agrement_number')); ?>" required> </div> </div> </div> <div class="row col-12"> <div class="col-6"> <div class="form-group mb-3"> <input type="text" class="form-control form-control-user" name="ice" id="ice" placeholder="ICE" value="<?php echo e(@old('ice')); ?>" required> </div> </div> <div class="col-6"> <div class="form-group mb-3"><input type="text" class="form-control form-control-user" name="rc" id="rc" placeholder="RC" value="<?php echo e(@old('rc')); ?>" required></div> </div> </div> <div class="row col-12"> <div class="col-12"> <div class="input-group mb-3"> <div class="custom-file"> <input type="file" class="custom-file-input" name="upload" id="upload" aria-describedby="inputGroupFileAddon01" required> <label class="custom-file-label" for="inputGroupFile01"> Scanner CIN, Nb_agrement, RC, ICE...</label> </div> </div> </div> </div> <div class="row col-12"> <div class="col-12"> <div class="form-group mb-3"> <textarea name="remarques" class="form-control form-control-user" placeholder="Remarques" id="remarques" cols="75" rows="10"></textarea> </div> </div> </div> </div> <button type="submit" class="btn btn-primary btn-user">Ajouter</button> </div> </form> </div> </div> </div> <script> $(document).ready(function() { var total = <?php echo e($commande->total); ?>; var total_prices = total; var prod_array = $('.regl-array:last').clone(); $(document).on('click', '.regl-array-add', function(e) { if( total_prices == 0 ) { e.preventDefault(); return false; } $(this).removeClass('regl-array-add'); $(this).addClass('regl-array-remove'); prod_array = $("#regl-array").append(prod_array).find('.regl-array'); prod_array = prod_array.eq(prod_array.length - 1).clone(); $(document).find('[name="type[]"]').trigger('change'); }); $(document).on('click', '.regl-array-remove', function() { $(this).parents('.regl-array').remove(); $(document).find('[name="type[]"]').trigger('change'); }); $(document).on('change', '[name="type[]"]', function() { $(document).find('[name="type[]"]').find('option[value="avance"]').prop('disabled', false); $(document).find('[name="type[]"]').each(function(i, elem) { if( $(elem).val() == 'avance' ) { $(document).find('[name="type[]"]').not(elem).val('reste').find('option[value="avance"]').prop('disabled', true); } }); var type = $(this).val(); if( type == 'avance' ) { $(this).parents('.regl-array').find('[name="method[]"]').find('option[value="cr"]').prop('disabled', true); } else { $(this).parents('.regl-array').find('[name="method[]"]').find('option').prop('disabled', false); } }); $(document).on('input', '[name="montant[]"]', function() { var prices = 0; $(document).find('[name="montant[]"]').each(function(i, elem) { prices += parseFloat($(elem).val() ? $(elem).val() : 0); }); total_prices = total - prices; $('#commande-reste-price').text(total_prices); }); $(document).on('change', '[name="method[]"]', function() { var method = $(this).val(); $(this).next('[name="num[]"]').addClass('d-none'); if( method == 'cheque' ) { $(this).next('[name="num[]"]').removeClass('d-none'); } if( method == 'espece' ) { $(this).parents('.regl-array').find('[name="banque[]"]').val('watania').addClass('d-none'); } else { $(this).parents('.regl-array').find('[name="banque[]"]').removeClass('d-none'); } }); $(document).find('[name="type[]"]').trigger('change'); $(document).find('[name="method[]"]').trigger('change'); $(document).find('[name="montant[]"]').trigger('input'); }); </script> <script> $(document).ready(function() { $('#livreur').on('change', function() { var type = $(this).val(); $('[data-livr-type]').addClass('d-none'); $('[data-livr-type=' + type + ']').removeClass('d-none'); }).trigger('change'); }); </script> <script> $(document).ready(function() { $(document).on('change', '[name="type_facture"]', function() { var type = $(this).val(); var select = $(this); if( $('[name="num_facture"]').attr('data-stop-api') == type ) { $('[name="num_facture"]').val($('[name="num_facture"]').attr('data-stop-num')); return false; } $(select).prop('disabled', true); $.ajax({ type: "POST", data: { type: type }, dataType: "json", url: "<?php echo e(route('facture_api', ['user' => 'C'])); ?>", success: function(data) { $(select).prop('disabled', false); $('[name="num_facture"]').val(data.num); }, error: function(jqXHR, textStatus) { $(select).prop('disabled', false); } }) }); $('[name="type_facture"]').trigger('change'); }); $('#facture_type').on('change', function() { var type = $(this).val(); $('[data-facture-type]').addClass('d-none'); $('[data-facture-type=' + type + ']').removeClass('d-none'); }).trigger('change'); $(document).on('change', '[name="client_id"]', function() { var name = $(this).find("option:selected").attr('data-client-option'); if( !name ) name = ''; $('[data-client-name]').text(name); }); </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/formValider.blade.php ENDPATH**/ ?>