fixed conflict after merch dev for current shop
This commit is contained in:
@@ -11,7 +11,8 @@ class Origami::AlipayController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@alipaycount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_alipay = 0
|
||||
@member_discount = 0
|
||||
@@ -64,7 +65,8 @@ class Origami::AlipayController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
@@ -86,8 +88,9 @@ class Origami::AlipayController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
|
||||
@creditcount = 0
|
||||
others = 0
|
||||
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
@@ -32,6 +33,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
|
||||
@@ -3,11 +3,11 @@ class Origami::CreditSalesController < BaseOrigamiController
|
||||
@cashier_type = 'cashier'
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@@ -15,7 +15,7 @@ class Origami::CreditSalesController < BaseOrigamiController
|
||||
@sale = Sale.find_by_sale_id(params[:sale_id])
|
||||
@sale_payment = SalePayment.select("SUM(payment_amount) as payment_amount")
|
||||
.where("sale_id = ? and payment_method=?", @sale.sale_id, "creditnote")
|
||||
|
||||
|
||||
@sale_taxes = []
|
||||
sale_taxes = SaleTax.where("sale_id = ?", @sale.sale_id)
|
||||
if !sale_taxes.empty?
|
||||
@@ -24,5 +24,5 @@ class Origami::CreditSalesController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -87,7 +87,7 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
@count_customer = Customer.count_customer
|
||||
|
||||
# @taxes = TaxProfile.where(:group_type => 'cashier')
|
||||
@taxes = TaxProfile.unscoped.select("id, (CONCAT(name,'(',(SELECT name FROM lookups WHERE lookup_type='tax_profiles' AND value=group_type),')')) as name")
|
||||
@taxes = TaxProfile.unscope(:order).select("id, (CONCAT(name,'(',(SELECT name FROM lookups WHERE lookup_type='tax_profiles' AND value=group_type),')')) as name")
|
||||
.order("group_type ASC,order_by ASC")
|
||||
# if flash["errors"]
|
||||
# @crm_customer.valid?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,7 +6,8 @@ class Origami::DingaController < BaseOrigamiController
|
||||
@membership_rebate_balance=0
|
||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
@receipt_no = @sale_data.receipt_no
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(@sale_data.grand_total)
|
||||
else
|
||||
@@ -77,7 +78,8 @@ def create
|
||||
account_no = params[:account_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
|
||||
@@ -6,7 +6,8 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = 0
|
||||
@gift_vouchercount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_gift_voucher = 0
|
||||
@member_discount = 0
|
||||
@@ -48,8 +49,8 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
ref_no = params[:reference_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -64,8 +65,9 @@ class Origami::GiftVoucherController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,10 +4,12 @@ class Origami::HomeController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
@webview = check_mobile
|
||||
@tables = Table.unscoped.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
|
||||
@rooms = Room.unscoped.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
|
||||
@complete = Sale.completed_sale("cashier",@shop.shop_code)
|
||||
@orders = Order.includes("sale_orders").where("shop_code='#{@shop.shop_code}' and DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
|
||||
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@occupied_table = DiningFacility.where("shop_code='#{@shop.shop_code}' and status='occupied'").count
|
||||
@@ -20,10 +22,11 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
@webview = check_mobile
|
||||
|
||||
@tables = Table.unscoped.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
|
||||
@rooms = Room.unscoped.all.active.where("shop_code='#{@shop.shop_code}'").order('status desc')
|
||||
@complete = Sale.completed_sale("cashier",@shop.shop_code)
|
||||
@orders = Order.includes("sale_orders").where("shop_code='#{@shop.shop_code}' and DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@shift = ShiftSale.current_open_shift(current_user)
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ class Origami::JcbController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@jcbcount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_jcb = 0
|
||||
@member_discount= 0
|
||||
@@ -66,8 +67,7 @@ class Origami::JcbController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -87,8 +87,9 @@ class Origami::JcbController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ class Origami::JunctionPayController < BaseOrigamiController
|
||||
@cashier_id = current_user.emp_id
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
# @shop = Shop.first
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
@@ -52,8 +52,8 @@ class Origami::JunctionPayController < BaseOrigamiController
|
||||
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
|
||||
@@ -12,7 +12,8 @@ class Origami::MasterController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@mastercount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_master = 0
|
||||
@member_discount = 0
|
||||
@@ -63,8 +64,8 @@ class Origami::MasterController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -85,8 +86,9 @@ class Origami::MasterController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -105,7 +105,7 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
# @type = (DiningFacility.find(change_to)).type
|
||||
# @moved_by = @current_user.name
|
||||
# @date = DateTime.now
|
||||
# @shop = Shop.first
|
||||
# @shop = Shop.current_shop
|
||||
# unique_code = "MoveTablePdf"
|
||||
# pdf_no = PrintSetting.where(:unique_code => unique_code).count
|
||||
# #print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
@@ -11,7 +11,8 @@ class Origami::MpuController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@mpucount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_mpu = 0
|
||||
@member_discount = 0
|
||||
@@ -64,8 +65,8 @@ class Origami::MpuController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -85,8 +86,9 @@ class Origami::MpuController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,6 +4,8 @@ class Origami::OrderReservationController < BaseOrigamiController
|
||||
@order = OrderReservation.latest_order #.active
|
||||
@count_on_order = OrderReservation.get_count_on_order
|
||||
@count_on_completed = OrderReservation.get_count_on_completed
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@receipt_bill = check_receipt_bill
|
||||
end
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ class Origami::OrdersController < BaseOrigamiController
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@order = Order.find(params[:order_id])
|
||||
|
||||
@@ -6,7 +6,8 @@ class Origami::PaymalController < BaseOrigamiController
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
@receipt_no = sale_data.receipt_no
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
@@ -74,7 +75,8 @@ def create
|
||||
account_no = params[:account_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
|
||||
@@ -59,7 +59,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#shop detail
|
||||
## shop_detail = Shop.first
|
||||
## shop_detail = Shop.current_shop
|
||||
# customer= Customer.where('customer_id=' +.customer_id)
|
||||
customer = Customer.find(sale_data.customer_id)
|
||||
# rounding adjustment
|
||||
@@ -141,7 +141,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_items = SaleItem.get_all_sale_items(sale_id)
|
||||
#shop_detail = Shop.first
|
||||
#shop_detail = Shop.current_shop
|
||||
# rounding adjustment
|
||||
if !path.include? ("credit_payment")
|
||||
if @shop.is_rounding_adj
|
||||
@@ -577,7 +577,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
#shop detail
|
||||
#shop_detail = Shop.first
|
||||
#shop_detail = Shop.current_shop
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
@@ -686,8 +686,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
#shop detail
|
||||
#shop_detail = Shop.first
|
||||
printer = PrintSetting.where("shop_code='#{@shop.shop_code}'")
|
||||
|
||||
#shop_detail = Shop.current_shop
|
||||
printer = PrintSetting.all
|
||||
|
||||
unique_code="ReceiptBillPdf"
|
||||
if !printer.empty?
|
||||
|
||||
@@ -7,8 +7,8 @@ class Origami::PayparPaymentsController < BaseOrigamiController
|
||||
payment_method = "paypar"
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
|
||||
@@ -6,7 +6,7 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
# @shop = Shop.first
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
|
||||
@@ -90,7 +90,7 @@ class Origami::RequestBillsController < ApplicationController
|
||||
# Not Use for these printed bill cannot give customer
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# #shop detail
|
||||
# shop_details = Shop.find(1)
|
||||
# shop_details = Shop.current_shop
|
||||
# # customer= Customer.where('customer_id=' +.customer_id)
|
||||
# customer= Customer.find(@sale_data.customer_id)
|
||||
# # get member information
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
class Origami::RoomsController < BaseOrigamiController
|
||||
def index
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier",@shop.shop_code)
|
||||
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@shift = ShiftSale.current_open_shift(current_user)
|
||||
@webview = false
|
||||
@@ -17,9 +18,10 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier",@shop.shop_code)
|
||||
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
@@ -31,6 +33,10 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@membership = MembershipSetting.find_by_shop_code(@shop.shop_code)
|
||||
@payment_methods = PaymentMethodSetting.find_by_shop_code(@shop.shop_code)
|
||||
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@membership = MembershipSetting::MembershipSetting
|
||||
@payment_methods = PaymentMethodSetting.all
|
||||
@dining_room = @room.bookings.active.where("DATE_FORMAT(created_at,'%Y-%m-%d') = '#{DateTime.now.strftime('%Y-%m-%d')}' OR DATE_FORMAT(created_at,'%Y-%m-%d') = '#{Date.today.prev_day}' ")
|
||||
@order_items = Array.new
|
||||
@dining_room.each do |booking|
|
||||
|
||||
@@ -5,9 +5,10 @@ class Origami::SalesController < BaseOrigamiController
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.unscoped.all.active.order('status desc')
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier",@shop.shop_code)
|
||||
|
||||
@tables = Table.unscope(:order).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@sale = Sale.find(params[:sale_id])
|
||||
|
||||
@@ -27,7 +27,7 @@ class Origami::SecondDisplayController < BaseOrigamiController
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# @shop = Shop.current_shop
|
||||
# end
|
||||
|
||||
|
||||
|
||||
@@ -397,4 +397,9 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
render :json => { status: true }
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
class Origami::TableInvoicesController < BaseOrigamiController
|
||||
def index
|
||||
@table = DiningFacility.find(params[:table_id])
|
||||
|
||||
shop = Shop.current_shop
|
||||
@sale_array = Array.new
|
||||
@table.bookings.each do |booking|
|
||||
|
||||
@@ -28,10 +30,10 @@ class Origami::TableInvoicesController < BaseOrigamiController
|
||||
|
||||
def show
|
||||
@table = DiningFacility.find(params[:table_id])
|
||||
@membership = MembershipSetting.find_by_shop_code(@shop.shop_code)
|
||||
@payment_methods = PaymentMethodSetting.where("shop_code='#{@shop.shop_code}'")
|
||||
|
||||
# shop = Shop.first
|
||||
@membership = MembershipSetting::MembershipSetting
|
||||
@payment_methods = PaymentMethodSetting.all
|
||||
shop = Shop.current_shop
|
||||
@sale_array = Array.new
|
||||
@table.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
|
||||
@@ -11,7 +11,8 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@unionpaycount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_unionpay = 0
|
||||
@member_discount = 0
|
||||
@@ -61,8 +62,8 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -83,8 +84,9 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,8 @@ class Origami::VisaController < BaseOrigamiController
|
||||
end
|
||||
total = 0
|
||||
@visacount = 0
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
@rounding_adj = 0
|
||||
@can_visa = 0
|
||||
@member_discount = 0
|
||||
@@ -61,8 +62,8 @@ class Origami::VisaController < BaseOrigamiController
|
||||
ref_no = params[:ref_no]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
# shop_details = Shop.first
|
||||
|
||||
shop_details = Shop.current_shop
|
||||
# rounding adjustment
|
||||
# if shop_details.is_rounding_adj
|
||||
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
@@ -83,8 +84,9 @@ class Origami::VisaController < BaseOrigamiController
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
# helper_method :shop_detail
|
||||
# def shop_detail
|
||||
# @shop = Shop.first
|
||||
# end
|
||||
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.current_shop
|
||||
end
|
||||
end
|
||||
|
||||
@@ -115,6 +115,8 @@ class Origami::VoidController < BaseOrigamiController
|
||||
|
||||
customer= Customer.find(sale.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop.current_shop
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate_and_shop_code(1,@shop.shop_code)
|
||||
if customer.membership_id != nil && rebate
|
||||
|
||||
@@ -8,7 +8,8 @@ class Origami::VoucherController < BaseOrigamiController
|
||||
@vouchercount = 0
|
||||
others = 0
|
||||
|
||||
# @shop = Shop.first
|
||||
|
||||
@shop = Shop.current_shop
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
|
||||
@@ -88,6 +88,8 @@ class Origami::WasteSpoileController < BaseOrigamiController
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(sale.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop.current_shop
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate_and_shop_code(1,@shop.shop_code)
|
||||
if customer.membership_id != nil && rebate
|
||||
|
||||
Reference in New Issue
Block a user