<?php 
//activamos almacenamiento en el buffer
//ob_start();
//session_start();
if (!isset($_SESSION['nombre'])) {
  header("Location: login.html");
}else{
  //if ($_SESSION['cxc']==1) {
  if ($_SESSION['proceso']==1) {  
  ?>
  
 
      <!-- Main content -->
      <section class="content">
        <!-- Default box -->
        <div class="row">
          <div class="col-md-12">
            <div class="box">
                <div class="box-header with-border">
                  
                    <div class="box-tools pull-right">
                      <h1 class="box-title">Proceso\Radar1
                    </div> 
                    
                </div>
                <!--box-header-->
                <!--centro-->
                <div class="form-group col-lg-12 col-md-12 col-xs-12">
                  <button class="btn bg-default btn-sm pull-left" onclick="iniciarrruta()" id="btnIniciar" type="button"><i class="fa  fa-hourglass-1"></i> Iniciar Día</button>
                  <button class="btn bg-default btn-sm pull-left" onclick="cerrarruta()" id="btnCerra" type="button"><i class="fa  fa-hourglass-3"></i> Cerrar Día</button>
                </div>
                <div class="panel-body table-responsive" id="listadoregistros">
                
                  
                  <div class="form-group col-lg-12 col-md-12 col-xs-12"></div>
                  <table id="tbllistado" class="table table-striped table-bordered table-condensed table-hover">
                    <thead>
                      <th>Opciones</th>
                      <th>Nombre</th>
                      <th>Tipo Documento</th>
                      <th>Nro. Documento</th>
                      <th>Teléfeno</th>
                      <th>Estado</th>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                     <!--  <th>Opciones</th>
                      <th>Nombre</th>
                      <th>Rif./Cédula</th>
                      <th>Saldo</th>
                      <th>Estado</th> -->
                      <th></th>
                      <th></th>
                      <th></th>
                      <th></th>
                      <th></th>
                      <th></th>
                    </tfoot>   
                  </table>
                </div>
                <!--CxC-->
                <div class="panel-body" style="height: 400px;" id="formularioregistros">
                  <form action="" name="formulario" id="formulario" method="POST"> 
                  <input class="form-control" type="hidden" name="idpagocliente" id="idpagocliente">
                      <input class="form-control" type="hidden" name="agenteretencion" id="agenteretencion">
                      <input class="form-control" type="hidden" name="idbancocuentap" id="idbancocuentap"> 
                      <input class="form-control" type="hidden" name="idpersona" id="idpersona">
                      <input class="form-control" type="hidden" name="idusuario" id="idusuario" value=<?php echo $_SESSION['idusuario'] ?>>
                      <input class="form-control" type="hidden" name="validado" id="validado">
                      <input class="form-control" type="hidden" name="idempresa_venta" id="idempresa_venta" value="<?php echo $_SESSION['idempresa_venta_empresa'] ?>" >
                      <input class="form-control" type="hidden" name="diferencia" id="diferencia" value="0.00">
                      <input class="form-control" type="hidden" name="idtipopagos" id="idtipopagos" value="PARCIAL">
                      <input class="form-control" type="hidden" name="total_pagob" id="total_pagob" value="0.00">
                      <input class="form-control" type="hidden" name="total_pago" id="total_pago" value="0.00">
                    <div class="form-group col-lg-8 col-md-8 col-xs-12">
                      <label for="">Nombre</label>
                      
                      <input class="form-control" type="text"  name="nombre" id="nombre" maxlength="100" placeholder="Nombre del cliente" readonly="readonly">
                    </div>
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Fecha</label>
                      <input class="form-control" type="date" name="fecha_hora" id="fecha_hora" required>
                    </div>
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Tasa de Cambio</label>
                      <input class="form-control" type="text" name="tasacambioventa" id="tasacambioventa"  value="<?php echo $_SESSION['idempresa_venta_empresa'] ?>" style="text-align:center;background-color:#cffedf;">
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Cuenta de Banco</label>
                        <select name="idbancocuenta" id="idbancocuenta" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                        <label for="">Método de Pago</label>
                        <select name="idformapago" id="idformapago" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div>
                     
                    <!-- <div class="form-group col-lg-6 col-md-6 col-xs-12">
                        <label for="">Tipo de Pago</label>
                        <select name="idtipopagos" id="idtipopagos" class="form-control selectpicker" data-Live-search="true" ></select>
                    </div> -->
                    
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <label for="">Referencia de Pago</label>
                      <!-- <input class="form-control" type="text" name="referencia" id="referencia" maxlength="20" placeholder="Referencia de Pago"> -->
                      <input class="form-control" type="text" name="referencia" id="referencia" placeholder="Referencia de Pago" oninput="this.value = this.value.replace(/[^0-9]/g, '')">
                    </div>
                   
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Monto del Pago Dollar</label>
                      <input class="form-control" type="text" name="montopago" id="montopago"  value="0,00" placeholder="0,00">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Monto del Pago Bolivares</label>
                      <input class="form-control" type="text" name="montopagob" id="montopagob"  value="0,00" placeholder="0,00">
                    </div>
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Total Saldo</label>
                      <input class="form-control" type="text" name="montosaldo" id="montosaldo"  value="0,00" placeholder="0,00" readonly>
                    </div>
                   
                    <div class="form-group col-lg-3 col-md-3 col-xs-12">
                      <label for="">Diferencia</label>
                      <input class="form-control" type="text" name="montopagod" id="montopagod"  value="0,00" placeholder="0,00">
                    </div>
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <label for="">NOTA DE CRÉDITO</label>
                      <div class="form-group">
                        <div class="radio">
                          <label>
                            <input type="radio" name="optionsRadios" id="notacredito1" value="NOTA DE CREDITO POR PRONTO PAGO">
                            POR PRONTO PAGO
                          </label>
                        </div>
                        <div class="radio">
                          <label>
                            <input type="radio" name="optionsRadios" id="notacredito2" value="NOTA DE CREDITO POR PAGO DIVISAS">
                            POR PAGO DIVISAS
                          </label>
                        </div>
                        <div class="radio">
                          <label>
                            <input type="radio" name="optionsRadios" id="notacredito3" value="NOTA DE CREDITO POR AJUSTE DE PRECIO">
                            POR AJUSTE DE PRECIO
                          </label>
                        </div>
                        <div class="radio">
                          <label>
                            <input type="radio" name="optionsRadios" id="notacredito4" value="NOTA DE CREDITO POR DEVOLUCION">
                            POR DEVOLUCIÓN
                          </label>
                        </div>
                      </div>
                      <input class="form-control" type="hidden" name="notacredito" id="notacredito">
                      <input class="form-control" type="hidden" name="tiponotacredito" id="tiponotacredito">
                    </div>

                    


                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                    <!-- class="table table-bordered table-hover nowrap" style="width:100%"
                    <table id="detalles" class="table table-striped table-bordered table-condensed table-hover"> -->
                      <div class="box-body table-responsive no-padding">
                        <div id="contenedor">  
                          <table id="detallescxc" class="table table-bordered table-hover">
                            
                          </table>
                        </div>
                      </div>  
                    </div>
                  </form>
                </div>
                <div class="box-footer" id="formularioregistros1">
                    <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button>
                    
                      
                    
                    <button class="btn bg-red btn-app pull-right" onclick="cancelarform()" id="btnCancelar" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button> 
                </div>

                <!--Pedido-->
                <div class="panel-body" style="height: 400px;" id="formularioregistrosp">
                  <form action="" name="formulariop" id="formulariop" method="POST">
                    <input class="form-control" type="hidden" name="idventa" id="idventa">
                    <input class="form-control" type="hidden" name="idtransportista" id="idtransportista" value="1">
                    <input class="form-control" type="hidden" name="idempresa_venta" id="idempresa_venta" value="<?php echo $_SESSION['idempresa_venta_empresa'] ?>" >
                    <input class="form-control" type="hidden" name="serie_comprobante" id="serie_comprobante" value="N/A">
                    <input class="form-control" type="hidden" name="num_comprobante" id="num_comprobante" value="N/A">
                    <input class="form-control" type="hidden" name="tipo_documento" id="num_comprobante">
                    <input class="form-control" type="hidden" name="num_documento" id="num_documento">
                    <input class="form-control" type="hidden" name="idvendedor" id="idvendedor">
                     <input class="form-control" type="hidden" name="tipo_comprobante" id="tipo_comprobante"> 
                    <input class="form-control" type="hidden" name="idusuario" id="idusuario" value=<?php echo $_SESSION['idusuario'] ?>>
                    <!-- <input class="form-control" type="hidden" name="idcliente" id="idcliente"> -->
                    <input class="form-control" type="hidden" name="validar" id="validar">
                    <input class="form-control" type="hidden" name="validado" id="validado">
                    <input class="form-control" type="hidden" name="tasa_dollar" id="tasa_dollar">
                    <input class="form-control" type="hidden" name="tasa_euro" id="tasa_euro">
                   
                    <input class="form-control" type="hidden" name="impuestoart18_empresa" id="impuestoart18_empresa" value="<?php echo $_SESSION['impuestoart18_empresa'] ?>" >
                    
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <label for="">Nombre</label>
                      <select name="idcliente" id="idcliente" class="form-control selectpicker" data-live-search="true" required>
                      </select>
                      
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <label for="">Despacho</label>
                      <select name="idclientedespacho" id="idclientedespacho" class="form-control selectpicker" data-live-search="true" required>
                      </select>
                      
                    </div>
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Fecha: </label>
                      <input class="form-control" type="date" name="fecha_hora1" id="fecha_hora1" required>
                    </div>
                    <input class="form-control" type="hidden" name="impuesto" id="impuesto" maxlength="20" placeholder="IVA" value=<?php echo $_SESSION['iva_empresa'] ?> readonly>
                    <div class="form-group col-lg-2 col-md-2 col-xs-6">
                      <label for="">Nro. Pedido: </label>
                      <input class="form-control" type="text" name="num_pedido" id="num_pedido" maxlength="20" placeholder="Número pedido" readonly>
                    </div>
                    <!-- Meraki -->
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Licencia de Licor</label>
                      <input class="form-control" type="text" name="licencia_licor" id="licencia_licor" readonly>
                    </div>
                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Tipo Comprobante </label>
                      <select name="tipo_comprobante1" id="tipo_comprobante1" class="form-control selectpicker" required>
                        <option value="Factura">Factura</option>
                        <option value="NotaEntrega">Nota de Entrega</option>
                       
                        
                      </select>
                    </div>

                    <div class="form-group col-lg-2 col-md-2 col-xs-12">
                      <label for="">Días de Crédito</label>
                      <input class="form-control" type="number" max="45" name="diacredito" id="diacredito" readonly>
                      <input class="form-control" type="hidden" name="iddiacredito" id="iddiacredito" readonly>
                    </div>
                    
                    <div class="form-group col-lg-12 col-md-12 col-xs-12">
                      <label for="">Observación</label>
                      
                      <input class="form-control" type="text" name="observacion" id="observacion" placeholder="Observación">
                     
                     
                    </div>
                  <!-- Meraki -->
                    <!-- table table-bordered table-hover -->
                    <!-- table table-striped table-bordered table-condensed table-hover -->
                    
                    <!-- <table id="detallesp" class="table table-bordered table-condensed table-hover"> -->
                    <div class="form-group col-lg-12 col-md-12 col-xs-12"> 
                      <div class="box-body table-responsive no-padding">  

                        <!-- <table id="detallesp" class="table table-bordered table-hover table-layout" style="width:100%">  -->
                        <table id="detallesp" class="table table-hover">
                          <thead style="background-color:#A9D0F5">
                          <tr>
                              <th style="text-align:center;width:45px"">Opciones</th> 
                              <th style="text-align:center;width:45px"">Articulo</th>
                              <th style="text-align:center;width:45px"">Cantidad</th>
                              <th style="text-align:center;width:45px"">Precio</th>
                              <th style="text-align:center;width:45px"">Subtotal</th>
                              <th style="text-align:center;width:45px"">Actualizar</th>
                            </tr>
                          </thead>
                          <tfoot>
                            <tr>
                              
                              <th>TOTAL</th>
                              <!-- <th align="right"><h4  align="right" id="totald"></h4></th> -->
                              <th align="right"><h4 align="right" id="totald"></h4>
                                <input type="hidden" name="total_venta1" id="total_venta1" disabled>
                                <input type="hidden" name="total_venta" id="total_venta">
                                <input type="hidden" name="total_ventad" id="total_ventad">
                              </th>
                              <th></th>
                              <th></th>
                              <th></th>
                              <th></th>
                            </tr>
                          </tfoot>
                          <tbody>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </form>
                </div>
                <div class="box-footer" id="formularioregistrosp1">
                  <div class="btn-group col-lg-12 col-md-12 col-xs-12">
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <a data-toggle="modal" href="#myModalA">
                        <button type="button" class="btn bg-blue btn-app pull-left" id="btnAgregarArt"><i class="fa fa-inbox"></i>Producto</button>
                      </a>
                      <a data-toggle="modal" href="#myModalAb">
                        <button type="button" class="btn bg-green btn-app pull-left" id="btnAgregarArtb"><i class="fa fa-inbox"></i>Producto</button>
                      </a> 
                      <a data-toggle="modal" href="#myModalAc">
                        <button type="button" class="btn bg-yellow btn-app pull-left" id="btnAgregarArtc"><i class="fa fa-inbox"></i>Producto</button>
                      </a>   
                      <a data-toggle="modal" href="#myModalAd">
                        <button type="button" class="btn bg-olive btn-app pull-left" id="btnAgregarArtd"><i class="fa fa-inbox"></i>Producto</button>
                      </a>
                      <a data-toggle="modal" href="#myModalAe">
                        <button type="button" class="btn bg-orange btn-app pull-left" id="btnAgregarArte"><i class="fa fa-inbox"></i>Producto</button>
                      </a>
                      <a data-toggle="modal" href="#myModalS">
                        <button type="button" class="btn bg-yellow btn-app pull-left" id="btnAgregarSer"><i class="fa fa-envelope"></i>Servicios</button>
                      </a>
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12" >
                      <label for="">Ingrese en codigo de barra </label>
                      <input class="form-control" type="text" name="cod_barra" id="cod_barra" maxlength="30" placeholder="Codigo Barra Producto" >
                      
                    </div>
                    <div class="form-group col-lg-4 col-md-4 col-xs-12">
                      <!-- <button class="btn bg-blue btn-app pull-right" type="submit" id="btnGuardar"><i class="fa fa-save"></i>  Guardar</button> -->
                      <!-- <a data-toggle="modal" href="#myModalT"> -->
                        <button class="btn bg-blue btn-app pull-right" type="submit" id="btnFacturar"><i class="fa fa-bank"></i>  Agregar Pedido</button>
                        <button class="btn bg-green btn-app pull-right" onclick="cerrarruta()" id="btnCerra1" type="button"><i class="fa  fa-close"></i> Cerrar Día</button>
                      <!-- </a> -->  
                      <button class="btn bg-red btn-app pull-right" onclick="cancelarform()" id="btnCancelar1" type="button"><i class="fa fa-arrow-circle-left"></i> Cancelar</button> 
                    </div>
                  </div>
                </div>
                 <!--Modal-->
                <div class="modal fade" id="myModalA" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Articulo</h4>
                      </div>
                      <!-- <div class="modal-body"> -->
                      <div class="modal-body table-responsive no-padding">
                        <!-- <table id="tblarticulos" class="table table-striped table-bordered table-condensed table-hover"> -->
                        <table id="tblarticulos" class="table table-hover">  
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="modal fade" id="myModalAb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Articulo</h4>
                      </div>
                       <!-- <div class="modal-body"> -->
                       <div class="modal-body table-responsive no-padding">
                        <!-- <table id="tblarticulosb" class="table table-striped table-bordered table-condensed table-hover"> -->
                        <table id="tblarticulosb" class="table table-hover">
                      
                        
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="modal fade" id="myModalAc" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
                    <!--  <div class="modal fade" id="myModalAc" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">-->
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Articulo</h4>
                      </div>
                      <div class="modal-body table-responsive no-padding">
                        <!-- <table id="tblarticulosc" class="table table-striped table-bordered table-condensed table-hover"> -->
                        <table id="tblarticulosc" class="table table-hover">
                          
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  <!-- </div> -->
                </div>
                <div class="modal fade" id="myModalAd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Articulo</h4>
                      </div>
                       <!-- <div class="modal-body"> -->
                       <div class="modal-body table-responsive no-padding">
                        <!-- <table id="tblarticulosb" class="table table-striped table-bordered table-condensed table-hover"> -->
                        <table id="tblarticulosd" class="table table-hover">
                      
                        
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="modal fade" id="myModalAe" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Articulo</h4>
                      </div>
                       <!-- <div class="modal-body"> -->
                       <div class="modal-body table-responsive no-padding">
                        <!-- <table id="tblarticulosb" class="table table-striped table-bordered table-condensed table-hover"> -->
                        <table id="tblarticulose" class="table table-hover">
                      
                        
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Código</th>
                            <th>Stock</th>
                            <th>Precio Venta</th>
                            <th>Nro. Lote</th>
                            <th>Fecha Vec.</th>
                            <th>Imagen</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="modal fade" id="myModalS" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 45% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione un Servicio</h4>
                      </div>
                      <div class="modal-body">
                        <table id="tblservicios" class="table table-striped table-bordered table-condensed table-hover">
                          <thead>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Precio</th>
                            <th>Porcenjate</th>
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th>Opciones</th>
                            <th>Nombre</th>
                            <th>Categoria</th>
                            <th>Precio</th>
                            <th>Porcentaje</th>
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="modal fade" id="myModalestado" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 25% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Seleccione Motivo de No Venta</h4>
                      </div>
                      <div class="modal-body">
                        <select name="motivonovisita" id="motivonovisita" class="form-control selectpicker" required>
                          <option value="0">Seleccione Motivo</option>
                          <option value="Cerrado">Cerrado</option>
                          <option value="Remodelacion">Remodelacion</option>
                          <option value="Clausurado">Clausurado</option>
                          <option value="Cambio de Ramo">Cambio de Ramo</option>
                          <option value="Restricciones Gubernamentales">Restricciones Gubernamentales</option>
                          <option value="Problemas Atmosfericos">Problemas Atmosfericos</option>
                          <option value="Poca rotación">Poca rotación</option>
                          <option value="Inventario Full">Inventario Full</option>
                          <option value="Clausurado">Pedidos Pendientes</option>
                          <option value="Moroso">Moroso</option>
                          <option value="Visita Quicenal">Visita Quicenal</option>
                          <option value="No Comercializa nuestros productos">No Comercializa nuestros productos</option>
                        </select>
                        <input class="form-control" type="hidden" name="idpersonan" id="idpersonan">
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-primary" type="button" id="btnmodalenviar">Enviar</button>
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="modal fade" id="myModalcobros" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog" style="width: 65% !important;">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Cobros del Documento: <label id="orden"></label> </h4>
                      </div>
                      <div class="modal-body">
                        <table id="tbcobros" class="table table-striped table-bordered table-condensed table-hover" style="width:100%">
                          <thead>

                            <th>Fecha</th>
                            <th>Referencia</th>
                            <th>Cuenta</th>
                            <th>Forma de Pago</th>
                            <th>Cobrado</th>
                            <th>Tasa</th>
                            
                          </thead>
                          <tbody>
                            
                          </tbody>
                          <tfoot>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            <th></th>
                            
                            
                          </tfoot>
                        </table>
                      </div>
                      <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">Cerrar</button>
                      </div>
                    </div>
                  </div>
                </div>
              <!--fin centro-->
            
          </div>
        </div>
        <!-- /.box -->
      </section>
      <!-- /.content -->
    </div>
    <?php 
  }else{
    require 'vistas/contenidos/noacceso-view.php'; 
  }
  ?>
          <!-- Main Footer -->
          <?php include "vistas/modulos/mainfooter.php";?>
      </div>

      <!-- ./wrapper -->
      <!-- REQUIRED JS SCRIPTS -->
      <?php include "vistas/modulos/script.php";?>
      <script src="vistas/scripts/radarchocoboca185.js"></script>
      </body>
  </html> 
<?php  
}
  ob_end_flush();
?>
