{% load static %}
<!DOCTYPE html>
<html lang="es">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
  <title> ARQUEO  GENERAL DE CAJA</title>
  <link href="{% static 'Bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
  <link href="{% static 'Bootstrap/css/bootstrap-datetimepicker.css' %}" rel="stylesheet">
  <link href="{% static 'Bootstrap/css/sweet-alert.css' %}" rel="stylesheet">
  <script src="{% static 'Bootstrap/js/jquery-1.11.3.min.js' %}"></script>
  <style type="text/css">
    td.row{
        padding: 2px;
        border-right-width: 1px;
        border-right-color: #4C4B4B;
        border-right-style: solid;
        margin-top: 0px;
        border-bottom-width: 1px;
        border-bottom-style:dashed;
        border-bottom-color: #7A7979;
    }
    div.main {
        position: absolute;
        width: 1350px;
        height: auto;
    }
    body{
      font-size: 10px;
    }
  </style>
   
</head>
<body>
  <div class="row" >
    <div class="" role="alert" align="center" id="ExitoMensaje">
      <h4 id="texto"></h4>
    </div>
  </div>
  <div class="row">
    <div class="col-md-1 col-md-offset-1">
      <a class="btn btn-danger"  href="/Lista_liquidaciones_admin_tem/" role="button">ATRAS</a>
    </div>
    <div class="col-md-1">
      <button type="button" class="btn btn-primary" id="refresh">Actualizar</button>
    </div>
  </div>
  <!--
  <div class="row">
    <div class="col-md-4 col-md-offset-1">
      <div class="checkbox" id="campoChk">
        <label>
          <input type="checkbox" id="cierrefecha" value="1"><h5>Ver movimiento de otra fechas?</h5>
        </label>
      </div>
    </div>
  </div>-->
<!--
  <div class="col-md-4 col-md-offset-1">
      <div class="checkbox" id="cheksS">
        <label >
          <input type="checkbox" id="chekSS" value="1" style="margin-top: 12px;"><h4>Arqueo Solo Soles?</h4>
        </label>
      </div>
  </div>-->
 <div id ="progreso_ajax"class="row" hidden>
  <br>
  <div class="col-md-12">
    <div class="progress">
      <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
      </div>
    </div>
  </div>
