This commit is contained in:
Myat Zin Wai Maw
2020-01-08 15:35:47 +06:30
parent fab750c53a
commit d43266bd7d
8 changed files with 12 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ class Api::BillController < Api::ApiController
@status = false @status = false
@error_message = "Order ID or Booking ID is require to request for a bill." @error_message = "Order ID or Booking ID is require to request for a bill."
# if shift_by_terminal = ShiftSale.current_open_shift(get_cashier[0].id) # if shift_by_terminal = ShiftSale.current_open_shift(get_cashier[0].id)
if !ShiftSale.current_shift(@shop.shop_code).nil? if !ShiftSale.current_shift.nil?
#create Bill by Booking ID #create Bill by Booking ID
table = 0 table = 0
if (params[:booking_id]) if (params[:booking_id])

View File

@@ -16,7 +16,7 @@ class Api::SurveyController < Api::ApiController
def create def create
dining_facility = DiningFacility.find(params[:id]) dining_facility = DiningFacility.find(params[:id])
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''") open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
current_shift = ShiftSale.current_shift(@shop.shop_code) current_shift = ShiftSale.current_shift
current_shift_user =Employee.find_by_id(current_shift.employee_id) current_shift_user =Employee.find_by_id(current_shift.employee_id)
if open_cashier.count>0 if open_cashier.count>0
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0]) shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0])

View File

@@ -47,7 +47,7 @@ class Foodcourt::SurveysController < BaseFoodcourtController
# shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil) # shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
# set cashier # set cashier
open_cashier = Employee.where("role = 'cashier' AND token_session <> '' and shop_code='#{@shop.shop_code}'") open_cashier = Employee.where("role = 'cashier' AND token_session <> '' and shop_code='#{@shop.shop_code}'")
current_shift = ShiftSale.current_shift(@shop.shop_code) current_shift = ShiftSale.current_shift
current_shift_user =Employee.find_by_id(current_user.employee_id) current_shift_user =Employee.find_by_id(current_user.employee_id)
if open_cashier.count>0 if open_cashier.count>0
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0]) shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0])

View File

@@ -47,7 +47,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
def create_credit_payment def create_credit_payment
arr_sale = JSON.parse(params[:data]) arr_sale = JSON.parse(params[:data])
if !ShiftSale.current_shift(@shop.shop_code).nil? if !ShiftSale.current_shift.nil?
if !arr_sale.nil? if !arr_sale.nil?
arr_sale.each do |arr_sale| arr_sale.each do |arr_sale|
arr_sale.each do |sale| arr_sale.each do |sale|

View File

@@ -22,7 +22,7 @@ class Origami::OrderReservationController < BaseOrigamiController
order_reserve = OrderReservation.find_by_transaction_ref(params[:ref_no]) order_reserve = OrderReservation.find_by_transaction_ref(params[:ref_no])
if !order_reserve.nil? if !order_reserve.nil?
if !ShiftSale.current_shift(@shop.shop_code).nil? if !ShiftSale.current_shift.nil?
if @status == "processed" if @status == "processed"
if order_reserve.status == "accepted" if order_reserve.status == "accepted"
result = OrderReservation.create_doemal_order(order_reserve,current_user) result = OrderReservation.create_doemal_order(order_reserve,current_user)
@@ -86,7 +86,7 @@ class Origami::OrderReservationController < BaseOrigamiController
def send_status def send_status
order_reservation = OrderReservation.find_by_transaction_ref(params[:ref_no]) order_reservation = OrderReservation.find_by_transaction_ref(params[:ref_no])
if !order_reservation.nil? if !order_reservation.nil?
if !ShiftSale.current_shift(@shop.shop_code).nil? || params[:status] == 'accepted' || (order_reservation.status == 'new' && params[:status] == 'rejected') if !ShiftSale.current_shift.nil? || params[:status] == 'accepted' || (order_reservation.status == 'new' && params[:status] == 'rejected')
response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],params[:status],params[:waiting_time],params[:min_type],params[:reason]) response = OrderReservation.send_status_to_ordering(params[:url],params[:ref_no],params[:status],params[:waiting_time],params[:min_type],params[:reason])
else else
response = { status: false, message: 'No current shift open for this employee!'} response = { status: false, message: 'No current shift open for this employee!'}

View File

@@ -100,7 +100,7 @@ class Origami::SplitBillController < BaseOrigamiController
end end
status = false status = false
if !ShiftSale.current_shift(@shop.shop_code).nil? if !ShiftSale.current_shift.nil?
#create Bill by Booking ID #create Bill by Booking ID
table = 0 table = 0
if !params[:booking_id].empty? if !params[:booking_id].empty?

View File

@@ -47,7 +47,7 @@ class Origami::SurveysController < BaseOrigamiController
# shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil) # shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
# set cashier # set cashier
open_cashier = Employee.where("role = 'cashier' AND token_session <> '' and shop_code='#{@shop.shop_code}'") open_cashier = Employee.where("role = 'cashier' AND token_session <> '' and shop_code='#{@shop.shop_code}'")
current_shift = ShiftSale.current_shift(@shop.shop_code) current_shift = ShiftSale.current_shift
current_shift_user =Employee.find_by_id(current_user.employee_id) current_shift_user =Employee.find_by_id(current_user.employee_id)
if open_cashier.count>0 if open_cashier.count>0
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0]) shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0])