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

@@ -2,12 +2,12 @@ class Api::BillController < Api::ApiController
#Create invoice based on booking
#Output and invoice
def create
@status = false
@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 !ShiftSale.current_shift(@shop.shop_code).nil?
if !ShiftSale.current_shift.nil?
#create Bill by Booking ID
table = 0
if (params[:booking_id])

View File

@@ -16,7 +16,7 @@ class Api::SurveyController < Api::ApiController
def create
dining_facility = DiningFacility.find(params[:id])
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)
if open_cashier.count>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)
# set cashier
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)
if open_cashier.count>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
arr_sale = JSON.parse(params[:data])
if !ShiftSale.current_shift(@shop.shop_code).nil?
if !ShiftSale.current_shift.nil?
if !arr_sale.nil?
arr_sale.each do |arr_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])
if !order_reserve.nil?
if !ShiftSale.current_shift(@shop.shop_code).nil?
if !ShiftSale.current_shift.nil?
if @status == "processed"
if order_reserve.status == "accepted"
result = OrderReservation.create_doemal_order(order_reserve,current_user)
@@ -86,7 +86,7 @@ class Origami::OrderReservationController < BaseOrigamiController
def send_status
order_reservation = OrderReservation.find_by_transaction_ref(params[:ref_no])
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])
else
response = { status: false, message: 'No current shift open for this employee!'}

View File

@@ -100,7 +100,7 @@ class Origami::SplitBillController < BaseOrigamiController
end
status = false
if !ShiftSale.current_shift(@shop.shop_code).nil?
if !ShiftSale.current_shift.nil?
#create Bill by Booking ID
table = 0
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)
# set cashier
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)
if open_cashier.count>0
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0])

View File

@@ -2,7 +2,7 @@ class Reports::ShiftsaleController < BaseReportController
authorize_resource :class => false
def index
from, to = get_date_range_from_params
@shift = ''
if params[:shift_name].to_i != 0
@@ -26,7 +26,7 @@ class Reports::ShiftsaleController < BaseReportController
end
def show
from, to = get_date_range_from_params
@sale_data = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED).where("shift_sales.shop_code='#{@shop.shop_code}'")
@@ -50,7 +50,7 @@ class Reports::ShiftsaleController < BaseReportController
end
def print_close_receipt
shift_id = params[:id]
@shift = ShiftSale.find_by_id(shift_id)
shift_obj = ShiftSale.where('id =?',shift_id)