From 086d5a730658b59c82442d3246cad0ed60cebb38 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 14 Feb 2018 13:59:28 +0630 Subject: [PATCH 1/2] update symn for display images --- db/sym_master.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 From 91aa21666624074459efaa69a0f22472e917d913 Mon Sep 17 00:00:00 2001 From: phyusin Date: Wed, 14 Feb 2018 14:20:20 +0630 Subject: [PATCH 2/2] check booking sale id is null for all order --- app/controllers/origami/home_controller.rb | 14 ++++++++++---- app/controllers/origami/orders_controller.rb | 14 ++++++++++---- app/controllers/origami/rooms_controller.rb | 14 ++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index bf4008a2..b4b63515 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -38,15 +38,21 @@ class Origami::HomeController < BaseOrigamiController if !order.order_items.empty? if !@order_items_count.key?(booking.dining_facility_id) @order_items_count.store(booking.dining_facility_id, order.order_items.count) + else + @order_items_count[booking.dining_facility_id] += order.order_items.count end end 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) + 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 f4b11fc5..ec2f58ba 100755 --- a/app/controllers/origami/orders_controller.rb +++ b/app/controllers/origami/orders_controller.rb @@ -24,15 +24,21 @@ class Origami::OrdersController < BaseOrigamiController if !order.order_items.empty? if !@order_items_count.key?(booking.dining_facility_id) @order_items_count.store(booking.dining_facility_id, order.order_items.count) + else + @order_items_count[booking.dining_facility_id] += order.order_items.count end end 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) + 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 7ffac1f0..68cb8798 100755 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -34,15 +34,21 @@ class Origami::RoomsController < BaseOrigamiController if !order.order_items.empty? if !@order_items_count.key?(booking.dining_facility_id) @order_items_count.store(booking.dining_facility_id, order.order_items.count) + else + @order_items_count[booking.dining_facility_id] += order.order_items.count end end 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) + 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