<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
	<meta http-equiv="Content-type" content="application/vnd.ms-excel; charset=UTF-8">
</head>
<body>
<div class="row">
	<div class="col-md-12">
		<div class="margin-top-20">
			<div class="card">
				<table class="table table-striped" border="0">
					<thead>
						<tr>
							<th colspan="9"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.strftime("%Y-%b-%d") rescue '-' %>  - <%= t("views.right_panel.detail.to_date") %> : <%= @to ? @to.strftime("%Y-%b-%d") : '-'%></th>
						</tr>
						<% if @shift_from %>
						<tr>
							<% if @shift_data.employee %>		
							<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
							<% end %>			
							<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> =  <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
						</tr>
						<% end %>	 

			            <tr>
			                <th><%= t("views.right_panel.detail.shift_sale_id") %></th>
			                <th><%= t("views.right_panel.detail.req_date") %></th>
			                <th><%= t("views.right_panel.detail.req_type") %></th>
			                <th><%= t("views.right_panel.detail.res_date") %></th>
			                <th><%= t("views.right_panel.detail.res_type") %></th>
			                <th><%= t("views.right_panel.detail.employee_name") %></th>
			                <th><%= t("views.right_panel.detail.sale_cnt") %></th>
			                <th><%= t("views.right_panel.detail.sale_amount") %></th>
			                <th><%= t("views.right_panel.detail.void_cnt") %></th>
			                <th><%= t("views.right_panel.detail.void_amount") %></th>
			            </tr>
					</thead>
		            <tbody>
		                    <% if @cardSettles != 0 %>
		                      <% @cardSettles.each do |cardSettle| %>
		                          <tr>
		                              <td><%= cardSettle.shift_sale.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - <%= cardSettle.shift_sale.shift_closed_at ? cardSettle.shift_sale.shift_closed_at.strftime("%e %b %I:%M%p") : '-'  %></td>
		                              <td><%= cardSettle.req_date %> <%= cardSettle.req_time.strftime("%I:%M %p") %></td>
		                              <td><%= cardSettle.req_type %></td>
		                              <td><%= cardSettle.res_date %> <%= cardSettle.res_time.strftime("%I:%M %p") %></td>
		                              <td><%= cardSettle.res_type %></td>
		                              <td><%= cardSettle.shift_sale.employee.name %></td>
		                              <td><%= cardSettle.sale_cnt %></td>
		                              <td><%= cardSettle.sale_amt %></td>
		                              <td><%= cardSettle.void_cnt %></td>
		                              <td><%= cardSettle.void_amt %></td>
		                          </tr>
		                      <% end %>
		                  <% else %>
		                      <tr><td colspan="10"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
		                  <% end %>
		            </tbody>
				</table>
			</div>
		</div>
	</div>
</div>
</body>
</html>