current shop

This commit is contained in:
Nweni
2019-12-03 14:54:53 +06:30
parent 23b5d0d344
commit 78838a7718
17 changed files with 44 additions and 43 deletions

View File

@@ -1,13 +1,13 @@
class Api::AuthenticateController < Api::ApiController
skip_before_action :authenticate
before_action :find_shop
# before_action :find_shop
def create
emp_id = params[:emp_id]
password = params[:password]
if emp_id && password
@employee = Employee.login(@shop, emp_id, password)
@employee = Employee.login(emp_id, password)
if @employee && @employee.role == "waiter"
render json: JSON.generate({:status => true, :session_token => @employee.token_session, :name => @employee.name, :role => @employee.role})
else

View File

@@ -6,7 +6,7 @@ class Api::BillController < Api::ApiController
@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(Shop.current_shop.shop_code).nil?
#create Bill by Booking ID
table = 0
if (params[:booking_id])

View File

@@ -19,7 +19,7 @@ class Api::Payment::MobilepaymentController < Api::ApiController
# rounding adjustment
if !path.include? ("credit_payment")
if @shop.is_rounding_adj
if shop_detail.is_rounding_adj
a = saleObj.grand_total % 25 # Modulus
b = saleObj.grand_total / 25 # Division
#not calculate rounding if modulus is 0 and division is even

View File

@@ -15,8 +15,8 @@ class Api::SurveyController < Api::ApiController
def create
dining_facility = DiningFacility.find(params[:id])
open_cashier = Employee.where("shop_code='#{@shop.shop_code}' and role = 'cashier' AND token_session <> ''")
current_shift = ShiftSale.current_shift(@shop.shop_code)
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
current_shift = ShiftSale.current_shift(Shop.current_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])