Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into quick_service
This commit is contained in:
@@ -27,9 +27,9 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
@membership = MembershipSetting::MembershipSetting
|
@membership = MembershipSetting::MembershipSetting
|
||||||
@payment_methods = PaymentMethodSetting.all
|
@payment_methods = PaymentMethodSetting.all
|
||||||
|
|
||||||
@order_items_count = Hash.new
|
|
||||||
bookings = Booking.all
|
bookings = Booking.all
|
||||||
if !bookings.nil?
|
if !bookings.nil?
|
||||||
|
@order_items_count = Hash.new
|
||||||
bookings.each do |booking|
|
bookings.each do |booking|
|
||||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
if !booking.booking_orders.empty?
|
if !booking.booking_orders.empty?
|
||||||
@@ -51,7 +51,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
if !@order_items_count.key?(booking.dining_facility_id)
|
if !@order_items_count.key?(booking.dining_facility_id)
|
||||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||||
else
|
else
|
||||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
@order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -59,6 +59,9 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts "@order_items_count"
|
||||||
|
puts @order_items_count.to_json
|
||||||
|
|
||||||
@dining.bookings.active.each do |booking|
|
@dining.bookings.active.each do |booking|
|
||||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
@order_items = Array.new
|
@order_items = Array.new
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ class Origami::OrdersController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@order_items_count = Hash.new
|
|
||||||
bookings = Booking.all
|
bookings = Booking.all
|
||||||
if !bookings.nil?
|
if !bookings.nil?
|
||||||
|
@order_items_count = Hash.new
|
||||||
bookings.each do |booking|
|
bookings.each do |booking|
|
||||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
if !booking.booking_orders.empty?
|
if !booking.booking_orders.empty?
|
||||||
@@ -37,7 +37,7 @@ class Origami::OrdersController < BaseOrigamiController
|
|||||||
if !@order_items_count.key?(booking.dining_facility_id)
|
if !@order_items_count.key?(booking.dining_facility_id)
|
||||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||||
else
|
else
|
||||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
@order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ class Origami::RoomsController < BaseOrigamiController
|
|||||||
@shop = Shop::ShopDetail
|
@shop = Shop::ShopDetail
|
||||||
@membership = MembershipSetting::MembershipSetting
|
@membership = MembershipSetting::MembershipSetting
|
||||||
@payment_methods = PaymentMethodSetting.all
|
@payment_methods = PaymentMethodSetting.all
|
||||||
|
|
||||||
@order_items_count = Hash.new
|
|
||||||
bookings = Booking.all
|
bookings = Booking.all
|
||||||
if !bookings.nil?
|
if !bookings.nil?
|
||||||
|
@order_items_count = Hash.new
|
||||||
bookings.each do |booking|
|
bookings.each do |booking|
|
||||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
if !booking.booking_orders.empty?
|
if !booking.booking_orders.empty?
|
||||||
@@ -47,7 +47,7 @@ class Origami::RoomsController < BaseOrigamiController
|
|||||||
if !@order_items_count.key?(booking.dining_facility_id)
|
if !@order_items_count.key?(booking.dining_facility_id)
|
||||||
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
@order_items_count.store(booking.dining_facility_id, sale.sale_items.count)
|
||||||
else
|
else
|
||||||
@order_items_count[booking.dining_facility_id] += sale.sale_items.count
|
@order_items_count[booking.dining_facility_id] = sale.sale_items.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,16 +40,25 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
# end
|
# end
|
||||||
|
|
||||||
table_avaliable = true
|
table_avaliable = true
|
||||||
|
table_count = 0
|
||||||
table = sale.bookings[0].dining_facility
|
table = sale.bookings[0].dining_facility
|
||||||
table.bookings.each do |booking|
|
table.bookings.each do |booking|
|
||||||
if !booking.sale.nil?
|
if booking.booking_status != 'moved'
|
||||||
if booking.sale.sale_status == 'new'
|
if booking.sale_id
|
||||||
|
if booking.sale.sale_status != 'completed' && booking.sale.sale_status != 'void'
|
||||||
|
table_avaliable = false
|
||||||
|
table_count += 1
|
||||||
|
else
|
||||||
|
table_avaliable = true
|
||||||
|
end
|
||||||
|
else
|
||||||
table_avaliable = false
|
table_avaliable = false
|
||||||
|
table_count += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if table_avaliable
|
if table_avaliable && table_count == 0
|
||||||
table.status = 'available'
|
table.status = 'available'
|
||||||
table.save
|
table.save
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class OrderSummaryPdf < Prawn::Document
|
class OrderSummaryPdf < Prawn::Document
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||||
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
|
def initialize(print_settings,order, print_status, order_items = nil,alt_name,before_updated_qty)
|
||||||
self.page_width = print_settings.page_width
|
self.page_width = print_settings.page_width
|
||||||
self.page_height = print_settings.page_height
|
self.page_height = print_settings.page_height
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class OrderSummarySetPdf < Prawn::Document
|
class OrderSummarySetPdf < Prawn::Document
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||||
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
|
def initialize(print_settings,order, print_status, order_items = nil,alt_name,before_updated_qty)
|
||||||
self.page_width = print_settings.page_width
|
self.page_width = print_settings.page_width
|
||||||
self.page_height = print_settings.page_height
|
self.page_height = print_settings.page_height
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class OrderSummarySlimPdf < Prawn::Document
|
class OrderSummarySlimPdf < Prawn::Document
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||||
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
|
def initialize(print_settings,order, print_status, order_items = nil,alt_name,before_updated_qty)
|
||||||
self.page_width = print_settings.page_width
|
self.page_width = print_settings.page_width
|
||||||
self.page_height = print_settings.page_height
|
self.page_height = print_settings.page_height
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user