remove conflict
This commit is contained in:
@@ -18,24 +18,20 @@ class Api::BillController < Api::ApiController
|
|||||||
order = Order.find(bk_order.order_id)
|
order = Order.find(bk_order.order_id)
|
||||||
|
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
puts cashier_zone.to_json
|
|
||||||
puts "cashier_zone"
|
|
||||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first
|
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first
|
||||||
|
|
||||||
|
#for multiple zone with terminal
|
||||||
if !shift.nil?
|
if !shift.nil?
|
||||||
cashier = Employee.find(shift.employee_id)
|
cashier = Employee.find(shift.employee_id)
|
||||||
else
|
else
|
||||||
multiple_zone = CashierTerminalByZone.where('zone_id = #{cashier_zone.zone_id}')
|
multiple_zone = CashierTerminalByZone.where("zone_id = #{table.zone_id}")
|
||||||
puts cashier_zone.to_json
|
|
||||||
puts "cashier_zone"
|
|
||||||
multiple_zone.each do |zone|
|
multiple_zone.each do |zone|
|
||||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{zone.cashier_terminal_id}").first
|
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{zone.cashier_terminal_id}").first
|
||||||
puts shift.to_json
|
if !shift.nil? then
|
||||||
puts "shift"
|
cashier = Employee.find(shift.employee_id)
|
||||||
if !shift.nil? then
|
|
||||||
cashier = Employee.find(shift.employee_id)
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Api::SoundEffectController < Api::ApiController
|
|||||||
end
|
end
|
||||||
ActionCable.server.broadcast "sound_effect_channel",data: {status: params[:status], message: params[:message]},shop_code: shop_code,from:from,audio:audio
|
ActionCable.server.broadcast "sound_effect_channel",data: {status: params[:status], message: params[:message]},shop_code: shop_code,from:from,audio:audio
|
||||||
else
|
else
|
||||||
render :json => { :status => true, :message => "Something wrongs!" }
|
render :json => { :status => false, :message => "Something wrongs!" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#sound effect / alarm api for doemal side calling
|
#sound effect / alarm api for doemal side calling
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
|
|||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
helper_method :shop_detail
|
helper_method :shop_detail, :order_reservation, :bank_integration
|
||||||
# lookup domain for db from provision
|
# lookup domain for db from provision
|
||||||
# before_action :set_locale
|
# before_action :set_locale
|
||||||
# helper_method :current_company,:current_login_employee,:current_user
|
# helper_method :current_company,:current_login_employee,:current_user
|
||||||
@@ -21,6 +21,36 @@ class ApplicationController < ActionController::Base
|
|||||||
def shop_detail
|
def shop_detail
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def order_reservation
|
||||||
|
order_reserve = Lookup.collection_of('order_reservation')
|
||||||
|
status = false
|
||||||
|
if !order_reserve.empty?
|
||||||
|
order_reserve.each do |order|
|
||||||
|
if order[0] == 'OrderReservation'
|
||||||
|
if order[1] == '1'
|
||||||
|
status = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return status
|
||||||
|
end
|
||||||
|
|
||||||
|
def bank_integration
|
||||||
|
bank_integration = Lookup.collection_of('bank_integration')
|
||||||
|
status = false
|
||||||
|
if !bank_integration.empty?
|
||||||
|
bank_integration.each do |bank|
|
||||||
|
if bank[0] == 'Bank Integration'
|
||||||
|
if bank[1] == '1'
|
||||||
|
status = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,16 @@ class Sale < ApplicationRecord
|
|||||||
table = DiningFacility.find(booking.dining_facility_id)
|
table = DiningFacility.find(booking.dining_facility_id)
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first
|
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{cashier_zone.cashier_terminal_id}").first
|
||||||
|
#for multiple zone with terminal
|
||||||
|
if shift.nil?
|
||||||
|
multiple_zone = CashierTerminalByZone.where("zone_id = #{table.zone_id}")
|
||||||
|
multiple_zone.each do |zone|
|
||||||
|
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{zone.cashier_terminal_id}").first
|
||||||
|
if !shift.nil? then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||||
current_shift = ShiftSale.current_shift
|
current_shift = ShiftSale.current_shift
|
||||||
|
|||||||
@@ -119,9 +119,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if can? :manage, OrderReservation %>
|
<% if can? :manage, OrderReservation %>
|
||||||
<li>
|
<% if order_reservation %>
|
||||||
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
<li>
|
||||||
</li>
|
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if can? :menage, Sale %>
|
<% if can? :menage, Sale %>
|
||||||
<li>
|
<li>
|
||||||
@@ -151,9 +153,11 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
|
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
|
||||||
</li>
|
</li>
|
||||||
|
<% if order_reservation %>
|
||||||
<li>
|
<li>
|
||||||
<a href="<%= reports_order_reservation_index_path %>">Order Reservation</a>
|
<a href="<%= reports_order_reservation_index_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||||
</li>
|
</li>
|
||||||
|
<% end %>
|
||||||
<li>
|
<li>
|
||||||
<a href="<%= reports_receipt_no_index_path %>">Receipt</a>
|
<a href="<%= reports_receipt_no_index_path %>">Receipt</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user