{% extends "base_basic.html" %}
{% block title %}Cliente{% endblock %}

<!-- CSS Code -->
{% block style_css %}{% endblock %}

{% block js_code %}
<script type="text/javascript">
  $(document).ready(function(){
    $('#id_cliente').focus();

    setTimeout(cerrar, 7000);
  });

  function cerrar(){
    open(location, '_self').close();
  }

  
</script>
{% endblock %}
{% block content %}
<form method="post" class="form-horizontal" action="" width="300px"  enctype='multipart/form-data'>
  {% csrf_token %}
    {{ form.errors }}
  {% if message %}
  <div class="alert alert-block alert-error fade in">
    <button type="button" class="close" data-dismiss="alert">×</button>
    <p>{{ message }}</p>
  </div>
  {% endif %}

  <div class="span4"  style='clear:both;'>
    <label>Clave Cliente</label>
    <div class="input-prepend input-append">
      {{ form.cliente }}
      <!-- <a href="#" class='btn' id='boton'>Buscar</a> -->
      <input type="submit" class="btn" value="Buscar" />
    </div>
  </div>
  <div class="span2" >
    <label>Cobrar y abonar con</label>
    <div class="input-prepend input-append">
      <h2 id='h2_puntos'>
        {% if cliente.tipo_tarjeta = 'P' %}
          Puntos
        {% elif cliente.tipo_tarjeta = 'D'%}
          Dinero Electronico
        {% elif cliente.tipo_tarjeta = 'N'%}
          No aplica
        {% endif %}
      </h2>
    </div>
  </div>
  <div class="span4" style="clear:both;" >
    <label>Puntos(Dinero)</label>
    <div class="input-prepend input-append">
      <h2 id='h2_puntos' class="money-text">{{ total_puntos }}(${{ dinero_en_puntos }})</h2>
    </div>
  </div>
  <div class="span4" >
    <label>Dinero Electronico</label>
    <div class="input-prepend input-append">
      <h2 id='h2_dinero_electronico' class="money-text">${{ total_dinero_electronico }}</h2>
    </div>
  </div>
  <div class="span4" style="clear:both;">
    <h4 id='h4_cliente_nombre'>{{ cliente.nombre }}</h4>
  </div>

  

  
  <br style='clear:both;'>
  
</form>
{% endblock %}