shop code

This commit is contained in:
Myat Zin Wai Maw
2019-11-22 18:24:02 +06:30
parent 5a3f328789
commit d1ab2c194d
106 changed files with 834 additions and 895 deletions

View File

@@ -19,14 +19,15 @@ class Api::SurveyController < Api::ApiController
# shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
# puts params.to_json
# set cashier
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
current_shift = ShiftSale.current_shift
open_cashier = Employee.where("shop_code='#{@shop.shop_code}' and role = 'cashier' AND token_session <> ''")
current_shift = ShiftSale.current_shift(@shop.shop_code)
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].id)
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0])
else
shift_by_terminal = ShiftSale.current_open_shift(current_shift.employee_id)
shift_by_terminal = ShiftSale.current_open_shift(current_shift_user)
end
if params[:survey][:id]>0
survey = Survey.find(params[:survey][:id])
else
@@ -50,8 +51,8 @@ class Api::SurveyController < Api::ApiController
# private
# def survey_params
# params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner,
# params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner,
# :dining_name,:created_by,:total_customer,:total_amount)
# end
end
end