Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -221,7 +221,7 @@ class Api::OrdersController < Api::ApiController
|
||||
|
||||
order_item = OrderItem.find(order_items_id)
|
||||
before_updated_qty = order_item.qty
|
||||
|
||||
if qty_weight < order_item.qty.to_f
|
||||
order_item.item_order_by = current_login_employee.name
|
||||
order_item.qty = qty_weight
|
||||
order_item.remark = remarks
|
||||
@@ -266,6 +266,9 @@ class Api::OrdersController < Api::ApiController
|
||||
end
|
||||
|
||||
return return_json_status_with_code(200, "updated successfully!")
|
||||
else
|
||||
return return_json_status_with_code(304, "Quantity is over!")
|
||||
end
|
||||
else
|
||||
return return_json_status_with_code(406, "Checkout time is over!")
|
||||
end
|
||||
|
||||
@@ -15,9 +15,18 @@ class Api::SurveyController < Api::ApiController
|
||||
|
||||
def create
|
||||
dining_facility = DiningFacility.find(params[:id])
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id)
|
||||
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
|
||||
puts params.to_json
|
||||
# cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id)
|
||||
# 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
|
||||
if open_cashier.count>0
|
||||
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||
else
|
||||
shift_by_terminal = ShiftSale.current_open_shift(current_shift.employee_id)
|
||||
end
|
||||
|
||||
if params[:survey][:id]>0
|
||||
survey = Survey.find(params[:survey][:id])
|
||||
else
|
||||
|
||||
@@ -40,11 +40,24 @@ class Origami::SurveysController < BaseOrigamiController
|
||||
def create
|
||||
@type = params[:cashier_type]
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
if params[:table_id].to_i>0
|
||||
@dining_facility = DiningFacility.find(params[:table_id])
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(@dining_facility.zone_id)
|
||||
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_zone.cashier_terminal_id,nil)
|
||||
if params[:sale_id].to_i > 0
|
||||
# cashier_zone = CashierTerminalByZone.find_by_zone_id(@dining_facility.zone_id)
|
||||
# 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 <> ''")
|
||||
current_shift = ShiftSale.current_shift
|
||||
if open_cashier.count>0
|
||||
shift_by_terminal = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||
else
|
||||
shift_by_terminal = ShiftSale.current_open_shift(current_shift.employee_id)
|
||||
end
|
||||
else
|
||||
sale = Sale.find(@sale_id)
|
||||
shift = ShiftSale.find(sale.shift_sale_id)
|
||||
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(shift.cashier_terminal_id,nil)
|
||||
end
|
||||
else
|
||||
sale = Sale.find(@sale_id)
|
||||
shift = ShiftSale.find(sale.shift_sale_id)
|
||||
|
||||
Reference in New Issue
Block a user