Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -44,12 +44,14 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
change_to = params[:change_to] #new
|
change_to = params[:change_to] #new
|
||||||
change_from = params[:change_from] #original
|
change_from = params[:change_from] #original
|
||||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||||
|
|
||||||
booking_array = Array.new
|
booking_array = Array.new
|
||||||
bookings.each do | booking |
|
bookings.each do | booking |
|
||||||
if booking.sale_id.nil? || booking.sale.sale_status != 'completed' || booking.booking_status != 'moved'
|
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
booking_array.push(booking)
|
booking_array.push(booking)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,10 +34,6 @@ class Origami::ShiftsController < BaseOrigamiController
|
|||||||
shift_obj = ShiftSale.where('id =?',@shift.id)
|
shift_obj = ShiftSale.where('id =?',@shift.id)
|
||||||
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||||
|
|
||||||
puts @sale_taxes.to_a
|
|
||||||
puts @sale_taxes
|
|
||||||
puts @sale_taxes.to_json
|
|
||||||
puts "taxxxxxxxxxxxx"
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
class Booking < ApplicationRecord
|
class Booking < ApplicationRecord
|
||||||
self.primary_key = "booking_id"
|
self.primary_key = "booking_id"
|
||||||
|
|
||||||
@@ -14,6 +13,7 @@ class Booking < ApplicationRecord
|
|||||||
def self.update_dining_facility(booking_arr, newd, old)
|
def self.update_dining_facility(booking_arr, newd, old)
|
||||||
table = DiningFacility.find(newd)
|
table = DiningFacility.find(newd)
|
||||||
exist = table.get_booking
|
exist = table.get_booking
|
||||||
|
|
||||||
if exist
|
if exist
|
||||||
# order exists
|
# order exists
|
||||||
booking_arr.each do |booking|
|
booking_arr.each do |booking|
|
||||||
|
|||||||
@@ -321,10 +321,14 @@ class SalePayment < ApplicationRecord
|
|||||||
bookings = table.bookings
|
bookings = table.bookings
|
||||||
bookings.each do |tablebooking|
|
bookings.each do |tablebooking|
|
||||||
if tablebooking.booking_status != 'moved'
|
if tablebooking.booking_status != 'moved'
|
||||||
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
|
if tablebooking.sale_id
|
||||||
|
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
|
||||||
|
status = false
|
||||||
|
end
|
||||||
|
else
|
||||||
status = false
|
status = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if status
|
if status
|
||||||
table.status = "available"
|
table.status = "available"
|
||||||
|
|||||||
Reference in New Issue
Block a user