{% extends "new_base_glarus.html" %}
{% load staticfiles bootstrap3 i18n %}
{% block content %}
  
  <style type="text/css">

  .invoice-title{
    text-align: center !important;
  }
  
#outer
{
    width:100%;
    text-align: center;
}
.inner
{
    display: inline-block;
}
   
  </style>

<script type="text/javascript">

</script>

  <section id="price">
     <div class="signup-container">
        <div class="col-xs-12 col-sm-6 col-lg-8 text-center wow fadeInDown"> 
          <div class="payment-box">
            <h2 class="section-heading payment-head">Your Booking Detail</h2>
            <hr class="greyline-long">
            {% bootstrap_form_errors form type='non_fields'%}
            {% if messages %}
                <ul class="list-unstyled">
                {% for message in messages %}
                    <li>{{ message }}</li>
                {% endfor %}
                </ul>
            {% endif %}

            <h2 class="billing-head">Invoice<btn class="btn btn-primary btn-grey btn-edit  print hidden-print" data-print="price">Get PDF</btn></h2>                              
                               
            <h2 class="order-head">Order Number</h2>
            <h2 class="member-name">#{{order.id}}</h2>

            <h2 class="order-head">Status</h2>
            <h2 class="member-name">{{order.get_status_display}}</h2>
                                
            <h2 class="order-head">Billed to :</h2>
            <h2 class="history-name">{{user.name}}<br>
              {{order.billing_address.street_address}},{{order.billing_address.postal_code}}<br>
              {{order.billing_address.city}}, {{order.billing_address.country}}.
            </h2>
         
            <h2 class="order-head">Payment Method</h2>
            <h2 class="history-name">
                {{order.cc_brand}} ending **** {{order.last4}}<br>
                {{user.email}}
            </h2>
                                
            <hr class="greyline-long">
            <h2 class="order-head">Order Summary</h2>
            <h2 class="history-name">
              Dates: {{start_date}} - {{end_date}}<br>
            </h2>
            <h2 class="col-xs-6 payment-total text-left">Total days {{booking_days}}</h2>
            <h2 class="order-sum">{{original_price|floatformat}}CHF</h2>
            {% if free_days %}
              <h2 class="col-xs-6 payment-total text-left">Free days {{free_days}} </h2>
              <h2 class="order-sum text-danger">-{{total_discount|floatformat}}CHF</h2>
            {% endif %}
            <hr class="greyline-long">
            <h2 class="col-xs-6 payment-total text-left"> Total</h2>
            <h2 class="order-result">{{final_price|floatformat}}CHF</h2>
            

			
            
            {% if not order.get_status_display == 'Cancelled' %}
            <form method="POST" action="">
              {% csrf_token %} 
              <p class="inner">
                <input type="hidden" name="start_date" value="{{order.booking.start_date}}">
                <!-- <a class=""  href="{% url 'digitalglarus:booking_orders_list' %}" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</a> -->
				 <a class="btn btn-primary btn-blue hidden-print"  href="{% url 'digitalglarus:booking_orders_list' %}">Go to my page</a>
                <button type="button" class="btn btn-primary btn-grey hidden-print" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</button>
              </p>
			         
              <div class="modal fade bs-example-modal-sm" id="cancel-booking-modal" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                      <h4 class="modal-title">Cancel booking</h4>
                    </div>
                    <div class="modal-body">
                      <p>Do you want to cancel your booking?</p>
                      {% if booking_required %}
                      <p>
                        Your booking is within 7 days. You may cancel your booking but the fees will not be refunded. Your booking can be only cancelled freely until 7 days before the booked date.
                      </p>
                      {% endif %}
                    </div>
                    <div class="modal-footer text-center">
                      <button type="button" class="btn btn-primary btn-grey" data-dismiss="modal">No</button>
                      <button type="submit" class="btn btn-primary">Yes</button>
                    </div>
                  </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
              </div><!-- /.modal -->

            </form>
			{% else %}
				<p class="inner">
					<a class="btn btn-primary btn-blue hidden-print"  href="{% url 'digitalglarus:booking_orders_list' %}">Go to my page</a>            
				</p> 
            {% endif %}






          </div>

    </div>              
     



    <div class="col-xs-12 col-sm-4 col-lg-4 wow fadeInDown hidden-print"> 
        <div class="order-summary">
           <div class="header text-center">
              <h2 class="order-name">Order Summary</h2>
          </div>
            <div class="order-box">
              <h2 class="col-xs-6 order-item" style="padding-bottom:10px">Dates: {{start_date}} - {{end_date}}<br></h2>
              
              <h2 class="col-xs-6 payment-total">Total days {{booking_days}}</h2>
              <h2 class="order-sum">{{original_price|floatformat}}CHF</h2>
              {% if free_days %}
                <h2 class="col-xs-6 payment-total">Free days {{free_days}}</h2>
                <h2 class="order-sum text-danger">-{{total_discount|floatformat}}CHF</h2>
              {% endif %}
              <hr class="greyline">
              <h2 class="col-xs-6 payment-total">Total</h2>
              <h2 class="order-result">{{final_price|floatformat}}CHF</h2>
          </div>
          
        </div> 
    </div>
  </section>

<!-- stripe key data -->
{% if stripe_key %}
<script type="text/javascript"> 
     (function () {window.stripeKey = "{{stripe_key}}";})();
</script>

{%endif%}

{% endblock %}