Pull from master
This commit is contained in:
@@ -119,8 +119,17 @@ class HomeController < ApplicationController
|
||||
@hourly_sales = Sale.hourly_sales(today,current_user,@from,@to,@from_time,@to_time).sum(:grand_total)
|
||||
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
|
||||
# .sum(:grand_total)
|
||||
@employee_sales = Sale.employee_sales(today,current_user,@from,@to,@from_time,@to_time)
|
||||
.sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
|
||||
|
||||
employee_sales = Sale.employee_sales(today,current_user,@from,@to,@from_time,@to_time)
|
||||
# .sum("(CASE WHEN sp.payment_method='cash' THEN ((sp.payment_amount) - (sales.amount_changed)) ELSE (sp.payment_amount) END)")
|
||||
@employee_sales = []
|
||||
if !employee_sales.nil?
|
||||
employee_sales.each do |emp|
|
||||
emp_data = []
|
||||
emp_data.push([emp.e_name, emp.payment_amount])
|
||||
@employee_sales.push({'name' => emp.payment_method, 'data' => emp_data})
|
||||
end
|
||||
end
|
||||
@inventories = StockJournal.inventory_balances(today,@from,@to,@from_time,@to_time).sum(:balance)
|
||||
|
||||
@total_trans = Sale.total_trans(today,current_user,@from,@to,@from_time,@to_time)
|
||||
|
||||
Reference in New Issue
Block a user