{% extends "baseAdmin.html" %}
{% load static %}
{% block titulo %}
  .::Evolución
{% endblock titulo %}
{% block content1 %}
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <div class="panel panel-default">
          <div class="panel-heading"> 
            <strong>EVOLUCIÓN DE LA EMPRESA </strong>
          </div>
          <div class="panel-body">
              <div class="row">
                <div class="col-lg-12">
                  <div class="box">
                   
                    <div class="box-body no-padding">
                    <div class="form-horizontal form-banded">
                    <div class="form-group">
                    <div class="col-md-12">
                      {% ifequal data '' %}
                         
                      {% else %}
                      <div class="alert alert-danger" role="alert" align="center">
                        <h4>FALLO OPERACIÓN :( {{ data}}</h4>
                      </div>
                      {% endifequal %}
                    </div>
                    </div>
                    <!--<div class="row">
                      <div class="col-md-2 col-md-offset-1">
                        <h5>Filtrar Por</h5>
                      </div>
                      <div class="col-md-2">
                      <div class="select">
                      <div class="fg-line">
                        <select class="form-control" id="comboFiltroF">
                          <option value="h">Hoy</option>
                          <option value="f">Fecha</option>
                          <option value="ef">Entre Fechas</option>
                        </select>
                        </div>
                        </div>
                        <p></p>
                      </div>
                      <div class="col-md-2">
                      <div class="fg-line">
                        <input type='text' class=" form-control" id="txtfecha1">
                        </div>
                        <p></p>
                      </div>
                      <div class="col-md-2">
                      <div class="fg-line">
                        <input type='text' class="form-control" id="txtfecha2">
                        </div>
                      </div>
                      <div class="col-md-2" align="center">
                        <button type="button" class=" btn btn-block btn-success" id="buscarF">Buscar</button>
                        <p></p>
                      </div>
                  </div>-->
                    <div class="form-group">
                         <form class="form-horizontal form-banded form-bordered" action="/comisionesFechas_ajax/" method="POST">
                           {% csrf_token %}
                                <div class="col-md-12">
                                  <div class="col-md-2 col-md-offset-1">
                                    <label for="comboFiltroF">Por Fechas:</label> 
                                  </div>
                                  <div class="col-md-8">
                                    <div class="col-md-4">
                                      <input type="text" class="form-control" id="txtfecha1" name="F1" value="{{F1}}" placeholder="Fecha Desde">
                                      <p></p>
                                    </div>
                                    <div class="col-md-4">
                                      <input type="text" class="form-control" id="txtfecha2" name="F2" value="{{F2}}" placeholder="Fecha Hasta">
                                      <p></p>
                                    </div>
                                     <button class="btn btn-danger" id="buscarF" type="submit">Buscar</button>
                                    
                                  </div>
                              </div>
                        </form>
                  </div>

                     
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <label class="control-label">PRECIO PROMEDIO POR GRAMO DE COMPRA : {{promedio}}</label>
                        </div>
 
                    
                      </div>
                        
                    </div>
                    </div><!--end .box-body -->
                  </div><!--end .box -->
                </div><!--end .col-lg-12 -->
              </div><!--end .row -->
           
            <div class="row">
              <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center"> 
                  <h4 class="text-light"><strong>EFECTIVO TOTAL CAJAS</strong></h4> 
                   
                  </div>
                  <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                           
                            
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Efectivo US$</label>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoDolares}}" readonly>
                              </div>
                            </div>
                            
                             <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Efectivo S/.</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoSoles}}" readonly>
                              </div>
                            </div>
                           
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Material Total</label>
                              </div>

                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{saldoMaterial}}" readonly> 
                                </div>
                                <div class="col-md-2">
                                  <h5 class="pull-right">Inversión</h5>
                                </div>
                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{solesMaterial}}" readonly>
                                </div>
                            </div>
                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>
               <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>HABILITACIONES DE DINERO Y MATERIAL PENDIENTES DE RECEPCIÓN</strong></h4></header>
                   
                  </div>
                 <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                           
                            
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Habilitaciones Dolares</label>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{habilitacionesDolares}}" readonly>
                              </div>
                            </div>
                            
                             <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Habilitaciones Soles</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{habilitacionesSoles}}" readonly>
                              </div>
                            </div>
                           
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Habilitaciones Material</label>
                              </div>

                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{habilitacionesMaterial}}" readonly> 
                                </div>
                                <div class="col-md-2">
                                  <h5 class="pull-right">Inversión</h5>
                                </div>
                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{solesHabilitacionesMaterial}}" readonly>
                                </div>
                            </div>
                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>
            </div> 

             <div class="row">
              <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>CUENTAS</strong></h4></header>
                   
                  </div>
                  <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                           
                            <div class="row">
                              <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Debemos en Ctas Ctes (Positivos) : </label>
                                </div>
                              </div>
                              <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Efectivo US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{debemosDolaresCtaCte}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Efectivo S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{debemosSolesCtaCte}}" readonly>
                                  </div>
                                </div>
                              </div>
                              <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Nos deben en Ctas Ctes (Sobregirados) : </label>
                                </div>
                              </div>

                                <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Efectivo US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{nosdebenDolaresCtaCte}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Efectivo S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{nosdebenSolesCtaCte}}" readonly>
                                  </div>
                                </div>
                              </div>

                              <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Debemos en Ctas Ctes Material (Positivos) : </label>
                                </div>
                              </div>
                               <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-4">
                                    <label class="control-label">Gramos (Positivos)</label>
                                  </div>

                                  <div class="col-md-8">
                                      <input type="text" class="form-control" value="{{debemosMaterialCtaCte}}" readonly>
                                  </div>
                                </div>
                              </div>

                              <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Nos Deben en Ctas Ctes Material (Sobregirados) : </label>
                                </div>
                              </div>

                              <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-4">
                                    <label class="control-label">Gramos (Sobregirados)</label>
                                  </div>

                                  <div class="col-md-8">
                                      <input type="text" class="form-control" value="{{nosdebenMaterialCtaCte}}" readonly>
                                  </div>
                                </div>
                              </div>

                            </div>
                            
                            <!-- <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Efectivo S/.</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoSoles}}" readonly>
                              </div>
                            </div>-->
                           
                            <!--<div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Material Total</label>
                              </div>

                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{saldoMaterial}}" readonly> 
                                </div>
                                <div class="col-md-2">
                                  <h5 class="pull-right">Inversión</h5>
                                </div>
                                <div class="col-md-3">
                                  <input type="text" class="form-control" value="{{solesMaterial}}" readonly>
                                </div>
                            </div>-->
                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>







               <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>MATERIAL</strong></h4></header>
                   
                  </div>
                <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                            <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Material Comprado: </label>
                                </div>
                            </div>
                            
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Total Comprado (Gr.):</label>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{materialComprado}}" readonly>
                              </div>
                            </div>

                             <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Inversión US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{totalEgresoMD}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Inversión S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{totalEgresoMS}}" readonly>
                                  </div>
                                </div>
                              </div>


                            <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">Material Vendido: </label>
                                </div>
                            </div>
                            
                             <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Total Vendido  (Gr.)</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{materialVendido}}" readonly>
                              </div>
                            </div> 

                            <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Ingreso US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{totalIngresoMD}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Ingreso S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{totalIngresoMS}}" readonly>
                                  </div>
                                </div>
                              </div>

                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>

            </div> 



            <div class="row">
                

              <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>TRANSFERENCIAS</strong></h4></header>
                   
                  </div>
                <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                           
                            <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Por Pagar US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{STXPDolares}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Creadas US$</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{STCDolares}}" readonly>
                                  </div>
                                </div>
                              </div>
                              <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Por Pagar S/.</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{STXPSoles}}" readonly>
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Creadas S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{STCSoles}}" readonly>
                                  </div>
                                </div>
                              </div>
                            <!--<div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Por Pagar US$</label>
                              </div>

                              <div class="col-md-4">
                                  <input type="text" class="form-control" value="{{STXPDolares}}" readonly>
                              </div>
                            </div>-->
                            
                            <!-- <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Por Pagar S/.</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{STXPSoles}}" readonly>
                              </div>
                            </div>--> 


                            <div class="form-group">
                                <div class="col-md-12">
                                  <label class="control-label">COMISIONES TRANSFERENCIAS CREADAS </label>
                                </div>
                            </div>

                           
                              <div class="form-group">
                                <div class="col-md-12">
                                  

                                  <div class="col-md-4">
                                    <h5><label class="control-label">Total Comisiones S/.</label></h5>
                                  </div>

                                  <div class="col-md-6">
                                      <input type="text" class="form-control" value="{{ComisionSoles}}" id="txtTotalComisionesS" readonly="">
                                  </div>
                                </div>
                              </div>

                              <div class="form-group">
                                <div class="col-md-12">
                                  

                                  <div class="col-md-4">
                                    <h5><label class="control-label">Total Comisiones US$</label></h5>
                                  </div>

                                  <div class="col-md-6">
                                      <input type="text" class="form-control" value="{{ComisionDolares}}" id="txtTotalComisionesD" readonly="">
                                  </div>
                                </div>
                              </div>

                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>


               

              <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>EGRESO</strong></h4></header>
                   
                  </div>
                <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                            <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Egreso ST US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{haberSTDolares}}" readonly="">
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Egreso ST S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{haberSTSoles}}" readonly="">
                                  </div>
                                </div>
                              </div>
                               <div class="form-group">
                                <div class="col-md-12">
                                  <div class="col-md-3">
                                    <label class="control-label">Otros Egresos US$</label>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{haberOtrosDolares}}" readonly="">
                                  </div>

                                  <div class="col-md-3">
                                    <h5><label class="control-label">Otros Egresos S/.</label></h5>
                                  </div>

                                  <div class="col-md-3">
                                      <input type="text" class="form-control" value="{{haberOtrosSoles}}" readonly="">
                                  </div>
                                </div>
                              </div>
                           
                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>
               <div class="col-lg-6">
                <div class="panel bs-item z-depth-1 m-r-5 m-l-5 m-t-5">
                  <div class="panel-heading text-center">
                    <header><h4 class="text-light"><strong>DINERO REAL</strong></h4></header>
                   
                  </div>
                <div class="panel-body">
                    <div class="row">
                      <div class="col-lg-12">
                        <div class="box">
                         
                          <div class="box-body no-padding">
                          <div class="form-horizontal form-banded form-bordered">
                           
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Capital</label>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{capital}}" readonly>
                              </div>
                            </div>

                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Efectivo US$</label>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoDolaresReal}}" readonly>
                              </div>
                            </div>
                            
                             <div class="form-group">
                              <div class="col-md-4">
                                <h5><label class="control-label">Efectivo S/.</label></h5>
                              </div>

                              <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoSolesReal}}" readonly>
                              </div>
                            </div>
                           
                            <div class="form-group">
                              <div class="col-md-4">
                                <label class="control-label">Material Total</label>
                              </div>

                                <div class="col-md-8">
                                  <input type="text" class="form-control" value="{{saldoMaterialReal}}" readonly> 
                                </div>
                                
                            </div>
                          </div>
                          </div><!--end .box-body -->
                        </div><!--end .box -->
                      </div><!--end .col-lg-12 -->
                    </div><!--end .row --> 
                  </div>
                </div>
              </div>


            </div>



          </div>
        </div>
      </div>
    </div>
  </div>
    
     <script type="text/javascript">
      $(document).ready(function (){
        $('#txtfecha1').datetimepicker({
          locale: 'es',
          format: 'YYYY-MM-DD'
        });
        $('#txtfecha2').datetimepicker({
          locale: 'es',
          format: 'YYYY-MM-DD'
        });
        //
       

         /*$("#buscarF").click(function(){
              
            ajax_Evolucion();

         });

         function ajax_Evolucion(){
              $.ajax({
                data:{'F1':$('#txtfecha1').val(),'F2':$('#txtfecha2').val()},
                url:'/comisionesFechas_ajax/',
                //async:false,
                type:'GET',
                dataType:'json',
                success: function(data){ 
                  if(data.estado=="-1" || data.estado==-1){
                    bootbox.alert(data.error);
                  }else{
                    $("#txtTotalComisionesS").val(data.resultado.totalSTComisionSoles);
                    $("#txtTotalComisionesD").val(data.resultado.totalSTComisionDolares);
                  }
                },
                error: function(xhr, textStatus, errorThrown) {
                  console.log(xhr.responseText);
                },
              });

         }*/

      });

      </script>

{% endblock content1 %}