<%= t(:overview) %>

<% if @show_dashboard %>

<%= t(:best_selling_products) %>

<% @best_selling_variants.each_with_index do |v,i| %>  
<%= number_with_delimiter v[1] %> <%= t(:units) %>
<% end %>

<%= t(:top_grossing_products) %>

<% @top_grossing_variants.each_with_index do |v,i| %>  
<%= number_to_currency v[1], :precision => 0 %>
<% end %>

<%= t(:best_selling_taxons) %>

<% @best_selling_taxons.each_with_index do |t,i| %>  
<%= number_with_delimiter t[1] %> <%= t(:units) %>
<% end %>

<%= t('orders') %> <%= t('count') %> <%= t('by_day') %> (<%= t('last_7_days') %>)

<%= t("number.currency.format.unit") %>

<%= t('order') %> <%= t('total') %>
|

<%= t("number.currency.format.unit") %>

<%= t('item') %> <%= t('total') %>
|

<%= t("number.currency.format.unit") %>

<%= t('adjustments') %>
|

<%= t("number.currency.format.unit") %>

<%= t('credits') %>
<%= select_tag "orders_by_day_reports", options_for_select([[t('last_7_days'), "7_days"], [t('last_14_days'), "14_days"], [t('this_month'), "this_month"], [t('last_month'), "last_month"], [t('this_year'), "this_year"], [t('last_year'), "last_year"] ], "7_days") %> <%= select_tag "orders_by_day_value", options_for_select({t('count') => 'Count', t('value') => 'Value'}, 'Count') %>

<%= t('last_5_orders') %>

<% @last_five_orders.each do |order| %> <% end %>
<%= t('name') %> <%= t('items') %> <%= t('total') %>
<%= truncate order[0], :length => 18 %> <%= order[1] %> <%= number_to_currency order[2] %>

<%= t('5_biggest_spenders') %>

<% @biggest_spenders.each do |order| %> <% end %>
<%= t('name') %> <%= t('ord_qty') %> <%= t('ord_total') %>
<%= truncate order[0], :length => 18 %> <%= order[1] %> <%= number_to_currency order[2] %>

<%= t('out_of_stock_products') %>

<% @out_of_stock_products.each do |product| %> <% end %>
<%= t('name') %>
<%= product.name %>

 

<% else %>
<%== t('overview_welcome') %>
<% end %>
<% content_for :head do %> <% if @show_dashboard %> <%= javascript_tag do -%> var orders_by_day_points = [[<%== @orders_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %>]]; var best_selling_variants_points = [<%== @best_selling_variants.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %>]; var top_grossing_variants_points = [<%== @top_grossing_variants.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %>]; var best_selling_taxons_points = [<%== @best_selling_taxons.map { |t| "[\"#{h(t[0])}\",#{t[1]}]" }.join(",") %>]; var orders = "<%= t(:orders) %>"; var by_day = "<%= t(:by_day) %>"; var pie_colors = [<%== @pie_colors.map{|c| "'#{c}'"}.join(",") %>]; <% end -%> <% end %> <% end %>