</div>
<br>
<div class="main" id="campoI">
  <div class="imp">
      <div>
        <img src="{% static 'img/btt.png' %}" width="1%" height="1%" style="margin-left:40px;margin-right:40px"> <label> CONSORCIO IMPERIAL</label>  <label style="margin-left:40px"> FECHA: <strong id="fechaOperacion"> </strong> </label>
      </div>
      <br>
      <div style="margin-left:40px">
        TRANSFERENCIAS Y DEPOSITOS
      </div>
      <br>
      <div style="margin-left:40px">
        BASE: <strong> {{ oficina }}</strong>
      </div>
      <div style="margin-left:40px">
        CAJA: <strong> {{ nomCaja }}</strong>
      </div>
      <br>
      <div style="margin-left:40px">
        OPERADOR: <strong >{{ operador }}</strong>
      </div>
      <br>
      <div style="margin-left:40px">
        DESDE: <strong id="fechad">{{ fd }}</strong><br>
        HASTA: <strong id="fechah">{{ fh }}</strong>
      </div>
  </div>
  <br>
  <div class="imp" style="text-align:center">
    <strong> MOVIMIENTOS VENTANILLA - CUADRE CAJA</strong>
  </div>
  <!-- TRANSFERENCIAS CREADAS-->
  <br>
  <div class="imp" id="stdo">
    <div >
      <table style="margin: 0 auto">
        <tr>
          <td width="70%">
            <strong>========================== SOLICITUDES DE TRANSFERENCIAS ================================</strong>
          </td>
           
          <td width="25%">
            <strong> ========= DOLARES ========= </strong>
          </td>
        </tr>   
      </table>
    </div>
    <br>
    <div >
      <table width="100%">
      <thead>
        <tr>
          <td width="10%" style="text-align:center">
            <label> OPERACION</label>
          </td>
          <td width="40%" style="text-align:center">
            <label>CONCEPTO DETALLE</label>
          </td>
          <td width="10%">
            <label>FECHA</label>
          </td>
          <td width= "8%">Capital</td>
          <td width= "5%">C. Bancos</td>
          <td width= "5%">Comision</td>
          <td width= "5%">Oficina</td>
          <td width= "5%">Central</td>
          <td width= "5%">Of. Compartida</td>
           <td width="9%">
            <label> INGRESO</label>
          </td>
          <td width="13%">
            <label>OPERADOR</label>
          </td>
        </tr>
        <tr>
          <td width="10%"align="center" >----------------------</td>
          <td width="40%" align="center">----------------------------------------------------------------</td>
          <td width="10%">------------------------</td>
          <td width="8%">-------------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="9%">-------------</td>
          <td width="13%">-----------------</td>
        </tr>
      </thead>
      <tbody id="listaTCD">
      </tbody>
      <tfoot>
        <tr>
            <td width="10%">
               &nbsp;
            </td>
            <td width="40%">
              &nbsp;
            </td>
            <td width="10%" class="row">
              &nbsp;
            </td>
            <td width="8%" class="row">
              <label id="tcapid"></label>
            </td>
            <td width="5%" class="row">
              <label id="tbancod"></label>
            </td>
            <td width="5%" class="row">
              <label id="tcomid"></label>
            </td>
             
            <td width="5%" class="row" >
              <label id="tcomiod"></label>
            </td>
            <td width="5%" class="row">
              <label id="tcomicd"></label>
            </td>
            <td width="5%" class="row" >
              <label id="tcomied"></label>
            </td>
            <td width="9%">
             &nbsp;
            </td>
            <td width="13%">
              &nbsp;
            </td>
        </tr>
        <tr>
            <td width="10%"></td>
            <td width="40%"></td>
            <td width="10%" style="text-align:right" class="row">
              <label> SUB-TOTAL-----------></label>
            </td>
            <td width="8%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
             <td width="9%" class="row">
              <label id="TTCD">S</label>
            </td>
            <td width="13%" class="row">
              <label> &nbsp;</label>
            </td>
        </tr>
      </tfoot>  
      </table>
    </div>
  </div>
  <br>
  <br>
  <br>
  <div class="imp">
    <div >
      <table style="margin: 0 auto">
        <tr>
          <td width="70%">
            <strong>========================== SOLICITUDES DE TRANSFERENCIAS ============================</strong>
          </td>
          <td width="25%">
            <strong>========== SOLES =========== </strong>
          </td>
        </tr>   
      </table>
    </div>
    <br>
    <div >
      <table width="100%">
      <thead>
        <tr>
          <td width="10%" style="text-align:center">
            <label> OPERACION</label>
          </td>
          <td width="40%" style="text-align:center">
            <label>CONCEPTO DETALLE</label>
          </td>
          <td width="10%">
            <label>FECHA</label>
          </td>
          <td width= "8%">Capital</td>
          <td width= "5%">C. Bancos</td>
          <td width= "5%">Comision</td>
          <td width= "5%">Oficina</td>
          <td width= "5%">Central</td>
          <td width= "5%">Of. Compartida</td>
           <td width="9%">
            <label> INGRESO</label>
          </td>
          <td width="13%">
            <label> OPERADOR </label>
          </td>
        </tr>
        <tr>
          <td width="10%"align="center" >----------------------</td>
          <td width="40%" align="center">----------------------------------------------------------------</td>
          <td width="10%">------------------------</td>
          <td width="8%">-------------------</td>
          <td width="5%">-----------</td>
          <td width="5%">-------------</td>
          <td width="5%">-------------</td>
          <td width="5%">-------------</td>
          <td width="5%">-------------</td>
          <td width="9%">-------------</td>
          <td width="13%">-------------</td>
        </tr>
         
      </thead>
      <tbody id="listaTCS">
      </tbody>
      <tfoot>
        <tr>
            <td width="10%">
               &nbsp;
            </td>
            <td width="40%">
              &nbsp;
            </td>
            <td width="10%" class="row">
              &nbsp;
            </td>
            <td width="8%" class="row">
              <label id="tcapis"></label>
            </td>
            <td width="5%" class="row">
              <label id="tbancos"></label>
            </td>
            <td width="5%" class="row">
              <label id="tcomis"></label>
            </td>
             
            <td width="5%" class="row" >
              <label id="tcomios"></label>
            </td>
            <td width="5%" class="row">
              <label id="tcomics"></label>
            </td>
            <td width="5%" class="row">
              <label id="tcomies"></label>
            </td>
            <td width="9%">
             &nbsp;
            </td>
            <td width="13%">
              &nbsp;
            </td>
        </tr>
        <tr>
            <td width="10%"></td>
            <td width="40%"></td>
            <td width="10%" style="text-align:right" class="row">
              <label> SUB-TOTAL-----------></label>
            </td>
            <td width="8%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
             <td width="9%" class="row">
              <label id="TTCS">S</label>
            </td>
            <td width="13%" class="row">
              <label> &nbsp;</label>
            </td>
        </tr>
      </tfoot>  
      </table>
    </div>
  </div>
  <br>
  <!-- END -->
  <!-- TRANSFERENCIAS PAGADAS -->
  <br>
  <div class="imp" id="ptdo">
    <div >
      <table style="margin: 0 auto">
        <tr>
          <td width="70%">
            <strong>========================== TRANSFERENCIAS PAGADAS ================================</strong>
          </td>
           
          <td width="25%">
            <strong> ========= DOLARES ========= </strong>
          </td>
        </tr>   
      </table>
    </div>
    <br>
    <div >
      <table width="100%">
      <thead>
        <tr>
          <td width="10%" style="text-align:center">
            <label> OPERACION</label>
          </td>
          <td width="40%" style="text-align:center">
            <label>CONCEPTO DETALLE</label>
          </td>
          <td width= "5%">ST</td>
          <td width="10%">
            <label>FECHA</label>
          </td>
          <td width= "5%">Comision</td>
          <td width= "5%">Oficina</td>
          <td width= "5%">Central</td>
          <td width= "5%">Of. Compartida</td>
           <td width="9%">
            <label> EGRESO</label>
          </td>
          <td width="13%">
            <label> OPERADOR </label>
          </td>
        </tr>
        <tr>
          <td width="10%"align="center" >----------------------</td>
          <td width="40%" align="center">----------------------------------------------------------------</td>
          <td width="5%">------------</td>
          <td width="10%">------------------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="5%">------------</td>
          <td width="9%">-------------</td>
          <td width="13%">-------------</td>
        </tr>
         
      </thead>
      <tbody id="listaTPD">
      </tbody>
      <tfoot>
        <tr>
            <td width="10%">
               &nbsp;
            </td>
            <td width="40%">
              &nbsp;
            </td>
            <td width="5%">
              &nbsp;
            </td>
            <td width="10%" class="row">
              &nbsp;
            </td>
            <td width="8%" class="row">
              <label id="tcapid"></label>
            </td>
             <td width="5%" class="row">
              <label id="ptcomid"></label>
            </td>
            <td width="5%" class="row">
              <label id="ptcomiod"></label>
            </td>
            <td width="5%" class="row">
              <label id="ptcomicd"></label>
            </td>
            <td width="5%" class="row">
              <label id="ptcomied"></label>
            </td>
            <td width="9%">
             &nbsp;
            </td>
            <td width="13%">
              &nbsp;
            </td>
        </tr>
        <tr>
            <td width="10%"></td>
            <td width="40%"></td>
            <td width="5%"></td>
            <td width="10%" style="text-align:right" class="row">
              <label> SUB-TOTAL-----------></label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
             <td width="9%" class="row">
              <label id="TTPD"></label>
            </td>
            
            <td width="13%" class="row">
              <label> &nbsp;</label>
            </td>
        </tr>
      </tfoot>  
      </table>
    </div>
  </div>
  <br>
  <br>
  <br>
  <div class="imp">
    <div >
      <table style="margin: 0 auto">
        <tr>
          <td width="70%">
            <strong>============================== TRANSFERENCIAS PAGADAS ================================</strong>
          </td>
          <td width="25%">
            <strong>========== SOLES =========== </strong>
          </td>
        </tr>   
      </table>
    </div>
    <br>
    <div >
      <table width="100%">
      <thead>
        <tr>
          <td width="10%" style="text-align:center">
            <label> OPERACION</label>
          </td>
          <td width="40%" style="text-align:center">
            <label>CONCEPTO DETALLE</label>
          </td>
          <td width= "5%">ST</td>
          <td width="10%">
            <label>FECHA</label>
          </td>
          <td width= "5%">Comision</td>
          <td width= "5%">Oficina</td>
          <td width= "5%">Central</td>
          <td width= "5%">Of. Compartida</td>
           <td width="9%">
            <label> EGRESO</label>
          </td>
          <td width="13%">
            <label> OPERADOR </label>
          </td>
        </tr>
        <tr>
          <td width="10%"align="center" >----------------------</td>
          <td width="40%" align="center">----------------------------------------------------------------</td>
          <td width="5%">------------</td>
          <td width="10%">------------------------</td>
          <td width="5%">-----------</td>
          <td width="5%">-----------</td>
          <td width="5%">-----------</td>
          <td width="5%">-----------</td>
          <td width="9%">-------------</td>
          <td width="13%">-------------</td>
        </tr>    
      </thead>
      <tbody id="listaTPS">
      </tbody>
      <tfoot>
        <tr>
            <td width="10%">
               &nbsp;
            </td>
            <td width="40%">
              &nbsp;
            </td>
            <td width="5%">
              &nbsp;
            </td>
            <td width="10%" class="row">
              &nbsp;
            </td>
            <td width="5%" class="row">
              <label id="ptcomis"></label>
            </td>
            <td width="5%"  class="row">
              <label id="ptcomios"></label>
            </td>
            <td width="5%" class="row">
              <label id="ptcomics"></label>
            </td>
            <td width="5%" class="row">
              <label id="ptcomies"></label>
            </td>
             <td width="5%" class="row">
              
            </td>
            <td width="8%">
             &nbsp;
            </td>
            <td width="13%">
              &nbsp;
            </td>
        </tr>
        <tr>
            <td width="10%"></td>
            <td width="40%"></td>
            <td width="5%"></td>
            <td width="10%" style="text-align:right" class="row">
              <label> SUB-TOTAL-----------></label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
            <td width="5%" class="row">
              <label> &nbsp;</label>
            </td>
             <td width="9%" class="row">
              <label id="TTPS">S</label>
            </td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="13%" class="row">
              <label> &nbsp;</label>
            </td>
        </tr>
      </tfoot>  
      </table>
    </div>
  </div>
  <br>
  <div align="center">
    <div class="form-group">
      <label for="obse">OBSERVACIONES: </label>
      <p id="texto_obse" style="width:300px" > {{ obs }} </p>
    </div>
  </div>
  <!-- END -->
  <br>
  <div >
      <div align="center">
          <button type="button" class="btn btn-primary bc" id="CerrarC">Imprimir</button>
      </div>
      <br>
  </div>
