shop
This commit is contained in:
@@ -13,7 +13,8 @@ module MultiTenancy
|
||||
shop_code = request.subdomain.partition('-').last
|
||||
@shop = Shop.find_by(shop_code: shop_code)
|
||||
else
|
||||
@shop = Shop.first
|
||||
# @shop = Shop.first
|
||||
@shop = Shop.find_by(shop_code: '262')
|
||||
end
|
||||
set_current_tenant(@shop)
|
||||
end
|
||||
|
||||
@@ -130,7 +130,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
|
||||
params[:type] = nil
|
||||
params[:customer_id] = params[:id]
|
||||
@credit_sales = SalePayment.get_credit_sales(params,@shop.shop_code)
|
||||
@credit_sales = SalePayment.get_credit_sales(params)
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(params[:id])
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
class Foodcourt::CashInsController < BaseFoodcourtController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
reference = params[:reference]
|
||||
remark = params[:remark]
|
||||
amount = params[:amount]
|
||||
payment_method = params[:payment_method]
|
||||
payment_method_reference = params[:payment_method_reference]
|
||||
type = params[:type]
|
||||
|
||||
p_jour = PaymentJournal.new
|
||||
|
||||
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.shop_code)
|
||||
# set cashier
|
||||
if shift != nil
|
||||
shift = shift
|
||||
else
|
||||
|
||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
if open_cashier.count>0
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0])
|
||||
|
||||
if shift
|
||||
emp = Employee.find_by_id(shift.employee_id)
|
||||
shift = ShiftSale.current_open_shift(emp)
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_shift)
|
||||
end
|
||||
else
|
||||
# shift = Employee.find(current_shift.employee_id).name
|
||||
shift =current_shift
|
||||
end
|
||||
end
|
||||
shift.cash_in = shift.cash_in + amount.to_f
|
||||
shift.save
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
class Foodcourt::CashOutsController < BaseFoodcourtController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
reference = params[:reference]
|
||||
remark = params[:remark]
|
||||
amount = params[:amount]
|
||||
p_jour = PaymentJournal.new
|
||||
p_jour.cash_out(reference, remark, amount, current_user)
|
||||
shift = ShiftSale.current_open_shift(current_user)
|
||||
|
||||
current_shift = ShiftSale.current_shift(@shop.shop_code)
|
||||
|
||||
# set cashier
|
||||
if shift != nil
|
||||
shift = shift
|
||||
else
|
||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
if open_cashier.count>0
|
||||
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0])
|
||||
|
||||
if shift
|
||||
emp = Employee.find_by_id(shift.employee_id)
|
||||
shift = ShiftSale.current_open_shift(emp)
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_shift)
|
||||
end
|
||||
else
|
||||
# shift = Employee.find(current_shift.employee_id).name
|
||||
shift =current_shift
|
||||
end
|
||||
end
|
||||
shift.cash_out = shift.cash_out + amount.to_i
|
||||
shift.save
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,121 +1,18 @@
|
||||
class Foodcourt::DashboardController < BaseFoodcourtController
|
||||
|
||||
def index
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
|
||||
@display_type = Lookup.find_by_lookup_type("display_type")
|
||||
|
||||
@sale_data = Array.new
|
||||
@total_payment_methods = Sale.total_payment_methods(@shop,today,current_user)
|
||||
if !@total_payment_methods.nil?
|
||||
@total_payment_methods.each do |payment|
|
||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay"
|
||||
pay = Sale.payment_sale(@shop,'card', today, current_user)
|
||||
@sale_data.push({'card' => pay.payment_amount})
|
||||
else
|
||||
pay = Sale.payment_sale(@shop,payment.payment_method, today, current_user)
|
||||
@sale_data.push({payment.payment_method => pay.payment_amount})
|
||||
end
|
||||
end
|
||||
else
|
||||
@sale_data = nil
|
||||
end
|
||||
@summ_sale = Sale.summary_sale_receipt(@shop,today,current_user)
|
||||
@total_customer, @total_dinein, @total_takeaway, @total_membership = Sale.total_customer(@shop,today,current_user,@from,@to,@from_time,@to_time)
|
||||
# @total_other_customer = Sale.total_other_customer(today,current_user)
|
||||
|
||||
@total_order = Sale.total_order(@shop,today,current_user)
|
||||
@total_accounts = Sale.total_account(@shop,today,current_user)
|
||||
@account_data = Array.new
|
||||
if !@total_accounts.nil?
|
||||
@total_accounts.each do |account|
|
||||
acc = Sale.account_data(@shop,account.account_id, today,current_user)
|
||||
if !acc.nil?
|
||||
@account_data.push({account.title => acc.cnt_acc, account.title + '_amount' => acc.total_acc})
|
||||
end
|
||||
end
|
||||
else
|
||||
@account_data = nil
|
||||
end
|
||||
|
||||
@top_items = Sale.top_items(@shop,today,current_user)
|
||||
@total_foc_items = Sale.total_foc_items(@shop,today,current_user)
|
||||
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
@current_user = current_user
|
||||
#dine-in cashier
|
||||
dinein_cashier = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('dinein_cashier')
|
||||
@dinein_cashier = 0
|
||||
if !dinein_cashier[0].nil?
|
||||
@dinein_cashier = dinein_cashier[0][1]
|
||||
end
|
||||
|
||||
#quick service
|
||||
quick_service = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('quick_service')
|
||||
@quick_service = 0
|
||||
if !quick_service[0].nil?
|
||||
@quick_service = quick_service[0][1]
|
||||
end
|
||||
|
||||
#fourt court
|
||||
food_court = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('food_court')
|
||||
@food_court = 0
|
||||
@food_court_name = nil
|
||||
if !food_court[0].nil?
|
||||
@food_court = food_court[0][1]
|
||||
@food_court_name = food_court[0][0]
|
||||
end
|
||||
|
||||
#order reservation
|
||||
order_reservation = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('order_reservation')
|
||||
@order_reservation = 0
|
||||
if !order_reservation.empty?
|
||||
order_reservation.each do |order_reserve|
|
||||
if order_reserve[0] == 'OrderReservation'
|
||||
@order_reservation = order_reserve[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#dashboard settings on/off for supervisor and cashier
|
||||
dashboard_settings = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('dashboard_settings')
|
||||
@setting_flag = true
|
||||
if !dashboard_settings.empty?
|
||||
dashboard_settings.each do |setting|
|
||||
if setting[0].to_s.downcase == current_user.role.downcase && setting[1] == '0'
|
||||
@setting_flag = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#reservation
|
||||
reservation = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('reservation')
|
||||
@reservation = 0
|
||||
if !reservation.empty?
|
||||
reservation.each do |reserve|
|
||||
if reserve[0] == 'Reservation'
|
||||
@reservation = reserve[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
def get_all_menu
|
||||
@menus = Menu.includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).active.shop
|
||||
@item_attributes = MenuItemAttribute.all.load
|
||||
@item_options = MenuItemOption.all.load
|
||||
end
|
||||
|
||||
def get_all_menu
|
||||
@menus = Menu.includes(:menu_categories => {:menu_items => :menu_item_instances}).includes(:menu_categories => {:menu_items => :item_sets }).active.all
|
||||
@item_attributes = MenuItemAttribute.all.load
|
||||
@item_options = MenuItemOption.all.load
|
||||
end
|
||||
def get_credit_sales
|
||||
credit_sales = SalePayment.get_credit_sales(params)
|
||||
if !credit_sales.nil?
|
||||
result = {:status=> true, :data=> credit_sales }
|
||||
else
|
||||
result = {:status=> false, :message=>"There is no record." }
|
||||
end
|
||||
|
||||
def get_credit_sales
|
||||
credit_sales = SalePayment.get_credit_sales(params,@shop.shop_code)
|
||||
if !credit_sales.nil?
|
||||
result = {:status=> true, :data=> credit_sales }
|
||||
else
|
||||
result = {:status=> false, :message=>"There is no record." }
|
||||
render :json => result.to_json
|
||||
end
|
||||
|
||||
render :json => result.to_json
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -42,12 +42,6 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
table = nil
|
||||
table_id = nil
|
||||
end
|
||||
|
||||
|
||||
# sale.total_discount = overall_discount.to_f
|
||||
# sale.total_amount = sub_total.to_f
|
||||
# sale.grand_total = (sub_total.to_f - overall_discount.to_f) + sale.total_tax;
|
||||
# sale.save
|
||||
if discount_items.length > 0
|
||||
|
||||
#save sale item for discount
|
||||
@@ -56,14 +50,6 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
|
||||
sale_item = SaleItem.new
|
||||
|
||||
# if !origin_sale_item.nil?
|
||||
# menu_category = MenuCategory.get_menu_category(origin_sale_item.product_code) #get menu category for menu items
|
||||
# if !menu_category.nil?
|
||||
# sale_item.menu_category_code = menu_category.code
|
||||
# sale_item.menu_category_name = menu_category.name
|
||||
# end
|
||||
# end
|
||||
|
||||
sale_item.menu_category_code = origin_sale_item.menu_category_code
|
||||
sale_item.menu_category_name = origin_sale_item.menu_category_name
|
||||
|
||||
@@ -153,9 +139,6 @@ class Foodcourt::DiscountsController < BaseFoodcourtController
|
||||
sale_item.destroy
|
||||
end
|
||||
end
|
||||
|
||||
# sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax;
|
||||
# sale.save
|
||||
# Re-calc All Amount in Sale
|
||||
sale.compute_by_sale_items(sale.total_discount, nil, order_source)
|
||||
if table.nil?
|
||||
|
||||
@@ -10,17 +10,8 @@ class Foodcourt::FoodCourtController < ApplicationController
|
||||
def index
|
||||
today = DateTime.now
|
||||
day = Date.today.wday
|
||||
# if params[:menu] == "true"
|
||||
@menus = []
|
||||
@menu = []
|
||||
# else
|
||||
# @menus = Menu.all
|
||||
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||
# end
|
||||
@zone = Zone.all.where("is_active= true")
|
||||
@customer = Customer.all
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@cashier_type = "food_court"
|
||||
#checked quick_service only
|
||||
@quick_service_only = true
|
||||
@@ -40,104 +31,9 @@ class Foodcourt::FoodCourtController < ApplicationController
|
||||
.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.shop_code}' and DATE(bookings.created_at) = '#{Date.today}' and bookings.booking_status='assign'").uniq.length
|
||||
|
||||
render "foodcourt/addorders/detail"
|
||||
end
|
||||
|
||||
def modify_order
|
||||
@cashier_type = "food_court"
|
||||
today = DateTime.now
|
||||
day = Date.today.wday
|
||||
# if params[:menu] == "true"
|
||||
@menus = []
|
||||
@menu = []
|
||||
# else
|
||||
# @menus = Menu.all
|
||||
# @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||
# end
|
||||
if(params[:id][0,3] == "BKI")
|
||||
@table_id = nil
|
||||
@table = nil
|
||||
@booking = Booking.find(params[:id])
|
||||
else
|
||||
@table_id = params[:id]
|
||||
@table = DiningFacility.find(@table_id)
|
||||
@booking = @table.get_booking
|
||||
end
|
||||
|
||||
@sale_id = @booking.sale_id
|
||||
|
||||
if @booking
|
||||
@booking_id = @booking.booking_id
|
||||
@obj_order = @booking.orders.first
|
||||
@customer = @obj_order.customer
|
||||
@date = @obj_order.created_at
|
||||
@order_items = @booking.order_items
|
||||
end
|
||||
|
||||
render "foodcourt/addorders/detail"
|
||||
end
|
||||
|
||||
def update_modify_order
|
||||
booking = Booking.find(params[:booking_id])
|
||||
sale = booking.sale
|
||||
if sale && sale.sale_status != 'new'
|
||||
render :json => { :status => false }
|
||||
end
|
||||
|
||||
is_extra_time = false
|
||||
extra_time = ''
|
||||
cashier_type = "food_court"
|
||||
|
||||
items_arr = []
|
||||
JSON.parse(params[:order_items]).each { |i|
|
||||
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
||||
if i["item_instance_code"].include? "ext"
|
||||
is_extra_time = true
|
||||
arr_exts = i["item_instance_code"].split("_")
|
||||
if arr_exts[1].match(/^(\d)+$/)
|
||||
time = arr_exts[1].to_i*60*i["quantity"].to_i
|
||||
extra_time = Time.at(time)
|
||||
end
|
||||
end
|
||||
if i["parent_order_item_id"]
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": i["options"]}
|
||||
else
|
||||
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}
|
||||
end
|
||||
items_arr.push(items)
|
||||
}
|
||||
|
||||
# begin
|
||||
order = Order.new
|
||||
order.source = params[:order_source]
|
||||
order.order_type = params[:order_type]
|
||||
order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||
order.items = items_arr
|
||||
order.guest = params[:guest_info]
|
||||
order.table_id = params[:table_id] # this is dining facilities's id
|
||||
order.waiters = current_login_employee.name
|
||||
order.employee_name = current_login_employee.name
|
||||
|
||||
order.is_extra_time = is_extra_time
|
||||
order.extra_time = extra_time
|
||||
|
||||
order.new_booking = false
|
||||
order.booking_id = booking.booking_id
|
||||
|
||||
if order.generate
|
||||
if sale
|
||||
Sale.add_to_existing_pending_invoice(nil, sale.sale_id, booking)
|
||||
render :json => { :status => true, :data => sale }
|
||||
else
|
||||
render :json => { :status => true, :data => 'OK' }
|
||||
end
|
||||
else
|
||||
render :json => { :status => false }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_menu_category ()
|
||||
if (params[:id])
|
||||
puts params[:id]
|
||||
@@ -150,7 +46,6 @@ class Foodcourt::FoodCourtController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def get_menu_sub_category ()
|
||||
id = params[:id]
|
||||
if (id)
|
||||
@@ -173,35 +68,4 @@ class Foodcourt::FoodCourtController < ApplicationController
|
||||
}.to_json
|
||||
end
|
||||
|
||||
def check_order_with_table(table_id)
|
||||
table = DiningFacility.find(table_id)
|
||||
if table
|
||||
booking = table.get_current_booking
|
||||
# puts booking
|
||||
if booking
|
||||
if !booking.sale_id.nil?
|
||||
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"
|
||||
@order.new_booking = true
|
||||
return false
|
||||
end
|
||||
else
|
||||
@order.new_booking = false
|
||||
@order.booking_id = booking.booking_id
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# this can always true
|
||||
def check_order_with_booking(booking)
|
||||
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"
|
||||
@order.new_booking = true
|
||||
return false
|
||||
else
|
||||
@order.new_booking = false
|
||||
@order.booking_id = params[:booking_id]
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -66,11 +66,12 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
@sale_data = Sale.find_by_sale_id(@booking.sale_id)
|
||||
end
|
||||
@bookings = Booking.select("bookings.*,customers.*")
|
||||
.joins(" JOIN sales ON bookings.sale_id=sales.sale_id")
|
||||
.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=? and DATE(bookings.created_at)=?",@shop.shop_code,Date.today).order("bookings.created_at desc").uniq
|
||||
.where("sales.sale_status !=? and orders.source='app' and bookings.shop_code=? and DATE(bookings.created_at)=?",'void',@shop.shop_code,Date.today).order("bookings.created_at desc").uniq
|
||||
end
|
||||
def completed
|
||||
customer =Customer.find_by_customer_id(params[:customer_id])
|
||||
|
||||
@@ -15,7 +15,7 @@ class Foodcourt::ShiftsController < BaseFoodcourtController
|
||||
end
|
||||
|
||||
def new
|
||||
@float = Lookup.where('lookup_type=?','float_value')
|
||||
@float = Lookup.where('lookup_type=? and shop_code=?','float_value',@shop.shop_code)
|
||||
@terminal = CashierTerminal.available.where("shop_code='#{@shop.shop_code}'")
|
||||
end
|
||||
|
||||
|
||||
@@ -71,11 +71,12 @@ class Foodcourt::VoidController < BaseFoodcourtController
|
||||
sale_audit = SaleAudit.record_audit_for_edit(sale_id,current_user.name, action_by,remark,"SALEVOID" )
|
||||
|
||||
#call paymal to void
|
||||
if sale.sale_payments.nil?
|
||||
if !sale.sale_payments.nil?
|
||||
membership_response =sale.paymal_payment_void
|
||||
Rails.logger.debug "---------Paymal Payment Void response in VoidController"
|
||||
Rails.logger.debug membership_response.to_json
|
||||
end
|
||||
Rails.logger.debug "---------Paymal Payment Void response in VoidController"
|
||||
Rails.logger.debug membership_response.to_json
|
||||
|
||||
|
||||
# For Print
|
||||
member_info = nil
|
||||
|
||||
@@ -105,14 +105,14 @@ class Origami::DashboardController < BaseOrigamiController
|
||||
|
||||
def get_all_menu
|
||||
|
||||
@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
|
||||
@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.shop
|
||||
|
||||
@item_attributes = MenuItemAttribute.all.load
|
||||
@item_options = MenuItemOption.all.load
|
||||
end
|
||||
|
||||
def get_credit_sales
|
||||
credit_sales = SalePayment.get_credit_sales(params,@shop.shop_code)
|
||||
credit_sales = SalePayment.get_credit_sales(params)
|
||||
if !credit_sales.nil?
|
||||
result = {:status=> true, :data=> credit_sales }
|
||||
else
|
||||
|
||||
@@ -6,14 +6,14 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@webview = check_mobile
|
||||
|
||||
|
||||
@tables = Table.unscope(:order).includes(:zone).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).includes(:zone).all.active.order('status desc')
|
||||
@tables = Table.unscope(:order).includes(:zone).shop.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).includes(:zone).shop.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
|
||||
@occupied_table = DiningFacility.where("status='occupied'").shop.count
|
||||
@shift = ShiftSale.current_open_shift(current_user)
|
||||
end
|
||||
|
||||
@@ -24,8 +24,8 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@webview = check_mobile
|
||||
|
||||
|
||||
@tables = Table.unscope(:order).includes(:zone).all.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).includes(:zone).all.active.order('status desc')
|
||||
@tables = Table.unscope(:order).includes(:zone).shop.active.order('status desc')
|
||||
@rooms = Room.unscope(:order).includes(:zone).shop.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')
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def new
|
||||
@float = Lookup.where('lookup_type=?','float_value')
|
||||
@float = Lookup.where('lookup_type=? and shop_code=?','float_value',@shop.shop_code)
|
||||
@terminal = CashierTerminal.available
|
||||
end
|
||||
|
||||
|
||||
@@ -2,17 +2,15 @@ class Reports::DailysaleController < BaseReportController
|
||||
authorize_resource :class => false
|
||||
|
||||
def index
|
||||
from, to = get_date_range_from_params
|
||||
@sale_data = Sale.daily_sales_list(from,to,@shop.shop_code)
|
||||
@tax = SaleTax.get_tax(from,to,@shop.shop_code)
|
||||
@from = from
|
||||
@to = to
|
||||
@payment_methods = PaymentMethodSetting.where("is_active='1' and shop_code='#{@shop.shop_code}'").pluck("payment_method")
|
||||
|
||||
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
respond_to do |format|
|
||||
from, to = get_date_range_from_params
|
||||
@sale_data = Sale.daily_sales_list(from,to)
|
||||
@tax = SaleTax.get_tax(from,to)
|
||||
@from = from
|
||||
@to = to
|
||||
@payment_methods = PaymentMethodSetting.where("is_active='1' and shop_code=?",@shop.shop_code).pluck("payment_method")
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ class Transactions::BookingsController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@bookings = Booking.order("sale_id desc")
|
||||
@bookings = Booking.where("shop_code=?",@shop.shop_code).order("sale_id desc")
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
|
||||
else
|
||||
booking = Booking.search(filter,from,to)
|
||||
|
||||
@@ -6,7 +6,7 @@ class Transactions::CreditNotesController < ApplicationController
|
||||
# GET /transactions/sales
|
||||
# GET /transactions/sales.json
|
||||
def index
|
||||
|
||||
|
||||
@sources = [["All",''], ["Cashier","cashier"],["Quick Service","quick_service"],["Online Order","doemal_order"]]
|
||||
@customers = Customer.all
|
||||
|
||||
@@ -23,10 +23,10 @@ class Transactions::CreditNotesController < ApplicationController
|
||||
.joins("JOIN sale_payments sp on sp.sale_id = sales.sale_id")
|
||||
.where("(CASE WHEN (sales.grand_total + sales.amount_changed)=(select SUM(sale_payments.payment_amount)
|
||||
FROM sale_payments WHERE sale_payments.sale_id=sales.sale_id AND sale_payments.payment_method!='creditnote')
|
||||
THEN NULL ELSE payment_method='creditnote' END) and sales.shop_code='#{@shop.shop_code}'")
|
||||
THEN NULL ELSE payment_method='creditnote' END)").shop
|
||||
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
|
||||
else
|
||||
sale = Sale.search_credit_sales(customer,filter,from,to,order_source).where("sales.shop_code='#{@shop.shop_code}'")
|
||||
sale = Sale.search_credit_sales(customer,filter,from,to,order_source).shop
|
||||
if !sale.nil?
|
||||
@credit_notes = sale
|
||||
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
|
||||
|
||||
@@ -18,13 +18,13 @@ class Transactions::SalesController < ApplicationController
|
||||
|
||||
if receipt_no.nil? && from.nil? && to.nil?
|
||||
if @shift.blank?
|
||||
@sales = Sale.where("NOT sale_status='new'").order("sale_id desc")
|
||||
@sales = Sale.where("NOT sale_status='new'").shop.order("sale_id desc")
|
||||
else
|
||||
@sales = Sale.where("NOT sale_status='new' and shift_sale_id ='#{@shift.id}'").order("sale_id desc")
|
||||
@sales = Sale.where("NOT sale_status='new' and shift_sale_id ='#{@shift.id}'").shop.order("sale_id desc")
|
||||
end
|
||||
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
|
||||
else
|
||||
sale = Sale.search(receipt_no,from,to,@shift)
|
||||
sale = Sale.search(receipt_no,from,to,@shift).shop
|
||||
if sale.count > 0
|
||||
@sales = sale
|
||||
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
|
||||
@@ -271,6 +271,10 @@ class Transactions::SalesController < ApplicationController
|
||||
sale.sale_status = 'void'
|
||||
sale.save
|
||||
|
||||
#call paymal to void
|
||||
if !sale.sale_payments.nil?
|
||||
membership_response =sale.paymal_payment_void
|
||||
end
|
||||
# No Need
|
||||
# bookings = sale.bookings
|
||||
# bookings.each do |booking|
|
||||
|
||||
@@ -11,6 +11,8 @@ class Booking < ApplicationRecord
|
||||
has_many :order_items, :through => :orders
|
||||
scope :active, -> {where("booking_status != 'moved'")}
|
||||
scope :today, -> {where("created_at >= #{Time.now.utc}")}
|
||||
scope :shop, -> { where("bookings.shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
|
||||
def self.sync_booking_records(bookings)
|
||||
if !bookings.nil?
|
||||
@@ -84,7 +86,7 @@ class Booking < ApplicationRecord
|
||||
joins(" LEFT JOIN dining_facilities df ON df.id=bookings.dining_facility_id")
|
||||
.where("booking_id LIKE ? OR checkin_by LIKE ? OR booking_status LIKE? OR checkout_by LIKE? OR sale_id ='#{filter}' OR df.name LIKE ?","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||
end
|
||||
.order("sale_id DESC")
|
||||
.shop.order("sale_id DESC")
|
||||
end
|
||||
|
||||
def self.get_sync_data(sale_id)
|
||||
|
||||
@@ -7,6 +7,7 @@ class DiningFacility < ApplicationRecord
|
||||
ROOM_TYPE = "Room"
|
||||
|
||||
default_scope { order('order_by asc') }
|
||||
scope :shop, -> { where("shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ class Menu < ApplicationRecord
|
||||
#Default Scope to pull the active version only
|
||||
default_scope { order("created_at asc") }
|
||||
scope :active, -> {where("is_active = true")}
|
||||
scope :shop, -> { where("menus.shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
def self.current_menu
|
||||
today = DateTime.now
|
||||
|
||||
@@ -192,6 +192,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
puts printer_settings.to_json
|
||||
if !printer_settings.nil?
|
||||
if !printer_settings.unique_code.strip.downcase.include? ("receiptbillorder")
|
||||
pdf = ReceiptBillPdf.new(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,transaction_ref)
|
||||
|
||||
@@ -32,6 +32,7 @@ class Sale < ApplicationRecord
|
||||
|
||||
scope :receipt_date_between, -> (from, to) { where(receipt_date: from..to) }
|
||||
scope :along_with_sale_payments_except_void_between, -> (from, to) { joins(sanitize_sql_array(["LEFT JOIN sale_payments on sales.sale_status != 'void' AND sale_payments.sale_id = sales.sale_id AND sale_payments.created_at BETWEEN ? and ?", from, to])) }
|
||||
scope :shop, -> { where("sales.shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
|
||||
def qty_of(item_instance_code)
|
||||
@@ -832,7 +833,7 @@ class Sale < ApplicationRecord
|
||||
return num
|
||||
end
|
||||
|
||||
def self.daily_sales_list(from,to,shop_code)
|
||||
def self.daily_sales_list(from,to)
|
||||
sales = select("
|
||||
sales.*,
|
||||
SUM(case when (sale_payments.payment_method='KBZPay') then sale_payments.payment_amount else 0 end) as kbzpay_amount,
|
||||
@@ -853,7 +854,7 @@ def self.daily_sales_list(from,to,shop_code)
|
||||
SUM(case when (sale_payments.payment_method='giftvoucher') then sale_payments.payment_amount else 0 end) as giftvoucher_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
|
||||
.along_with_sale_payments_except_void_between(from, to)
|
||||
.where("(sale_status = ? OR sale_status = ?) AND sales.receipt_date between ? AND ? ", 'completed', 'void', from, to)
|
||||
.where("(sale_status = ? OR sale_status = ?) AND sales.receipt_date between ? AND ? ", 'completed', 'void', from, to).shop
|
||||
.group("sale_id").to_sql
|
||||
|
||||
daily_total = connection.select_all("SELECT
|
||||
@@ -2431,39 +2432,40 @@ def self.get_check_sale_data(transaction_date)
|
||||
.group("sales.receipt_no,sales.sale_status")
|
||||
end
|
||||
def paymal_payment_void
|
||||
puts self.sale_payments.to_json
|
||||
membership_setting = MembershipSetting.find_by_membership_type_and_shop_code("paypar_url",self.shop_code)
|
||||
membership_actions_data = MembershipAction.find_by_membership_type_and_shop_code("void",self.shop_code)
|
||||
if !membership_actions_data.nil?
|
||||
sale_payments =self.sale_payments.where("payment_reference is not null")
|
||||
account_no =sale_payments[0].payment_reference
|
||||
url = membership_setting.gateway_url.to_s + membership_actions_data.gateway_url.to_s
|
||||
merchant_uid = membership_actions_data.merchant_account_id
|
||||
auth_token = membership_actions_data.auth_token
|
||||
params = { receipt_no:self.receipt_no,
|
||||
account_no:account_no,
|
||||
merchant_uid:merchant_uid,
|
||||
auth_token:auth_token}.to_json
|
||||
if !sale_payments.empty?
|
||||
account_no =sale_payments[0].payment_reference
|
||||
url = membership_setting.gateway_url.to_s + membership_actions_data.gateway_url.to_s
|
||||
merchant_uid = membership_actions_data.merchant_account_id
|
||||
auth_token = membership_actions_data.auth_token
|
||||
params = { receipt_no:self.receipt_no,
|
||||
account_no:account_no,
|
||||
merchant_uid:merchant_uid,
|
||||
auth_token:auth_token}.to_json
|
||||
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.post(url,
|
||||
:body => params,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json; version=3'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Errno::ECONNREFUSED
|
||||
response = { "status" => false, "message" => "Can't open membership server"}
|
||||
rescue Net::OpenTimeout
|
||||
response = { "status" => false, "message" => "No internet connection " }
|
||||
rescue OpenURI::HTTPError
|
||||
response = { "status" => false, "message" => "No internet connection "}
|
||||
rescue SocketError
|
||||
response = { "status" => false, "message" => "No internet connection "}
|
||||
end
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.post(url,
|
||||
:body => params,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json; version=3'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Errno::ECONNREFUSED
|
||||
response = { "status" => false, "message" => "Can't open membership server"}
|
||||
rescue Net::OpenTimeout
|
||||
response = { "status" => false, "message" => "No internet connection " }
|
||||
rescue OpenURI::HTTPError
|
||||
response = { "status" => false, "message" => "No internet connection "}
|
||||
rescue SocketError
|
||||
response = { "status" => false, "message" => "No internet connection "}
|
||||
end
|
||||
end
|
||||
else
|
||||
response = { "status" => false}
|
||||
end
|
||||
|
||||
@@ -655,7 +655,7 @@ class SalePayment < ApplicationRecord
|
||||
if spay.payment_method == KbzPay::KBZ_PAY
|
||||
is_kbz_pay = 1
|
||||
end
|
||||
if spay.payment_method == "cash" || spay.payment_method == "foc" || spay.payment_method == "creditnote" || spay.payment_method == KbzPay::KBZ_PAY
|
||||
if spay.payment_method == "cash" || spay.payment_method == "foc" || spay.payment_method == "creditnote" || spay.payment_method == KbzPay::KBZ_PAY || spay.payment_method =="paymal"
|
||||
method_status = true
|
||||
end
|
||||
end
|
||||
@@ -954,14 +954,14 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
#credit payment query
|
||||
|
||||
def self.get_credit_sales(params,shop_code)
|
||||
def self.get_credit_sales(params)
|
||||
payments = SalePayment.select("sale_payments.sale_id, sale_payments.sale_payment_id, sale_payments.payment_method, sale_payments.payment_amount")
|
||||
.select("SUM(sale_payments.payment_amount) OVER (PARTITION BY sale_payments.sale_id) total_payment_amount")
|
||||
|
||||
credit_sales = Sale.select("sales.sale_id, sales.receipt_no, sales.receipt_date as sale_date, sales.cashier_name")
|
||||
.select("sale_payments.sale_payment_id, sale_payments.payment_amount").select("customers.name as customer_name")
|
||||
.joins("JOIN (#{payments.to_sql}) AS sale_payments ON sale_payments.sale_id = sales.sale_id").joins(:customer).joins(:orders)
|
||||
.completed.paid.where("sale_payments.payment_method = 'creditnote' AND sales.grand_total > sale_payments.total_payment_amount - sale_payments.payment_amount and sales.shop_code=?",shop_code)
|
||||
.completed.paid.where("sale_payments.payment_method = 'creditnote' AND sales.grand_total > sale_payments.total_payment_amount - sale_payments.payment_amount").shop
|
||||
.group(:receipt_no)
|
||||
.order(:receipt_date).order(:receipt_no)
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ class SaleTax < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_tax(from,to,shop_code)
|
||||
def self.get_tax(from,to)
|
||||
query = SaleTax.select("sale_taxes.tax_name,SUM(sale_taxes.tax_payable_amount) as tax_amount")
|
||||
.joins("join sales on sales.sale_id = sale_taxes.sale_id")
|
||||
.where("sales.shop_code='#{shop_code}' and sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0 AND inclusive = 0", 'completed', from, to)
|
||||
.where("sales.shop_code=? and sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0 AND inclusive = 0",Shop.current_shop.shop_code, 'completed', from, to)
|
||||
.group("sale_taxes.tax_name")
|
||||
end
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ class Zone < ApplicationRecord
|
||||
has_many :rooms, dependent: :destroy
|
||||
has_many :order_queue_stations
|
||||
has_many :cashier_terminals
|
||||
|
||||
scope :shop, -> { where("shop_code=?",Shop.current_shop.shop_code) }
|
||||
|
||||
# validations
|
||||
validates_presence_of :name, :created_by
|
||||
|
||||
@@ -46,7 +46,13 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
header(shop_details)
|
||||
if sale_data.orders[0].source =='app'
|
||||
text "Mobile Order", :size => self.header_font_size,:align => :left
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width) do
|
||||
text "Mobile Order", :size => self.header_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.header_font_size,:align => :right,:style=>:bold
|
||||
end
|
||||
move_down 1
|
||||
text "Customer Ph : #{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
|
||||
move_down 1
|
||||
@@ -136,11 +142,12 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width, :height => self.item_height) do
|
||||
text "Receipt No: #{sale_data.receipt_no}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width, :height => self.item_height) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
if sale_data.orders[0].source !='app'
|
||||
if sale_data.bookings[0].dining_facility_id.to_i > 0
|
||||
bounding_box([self.description_width - 2,y_position], :width => self.price_num_width, :height => self.item_height) do
|
||||
text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
|
||||
@@ -440,82 +440,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if type && !modify_order%>
|
||||
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="margin-top: -1rem;">
|
||||
<!-- <h4 class="modal-title" id="TableModalLabel">Select Table</h4> -->
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;">×</button>
|
||||
</div>
|
||||
<div class="modal-body" style="margin-top: -0.75rem;padding-top:5px">
|
||||
<%@zone.each do |zone| %>
|
||||
<h5>Zone : <%=zone.name%></h5>
|
||||
<div class="card-columns" style="column-count: 7;">
|
||||
<%zone.tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<% color="red"%>
|
||||
<% else %>
|
||||
<% color="orange"%>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<% color="blue"%>
|
||||
<% else %>
|
||||
<% color="orange"%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% color="green"%>
|
||||
<% end %>
|
||||
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
|
||||
<%zone.rooms.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<% color="red"%>
|
||||
<% else %>
|
||||
<% color="orange"%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if table.get_checkout_booking.nil? %>
|
||||
<% color="blue"%>
|
||||
<% else %>
|
||||
<% color="orange"%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% color="green"%>
|
||||
<% end %>
|
||||
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
<%end%>
|
||||
<div class="modal-footer p-r-30">
|
||||
<button type="button" class="btn btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect confirm_table" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||
</div>
|
||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.fadeInRight{
|
||||
-webkit-animation-duration: 350ms !important;
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
<div class="container-fluid">
|
||||
<div class='row'>
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<h2> <%= t :cash_in %> </h2>
|
||||
<br>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td> <%= t :payment_reference %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" placeholder="Reference" id="reference">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.remark") %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" placeholder="Remark" id="remark">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t :payment_method %>
|
||||
</td>
|
||||
<td>
|
||||
<button class='btn bg- waves-effect payment-type' data-id='cash' id='cash' style="background-color: #7a62d3;"><%= t("views.btn.cash") %></button>
|
||||
<button class='btn bg- waves-effect payment-type' data-id='mpu' id='mpu' style="background-color: #7a62d3;"><%= t("views.btn.mpu") %></button>
|
||||
<button class='btn bg- waves-effect payment-type' data-id='visa' id='visa' style="background-color: #7a62d3;"><%= t("views.btn.visa") %></button>
|
||||
<button class='btn bg- waves-effect payment-type' data-id='jcb' id='jcb' style="background-color: #7a62d3;"><%= t("views.btn.jcb") %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t :reference_number %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" id="payment_method_reference">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.amount") %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" placeholder="Amount" id="amount">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 ">
|
||||
<br>
|
||||
<div class="button-demo m-t-40">
|
||||
<button type="button" class="btn bg-default waves-effect btn-" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
|
||||
<button type="button" class="btn bg-blue waves-effect btn-" id='cash_in'> <%= t("views.btn.cash_in") %> </button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
cashier_type = '<%= @cashier_type %>';
|
||||
console.log(cashier_type)
|
||||
|
||||
var payment_method = "";
|
||||
$('.payment-type').on('click',function(){
|
||||
$('.payment-type').css("background-color","#7a62d3");
|
||||
$(this).css("background-color","green");
|
||||
var type = $(this).attr('data-id')
|
||||
if(type == 'cash'){
|
||||
payment_method = 'cash';
|
||||
}else if(type == 'mpu'){
|
||||
payment_method = "mpu";
|
||||
}else if(type == 'visa'){
|
||||
payment_method = "visa";
|
||||
}else if(type == 'jcb'){
|
||||
payment_method = "jcb";
|
||||
}
|
||||
})
|
||||
$('#cash_in').on('click',function(){
|
||||
var reference = $('#reference').val();
|
||||
var remark = $('#remark').val();
|
||||
var amount = $('#amount').val();
|
||||
var payment_method_reference = $('#payment_method_reference').val();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= foodcourt_cash_ins_path %>",
|
||||
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference,
|
||||
success:function(result){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#back').on('click',function(){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>CashMgmt#create</h1>
|
||||
<p>Find me in app/views/cash_mgmt/create.html.erb</p>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>CashMgmt#index</h1>
|
||||
<p>Find me in app/views/cash_mgmt/index.html.erb</p>
|
||||
@@ -1,3 +0,0 @@
|
||||
<h1>CashMgmt#new</h1>
|
||||
<p>Find me in app/views/cash_mgmt/new.html.erb</p>
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<div class="container-fluid">
|
||||
<div class='row'>
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<h2><%= t :cash_out %></h2>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td> <%= t :payment_reference %></td>
|
||||
<td><input type="text" class="form-control" placeholder="Reference" id="reference"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.remark") %></td>
|
||||
<td><input type="text" class="form-control" placeholder="Remark" id="remark"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <%= t("views.right_panel.detail.amount") %> </td>
|
||||
<td><input type="text" class="form-control" placeholder="Amount" id="amount"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<br><br>
|
||||
<button type="button" class="btn bg-default btn-block" id='back'> <i class="material-icons">reply</i><%= t("views.btn.back") %> </button>
|
||||
<button type="button" class="btn bg-blue btn-block" id='cash_out'> <%= t("views.btn.cash_out") %> </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
cashier_type = '<%= @cashier_type %>';
|
||||
$('#cash_out').on('click',function(){
|
||||
var reference = $('#reference').val();
|
||||
var remark = $('#remark').val();
|
||||
var amount = $('#amount').val();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= foodcourt_cash_outs_path %>",
|
||||
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
|
||||
success:function(result){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
|
||||
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
|
||||
}else{
|
||||
window.location.href = '/foodcourt';
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -1,281 +0,0 @@
|
||||
<div class="container-fluid">
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
<div class="block-header">
|
||||
<!-- <h2><%= t :dashboard %></h2> -->
|
||||
<h2><%= t :date_time %> : <%= Time.zone.now.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></h2>
|
||||
</div>
|
||||
<% if @print_settings.precision.to_i > 0
|
||||
precision = @print_settings.precision
|
||||
else
|
||||
precision = 0
|
||||
end
|
||||
#check delimiter
|
||||
if @print_settings.delimiter
|
||||
delimiter = ","
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
|
||||
<!-- Widgets -->
|
||||
<div class="row clearfix">
|
||||
<% if @quick_service == '1' %>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 qs_view">
|
||||
<div class="info-box bg-purple">
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :quick_service %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @food_court == '1' %>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 fc_view">
|
||||
<div class="info-box bg-pink">
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= @food_court_name %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @dinein_cashier == '1' %>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 cashier_view">
|
||||
<div class="info-box bg-green">
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @reservation == '1' %>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 reservation">
|
||||
<div class="info-box bg-orange">
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :reservation %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @order_reservation == '1' %>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 order_reservation">
|
||||
<div class="info-box bg-blue">
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :order_reservation %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!-- #END# Widgets -->
|
||||
<% if !@current_user.nil? && @current_user.role != 'waiter' && @setting_flag %>
|
||||
<!-- CPU Usage -->
|
||||
<div class="row clearfix">
|
||||
|
||||
<% if !@summ_sale.nil? %>
|
||||
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6><%= t :sale %></h6>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
|
||||
<td align="right"><%= @summ_sale.total_receipt %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<% revenue = @summ_sale.total_amount - @summ_sale.total_discount%>
|
||||
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
|
||||
<td align="right"><%= number_with_precision( revenue, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
|
||||
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="table">
|
||||
<% if !(@total_payment_methods.nil?) %>
|
||||
<% @total_payment_methods.each do |payment| %>
|
||||
<% if !@sale_data[0].empty? %>
|
||||
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
|
||||
<tr>
|
||||
<% if payment.payment_method == 'paypar' %>
|
||||
<td>Redeem Sale : </td>
|
||||
<% else %>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<% pay_mth = payment.payment_method %>
|
||||
<%= data[""+pay_mth+""] %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
|
||||
<% if !total_card.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
|
||||
<td align="right">
|
||||
<%= total_card["card"].to_f %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6><%= t :customer %></h6>
|
||||
<table class="table">
|
||||
<% if !@total_customer.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t :customer %> : </td>
|
||||
<td align="right"><%= @total_customer %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_dinein.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.dine_in") %> : </td>
|
||||
<td align="right"><%= @total_dinein %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_takeaway.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.takeaway") %> : </td>
|
||||
<td align="right"><%= @total_takeaway %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!-- <% if !@total_other_customer.nil? %>
|
||||
<tr>
|
||||
<td><%= t :customer %> : </td>
|
||||
<td align="right"><%= @total_other_customer.total_cus %></td>
|
||||
</tr>
|
||||
<% end %> -->
|
||||
<% if !@total_membership.nil? %>
|
||||
<tr>
|
||||
<td><%= t("views.right_panel.detail.membership") %> : </td>
|
||||
<td align="right"><%= @total_membership %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h6><%= t("views.right_panel.detail.order") %></h6>
|
||||
<table class="table">
|
||||
<% if !@total_order.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : </td>
|
||||
<td align="right" width="60px"><%= @total_order.total_order %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if !@total_accounts.nil? %>
|
||||
<% @total_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td width="40px"><%= account.title %> (Account) : </td>
|
||||
<td align="right" width="60px">
|
||||
<% @account_data.each do |data| %>
|
||||
<% acc = account.title %>
|
||||
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if !@top_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||
<br>(<%= @top_items.item_total_price %>)</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@total_foc_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px"><%= @total_foc_items.to_int %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<button type="button" data-href="<%=foodcourt_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect second_view hidden" style="height: 45px">Customer View</button>
|
||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||
<script>
|
||||
$(function() {
|
||||
$("#loading_wrapper").show();
|
||||
getAllMenu();
|
||||
|
||||
$(".cashier_view").on('click', function() {
|
||||
window.location.href = '/foodcourt';
|
||||
});
|
||||
|
||||
$(".qs_view").on('click', function() {
|
||||
var display_type = '<%= @display_type %>';
|
||||
if (display_type.length>0) {
|
||||
display_type = '<%= @display_type %>';
|
||||
}else{
|
||||
display_type = null;
|
||||
}
|
||||
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
||||
document.getElementById('second_view').click();
|
||||
}
|
||||
window.location.href = '/foodcourt/quick_service';
|
||||
});
|
||||
|
||||
$(".fc_view").on('click', function() {
|
||||
var display_type = '<%= @display_type %>';
|
||||
if (display_type.length>0) {
|
||||
display_type = '<%= @display_type %>';
|
||||
}else{
|
||||
display_type = null;
|
||||
}
|
||||
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
||||
document.getElementById('second_view').click();
|
||||
}
|
||||
window.location.href = '/foodcourt/food_court';
|
||||
});
|
||||
|
||||
$(".order_reservation").on('click', function() {
|
||||
window.location.href = '/foodcourt/order_reservation';
|
||||
});
|
||||
|
||||
$("#second_view").on('click', function () {
|
||||
var url = $(this).attr("data-href");
|
||||
window.open(url,'_blank');
|
||||
});
|
||||
|
||||
$(".reservation").on("click", function(){
|
||||
window.location.href = '/foodcourt/reservation';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -1,7 +0,0 @@
|
||||
if @status == true
|
||||
#show invoice number and stuff
|
||||
json.status @status
|
||||
else
|
||||
json.status @status
|
||||
json.error_message @error_message
|
||||
end
|
||||
@@ -1,149 +0,0 @@
|
||||
<%= stylesheet_link_tag 'reservation', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'reservation', 'data-turbolinks-track': 'reload' %>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||
<div class="card" id="make-reservation-slimscroll" data-height="-50">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title text-center bg-faded"><%= t :make_reservation %></h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="wizard">
|
||||
<div class="wizard-inner">
|
||||
<div class="active-line"></div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="nav-item">
|
||||
<div class="connecting-line border-right"></div>
|
||||
<a href="#reservation" class="nav-link active" data-toggle="tab" aria-controls="reservation" role="tab" title="Reservation">
|
||||
<span class="round-tab">
|
||||
1
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item disabled">
|
||||
<div class="connecting-line"></div>
|
||||
<a href="#personal_detail" class="nav-link disable" data-toggle="tab" aria-controls="personal_detail" role="tab" title="Personal Detail">
|
||||
<span class="round-tab">
|
||||
2
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> <!-- .end.wizard-inner -->
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" role="tabpanel" id="reservation">
|
||||
<div class="form-row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12">
|
||||
<label class="font-12 radio-inline">
|
||||
<input type="radio" name="reservation_type" checked class="radio-col-indigo reservation_type" value="0"><%= t("views.right_panel.detail.dine_in") %>
|
||||
</label>
|
||||
<label class="font-12 radio-inline">
|
||||
<input type="radio" name="reservation_type" class="radio-col-indigo reservation_type" value="1"><%= t :room %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dining_type">
|
||||
<div class="form-row clearfix">
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row clearfix">
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_in_time timepicker" name="check_in_time" id="check_in_time" type="text" placeholder="Check-in Time">
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_out_time timepicker" name="check_out_time" id="check_out_time" type="text" placeholder="Check Out Time">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="room_type">
|
||||
<div class="form-row clearfix">
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row clearfix">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<label for="room_count" class="control-label">ROOMS</label>
|
||||
<input type="number" class="form-control number_limit" name="room_count" id="room_count" data-type="room" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row clearfix">
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<label for="adult_count" class="control-label">ADULT</label>
|
||||
<input type="number" class="form-control number_limit" name="adult_count" id="adult_count" data-type="adult" value="1">
|
||||
</div>
|
||||
<div class="form-group col-sm-6 col-md-6 col-lg-6">
|
||||
<label for="child_count" class="control-label">CHILD</label>
|
||||
<input type="number" class="form-control number_limit" name="child_count" id="child_count" data-type="child">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<button class="btn bg-blue btn-lg waves-effect">CHECK AVAILABLE</button>
|
||||
<button class="btn bg-blue btn-lg waves-effect next-step">NEXT</button>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .end.tab-panel .reservation -->
|
||||
|
||||
<div class="tab-pane" role="tabpanel" id="personal_detail">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<input class="form-control" name="name" id="name" type="text" placeholder="NAME">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<input class="form-control" name="contact_no" id="contact_no" type="number" placeholder="PHONE NUMBER">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<input class="form-control" name="address" id="address" type="text" placeholder="ADDRESS">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<label for="reservation_note" class="control-label">RESERVATION NOTE</label>
|
||||
<textarea rows="3" id="reservation_note" name="reservation_note" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<div class="form-group col-sm-12 col-md-12 col-lg-12">
|
||||
<button class="btn bg-blue btn-lg prev-step">PREV</button>
|
||||
<button class="btn bg-blue btn-lg">SUBMIT</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- .end.tab-content .personal_detail -->
|
||||
</div> <!-- .end.wizard -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
|
||||
<div class="card font-13">
|
||||
<div class="row clearfix">
|
||||
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7" id="process-reservation-slimscroll" data-height="-80">
|
||||
|
||||
</div>
|
||||
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5" id="reservation-info-slimscroll" data-height="-80">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -531,8 +531,7 @@
|
||||
<% end %>
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<!-- first bill not used in cloud -->
|
||||
|
||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
||||
<%if @membership.discount && !@obj_sale.customer.membership_id.blank? %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal" data-order="<%= existing_order %>">First Bill</button>
|
||||
<%else%>
|
||||
<button type="button" id="first_bill" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<%= f.input :is_currently_login %>
|
||||
<%= f.input :auto_print_receipt %>
|
||||
<%= f.label "Select Zones", :class => 'control-label' %>
|
||||
<%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%>
|
||||
<%= f.collection_check_boxes :zone_ids , Zone.shop, :id, :name , :class => 'checkbox form-group'%>
|
||||
<% if(@server_mode != 'cloud') %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<% else %>
|
||||
@@ -58,24 +58,24 @@
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.cashier_terminal_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var serverMode = "<%= @server_mode %>";
|
||||
var serverMode = "<%= @server_mode %>";
|
||||
if(serverMode == 'cloud'){
|
||||
var printers = code2lab.getPrinters();
|
||||
var printerInfo = JSON.parse([printers]);
|
||||
var select = $("#cashier_terminal_printer_name");
|
||||
var printers = code2lab.getPrinters();
|
||||
var printerInfo = JSON.parse([printers]);
|
||||
var select = $("#cashier_terminal_printer_name");
|
||||
|
||||
$.each(printerInfo, function(key, value) {
|
||||
$.each(printerInfo, function(key, value) {
|
||||
$('#cashier_terminal_printer_name')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value.target)
|
||||
.text(value.deviceName));
|
||||
});
|
||||
}
|
||||
.text(value.deviceName));
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -395,6 +395,7 @@
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('.confirm').prop("disabled",true);
|
||||
var sale_id = "<%= @sale.sale_id %>";
|
||||
// console.log(sale_id)
|
||||
var ajax_url = "/transactions/sales/" + sale_id + '/cashier/void';
|
||||
|
||||
@@ -606,11 +606,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
|
||||
#only for foodcourt
|
||||
namespace :foodcourt do
|
||||
root "home#index"
|
||||
|
||||
post '/check_emp_access_code/:code' => 'home#check_emp_access_code', :defaults => { :format => 'json' }
|
||||
|
||||
get "dashboard" => "dashboard#index"
|
||||
get "get_all_menu" => "dashboard#get_all_menu"
|
||||
get "/table/:table_id/sale/:sale_id/:type/edit" => "sale_edit#edit"
|
||||
get "/table/sale/:sale_id/:type/edit" => "sale_edit#edit"
|
||||
@@ -636,17 +632,12 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
# Discount for Member
|
||||
post "/:id/member_discount" => "discounts#member_discount"
|
||||
|
||||
get "/:id/request_bills" => "request_bills#print", :as => "request_bill"
|
||||
get '/:sale_id/reprint' => 'payments#reprint', :defaults => {:format => 'json'}
|
||||
|
||||
#---------Shift ---------------#
|
||||
resources :shifts, only: [:index, :new, :create, :edit]
|
||||
post 'close_shift' => 'shifts#update_shift'
|
||||
get 'shift/:type/close' => 'shifts#show'
|
||||
get 'shift/sale_summary' => 'shifts#sale_summary'
|
||||
|
||||
resources :cash_mgmt, only: [:new, :create]
|
||||
|
||||
post 'sale/:sale_id/:type/payment/print' => 'payments#print' #route for print receipt
|
||||
get 'sale/:sale_id/:type/payment' => 'payments#show'
|
||||
post 'payment/:type/foc' => 'payments#foc', :defaults => {:format => 'json'}
|
||||
|
||||
Reference in New Issue
Block a user