Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-12-14 14:31:08 +06:30
4 changed files with 24 additions and 20 deletions

View File

@@ -72,7 +72,8 @@ class HomeController < ApplicationController
@hourly_sales = Sale.hourly_sales(today).sum(:grand_total)
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
# .sum(:grand_total)
@employee_sales = Sale.employee_sales(today).sum('payment_amount')
@employee_sales = Sale.employee_sales(today)
.sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
@inventories = StockJournal.inventory_balances(today).sum(:balance)
@total_sale = Sale.total_sale(today)