foodcourt
This commit is contained in:
@@ -46,7 +46,6 @@ class Api::PaymentsController < Api::ApiController
|
||||
|
||||
rebate_amount = nil
|
||||
# For Cashier by Zone
|
||||
# bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
bookings = Booking.find_by_sale_id(sale_id)
|
||||
|
||||
shift = ShiftSale.current_open_shift(current_login_employee)
|
||||
@@ -68,7 +67,6 @@ class Api::PaymentsController < Api::ApiController
|
||||
end
|
||||
|
||||
# For Print
|
||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
||||
unique_code = "ReceiptBillPdf"
|
||||
print_settings = PrintSetting.all
|
||||
@@ -110,7 +108,6 @@ class Api::PaymentsController < Api::ApiController
|
||||
end
|
||||
|
||||
#orders print out
|
||||
# if type == "quick_service"
|
||||
booking = Booking.find_by_sale_id(sale_id)
|
||||
if booking.dining_facility_id.to_i>0
|
||||
table_id = booking.dining_facility_id
|
||||
@@ -133,7 +130,6 @@ class Api::PaymentsController < Api::ApiController
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
|
||||
end
|
||||
|
||||
# end
|
||||
|
||||
#for card sale data
|
||||
card_data = Array.new
|
||||
|
||||
@@ -25,7 +25,6 @@ class Foodcourt::AddordersController < BaseFoodcourtController
|
||||
else
|
||||
@display_type = nil
|
||||
end
|
||||
# if params[:menu] == "true"
|
||||
@menus = []
|
||||
@menu = []
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Foodcourt::CashInsController < BaseFoodcourtController
|
||||
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user)
|
||||
shift = ShiftSale.current_open_shift(current_user)
|
||||
|
||||
current_shift = ShiftSale.current_shift(Shop.current_shopshop_code)
|
||||
current_shift = ShiftSale.current_shift(Shop.current_shop.shop_code)
|
||||
# set cashier
|
||||
if shift != nil
|
||||
shift = shift
|
||||
@@ -36,7 +36,6 @@ class Foodcourt::CashInsController < BaseFoodcourtController
|
||||
shift =current_shift
|
||||
end
|
||||
end
|
||||
puts shift.to_json
|
||||
shift.cash_in = shift.cash_in + amount.to_f
|
||||
shift.save
|
||||
end
|
||||
|
||||
@@ -60,18 +60,17 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
||||
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
||||
.where("orders.source='app' and bookings.booking_id='#{params[:booking_id]}'").first
|
||||
@customer_id =@booking.customer_id
|
||||
@booking_id =@booking.booking_id
|
||||
@order_id =@booking.order_id
|
||||
@sale_data = Sale.find_by_sale_id(@booking.sale_id)
|
||||
@customer_id =@booking.customer_id
|
||||
@booking_id =@booking.booking_id
|
||||
@order_id =@booking.order_id
|
||||
@sale_data = Sale.find_by_sale_id(@booking.sale_id)
|
||||
end
|
||||
@bookings = Booking.select("bookings.*,customers.*")
|
||||
.joins(" JOIN booking_orders ON booking_orders.booking_id=bookings.booking_id")
|
||||
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
||||
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
||||
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
||||
.where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}'").order("bookings.created_at desc").uniq
|
||||
# .where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}' and DATE(bookings.created_at) = '#{Date.today}'").order("bookings.created_at desc").uniq
|
||||
.where("orders.source='app' and bookings.shop_code=? and DATE(bookings.created_at)=?",Shop.current_shop.shop_code,Date.today).order("bookings.created_at desc").uniq
|
||||
end
|
||||
def completed
|
||||
customer =Customer.find_by_customer_id(params[:customer_id])
|
||||
|
||||
@@ -20,7 +20,7 @@ if (@booking)
|
||||
@total_tax = 0.00
|
||||
|
||||
# For YGN BBQ
|
||||
adult_count = 0
|
||||
adult_count = 0
|
||||
child_count = 0
|
||||
adult_spent = 0
|
||||
child_spent = 0
|
||||
@@ -33,18 +33,18 @@ if (@booking)
|
||||
if (order.status == "new")
|
||||
order_items = order_items + order.order_items
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.order_items order_items do |item|
|
||||
total_set_menu = 0
|
||||
# For YGN BBQ
|
||||
if item.item_code.include? ("PSA_")
|
||||
adult_count += item.qty
|
||||
adult_spent += (item.price * item.qty)
|
||||
adult_count += item.qty
|
||||
adult_spent += (item.price * item.qty)
|
||||
end
|
||||
if item.item_code.include? ("PSC_")
|
||||
child_count += item.qty
|
||||
child_spent += (item.price * item.qty)
|
||||
child_spent += (item.price * item.qty)
|
||||
end
|
||||
# End YGN BBQ
|
||||
|
||||
@@ -115,7 +115,7 @@ if (@booking)
|
||||
end
|
||||
@total_tax_amount = @service_charges + @commercial_tax
|
||||
end
|
||||
|
||||
|
||||
#total tax calculation
|
||||
json.sub_total @total_amount
|
||||
if @service_rate.to_i > 0
|
||||
|
||||
@@ -21,11 +21,11 @@ class ActionController::Base
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
# if check_license
|
||||
# current_license(ENV["SX_PROVISION_URL"])
|
||||
# else
|
||||
# redirect_to activate_path
|
||||
# end
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
# directory application_path
|
||||
# #environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
# environment "production"
|
||||
# pidfile "#{application_path}/tmp/puma/pid"
|
||||
# state_path "#{application_path}/tmp/puma/state"
|
||||
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
# port ENV.fetch("PORT") { 62158 }
|
||||
# workers 2
|
||||
# preload_app!
|
||||
# threads 1,1
|
||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
||||
directory application_path
|
||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
||||
environment "production"
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
port ENV.fetch("PORT") { 62158 }
|
||||
workers 2
|
||||
preload_app!
|
||||
threads 1,1
|
||||
|
||||
@@ -1 +1 @@
|
||||
3072
|
||||
8746
|
||||
Reference in New Issue
Block a user