211 lines
8.3 KiB
Plaintext
211 lines
8.3 KiB
Plaintext
<div class="container-fluid">
|
|
<div class="block-header">
|
|
<!-- <h2><%= t :dashboard %></h2> -->
|
|
<h2><%= t :date_time %> : <%= Time.zone.now.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></h2>
|
|
</div>
|
|
<% if @print_settings.precision.to_i > 0
|
|
precision = @print_settings.precision
|
|
else
|
|
precision = 0
|
|
end
|
|
#check delimiter
|
|
if @print_settings.delimiter
|
|
delimiter = ","
|
|
else
|
|
delimiter = ""
|
|
end
|
|
%>
|
|
|
|
<!-- Widgets -->
|
|
<div class="row clearfix">
|
|
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 qs_view">
|
|
<div class="info-box bg-purple">
|
|
<div class="icon" >
|
|
<i class="material-icons">arrow_forward</i>
|
|
</div>
|
|
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :quick_service %></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 cashier_view">
|
|
<div class="info-box bg-green">
|
|
<div class="icon" >
|
|
<i class="material-icons">arrow_forward</i>
|
|
</div>
|
|
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- #END# Widgets -->
|
|
<% if !@current_user.nil? && @current_user.role != 'waiter' %>
|
|
<!-- CPU Usage -->
|
|
<div class="row clearfix">
|
|
|
|
<% if !@summ_sale.nil? %>
|
|
|
|
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
|
<div class="card">
|
|
<div class="body">
|
|
<h6><%= t :sale %></h6>
|
|
<table class="table">
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
|
|
<td align="right"><%= @summ_sale.total_receipt %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
|
|
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
|
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
|
|
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
|
|
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
|
|
</tr>
|
|
</table>
|
|
<table class="table">
|
|
<% if !(@total_payment_methods.nil?) %>
|
|
<% @total_payment_methods.each do |payment| %>
|
|
<% if !@sale_data[0].empty? %>
|
|
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
|
<tr>
|
|
<% if payment.payment_method == 'paypar' %>
|
|
<td>Redeem Sale : </td>
|
|
<% else %>
|
|
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
|
<% end %>
|
|
<td align="right">
|
|
<% @sale_data.each do |data| %>
|
|
<% pay_mth = payment.payment_method %>
|
|
<%= data[""+pay_mth+""] %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
|
<% if !total_card.nil? %>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
|
<td align="right">
|
|
<%= total_card["card"].to_f %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
|
<div class="card">
|
|
<div class="body">
|
|
<h6><%= t :customer %></h6>
|
|
<table class="table">
|
|
<% if !@total_customer.nil? %>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.total") %> <%= t :customer %> : </td>
|
|
<td align="right"><%= @total_customer %></td>
|
|
</tr>
|
|
<% end %>
|
|
<% if !@total_dinein.nil? %>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.dine_in") %> : </td>
|
|
<td align="right"><%= @total_dinein.total_dinein_cus %></td>
|
|
</tr>
|
|
<% end %>
|
|
<% if !@total_takeaway.nil? %>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.takeaway") %> : </td>
|
|
<td align="right"><%= @total_takeaway.total_take_cus %></td>
|
|
</tr>
|
|
<% end %>
|
|
<% if !@total_other_customer.nil? %>
|
|
<tr>
|
|
<td><%= t :customer %> : </td>
|
|
<td align="right"><%= @total_other_customer.total_cus %></td>
|
|
</tr>
|
|
<% end %>
|
|
<% if !@total_membership.nil? %>
|
|
<tr>
|
|
<td><%= t("views.right_panel.detail.membership") %> : </td>
|
|
<td align="right"><%= @total_membership.total_memb_cus %></td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
|
<div class="card">
|
|
<div class="body">
|
|
<h6><%= t("views.right_panel.detail.order") %></h6>
|
|
<table class="table">
|
|
<% if !@total_order.nil? %>
|
|
<tr>
|
|
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : </td>
|
|
<td align="right" width="60px"><%= @total_order.total_order %></td>
|
|
</tr>
|
|
<% end %>
|
|
|
|
<% if !@total_accounts.nil? %>
|
|
<% @total_accounts.each do |account| %>
|
|
<tr>
|
|
<td width="40px"><%= account.title %> (Account) : </td>
|
|
<td align="right" width="60px">
|
|
<% @account_data.each do |data| %>
|
|
<% acc = account.title %>
|
|
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
<% if !@top_items.nil? %>
|
|
<tr>
|
|
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
|
<td align="right" width="60px"><%= @top_items.item_name %>
|
|
<br>(<%= @top_items.item_total_price %>)</td>
|
|
</tr>
|
|
<% end %>
|
|
<% if !@total_foc_items.nil? %>
|
|
<tr>
|
|
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : </td>
|
|
<td align="right" width="60px"><%= @total_foc_items.to_int %></td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<button type="button" data-href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect second_view hidden" style="height: 45px">Customer View</button>
|
|
<script>
|
|
|
|
$(".cashier_view").on('click', function() {
|
|
window.location.href = '/origami';
|
|
});
|
|
|
|
$(".qs_view").on('click', function() {
|
|
document.getElementById('second_view').click();
|
|
window.location.href = '/origami/quick_service';
|
|
|
|
});
|
|
|
|
$("#second_view").on('click', function () {
|
|
var url = $(this).attr("data-href");
|
|
window.open(url,'_blank');
|
|
});
|
|
|
|
</script> |