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


<div id="contenedor_interno" class="container-fluid">
    <div class="row ">
      <div class="col-md-12">
        <nav aria-label="breadcrumb">
          <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="<?php echo e(route('ventas.dashboard')); ?>">Solicitud de orden de Produción</a></li>
            <li class="breadcrumb-item active" aria-current="page">Nueva</li>
          </ol>
        </nav>
        <form action="<?php echo e(route('ventas.orden_produccion_ok',$op->id)); ?>" method="POST">
          <?php echo csrf_field(); ?>
          <input type="submit" href="<?php echo e(route('ventas.cliente')); ?>" class="botonColor" value="Crear Orden Producción" />
      </div>
      <hr>
    </div>
</div>

<div id="contenedor_contenido" class="container-fluid px-lg-5">
  <div class="row">
    <div class="col-md-12">
      <h2>Solicitud Orden de Produción</h2>
    </div>
    <div class="col-md-12">
     
        <div class="row">
          <div class="col-md-6">
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Es para inventario</label>
              <div class="col-sm-8">
                <input class="form-check-input" <?php echo e($op->inventario==1 ? "checked" : ""); ?> type="checkbox" id="gridCheck" name="inventario" value="1">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Cliente</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext" value="<?php echo e($op->cliente->nombre); ?>" placeholder="">
                <input type="hidden" class="form-control-plaintext" name="id_cliente" value="<?php echo e($op->id_cliente); ?>">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Producto</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext" value="<?php echo e($op->producto->nombre); ?>" placeholder="">
                <input type="hidden" class="form-control-plaintext" name="id_producto" value="<?php echo e($op->id_producto); ?>">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Cantidades para producir</label>
              <div class="col-sm-8">
                <input type="text" id="cantidad" readonly class="form-control-plaintext" name="cantidad" value="<?php echo e($op->cantidad); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Fecha Prevista:</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext daterange-single" name="fecha_prevista" value="<?php echo e(date("d-m-Y", strtotime($op->fecha_prevista))); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Lista de materiales</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext" name="lista_materiales" value="<?php echo e($op->lista_materiales); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Condiciones de entrega</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext" name="condiciones_entrega" value="<?php echo e($op->condiciones_entrega); ?>" placeholder="">
              </div>
            </div>
          </div>


          <div class="col-md-6">

            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Vendedor</label>
              <div class="col-sm-8">
                <input type="text" readonly class="form-control-plaintext" value="Admin" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Número de cotización</label>
              <div class="col-sm-8">
                <input type="text" class="form-control-plaintext" value="CO/<?php echo e($op->id_cotizacion); ?>" placeholder="">
                <input type="hidden" name="id_cotizacion" value="<?php echo e($op->id_cotizacion); ?>">
                <input type="hidden" name="id_cotizacion_producto" value="<?php echo e($op->id_cotizacion_producto); ?>">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Número de orden compra</label>
              <div class="col-sm-8">
                <input type="text" class="form-control-plaintext" name="numero_oc" value="<?php echo e($op->numero_oc); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">kgs por Millar</label>
              <div class="col-sm-8">
                <input id="kgs_millar" name="kgs_millar" type="text" onchange="materialProcesar(this)" class="form-control-plaintext" value="<?php echo e($op->kgs_millar); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Kgs a Procesar</label>
              <div class="col-sm-8">
                <input type="text" id="kgProcesar" name="kgs_procesar" readonly class="form-control-plaintext" value="<?php echo e($op->kgs_procesar); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Micras</label>
              <div class="col-sm-8">
                <input type="text"  class="form-control-plaintext" name="micras" value="<?php echo e($op->micras); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Caracteristicas</label>
              <div class="col-sm-8">
                <input type="text"  class="form-control-plaintext" name="caracteristicas" value="<?php echo e($op->caracteristicas); ?>" placeholder="">
              </div>
            </div>
            <div class="form-group row">
              <label for="" class="col-sm-4 col-form-label">Observaciones</label>
              <div class="col-sm-8">
                <input type="text"  class="form-control-plaintext" name="observaciones" value="<?php echo e($op->observaciones); ?>" placeholder="">
              </div>
            </div>
          </div>
        </div>
        <!-- Productos -->
        <!--
        <div class="row">
          <div class="col-md-12">
            <ul class="nav nav-tabs" id="myTab">
              <li class="nav-item">
                  <a href="#home" class="nav-link" data-toggle="tab">Materiales consumidos</a>
              </li>
              <li class="nav-item">
                  <a href="#profile" class="nav-link" data-toggle="tab">Productos finalizados</a>
              </li>
            </ul>
            <div class="tab-content">
              <div class="tab-pane fade" id="home">
                <table class="table">
                  <thead>
                    <tr>
                      <th scope="col">Producto</th>
                      <th scope="col">Unidad de medida</th>
                      <th scope="col">Seguimiento</th>
                      <th scope="col">A consumir</th>
                      <th scope="col">Reservado</th>
                      <th scope="col">Consumido</th>
                    </tr>
                  </thead>
                  <tbody id="contenedorProductos">
                    <tr class="producto">
                      <td><input type="text"></td>
                      <td><input type="text"></td>
                      <td><input type="text"></td>
                      <td><input type="text"></td>
                      <td><input type="text"></td>
                      <td><input type="text"></td>
                    </tr>
                  </tbody>
                </table>
                <a class="botonColor" onclick="nuevaFila()">Agregar registro</a>
                <hr>                
              </div>
              <div class="tab-pane fade" id="profile">
                
              </div>

            </div>
        </div>
        -->
      </form>

    </div>
  </div>
</div>
<script>
  var kgs_millar=document.getElementById('kgs_millar');
  materialProcesar(kgs_millar)

  function nuevaFila(){
    var row = document.getElementsByClassName("producto"); // find row to copy
    console.log(row);
    var table = document.getElementById("contenedorProductos"); // find table to append to
    var clone = row[0].cloneNode(true); // copy children too
    table.appendChild(clone); // add new row to end of table
  }
  function materialProcesar(element){
    
    var cantidad=document.getElementById('cantidad').value;
    var kgMillar=element.value;
    var total=parseFloat(kgMillar)*parseFloat(cantidad);
    document.getElementById('kgProcesar').value=total;
    console.log(total);
    
  }
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('ventas.menu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\erp\resources\views/ventas/orden_produccion_ok.blade.php ENDPATH**/ ?>