Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2017-10-27 12:03:00 +06:30
2 changed files with 2 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ class HomeController < ApplicationController
@sales = Sale::where("payment_status='paid' and sale_status='completed' and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'").count()
@top_products = Sale.top_products(today)
@hourly_sales = Sale.hourly_sales(today)
@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(:grand_total)

View File

@@ -5,6 +5,7 @@ class DiningCharge < ApplicationRecord
def self.amount_calculate(dining_charges_obj, checkin , checkout)
# note :: the first Charge Block will cost all, the Time rounding block will included in 2nd Charge Block
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
block_count = 0
price = 0
minutes = DiningCharge.time_diff(checkout, checkin)
free_time = DiningCharge.convert_to_minutes(dining_charges_obj.minimum_free_time.utc.localtime.strftime('%H:%M'))