diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 58f64a27..01c7b149 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -45,12 +45,14 @@ class Origami::HomeController < BaseOrigamiController end end else - sale = Sale.find(booking.sale_id) - if sale.sale_status !='completed' - if !@order_items_count.key?(booking.dining_facility_id) - @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) - else - @order_items_count[booking.dining_facility_id] += sale.sale_items.count + if !booking.sale_id.nil? + sale = Sale.find(booking.sale_id) + if sale.sale_status !='completed' + if !@order_items_count.key?(booking.dining_facility_id) + @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) + else + @order_items_count[booking.dining_facility_id] += sale.sale_items.count + end end end end diff --git a/app/controllers/origami/orders_controller.rb b/app/controllers/origami/orders_controller.rb index b4d7baf0..7cd6c426 100755 --- a/app/controllers/origami/orders_controller.rb +++ b/app/controllers/origami/orders_controller.rb @@ -46,12 +46,14 @@ class Origami::OrdersController < BaseOrigamiController end end else - sale = Sale.find(booking.sale_id) - if sale.sale_status !='completed' - if !@order_items_count.key?(booking.dining_facility_id) - @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) - else - @order_items_count[booking.dining_facility_id] += sale.sale_items.count + if !booking.sale_id.nil? + sale = Sale.find(booking.sale_id) + if sale.sale_status !='completed' + if !@order_items_count.key?(booking.dining_facility_id) + @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) + else + @order_items_count[booking.dining_facility_id] += sale.sale_items.count + end end end end diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index fd28230e..47fed13a 100755 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -41,12 +41,14 @@ class Origami::RoomsController < BaseOrigamiController end end else - sale = Sale.find(booking.sale_id) - if sale.sale_status !='completed' - if !@order_items_count.key?(booking.dining_facility_id) - @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) - else - @order_items_count[booking.dining_facility_id] += sale.sale_items.count + if !booking.sale_id.nil? + sale = Sale.find(booking.sale_id) + if sale.sale_status !='completed' + if !@order_items_count.key?(booking.dining_facility_id) + @order_items_count.store(booking.dining_facility_id, sale.sale_items.count) + else + @order_items_count[booking.dining_facility_id] += sale.sale_items.count + end end end end diff --git a/db/sym_master.sql b/db/sym_master.sql index 4a181439..89abaf5b 100755 --- a/db/sym_master.sql +++ b/db/sym_master.sql @@ -121,6 +121,10 @@ delete from sym_node; (trigger_id,source_table_name,channel_id,last_update_time,create_time) values('tax_profiles','customers','setting',current_timestamp,current_timestamp); + insert into sym_trigger + (trigger_id,source_table_name,channel_id,last_update_time,create_time) + values('display_images','customers','setting',current_timestamp,current_timestamp); + # Create Trigger for Dining Channel insert into sym_trigger @@ -367,6 +371,10 @@ delete from sym_node; (trigger_id,router_id,initial_load_order,last_update_time,create_time) values('tax_profiles','cloud_2_sx', 100, current_timestamp, current_timestamp); + insert into sym_trigger_router + (trigger_id,router_id,initial_load_order,last_update_time,create_time) + values('display_images','cloud_2_sx', 100, current_timestamp, current_timestamp); + # Setting Channel # From Master to cloud insert into sym_trigger_router (trigger_id,router_id,initial_load_order,last_update_time,create_time) @@ -400,6 +408,10 @@ delete from sym_node; (trigger_id,router_id,initial_load_order,last_update_time,create_time) values('tax_profiles','sx_2_cloud', 100, current_timestamp, current_timestamp); + insert into sym_trigger_router + (trigger_id,router_id,initial_load_order,last_update_time,create_time) + values('display_images','sx_2_cloud', 100, current_timestamp, current_timestamp); + #End Setting Channel # Dining Channel # From cloud to SX