{% extends "base.html" %}
{% block titulo %}
  .:: Saldo de Bases
{% endblock titulo %}
{% block content1 %}
    <div class="container">
      <script type="text/javascript">
        $("#navIE").attr('class','dropdown active');
        $("#navDeudaAsoc").attr('class','active');
      </script>
        <div class="row">
          <div class="col-md-12 col-sm-12" >
              <div class="card">
                <div class="card-head card-head-xs style-default"> <strong>SALDOS DE BASES</strong></div>
                <div class="card-body">
                   <div class="row" >
                    <p class="bg-success" align="center" id="ExitoMensaje">
                    </p>
                  </div>
                  <div class="row">
                      <div class="col-md-2 col-md-offset-1 col-xs-4">
                        <button type="button" class="btn btn-primary btn-block" id="btnRefrescar"><span class="fa fa-refresh"></span> Actualizar</button>
                      </div>
                  </div>
                  <div class="row">
                    <br>
                    
                      &nbsp;
                      <div class="col-md-12">
                          <script type="text/JavaScript">
                              var Aux="";
                              var filaI =0;
                              $(document).ready(function(){
                                ajax_Deuda();
                                $("#btnRefrescar").click(function(){
                                  ajax_Deuda();
                                });
                                //otra funcion
                                function ajax_Deuda(){
                                  $.ajax({
                                    url:'/deuda_oficinas_asociado_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].mrs+'</b></td><td class="success"><b>'+data[i].totald+'</b></td ><td class="success"><b>'+data[i].mrd+'</b></td ><td class="warning"><b>'+data[i].totalm+'</b></td ></tr>';
                                        }
                                      }
                                      $('#listaO').html(html);
                                    }
                                  });
                                }
                                //
                               //-------------------
                              });
                          </script>
                          <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="success" align="center"><b>DOLARES</b></td>
                                    <td class="success" align="center"><b>DOLARES</b></td>
                                    <td class="warning" align="center"><b>MATERIAL</b></td>
                                  </tr>
                                  <tr>
                                    <td><b>Oficina</b></td>
                                    <td><b>Caja</b></td>
                                    <td><b>Operador</b></td>
                                    <td class="info"><b>Saldo S/.</b></td>
                                    <td class="info"><b>ST por pagar S/.</b></td>
                                    <td class="info"><b>Habilitacion por Recepcionar S/.</b></td>
                                    <td class="success"><b>saldo $</b></td>
                                    <td class="success"><b>Habilitacion por Recepcionar $</b></td>
                                    <td class="warning"><b>saldo g</b></td>
                                  </tr>
                                </thead>
                                <tbody id="listaO">
                                    
                                </tbody>
                            </table>
                          </div>
                      </div> 
                  </div>
                  <br>
                  <br>
                </div>
              </div>
          </div>
        </div>
    </div>
{% endblock content1 %}