</div>
<br>
</body>
<script type="text/javascript">
  var bi=false,be=false;
  var pkCa ={{ pkc }}
  var pkLi ={{ pkl }}
  var listaSI="",listaSE="";
  var listaDI="",listaDE="";
  var solos=0;
  var urlbtt="{% static 'img/btt.png' %}";
  $(document).ready(function(){
    var fecha = new Date();
    var mes = ["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];
    var textofecha= fecha.getDate() + " de " + mes[fecha.getMonth()] + " del " + fecha.getFullYear();
    var hora = new Date();
    var textohora = hora.getHours() + ":" + hora.getMinutes();
    $("#fechaOperacion").text(textofecha+" "+textohora);
    var aux='';
    //ajax_validar();
    

    function imprimir(){
      var stilo="<style>body{font-size: 9px;}</style>"
      var ori = $("body").html();
      var areai= $("#campoI").html();
      $("body").html(stilo+areai);
      window.print();
      $("body").html(ori);
       //$("#campoI").printThis();
    }
    $("#stdo").hide();
    $("#ptdo").hide();
    $("#chekSS").click(function(){
      if($("#chekSS").prop('checked')){
        solos=1;
        $("#ExitoMensaje").prop('class','alert alert-success');
        $("#texto").text("LIQUIDACION DE TRANSFERENCIAS EN SOLES");
        $("#stdo").hide();
        $("#ptdo").hide();
      }
      else{
        solos=0;
        $("#ExitoMensaje").prop('class','');
        $("#texto").text(" ");
      }
    });
    //
    ajax_validar();

    $("#refresh").click(function(){
      $("#listaIES").html(" ");
      $("#listaIED").html(" ");
      ajax_validar();
    })
    //
    //
    function ajax_transCreadas(){
      bi=false;
      $("#progreso_ajax").show();
          $.ajax({
            data:{'filtro':'ef' ,'F1':$('#fechad').text(),'F2':$('#fechah').text(),'pkC':pkCa,'pkL':pkLi},
            url:'/consulta_tras_creadas_caja_liquidado_ajax/',
            type:'GET',
            dataType:'json',
            success: function(data){
              var html1 ="";
              var html2 ="";
              
              var sty='';
              for(var i=0;i<data.length-1;i++){
                if (data[i].x=='n'){
                  sty='';
                }
                else{
                  sty='style="color: #CB060A;"'
                }
                if (data[i].moneda =="soles"){
                  html1 += '<tr '+sty+'><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+'<img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="8%" class="row"><label>'+data[i].capi+'</label></td><td width="5%" class="row"><label>'+data[i].comi_banco+'</label></td><td width="5%" class="row"><label>'+data[i].comision+'</label></td><td width="5%" class="row"><label>'+data[i].st_ca+'</label></td><td width="5%" class="row"><label>'+data[i].st_ce+'</label></td><td width="5%" class="row"><label>'+data[i].st_ot+'</label></td><td width="9%" class="row"><label>'+data[i].monto+'</label></td><td width="13%" class="row"><label>'+data[i].ope+'</label></td></tr>';
                }
                else{
                  html2 += '<tr '+sty+'><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+'<img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="8%" class="row"><label>'+data[i].capi+'</label></td><td width="5%" class="row"><label>'+data[i].comi_banco+'</label></td><td width="5%" class="row"><label>'+data[i].comision+'</label></td><td width="5%" class="row"><label>'+data[i].st_ca+'</label></td><td width="5%" class="row"><label>'+data[i].st_ce+'</label></td><td width="5%" class="row"><label>'+data[i].st_ot+'</label></td><td width="9%" class="row"><label>'+data[i].monto+'</label></td><td width="13%" class="row"><label>'+data[i].ope+'</label></td></tr>';
                }
              }
              $("#listaTCS").html(html1);
              $("#listaTCD").html(html2);
              $("#TTCS").text(data[data.length-1].total_soles);
              $("#TTCD").text(data[data.length-1].total_dolares);
              $("#tcapis").text(data[data.length-1].tcapis);
              $("#tcapid").text(data[data.length-1].tcapid);
              $("#tbancos").text(data[data.length-1].tbancos);
              $("#tbancod").text(data[data.length-1].tbancod);
              $("#tcomis").text(data[data.length-1].util_soles);
              $("#tcomid").text(data[data.length-1].util_dolares);
              $("#tcomios").text(data[data.length-1].tcof);
              $("#tcomics").text(data[data.length-1].tcce);
              $("#tcomies").text(data[data.length-1].tcot);
              bi=true;
              if (bi && be){
                $("#progreso_ajax").hide();
               }
            }
          });
        };
        ///
         
        function ajax_transPagdas(){
          be=false;
          $("#progreso_ajax").show();
          $.ajax({
            data:{'filtro':'ef','F1':$('#fechad').text(),'F2':$('#fechah').text(),'pkC':pkCa,'pkL':pkLi},
            url:'/consulta_tras_pagadas_caja_liquidado_ajax/',
            type:'GET',
            dataType:'json',
            success: function(data){
              var html1 ="";
              var html2 ="";
             
              for(var i=0;i<data.length-1;i++){
                if (data[i].moneda =="soles"){
                  html1 += '<tr><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+' <img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><td width="5%" class="row"><label>'+data[i].st +'</label></td><td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="5%" class="row"><label>'+data[i].comision+'</label></td><td width="5%" class="row"><label>'+data[i].st_ca+'</label></td><td width="5%" class="row"><label>'+data[i].st_ce+'</label></td><td width="5%" class="row"><label>'+data[i].st_ot+'</label></td><td width="9%" class="row"><label>'+data[i].monto+'</label></td><td width="13%" class="row"><label>'+data[i].ope+'</label></td></tr>';
                }
                else{
                  html2 += '<tr><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+' <img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><td width="5%" class="row"><label>'+data[i].st +'</label></td><td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="5%" class="row"><label>'+data[i].comision+'</label></td><td width="5%" class="row"><label>'+data[i].st_ca+'</label></td><td width="5%" class="row"><label>'+data[i].st_ce+'</label></td><td width="5%" class="row"><label>'+data[i].st_ot+'</label></td><td width="9%" class="row"><label>'+data[i].monto+'</label></td><td width="13%" class="row"><label>'+data[i].ope+'</label></td></tr>';
                }
              }
              $("#TTPS").text(data[data.length-1].total_soles);
              $("#TTPD").text(data[data.length-1].total_dolares);
              $("#ptcomis").text(data[data.length-1].util_soles);
              $("#ptcomid").text(data[data.length-1].util_dolares);
              $("#ptcomios").text(data[data.length-1].tcof);
              $("#ptcomics").text(data[data.length-1].tcce);
              $("#ptcomies").text(data[data.length-1].tcot);
              $("#listaTPS").html(html1);
              $("#listaTPD").html(html2);
               be=true;
               if (bi && be){
                $("#progreso_ajax").hide();
               }
              
            }
          });
        };
    //
    function ajax_Extracto(){
          $.ajax({
            data:{'filtro':$('#comboFiltroF').val() ,'F1':$('#fechad').text(),'F2':$('#fechah').text(),'pkC':pkCa},
            url:'/consulta_extraxt_caja_report_ajax/',
            type:'GET',
            dataType:'json',
            success: function(data){
              var html1 ="";
              var html2 ="";
              for(var i=0;i<data.length-1;i++){
                if (data[i].moneda =="soles"){
                  html1 += '<tr><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+'<img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="9%" class="row"><label>'+data[i].montoi+'</label></td><td width="8%" class="row"><label>'+data[i].montoe+'</label></td><td width="13%" class="row"><label>&nbsp;</label></td></tr>';
                }
                else{
                  html2 += '<tr><td width="10%" class="row"><label> '+data[i].tipodoc+' - '+data[i].nroR+'<img src="'+urlbtt+'" width="8%" height="5%" style="margin-left:8px;margin-right:1px"></label></td><td width="40%" class="row"><label>'+data[i].concepto+'</label></td><<td width="10%" class="row"><label>'+data[i].fecha+'</label></td><td width="9%" class="row"><label>'+data[i].montoi+'</label></td><td width="8%" class="row"><label>'+data[i].montoe+'</label></td><td width="13%" class="row"><label>&nbsp;</label></td></tr>';
                }
              }
              $("#listaIES").html(html1);
              $("#listaIED").html(html2);
              $("#IS").text(data[data.length-1].totali_soles);
              $("#ID").text(data[data.length-1].totali_dolares);
              $("#ES").text(data[data.length-1].totale_soles);
              $("#ED").text(data[data.length-1].totale_dolares);
              $("#tcs").text(data[data.length-1].tc_soles);
              $("#tcd").text(data[data.length-1].tc_dolares);
              $("#tps").text(data[data.length-1].tp_soles);
              $("#tpd").text(data[data.length-1].tp_dolares);
            }
          });
        };
        ///
       
        //
    function ajax_saldo_inicial(){
          $.ajax({
            url:'/SaldoInicialCaja_ajax/',
            //async:false,
            type:'GET',
            dataType:'json',
            success: function(data){
             $('#sis').text(data[0].sis);
             $("#sid").text(data[0].sid);
             calcular_Saldo();
            }
          });
        };
    $("#CerrarC").click(function(){
      imprimir();
    });
     function ajax_validar(){//falta
      ajax_transCreadas();
      ajax_transPagdas();
      //ajax_Extracto();
    };
    //
    //
    function calcular_Saldo()
    {
      //alert($("#IS").html());
      var saldosoles= parseFloat($("#IS").text())-parseFloat($("#ES").text());
      var saldodolares= parseFloat($("#ID").text())-parseFloat($("#ED").text());
      $("#SS").text(saldosoles.toString());
      $("#SD").text(saldodolares.toString());
    }
    //


  });
</script>
<script src="{% static 'Bootstrap/js/Moment.js' %}"></script>
<script src="{% static 'Bootstrap/js/bootstrap.min.js' %}"></script>
<script src="{% static 'Bootstrap/js/bootstrap-datetimepicker.js' %}"></script>
<script src="{% static 'Bootstrap/js/sweet-alert.js' %}"></script>
<!--<script src="{% static 'est/jquery.printarea.js' %}"></script>-->
<script src="{% static 'Bootstrap/js/printThis.js' %}"></script>
</html>
 
