shop code

This commit is contained in:
Myat Zin Wai Maw
2019-12-10 15:18:48 +06:30
parent c606ca73db
commit 79598c0126
115 changed files with 247 additions and 396 deletions

View File

@@ -18,9 +18,8 @@ class HomeController < ApplicationController
def index
# @employees = Employee.all_emp_except_waiter.order("name asc")
shop = Shop.current_shop
@employees = Employee.all.where("shop_code='#{shop.shop_code}' and is_active = true").order("name asc")
@roles = Employee.where("shop_code='#{shop.shop_code}'").distinct.pluck(:role)
@employees = Employee.all.where("shop_code='#{@shop.shop_code}' and is_active = true").order("name asc")
@roles = Employee.where("shop_code='#{@shop.shop_code}'").distinct.pluck(:role)
# byebug
# @roles = Lookup.collection_of("employee_roles")
@@ -97,8 +96,6 @@ class HomeController < ApplicationController
def dashboard
@from, @to = get_date_range_from_params
@shop = Shop.current_shop
@orders = Sale.receipt_date_between(@from, @to).where("payment_status = 'new' and sale_status = 'bill'")
@sales = Sale.receipt_date_between(@from, @to).completed