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

    <div class="sixteen wide tablet fourteen wide computer column ">
        <div class="ui segment">
            
            <h4 class="ui dividing header teal centered">EMITIR GUIA DE REMISION DE TRANSPORTISTA</h4>
            <br>

            <form class="ui form" id="frmNuevo" autocomplete="off">

                
                <div class="four fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label" >Documento Identidad del Remitente</div>
                    </div>
                    <div class="four wide field">
                        <div class="ui action small input" >
                              <input type="text" id="numero_documento" name="numero_documento"  placeholder="Buscar..." maxlength="11">
                              <div class="ui icon button" id="loading_doc" title="Clic para Consultar"><i class="search icon"></i>&nbsp;SUNAT</div>
                        </div>
                    </div>
                    <div class="four wide field">
                        <div class="ui fluid large white label">Tipo Documento Remitente</div>
                    </div>
                    <div class="three wide field">
                         <select class="ui small selection dropdown" name="id_tipo_documento" id="id_tipo_documento">
                            <option value="1">RUC</option>
                            <option value="2">DNI</option>
                        </select>  
                    </div> 

                </div>

                <div class="three fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">Razon Social del Remitente</div>
                    </div>
                    <div class="eleven wide field">
                        <div class="ui small input">
                            <input type="text" value="" name="nombre" id="nombre_cliente"  oninput="$.upperCase(this)" maxlength="200" readonly>
                        </div>  
                    </div>
                </div>

                <div class="three fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">Direccion de Partida</div>
                    </div>
                    <div class="eleven wide field">
                        <div class="ui small input">
                            <input type="text" maxlength="100" id="punto_partida" name="punto_partida" value="" oninput="$.upperCase(this)">
                        </div> 
                    </div>
                </div>


                <div class="ui divider"></div>
                                <br>

                <div class="four fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label" >Documento Identidad del Destinatario</div>
                    </div>
                    <div class="four wide field">
                        <div class="ui action small input" >
                              <input type="text" id="numero_documento2" name="numero_documento2"  placeholder="Buscar..." maxlength="11">
                              <div class="ui icon button" id="loading_doc3" title="Clic para Consultar"><i class="search icon"></i>&nbsp;SUNAT</div>
                        </div>
                    </div>
                    <div class="four wide field">
                        <div class="ui fluid large white label">Tipo Documento Destinatario</div>
                    </div>
                    <div class="three wide field">
                         <select class="ui small selection dropdown" name="id_tipo_documento2" id="id_tipo_documento2">
                            <option value="1">RUC</option>
                            <option value="2">DNI</option>
                        </select>  
                    </div> 

                </div>

                <div class="three fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">Razon Social del Destinatario</div>
                    </div>
                    <div class="eleven wide field">
                        <div class="ui small input">
                            <input type="text" value="" name="nombre2" id="nombre_cliente2"  oninput="$.upperCase(this)" maxlength="200" readonly>
                        </div>  
                    </div>
                </div>

                <div class="three fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">Direccion de Llegada</div>
                    </div>
                    <div class="eleven wide field">
                        <div class="ui small input">
                            <input type="text" maxlength="100" id="punto_llegada" name="punto_llegada" value="" oninput="$.upperCase(this)">
                        </div> 
                    </div>
                </div>


                <div class="ui divider"></div>
                                <br>


                <div class="four fields">

                    <div class="four wide field">
                        <div class="ui fluid large white label">RUC Empresa de Transporte</div>
                    </div>

                    <div class="six wide field">
                        <div class="ui action small input" >
                              <input type="text" id="documento_transportista" value= "<?php echo e($empresa->ruc); ?>" name="documento_transportista"  placeholder="Buscar..." maxlength="11">
                              <div class="ui icon button" id="loading_doc2" title="Clic para Consultar"><i class="search icon"></i>&nbsp;BUSCAR EN SUNAT</div>
                        </div>
                    </div>

                   

                    <div class="two wide field">
                        <div class="ui fluid small green button btn_buscar_cliente" title="Clic para ver empresa de transportes"><i class="search icon"></i>VER</div>
                        
                    </div>
                    <div class="three wide field">
                         <select class="ui small search selection dropdown" name="motivo">
                            <option value="NO">Es Transporte Propio</option>
                            <option value="SI">Es Transporte Subcontratado</option>
                        </select>  
                    </div>
                </div>

                <div class="four fields">
                   

                     <div class="four wide field">
                        <div class="ui fluid large white label">Nombre Empresa de Transporte</div>
                    </div>
                    <div class="six wide field">
                        <div class="ui small input">
                            <input type="text" maxlength="200" id="nombre_transportista" value= "<?php echo e($empresa->razon_social); ?>"  name="nombre_transportista"  oninput="$.upperCase(this)" readonly>
                        </div> 
                    </div> 

                    <div class="two wide field">
                        <div class="ui fluid large white label">Licencia de Conducir</div>
                    </div>
                    <div class="three wide field">
                        <div class="ui small input">
                            <input type="text"  id="licencia" name="licencia" maxlength="9" oninput="$.upperCase(this)" placeholder="Z87654321">
                        </div> 
                    </div>
                </div> 


                <div class="six fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">DNI del Chofer</div>
                    </div>
                    <div class="two wide field">
                        <div class="ui small input">
                            <input type="text" id="dni_chofer"  name="dni_chofer" maxlength="8" placeholder="87654321">
                        </div> 
                    </div>

                    <div class="two wide field">
                        <div class="ui fluid large white label">Nombre del Chofer</div>
                    </div>
                    <div class="two wide field">
                        <div class="ui small input">
                            <input type="text" id="nombre_chofer"  name="nombre_chofer" maxlength="20" oninput="$.upperCase(this)" placeholder="JUAN">
                        </div> 
                    </div>

                    <div class="two wide field">
                        <div class="ui fluid large white label">Apellido del Chofer</div>
                    </div>
                    <div class="three wide field">
                        <div class="ui small input">
                            <input type="text" id="apellido_chofer"  name="apellido_chofer" maxlength="20" oninput="$.upperCase(this)" placeholder="QUISPE">
                        </div> 
                    </div>

                </div>  


                <div class="six fields">

                    <div class="four wide field">
                        <div class="ui fluid large white label">Placa del Vehiculo</div>
                    </div>
                    <div class="two wide field">
                        <div class="ui small input">
                            <input type="text" id="marca_placa"  name="marca_placa" maxlength="6" oninput="$.upperCase(this)" placeholder="XYZ123">
                        </div> 
                    </div>

                    <div class="two wide field">
                        <div class="ui fluid large white label">Peso de la carga (KG)</div>
                    </div>
                    <div class="two wide field">
                        <div class="ui small input">
                            <input type="text" id="peso"  name="peso" maxlength="10" oninput="$.upperCase(this)" placeholder="2000">
                        </div> 
                    </div>

                    <div class="two wide field">
                        <div class="ui fluid large white label">Fecha de Traslado</div>
                    </div>
                    <div class="three wide field">
                        <div class="ui small input">
                            <input type="text" class="fecha_fut_hoy hasDate" name="fecha_traslado" >
                        </div> 
                    </div>
                </div>  

                 <div class="four fields">
                    <div class="four wide field">
                        <div class="ui fluid large white label">Observacion</div>
                    </div>
                    <div class="six wide field">
                        <div class="ui small input">
                            <input type="text"  name="observacion" maxlength="200" placeholder="TARJETA UNICA DE CIRCULACION" oninput="$.upperCase(this)">
                        </div> 
                    </div>
                    <div class="two wide field">
                        <div class="ui fluid large white label">Documento que Sustenta</div>
                    </div>
                    <div class="three wide field">
                        <div class="ui small input">
                            <input type="text"  name="sustento" maxlength="15" oninput="$.upperCase(this)" placeholder="F001-00123">
                        </div> 
                    </div>
                </div>  

     
            <br><br>

            <div class="four fields">
                <div class="four wide field">
                    <div class="ui fluid large white label">Buscar producto</div>
                </div>
                <div class="eight wide field">
                    <select class="ui search selection " name="id_prod">
                        
                    </select> 
                </div>
                

                <div class="three wide field">
                    <div class="ui fluid small green button btn_buscar_producto" title="Clic para ver lista de productos"><i class="search icon"></i>Ver Lista de Productos</div>
                </div>
            </div>

            <br>
            

            <table class="ui table">
                <thead>
                    <tr>
                        <th class="center aligned">Nombre del Producto</th>
                        <th class="center aligned" data-tooltip="Unidad de Medida" data-position="top center" data-inverted="">Unidad de Medida</th>
                        <th class="center aligned" data-tooltip="Cantidad a trasladar" data-position="top center" data-inverted="">Cantidad</th>
                        <th class="center aligned" data-tooltip="Acciones" data-position="top center" data-inverted="">Acciones</th>
                    </tr>
                </thead>
                <tbody id="tbody">
                  

                </tbody>
            </table>

        </form>

            <div class="form_footer">
                <a class="ui small left  floated default button" href="<?php echo e(URL::previous()); ?>"><i class="arrow left icon"></i>REGRESAR</a>

               
                <input style="visibility: hidden;" type="text" name="total_venta" id="total_venta" >
                

                <div class="ui right floated primary button btn_registrar"><i class="check icon"></i>EMITIR GUIA</div>
            </div>

        </div>
    </div>

    <!--start register modal -->
    <div class="ui small basic modal" id="register_modal">
        <div class="ui icon header"><i class="circular inverted white shipping fast icon"></i>Emitir Guia de Remision</div>
        <div class="content" style="text-align: center; font-size: 16px">
          <p>¿Desea emitir la guia de remision?</p>
        </div>
        <div class="actions">
            <div class="ui red basic cancel inverted button" title="Haga clic para salir"><i class="remove icon"></i>Cancelar</div>
            <div class="ui green ok inverted button" title="Haga clic para confirmar"> <i class="checkmark icon"></i>Emitir</div>
        </div>
    </div>
    <!--end register modal -->

    <!--start buscar cliente modal -->
    <div class="ui standard large modal" id="buscar_cliente_modal">
        <div class="header">Buscar Transportista</div>
        <div class="scrolling content">
  
            <div class="ui action small input"  autocomplete="off">
                <input type="text" id="buscar_cliente" name="buscar_cliente" placeholder="Cliente a buscar...">
                <div class="ui icon button" id="btn_buscar_cli" title="Clic para buscar"><i class="search icon"></i></div>
            </div> 
            <table class="ui celled striped table" id="tabla_clientes">
                <thead>
                    <tr>
                        <th class="head_table">N°</th>
                        <th class="head_table">Empresa de Transportes</th>
                        <th class="head_table">Numero de RUC</th>
                        <th class="head_table">Placa Vehiculo</th>
                        <th class="head_table">Licencia Chofer</th>
                        <th class="head_table">Acciones</th>
                    </tr>
                </thead>
                <tbody id="tbody_clientes">
                   <?php /**/ $i = 1/**/ ?>
                    <?php $__currentLoopData = $transportista; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($i); ?></td>
                        <td><?php echo e($row->nombre_transportista); ?></td>
                        <td><?php echo e($row->documento_transportista); ?></td>
                        <td><?php echo e($row->marca_placa); ?></td>
                        <td><?php echo e($row->licencia); ?></td>
                        <td>                            
                            <div class="ui mini vertical animated positive button btn_seleccionar_cliente" title="Seleccionar este cliente" data-nombre="<?php echo e($row->nombre_transportista); ?>" data-documento="<?php echo e($row->documento_transportista); ?>" data-licencia="<?php echo e($row->licencia); ?>" data-placa="<?php echo e($row->marca_placa); ?> "  data-nc="<?php echo e($row->nombre_chofer); ?>"  data-ac="<?php echo e($row->apellido_chofer); ?>" data-dc="<?php echo e($row->dni_chofer); ?>">
                                <div class="hidden content">Elegir</div>
                                <div class="visible content"><i class="check icon"></i></div>
                            </div>
                        </td>
                    </tr>
                    <?php /**/ $i++ /**/ ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
        <div class="actions" >
            <div class="ui left floated red right labeled icon deny button" style="margin-bottom: 1em">Cerrar<i class="times icon"></i></div>
        </div>
    </div>
    <!--end buscar cliente modal -->

      <!--start buscar producto modal -->
    <div class="ui standard large modal" id="buscar_producto_modal">
        <div class="header">Buscar Productos</div>
        <div class="scrolling content">
            <div class="ui disabled inverted dimmer" id="loader_busqueda">
                <div class="ui text loader">Procesando...</div>
            </div>
            <div class="ui action small input"  autocomplete="off">
                <input type="text" id="buscar_producto" name="buscar_producto" placeholder="Producto a buscar...">
                <div class="ui icon button" id="btn_buscar_prod" title="Clic para buscar"><i class="search icon"></i></div>
            </div> 
            <table class="ui celled striped table" id="tabla_productos">
                <thead>
                    <tr>
                        <th class="head_table">N°</th>
                        <th class="head_table">Producto</th>  
                        <th class="head_table">Unidad de Medida</th>   
                        <th class="head_table">Stock</th>                 
                        <th class="head_table">Precio S/</th>
                        <th class="head_table">Accion</th>
                    </tr>
                </thead>
                <tbody id="tbody_productos">
                   <?php /**/ $i = 1/**/ ?>
                    <?php $__currentLoopData = $producto->sortBy('producto.nombre'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr data-table="<?php echo e($row->id_producto); ?>">
                        <td><?php echo e($i); ?></td>
                        <td><?php echo e($row->producto->nombre); ?> <?php echo e($row->producto->descripcion); ?> </td>
                        <td><?php echo e($row->producto->unidad_medida->nombre); ?> </td>
                        <td><?php echo e($row->stock < 1000001 ? 'AGOTADO' : $row->stock - 1000000); ?></td>
                        <td>
                            <?php echo e($row->producto->precio); ?>

                        </td>
                        <td>
                            <div class="ui mini vertical animated green button btn_seleccionar_producto" title="Click para seleccionar este producto" data-id="<?php echo e($row->id_producto); ?>" >
                                <div class="hidden content">Añadir</div>
                                <div class="visible content"><i class="check icon"></i></div>
                            </div>
                        </td>
                    </tr>
                    <?php /**/ $i++ /**/ ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
        <div class="actions" >
            <div class="ui left floated red right labeled icon deny button" style="margin-bottom: 1em">Cerrar<i class="times icon"></i></div>
        </div>
    </div>
    <!--end buscar producto modal -->
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('js/guia/nuevo_transportista.js')); ?>"></script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layout.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>