fixed conflict after merch dev for current shop
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
class Origami::DashboardController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
|
||||
@display_type = Lookup.where("shop_code='#{current_shop.shop_code}'").find_by_lookup_type("display_type")
|
||||
@shop = Shop.current_shop
|
||||
@display_type = Lookup.find_by_lookup_type("display_type")
|
||||
|
||||
@sale_data = Array.new
|
||||
|
||||
@total_payment_methods = Sale.total_payment_methods(current_user)
|
||||
if !@total_payment_methods.nil?
|
||||
@total_payment_methods.each do |payment|
|
||||
pay = Sale.payment_sale(payment.payment_method, current_user)
|
||||
@sale_data.push({payment.payment_method => pay.payment_amount})
|
||||
|
||||
end
|
||||
if !@total_payment_methods.nil?
|
||||
|
||||
@total_payment_methods.each do |payment|
|
||||
pay = Sale.payment_sale(payment.payment_method, current_user)
|
||||
@sale_data.push({payment.payment_method => pay.payment_amount})
|
||||
end
|
||||
else
|
||||
@sale_data = nil
|
||||
end
|
||||
@@ -27,15 +28,14 @@ class Origami::DashboardController < BaseOrigamiController
|
||||
@total_accounts = Account.select("accounts.id as account_id, accounts.title as title")
|
||||
@account_data = Array.new
|
||||
if !@total_accounts.nil?
|
||||
@total_accounts.each do |account|
|
||||
|
||||
acc = Sale.account_data(account.account_id, current_user)
|
||||
|
||||
if !acc.nil?
|
||||
@account_data.push({account.title => acc.cnt_acc, account.title + '_amount' => acc.total_acc})
|
||||
end
|
||||
@total_accounts.each do |account|
|
||||
acc = Sale.account_data(account.account_id, current_user)
|
||||
if !acc.nil?
|
||||
@account_data.push({account.title => acc.cnt_acc, account.title + '_amount' => acc.total_acc})
|
||||
end
|
||||
@total_accounts = @total_accounts.reject.with_index { |x, i| @account_data[i].nil? }
|
||||
end
|
||||
@total_accounts = @total_accounts.reject.with_index { |x, i| @account_data[i].nil? }
|
||||
else
|
||||
@account_data = nil
|
||||
end
|
||||
@@ -107,7 +107,7 @@ class Origami::DashboardController < BaseOrigamiController
|
||||
|
||||
def get_all_menu
|
||||
|
||||
@menus = Menu.includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).includes(:menu_categories => {:menu_items => {:item_sets => :menu_item_instances}}).active.all
|
||||
@menus = Menu.includes(:menu_categories => :children).includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).includes(:menu_categories => {:menu_items => {:item_sets => :menu_item_instances}}).active.all
|
||||
|
||||
@item_attributes = MenuItemAttribute.all.load
|
||||
@item_options = MenuItemOption.all.load
|
||||
|
||||
Reference in New Issue
Block a user