<%= t :date_time %> : <%= Time.zone.now.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %>

help
<%= t :sale_count %>
<% if !@total_trans[0].nil? %>
<% end %>
attach_money
<%= t :total_sale %>
<% if !@total_trans[0].nil? %>
<% end %>
person_add
<%= t :total_credit %>
<% if !@total_credit.nil? %>
" data-speed="1000" data-fresh-interval="20">
<% end %>
credit_card
<%= t :total_card %>
<% if !@total_card.nil? %>
" data-speed="1000" data-fresh-interval="20">
<% end %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% if !@from.nil? && @from != "" from_date = @from.strftime("%d-%m-%Y") from_time = @from.strftime("%H:%M") if @from.strftime("%H:%M") != "00:00" else from_date = Time.now.strftime('%d-%m-%Y') end if !@to.nil? && @to != "" to_date = @to.strftime("%d-%m-%Y") to_time = @to.strftime("%H:%M") if @to.strftime("%H:%M") != "23:59" else to_date = Time.now.strftime('%d-%m-%Y') end %>


<% end %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% isMobile = request.user_agent %> <% if !isMobile.include? "Mobile" %>

dashboard<%= (t :top) + " " + (t :products) %>

<%= pie_chart @top_products %>

dashboard<%= (t :bottom) + " " + (t :products) %>

<%= pie_chart @bottom_products %>
<% end %>

av_timer<%= (t :hourly) + " " + (t :sale) %>

<%= column_chart @hourly_sales %>

assignment_ind<%= (t :staff) + " " + (t :sale) %>

<%= column_chart @employee_sales %>
<% end %> <% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'cashier' %> <% if !@summ_sale.nil? %> <% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% else %>
<% end %>
<%= t :sale %>
<% revenue = @summ_sale.grand_total - @summ_sale.total_discount - @summ_sale.total_tax %>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : <%= @summ_sale.total_receipt %>
<%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : <%= number_format( revenue, precision: precision.to_i ,delimiter: delimiter) %>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : <%= number_format( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) rescue number_format(0, precision: precision.to_i ,delimiter: delimiter) %>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : <%= number_format( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter) rescue number_format(0, precision: precision.to_i ,delimiter: delimiter) %>
<%= t("views.right_panel.detail.total_sale") %> : <%= number_format( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%>
<% 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' %> <% if payment.payment_method == 'paypar' %> <% elsif payment.payment_method == 'paymal' %> <% else %> <% end %> <% end %> <% end %> <% end %> <% total_card = @sale_data.select { |hash| hash["card"]!=nil } %> <% if !total_card.nil? %> <% end %> <% end %>
Redeem Sale : Card Sales : <%= payment.payment_method.to_s.capitalize %> Sale : <% @sale_data.each do |data| %> <% pay_mth = payment.payment_method %> <%= data[pay_mth] %> <% end %>
<%= t("views.right_panel.detail.other_payment") %> : <% total_other_amt = 0 %> <% @sale_data.map { |k,v| k.map{|meth,amt| meth != 'cash' && meth != 'foc' && meth != 'creditnote' ? total_other_amt += amt : meth }} %> <%= total_other_amt %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% end %> <% end %> <% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% else %>
<% end %> <% if !@total_customer.nil? && @total_customer.to_i > 0 %>
<%= t :customer %>
<% if !@total_dinein.nil? %> <% end %> <% if !@total_takeaway.nil? %> <% end %> <% if !@total_membership.nil? %> <% end %>
<%= t("views.right_panel.detail.total") %> <%= t :customer %> : <%= @total_customer %>
<%= t("views.right_panel.detail.dine_in") %> : <%= @total_dinein %>
<%= t("views.right_panel.detail.takeaway") %> : <%= @total_takeaway %>
<%= t("views.right_panel.detail.membership") %> : <%= @total_membership %>
<% end %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% end %> <% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% else %>
<% end %>
<%= t("views.right_panel.detail.order") %>
<% if !@total_order.nil? %> <% end %> <% if !@total_accounts.nil? %> <% @total_accounts.each do |account| %> <% end %> <% end %> <% if !@top_items.nil? %> <% end %> <% if !@total_foc_items.nil? %> <% end %>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : <%= @total_order.total_order %>
<%= account.title %> (Account) : <% @account_data.each do |data| %> <% acc = account.title %> <%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %> <% end %>
<%= t :top %> <%= t("views.right_panel.detail.item") %> : <%= @top_items.item_name %>
(<%= @top_items.item_total_price %>)
<%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : <%= @total_foc_items.to_int %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
<% end %> <% end %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %> <% if isMobile.include? "Mobile" %>

dashboard<%= (t :top) + " " + (t :products) %>

<%= pie_chart @top_products %>

dashboard<%= (t :bottom) + " " + (t :products) %>

<%= pie_chart @bottom_products %>
<% end %> <% end %>