

<?php $__env->startSection('title','Manage Quotation - Purcahse Quotation'); ?>

<?php $__env->startSection('content'); ?>

    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">

            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Quotation Make </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <a href="<?php echo e(route('individual.new.requisition.add', $invoice_requisition->id)); ?>" type="button" class="btn btn-success"><i class="fa fa-plus" ></i>&nbsp;Add New Item</a>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>


    <!-- Main content -->
    <section class="content">
        <div class="col-lg-12">

            <div class="card"><br>
                <div class="card-body">
                    <div class="row">
                        
                        <div class="col-lg-12 table-responsive" >

                            <h4 class="text-left " >Requisition No :  <label style="padding: 5px 15px;" class="label-info">  <?php echo e($invoice_requisition->requisition->requisition_id); ?> </label>
                                
                            </h4>
                            <br>
                                <table class="table table-hover table-bordered capitalize display hide_action_column" id="myTable" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th> #SL</th>
                                            <th> Item Name</th>
                                            <th> Item Code</th>
                                            <th> Section</th>
                                            <th> Group</th>
                                            <th> Unit</th>
                                            <th  width="10%"> Qty</th>
                                            <th  width="10%"> Price</th>
                                            <th  width="30%">Remarks</th>
                                            <th>Save Qty</th>
                                        </tr>
                                    </thead>
                                <tbody>
                                <?php echo e(Form::open(['route'=>['inventory.quotation.store',$invoice_requisition->id]])); ?>

                                <?php $i=0; ?>
                                <?php if($quotations->count()>0): ?>
                                    <?php $__currentLoopData = $quotations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $requisition): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        
                                        <tr>
                                            <td> <?php echo e(++$i); ?> </td>
                                            <td> <?php echo e($requisition->product ? $requisition->product->name : "N/A"); ?> </td>
                                            <td> <?php echo e($requisition->product ? $requisition->product->item_code : "N/A"); ?> </td>
                                            <td> <?php echo e($requisition->product->department ? $requisition->product->department->name : "N/A"); ?> </td>
                                            <td> <?php echo e($requisition->product->group ? $requisition->product->group->name : "N/A"); ?> </td>
                                            <td> <?php echo e($requisition->product->unit ? $requisition->product->unit->name : "N/A"); ?> </td>
                                            <td>
                                                <input type="number" name="approved_qty[]" value="<?php echo e($requisition->qty); ?>" readonly id="approved_qty_<?php echo e($requisition->id); ?>" class="approved_qty form-control"/>
                                            </td>
                                           <td>
                                                <input type="hidden" name="requisition_product_id[]" value="<?php echo e($requisition->id); ?>" class="form-control form-control-sm" />
                                                <input type="number" step="0.000001" name="price[]"  class="form-control"/>
                                            </td>
                                            <td><input type="text" name="product_remarks[]" id="product_remarks_<?php echo e($requisition->id); ?>" value="<?php echo e($requisition->checking_note); ?>" placeholder="Brand:Japanese, Origin:Japan etc." class="form-control"/></td>
                                            <td class="text-center"><button onclick="saveQty('<?php echo e($requisition->id); ?>')" type="button" class="btn btn-primary">Save Qty & Remarks</button></td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                                <tbody>

                            </table>
                            <br>

                        </div>
                        
                        <div class="col-lg-12">
                            <input type="textarea" name="note" value="<?php echo e($requisition->note); ?>" class="form-control" rows=5 cols=5/>
                            
                            <br>
                        </div>

                        <div class="col-lg-4">
                            <select id="supplier_id" name="supplier_id" class="form-control">
                                <option value="<?php echo e(0); ?>">Select Supplier / Party</option>
                                <?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $supplier): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($supplier->id); ?>"> <?php echo e($supplier->name ."-". $supplier->phone); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            <span style="height: 10px; display: block;background: #fff;"></span>
                        </div>

                        <div class="col-lg-4">
                            <?php echo e(Form::submit('Save Quotation',['class'=>'form-control btn-info'])); ?>

                        </div>

                        <?php echo e(Form::close()); ?>


                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->

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


<?php $__env->startSection('style'); ?>
    <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo e(asset('plugins/datatables/dataTables.bootstrap4.css')); ?>">
    <link href='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css' rel='stylesheet' type='text/css'>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('css'); ?>
    <style>
        .capitalize label,.capitalize th{
            text-transform: capitalize!important;
        }
        .table td, .table th {
            padding: 0.40rem;
            vertical-align: top;
            FONT-SIZE: 14PX;
            border-top: 1px solid #dee2e6;
            font-family: monospace;
            font-weight: normal;
        }
        table.dataTable thead > tr > th.sorting_asc,
        table.dataTable thead > tr > th.sorting_desc,
        table.dataTable thead > tr > th.sorting,
        table.dataTable thead > tr > td.sorting_asc,
        table.dataTable thead > tr > td.sorting_desc,
        table.dataTable thead > tr > td.sorting {
            padding-right: 30px;
            font-size: 13px;
            background: #000;
            color: #fff;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('plugin_for_datatable_buttons'); ?>
    

    
    
    

<?php $__env->stopSection(); ?>
<?php $__env->startSection('plugin'); ?>
    <script type="text/javascript">
        function saveQty(id){
            var price = $('#approved_qty_'+id).val();
            var remarks = $('#product_remarks_'+id).val();
            if(price > 0){
                window.open('<?php echo e(url('Inventory/save-requisition-product-qty')); ?>/'+id+'&'+price+'*'+remarks ,'_parent');
            }
        }
        $(".approved_qty").click(function(){
            $(".approved_qty").not(this).attr('readonly','readonly');
            $(this).removeAttr('readonly');

        });
        $('#supplier_id').select2();
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.fixed', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/welluugs/purchase.wellgrouperp.com/resources/views/inventory/purchase/add-quotation-inventory-requisition.blade.php ENDPATH**/ ?>