%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/storage/framework/views/
Upload File :
Create Path :
Current File : //var/www/html/storage/framework/views/684506d749bc402c9793706b50b30dfda59d7c3e.php


<?php $__env->startSection('title'); ?>
Valider la commande
<?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 && $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->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 sortie du stock</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" disabled>
                            <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); ?>" disabled>
                    </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" disabled>
                            <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">
                            <select name="client_id" class="form-control form-control-user" disabled>
                                <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>
                    </div>
                </div>
                <div class="col-6">
                    <div class="form-group mb-3">
                        <select name="livreur" id="livreur" class="form-control form-control-user" disabled>
                            <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); ?>" disabled>
                    </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); ?>" disabled>
                    </div>
                </div>
                <div class="col-6">
                    <div class="form-group mb-3">
                        <select name="frais_livraison" class="form-control form-control-user" disabled>
                            <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 font-weight-bold 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" disabled readonly>
                                <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); ?>" disabled readonly>
                            <select name="method[]" class="form-control form-control-user hide-disabled" disabled readonly>
                                <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); ?>" disabled readonly>
                        </div>
                        <div class="input-group">
                            <select name="banque[]" class="form-control form-control-user" disabled readonly>
                                <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')); ?>" disabled readonly>
                            <select name="status[]" class="form-control form-control-user" disabled readonly>
                                <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>
                        </div>
                    </div> 
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </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 != 'unstocked'): ?>
    <div class="row col-12 justify-content-center pt-3">   
        <button type="submit" class="btn btn-success btn-user">Sortie de stock</button>
    </div>  
    <?php endif; ?>
</form>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('scripts'); ?>
<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>
<?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/unstocked.blade.php ENDPATH**/ ?>

Zerion Mini Shell 1.0