<div class="row">
 <div class="col-lg-4 col-md-6 col-sm-6">
         <% @sale_array.each do |sale| %>
         <div class="card tables" data-id="<%= sale.id %>">
           <div class="card-block">
              <%= sale.receipt_no %>
           </div>
         </div>
         <% end %>
</div>

 <!-- Column Two -->
  <div class="col-lg-7 col-md-5 col-sm-5">
     <div class="card"  >
       <div class="card-header">
          <div><strong id="order-title">INVOICE DETAILS </strong></div>
       </div>
       <div class="card-block">
         <div class="card-title row">
           <div class="col-lg-6 col-md-6 col-sm-6">
             <p> Receipt No: <span id="receipt_no">
                 <%= @sale.receipt_no rescue '' %>
             </span></p>
           </div>
           <div class="col-lg-6 col-md-6 col-sm-6 text-right">
             <p>Date:  <span id="receipt_date"><%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
           </div>
         </div>
         <div class="card-title row customer_detail hide">
           <div class="col-lg-6 col-md-6 col-sm-6">
             <p>Customer : <span id="customer_name"></span></p>
           </div>

         </div>

         <div class="card-footer">
           <table class="table" id="order-charges-table" border="0">
             <tr>
               <td class="charges-name"><strong>Sub Total:</strong></td>
               <td class="item-attr"><strong id="order-sub-total"></strong></td>
             </tr>
             <tr>
               <td class="charges-name"><strong>Discount:</strong></td>
               <td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
             </tr>
             <tr>
               <td class="charges-name"><strong>Tax:</strong></td>
               <td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
             </tr>
              <tr>
               <td class="charges-name"><strong>Rounding Adj:</strong></td>
               <td class="item-attr"><strong id="order-round-adj"><%= @sale.rounding_adjustment rescue 0%></strong></td>
             </tr>
             <tr>
               <td class="charges-name"><strong>Grand Total:</strong></td>
               <td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
             </tr>
              <tr class="rebate_amount"></tr>
           </table>
         </div>
       </div>
     </div>
  </div>

 <!-- Column Three -->
 <div class="col-lg-1 col-md-1 col-sm-1">
   <button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
   <button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
 </div>
</div>
<script>
$(document).ready(function(){
  $(".tables").on('click', function(){
      var dining_id = $(this).attr("data-id");
      window.location.href = '/origami/table/<%= @room.id %>/table_invoice/' + dining_id;
  })
});

$('#pay').on('click',function() {
  //  var sale_id = $('#sale_id').val();
  //  window.location.href = '/origami/sale/'+ sale_id + "/payment";
});
$('#back').on('click',function(){
  window.location.href = '/origami/table/<%= @room.id %>';
})
</script>
