{% extends "baseAdmin.html" %}
{% block titulo %}
  .:: Saldos de Oficinas
{% endblock titulo %}
{% block content1 %}
<script type="text/javascript">
  $("#navIE").attr('class','dropdown active');
  $("#navDeuda").attr('class','active');
</script>
<div class="row">
  <div class="col-md-12" >
      <div class="panel panel-default">
        <div class="panel-heading"> <strong>SALDOS DE OFICINAS</strong></div>
        <div class="panel-body">
           <div class="row" >
            <p class="bg-success" align="center" id="ExitoMensaje">
            </p>
          </div>
          <div class="row">
              <div class="col-md-2">
                <button type="button" class="btn btn-primary btn-sm" id="btnRefrescar"><span class="fa fa-refresh"></span> Actualizar</button>
              </div>
          </div>
          <p></p>
          <div class="row">
              <div class="col-md-12">
                  
                  <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                          <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td  class="info" align="center"> <b>SOLES</b></td>
                            <td  class="info" align="center"> <b>SOLES</b></td>
                            <td  class="info" align="center"> <b>SOLES</b></td>
                            <td  class="info" align="center"> <b>SOLES</b></td>
                            <td  class="info" align="center"> <b>SOLES</b></td>
                            <td class="success" align="center"><b>DOLARES</b></td>
                            <td class="success" align="center"><b>DOLARES</b></td>
                            <td  align="center"><b>MONTO TOPE</b></td>
                          </tr>
                          <tr>
                            <td><b>Oficina</b></td>
                            <td><b>Caja</b></td>
                            <td><b>Operador</b></td>
                            <td class="info"><b>Saldo</b></td>
                            <td class="info"><b>PT por pagar</b></td>
                            <td class="info"><b>Inter por pagar</b></td>
                            <td class="info"><b>Saldo por Recepcionar</b></td>
                            <td class="info"><b>ST leidas</b></td>
                            <td class="success"><b>saldo</b></td>
                            <td class="success"><b>Saldo por Recepcionar</b></td>
                            <td class="warning"><b>Soles</b></td>
                          </tr>
                        </thead>
                        <tbody id="listaO">
                            
                        </tbody>
                    </table>
                  </div>
              </div> 
          </div>
        </div>
      </div>
  </div>
</div>
<script type="text/JavaScript">
  var Aux="";
  var filaI =0;
  $(document).ready(function(){
    ajax_Deuda();
    $("#btnRefrescar").click(function(){
      ajax_Deuda();
    });
    function ajax_Deuda(){
      $('.table-responsive').waitMe({effect : 'progressBar',text : 'Recuperando Datos'});
      $.ajax({
        url:'/Deuda_oficinas_ajax/',
        type:'GET',
        dataType:'json',
        success: function(data){
          Aux= data;
          var html ="";
          for(var i=0;i<data.length;i++){
            if(data[i].ver_saldo=='si'){
              html += '<tr' +' id="'+i+'"><td><b>'+data[i].oficina+'</b></td><td>'+data[i].caja+'</td><td>'+data[i].op+'</td><td class="info"><b>'+data[i].totals+'</b></td><td class="info"><b>'+data[i].mt+'</b></td><td class="info"><b>'+data[i].mi+'</b></td><td class="info"><b>'+data[i].mrs+'</b></td><td class="info"><b>'+data[i].ml+'</b></td><td class="success"><b>'+data[i].totald+'</b></td ><td class="success"><b>'+data[i].mrd+'</b></td ><td class="'+data[i].est+'"><b>'+data[i].moto+'</b></td ></tr>';
            }
          }
          $('#listaO').html(html);
          $('.table-responsive').waitMe('hide');
        },  error: function(xhr, textStatus, errorThrown) {
                console.log(xhr.responseText);
        }
      });
    }
    //
   //-------------------
  });
</script>
{% endblock content1 %}
