From f8164e483c0b20da6e83e2fa734572c4201a8539 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 18 Apr 2018 14:50:16 +0630 Subject: [PATCH 01/42] update puma production and remove develop --- config/puma.rb | 59 ++++++++------------------------------- config/puma.rb.production | 11 -------- 2 files changed, 11 insertions(+), 59 deletions(-) delete mode 100755 config/puma.rb.production diff --git a/config/puma.rb b/config/puma.rb index c8e0145e..cd3f0829 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,48 +1,11 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum, this matches the default thread size of Active Record. -# -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i -threads threads_count, threads_count - -# Specifies the `port` that Puma will listen on to receive requests, default is 3000. -# -port ENV.fetch("PORT") { 3000 } - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch("RAILS_ENV") { "development" } - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. If you use this option -# you need to make sure to reconnect any threads in the `on_worker_boot` -# block. -# -# preload_app! - -# The code in the `on_worker_boot` will be called if you are using -# clustered mode by specifying a number of `workers`. After each worker -# process is booted this block will be run, if you are using `preload_app!` -# option you will want to use this block to reconnect to any threads -# or connections that may have been created at application boot, Ruby -# cannot share connections between processes. -# -# on_worker_boot do -# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) -# end - -# Allow puma to be restarted by `rails restart` command. - -plugin :tmp_restart +application_path="#{File.expand_path("../..", __FILE__)}" +directory application_path +#environment ENV.fetch("RAILS_ENV") { "production" } +environment "production" +pidfile "#{application_path}/tmp/puma/pid" +state_path "#{application_path}/tmp/puma/state" +stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +port ENV.fetch("PORT") { 62158 } +workers 2 +preload_app! + diff --git a/config/puma.rb.production b/config/puma.rb.production deleted file mode 100755 index cd3f0829..00000000 --- a/config/puma.rb.production +++ /dev/null @@ -1,11 +0,0 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! - From 61e8d6e2b5907489e5ae1d7e755995c1ba128713 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 19 Apr 2018 10:28:31 +0630 Subject: [PATCH 02/42] update shift_sale migration file --- config/secrets.yml | 2 +- db/migrate/20170626191519_create_shift_sales.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/secrets.yml b/config/secrets.yml index 6e8b73d4..84a824ba 100755 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -24,7 +24,7 @@ test: # instead read values from the environment. production: secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22 - sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api + sx_provision_url: https://connect.pos-myanmar.com/bensai/api #192.168.1.147:3002/api server_mode: application cipher_type: AES-256-CBC sx_key: Wh@t1$C2L diff --git a/db/migrate/20170626191519_create_shift_sales.rb b/db/migrate/20170626191519_create_shift_sales.rb index f18a2c1c..bd19a8cf 100755 --- a/db/migrate/20170626191519_create_shift_sales.rb +++ b/db/migrate/20170626191519_create_shift_sales.rb @@ -21,7 +21,7 @@ class CreateShiftSales < ActiveRecord::Migration[5.1] t.integer :dining_count, :default => 0 t.integer :takeaway_count, :default => 0 t.integer :member_count, :default => 0 - t.decimal :total_rounding,, :precision => 10, :scale => 2, :null => false, :default => 0.00 + t.decimal :total_rounding, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.integer :total_receipt, :default => 0 t.decimal :total_void, :default => 0 t.timestamps From 99e000e0003d1a9254b7042cc35573c671c4bc99 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 19 Apr 2018 10:31:02 +0630 Subject: [PATCH 03/42] update shift_sale migration file --- config/secrets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/secrets.yml b/config/secrets.yml index 84a824ba..b0d7c5c8 100755 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -24,7 +24,7 @@ test: # instead read values from the environment. production: secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22 - sx_provision_url: https://connect.pos-myanmar.com/bensai/api #192.168.1.147:3002/api + sx_provision_url: https://connect.pos-myanmar.com/api #192.168.1.147:3002/api server_mode: application cipher_type: AES-256-CBC sx_key: Wh@t1$C2L From 1913ada8e56e07ab8c9e557fa9dfe02a499625a7 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 19 Apr 2018 15:23:08 +0630 Subject: [PATCH 04/42] update --- app/views/origami/paymal/index.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/origami/paymal/index.html.erb b/app/views/origami/paymal/index.html.erb index 6818fbad..5594eb13 100644 --- a/app/views/origami/paymal/index.html.erb +++ b/app/views/origami/paymal/index.html.erb @@ -328,7 +328,6 @@ var payment_amount = parseFloat($("#used_amount").text()); setTimeout(function(){ code=getQRCode(); - alert(code) if(sale_id != 0 && code != ""){ $.ajax({ type: "POST", @@ -345,7 +344,6 @@ url: "<%=origami_payment_paymal_path%>", data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code}, success: function(result){ - alert(result) if(result.status == true){ swal({ title: "Information!", From f638837f81d380a707aaed71a39035e61852cd41 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 19 Apr 2018 15:48:39 +0630 Subject: [PATCH 05/42] update dinga and paymal view for tabcap --- app/views/origami/dinga/index.html.erb | 11 +++++++++-- app/views/origami/paymal/index.html.erb | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/views/origami/dinga/index.html.erb b/app/views/origami/dinga/index.html.erb index 1a7bd798..4c4bff3d 100644 --- a/app/views/origami/dinga/index.html.erb +++ b/app/views/origami/dinga/index.html.erb @@ -107,6 +107,12 @@ +
+

Card Tap

+
+ +
+
@@ -118,7 +124,7 @@ From 8d3946fede5b108c0401b341c68656547c7dec68 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 19 Apr 2018 15:49:38 +0630 Subject: [PATCH 06/42] update dinga and paymal view for tabcap --- app/views/origami/dinga/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/origami/dinga/index.html.erb b/app/views/origami/dinga/index.html.erb index 4c4bff3d..70b572db 100644 --- a/app/views/origami/dinga/index.html.erb +++ b/app/views/origami/dinga/index.html.erb @@ -124,7 +124,7 @@ + + \ No newline at end of file diff --git a/app/views/reports/payment_method/index.xls.erb b/app/views/reports/payment_method/index.xls.erb index 73c8683b..73a53005 100755 --- a/app/views/reports/payment_method/index.xls.erb +++ b/app/views/reports/payment_method/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -108,4 +115,6 @@
-
\ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/reports/product_sale/index.xls.erb b/app/views/reports/product_sale/index.xls.erb index 0ff60964..98885861 100644 --- a/app/views/reports/product_sale/index.xls.erb +++ b/app/views/reports/product_sale/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -81,4 +88,6 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/reports/receipt_no/index.xls.erb b/app/views/reports/receipt_no/index.xls.erb index 0b6a4dd0..ff74ef5a 100755 --- a/app/views/reports/receipt_no/index.xls.erb +++ b/app/views/reports/receipt_no/index.xls.erb @@ -1,4 +1,10 @@ - + + + + + + +
@@ -103,4 +109,6 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index 82b11aef..78d0aaec 100755 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -223,4 +230,6 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/reports/shiftsale/index.xls.erb b/app/views/reports/shiftsale/index.xls.erb index aa1d0231..46fe502d 100755 --- a/app/views/reports/shiftsale/index.xls.erb +++ b/app/views/reports/shiftsale/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -105,4 +112,6 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/reports/stock_check/index.xls.erb b/app/views/reports/stock_check/index.xls.erb index 4ea1f2f0..6ec88072 100755 --- a/app/views/reports/stock_check/index.xls.erb +++ b/app/views/reports/stock_check/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -50,3 +57,5 @@
+ + \ No newline at end of file diff --git a/app/views/reports/void_sale/index.xls.erb b/app/views/reports/void_sale/index.xls.erb index e07b60b0..587ca509 100755 --- a/app/views/reports/void_sale/index.xls.erb +++ b/app/views/reports/void_sale/index.xls.erb @@ -1,4 +1,10 @@ - + + + + + + +
@@ -63,4 +69,6 @@ <% end %>
-
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/app/views/reports/waste_and_spoilage/index.xls.erb b/app/views/reports/waste_and_spoilage/index.xls.erb index 48f26650..7e71fbdc 100755 --- a/app/views/reports/waste_and_spoilage/index.xls.erb +++ b/app/views/reports/waste_and_spoilage/index.xls.erb @@ -1,3 +1,10 @@ + + + + + + +
@@ -80,4 +87,6 @@
- \ No newline at end of file + + + \ No newline at end of file From 80e9f4fc362fd60ee73a4fc65ba79b7d5d1e514d Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 21 May 2018 15:59:42 +0630 Subject: [PATCH 33/42] update menu json for unscope4 --- app/views/origami/dashboard/_menu.json.jbuilder | 5 ++--- config/initializers/action_controller.rb | 10 +++++----- config/{puma.rb => puma-production.rb} | 0 3 files changed, 7 insertions(+), 8 deletions(-) rename config/{puma.rb => puma-production.rb} (100%) diff --git a/app/views/origami/dashboard/_menu.json.jbuilder b/app/views/origami/dashboard/_menu.json.jbuilder index ff9721a3..8d17208c 100644 --- a/app/views/origami/dashboard/_menu.json.jbuilder +++ b/app/views/origami/dashboard/_menu.json.jbuilder @@ -7,11 +7,10 @@ json.valid_time_to menu.valid_time_to.strftime("%H:%M") if (menu.menu_categories) order_by = Lookup.find_by_lookup_type("order_by") if !order_by.nil? && order_by.value == "name" - categories = MenuCategory.where("menu_id ='#{menu.id}'").order("name asc") + categories = MenuCategory.unscoped.where("menu_id ='#{menu.id}'").order("name asc") else categories = menu.menu_categories end - byebug json.categories categories do |category| menu_category = MenuCategory.find_by_menu_category_id(category.id) @@ -33,7 +32,7 @@ if (menu.menu_categories) json.is_available category.is_available if !order_by.nil? && order_by.value == "name" - menu_items = MenuItem.find_by_menu_category_id(category.id).order("name asc") + menu_items = MenuItem.unscoped.where("menu_category_id = ?",category.id).order("name asc") else menu_items = category.menu_items end diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index e0eb7455..b84bca54 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -20,11 +20,11 @@ class ActionController::Base end else #check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end diff --git a/config/puma.rb b/config/puma-production.rb similarity index 100% rename from config/puma.rb rename to config/puma-production.rb From fcfeb6fd98fee84e38d8812e6f184e5d4bd2010c Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 21 May 2018 16:57:32 +0630 Subject: [PATCH 34/42] update js for precompile --- app/assets/javascripts/addorder.js | 1 - .../javascripts/channels/check_in_booking.js | 17 +++++---- .../javascripts/channels/check_new_order.js | 36 +++++++++---------- .../channels/check_order_ready_to_delivery.js | 1 + .../channels/check_order_send_to_kitchen.js | 1 + 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 611ffb17..78e08b2e 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -119,7 +119,6 @@ $(function() { // $(".menu_sub_category").on("click", function(){ $('.sub_category_list').addClass("hidden"); var menu_id = $(this).attr("data-id"); - console.log(menu_id); var url = "get_menu_category/"+menu_id; show_menu_item_list(url,menu_id); }); diff --git a/app/assets/javascripts/channels/check_in_booking.js b/app/assets/javascripts/channels/check_in_booking.js index d2c85e20..410d1c53 100644 --- a/app/assets/javascripts/channels/check_in_booking.js +++ b/app/assets/javascripts/channels/check_in_booking.js @@ -7,14 +7,13 @@ App.checkin = App.cable.subscriptions.create('CheckInBookingChannel', { received: function(data) { var hostname = location.hostname.trim(); - if(data.from == "" || hostname == data.from) - { - if($('.table_'+data.table.id).hasClass('green')){ - $('.table_'+data.table.id).removeClass('green'); - $('.table_'+data.table.id).addClass('blue'); - } - $('.new_text_'+data.table.id).removeClass('hide'); - } - } + if(data.from == "" || hostname == data.from){ + if($('.table_'+data.table.id).hasClass('green')){ + $('.table_'+data.table.id).removeClass('green'); + $('.table_'+data.table.id).addClass('blue'); + } + $('.new_text_'+data.table.id).removeClass('hide'); + } + } }); diff --git a/app/assets/javascripts/channels/check_new_order.js b/app/assets/javascripts/channels/check_new_order.js index a6d7982b..9cf91522 100644 --- a/app/assets/javascripts/channels/check_new_order.js +++ b/app/assets/javascripts/channels/check_new_order.js @@ -5,8 +5,7 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', { received: function(data) { var hostname = location.hostname.trim(); - if(data.from == "" || hostname == data.from) - { + if(data.from == "" || hostname == data.from){ var order = data.data; var shop_code = data.shop_code; if(order.length > 0){ @@ -20,23 +19,24 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', { order_lists += ', ' + value.order_reservation_id; } }); - // alert(order_lists); - if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) { - checkNewOrderAlert(shop_code, order_lists); + // alert(order_lists); + if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) { + checkNewOrderAlert(shop_code, order_lists); + } + // $("#notify_new_order_lists").text(order_lists); + // if($("#"+shop_code+"_notify_new_order").hasClass("hidden")){ + // $("#"+shop_code+"_notify_new_order").removeClass("hidden"); + // } + // $("#"+shop_code+"_notify_new_order").on('shown.bs.modal', function(e){ + // // $(document).off('focusin.modal'); + // $("#"+shop_code+"_notify_new_order").focus(); + // $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + // $("#"+shop_code+"_notify_order_send_to_kitchen").addClass("hidden"); + // $("#"+shop_code+"_notify_order_ready_to_delivery").addClass("hidden"); + // }).on('hide.bs.modal', function (e) { + // $("#"+shop_code+"_notify_new_order").addClass("hidden"); + // }).modal({show: true, keyboard: false, backdrop: false}); } - // $("#notify_new_order_lists").text(order_lists); - // if($("#"+shop_code+"_notify_new_order").hasClass("hidden")){ - // $("#"+shop_code+"_notify_new_order").removeClass("hidden"); - // } - // $("#"+shop_code+"_notify_new_order").on('shown.bs.modal', function(e){ - // // $(document).off('focusin.modal'); - // $("#"+shop_code+"_notify_new_order").focus(); - // $("#"+shop_code+"_doemal_new_order").addClass("hidden"); - // $("#"+shop_code+"_notify_order_send_to_kitchen").addClass("hidden"); - // $("#"+shop_code+"_notify_order_ready_to_delivery").addClass("hidden"); - // }).on('hide.bs.modal', function (e) { - // $("#"+shop_code+"_notify_new_order").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/channels/check_order_ready_to_delivery.js b/app/assets/javascripts/channels/check_order_ready_to_delivery.js index 37f4dcf6..54666735 100644 --- a/app/assets/javascripts/channels/check_order_ready_to_delivery.js +++ b/app/assets/javascripts/channels/check_order_ready_to_delivery.js @@ -40,5 +40,6 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe // }).modal({show: true, keyboard: false, backdrop: false}); } } +} }); diff --git a/app/assets/javascripts/channels/check_order_send_to_kitchen.js b/app/assets/javascripts/channels/check_order_send_to_kitchen.js index c837fee1..fee2e3f6 100644 --- a/app/assets/javascripts/channels/check_order_send_to_kitchen.js +++ b/app/assets/javascripts/channels/check_order_send_to_kitchen.js @@ -40,5 +40,6 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend // }).modal({show: true, keyboard: false, backdrop: false}); } } +} }); From b68169b244400d4d9ef0be3e359eb3b3b26ee04b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 21 May 2018 17:26:48 +0630 Subject: [PATCH 35/42] update promotion with tax --- README.md | 6 ++++++ app/models/promotion.rb | 35 ++++++++++++++++++++++------------- app/models/sale.rb | 1 + 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index dfebed49..4ba6d51f 100755 --- a/README.md +++ b/README.md @@ -200,6 +200,12 @@ Add Feature for Order and Reservation ** '0' means can not use order reservation and '1' means can use order reservation ** => settings/lookups => { type:order_reservation, name: OrderReservation, value:'{0 or 1}' } +For Price 0 in receipt bill + 2) settings/lookups => { type:show_price, name:Shoe Price, value:1 } + +For Price 0 in receipt bill + 2) settings/lookups => { type:order_by, name:Order By, value:name } + * ToDo list 1. Migration diff --git a/app/models/promotion.rb b/app/models/promotion.rb index 028847f3..f1e19d98 100755 --- a/app/models/promotion.rb +++ b/app/models/promotion.rb @@ -136,7 +136,9 @@ class Promotion < ApplicationRecord else item = OrderItem.find_by_item_code(promo_product) end - update_existing_item(foc_qty, item, sale_id, "promotion", item.price) + source = Order.find(item.order_id).source + + update_existing_item(foc_qty, item, sale_id, "promotion", item.price,source) puts "Charged - " + charge_qty.to_s puts "FOC - " + foc_qty.to_s @@ -150,10 +152,12 @@ class Promotion < ApplicationRecord promotion_qty = foc_qty end item = OrderItem.find_by_item_instance_code(promo_product) - update_existing_item(promotion_qty, item, sale_id, "promotion", item.price) + source = Order.find(item.order_id).source + update_existing_item(promotion_qty, item, sale_id, "promotion", item.price,source) end - def self.update_existing_item(qty, item, sale_id, type, item_price) + + def self.update_existing_item(qty, item, sale_id, type, item_price,source) sale_item = SaleItem.new sale_item.product_code = item.item_code @@ -171,50 +175,54 @@ class Promotion < ApplicationRecord sale_item.sale_id = sale_id sale_item.save sale = Sale.find(sale_id) - sale.compute_by_sale_items(sale.id, sale.sale_items, sale.total_discount) + sale.compute_by_sale_items(sale.id, sale.sale_items, sale.total_discount,nil,source) end def self.give_promotion_nett_off(same, promo_product, foc_min_qty, orderitem, sale_id) puts " same: " + same.to_s + " promo_product: " + promo_product.item_code.to_s + " foc_min_qty: " + foc_min_qty.to_s + " orderitem: " + orderitem.to_s - + if same foc_qty = orderitem[1].to_i / foc_min_qty item = OrderItem.find_by_item_instance_code(orderitem[0]) - update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off) + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source) else foc_qty = find_second_item_qty(sale_id, promo_product.item_code) item = OrderItem.find_by_item_instance_code(promo_product.item_code) - update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off) + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source) end end def self.give_promotion_nett_price(same, promo_product, foc_min_qty, orderitem, sale_id) puts " same: " + same.to_s + " promo_product: " + promo_product.item_code.to_s + " foc_min_qty: " + foc_min_qty.to_s + " orderitem: " + orderitem.to_s - if same foc_qty = orderitem[1].to_i / foc_min_qty item = OrderItem.find_by_item_instance_code(orderitem[0]) # need to specify with menu item instance price = item.price.to_i - promo_product.net_price.to_i - update_existing_item(foc_qty, item, sale_id, "promotion nett price", price) + + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source) else foc_qty = find_second_item_qty(sale_id, promo_product.item_code) item = OrderItem.find_by_item_instance_code(promo_product.item_code) price = item.price - promo_product.net_price - update_existing_item(foc_qty, item, sale_id, "promotion nett price", price) + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source) end end def self.give_promotion_discount(same, promo_product, foc_min_qty, orderitem, sale_id) puts " same: " + same.to_s + " promo_product: " + promo_product.item_code.to_s + " foc_min_qty: " + foc_min_qty.to_s + " orderitem: " + orderitem.to_s - if same foc_qty = orderitem[1].to_i / foc_min_qty item = OrderItem.find_by_item_instance_code(orderitem[0]) # total = orderitem[1].to_i * item.price total = item.price price = calculate_discount(total, promo_product.percentage) - update_existing_item(foc_qty, item, sale_id, "promotion discount", price) + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source) else foc_qty = find_second_item_qty(sale_id, promo_product.item_code) # give total qty is 1 @@ -224,7 +232,8 @@ class Promotion < ApplicationRecord # total = item.price * foc_qty total = item.price price = calculate_discount(total, promo_product.percentage) - update_existing_item(foc_qty, item, sale_id, "promotion discount", price) + source = Order.find(item.order_id).source + update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source) end end diff --git a/app/models/sale.rb b/app/models/sale.rb index e072d435..7ceecebd 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -425,6 +425,7 @@ class Sale < ApplicationRecord tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(sale.customer_id) # #Creat new tax records + if sale.payment_status != 'foc' tax_profiles.each do |tax| # customer.tax_profiles.each do |cus_tax| From 1b5f657d0c35935145bcfb052320f2c073a77940 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 22 May 2018 10:53:06 +0630 Subject: [PATCH 36/42] update commission --- .../origami/product_commissions_controller.rb | 70 +++++++++++-------- app/models/order_queue_station.rb | 8 +-- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/app/controllers/origami/product_commissions_controller.rb b/app/controllers/origami/product_commissions_controller.rb index 2f209a7a..31343fe5 100755 --- a/app/controllers/origami/product_commissions_controller.rb +++ b/app/controllers/origami/product_commissions_controller.rb @@ -88,41 +88,49 @@ class Origami::ProductCommissionsController < BaseOrigamiController commissioner_id = params[:commissioner_id] @sale_item = SaleItem.find(sale_item_id) @menu_item = MenuItem.find_by_item_code(@sale_item.product_code) - @commission = Commission.where('product_code = ? AND is_active = ?', @menu_item.id, true).take + # @commission = Commission.where('product_code = ? AND is_active = ?', @menu_item.item_code, true).take + + Commission.all.each do |com| + if com.product_code.include? @menu_item.item_code && com.active == true + @commission = Commission.find(com.id) + break + end + end @commissioner = Commissioner.where('id = ? AND is_active = ?', commissioner_id, true).take @product_commission = ProductCommission.where('sale_item_id = ?', @sale_item.id).take - - if !@product_commission.nil? - if @product_commission.commissioner_id == @commissioner.id - @product_commission.destroy - deselect = true - else - @product_commission.commissioner_id = @commissioner.id - deselect = false - end - else - @product_commission = ProductCommission.new - @product_commission.product_code = @menu_item.id - @product_commission.product_type = 'menu_item' # use for dummy data ToDo::need to change product type - unless @commission.nil? - @product_commission.commission_id = @commission.id - if @commission.commission_type == 'Percentage' - @product_commission.price = @sale_item.unit_price * (@commission.amount / 100.0) - @product_commission.amount = @product_commission.price * @sale_item.qty - elsif @commission.commission_type == 'Net Amount' - @product_commission.price = @commission.amount - @product_commission.amount = @product_commission.price * @sale_item.qty + if !@commission.nil? && @commissioner.commission_id == @commission.commission_id + if !@product_commission.nil? + if @product_commission.commissioner_id == @commissioner.id + @product_commission.destroy + deselect = true + else + @product_commission.commissioner_id = @commissioner.id + deselect = false end + else + @product_commission = ProductCommission.new + @product_commission.product_code = @menu_item.item_code + @product_commission.product_type = 'menu_item' # use for dummy data ToDo::need to change product type + unless @commission.nil? + @product_commission.commission_id = @commission.id + if @commission.commission_type == 'Percentage' + @product_commission.price = @sale_item.unit_price * (@commission.amount / 100.0) + @product_commission.amount = @product_commission.price * @sale_item.qty + elsif @commission.commission_type == 'Net Amount' + @product_commission.price = @commission.amount + @product_commission.amount = @product_commission.price * @sale_item.qty + end + end + @product_commission.commissioner_id = @commissioner.id + @product_commission.qty = @sale_item.qty + @product_commission.sale_id = @sale_item.sale_id + @product_commission.sale_item_id = @sale_item.sale_item_id + end + if @product_commission.save + render json: {status: true, deselect: deselect} + else + render json: {status: false, deselect: deselect} end - @product_commission.commissioner_id = @commissioner.id - @product_commission.qty = @sale_item.qty - @product_commission.sale_id = @sale_item.sale_id - @product_commission.sale_item_id = @sale_item.sale_item_id - end - if @product_commission.save - render json: {status: true, deselect: deselect} - else - render json: {status: false, deselect: deselect} end end diff --git a/app/models/order_queue_station.rb b/app/models/order_queue_station.rb index a775601a..d731c3d2 100755 --- a/app/models/order_queue_station.rb +++ b/app/models/order_queue_station.rb @@ -117,10 +117,10 @@ class OrderQueueStation < ApplicationRecord order_items = order.order_items # Order.pay_process_order_queue(order_id,table_id) - if order - oqs = OrderQueueStation.new - oqs.process_order(order, table_id) - end + # if order + # oqs = OrderQueueStation.new + # oqs.process_order(order, table_id) + # end assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id) if ENV["SERVER_MODE"] == 'cloud' from = request.subdomain + "." + request.domain From 70b7ec784fd6ebdd3906e0c1301b658878820649 Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 22 May 2018 14:15:31 +0630 Subject: [PATCH 37/42] add base url for cloud mode --- app/controllers/api/restaurant/menu_controller.rb | 5 ++++- app/views/api/restaurant/menu/_menu.json.jbuilder | 2 +- app/views/api/restaurant/menu/_menu_item.json.jbuilder | 6 +++++- app/views/api/restaurant/menu/index.json.jbuilder | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/restaurant/menu_controller.rb b/app/controllers/api/restaurant/menu_controller.rb index 011e4602..f6a43514 100755 --- a/app/controllers/api/restaurant/menu_controller.rb +++ b/app/controllers/api/restaurant/menu_controller.rb @@ -7,7 +7,10 @@ class Api::Restaurant::MenuController < Api::ApiController # checksum = File.readlines("public/checksums/menu_json.txt").pop.chomp all_menu = Menu.all - + @request_url = '' + if ENV["SERVER_MODE"] == "cloud" + @request_url = request.subdomain + "." + request.domain #local_url => 'http://0.0.0.0:3000' + end # to hash menu_array = [] all_menu.each do |m| diff --git a/app/views/api/restaurant/menu/_menu.json.jbuilder b/app/views/api/restaurant/menu/_menu.json.jbuilder index 8dcdf6fe..082b5f0a 100755 --- a/app/views/api/restaurant/menu/_menu.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu.json.jbuilder @@ -17,7 +17,7 @@ if (menu.menu_categories) if category.menu_items json.items category.menu_items do |item| - json.partial! 'api/restaurant/menu/menu_item', item: item + json.partial! 'api/restaurant/menu/menu_item', item: item, request_url: request_url end end end diff --git a/app/views/api/restaurant/menu/_menu_item.json.jbuilder b/app/views/api/restaurant/menu/_menu_item.json.jbuilder index 810daf6d..56a8cb5f 100755 --- a/app/views/api/restaurant/menu/_menu_item.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu_item.json.jbuilder @@ -53,7 +53,11 @@ json.id item.id json.code item.item_code json.name item.name json.alt_name item.alt_name -json.image item.image_path.url +if !request_url.nil? && request_url != '' + json.image request_url + item.image_path.url.to_s +else + json.image item.image_path.url +end json.description item.description json.information item.information json.type item.type diff --git a/app/views/api/restaurant/menu/index.json.jbuilder b/app/views/api/restaurant/menu/index.json.jbuilder index 46f35e60..a230a965 100755 --- a/app/views/api/restaurant/menu/index.json.jbuilder +++ b/app/views/api/restaurant/menu/index.json.jbuilder @@ -5,7 +5,7 @@ menu_json = json.array! @menus do |menu| json.valid_time_from menu.valid_time_from.strftime("%H:%M") json.valid_time_to menu.valid_time_to.strftime("%H:%M") - json.partial! 'api/restaurant/menu/menu', menu: menu + json.partial! 'api/restaurant/menu/menu', menu: menu, request_url: @request_url # if (@current_menu) # json.current_menu do # json.partial! 'api/restaurant/menu/menu', menu: @current_menu From ec4a0a3f811f0c1d2d10cde1ef07a9cf617182b4 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 22 May 2018 16:54:18 +0630 Subject: [PATCH 38/42] update employee active , addorder view --- app/assets/javascripts/addorder.js | 8 +-- app/assets/stylesheets/addorder.scss | 27 +++++++--- app/controllers/home_controller.rb | 50 ++++++++++--------- .../settings/employees_controller.rb | 2 +- app/views/origami/addorders/detail.html.erb | 2 +- app/views/settings/employees/_form.html.erb | 1 + 6 files changed, 55 insertions(+), 35 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 5b3142e6..3be2f34d 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -1434,16 +1434,16 @@ $(function() { row = '
' +'
' - +'
'+ menu_items[field].name +'
' - +"
'+ menu_items[field].name +'
' + +"
" - +"" + +JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' style='padding:0px 5px 0px 5px'>" + +"" +add+ '' +'
' +'
' diff --git a/app/assets/stylesheets/addorder.scss b/app/assets/stylesheets/addorder.scss index d9b62131..929ffb13 100755 --- a/app/assets/stylesheets/addorder.scss +++ b/app/assets/stylesheets/addorder.scss @@ -56,24 +56,29 @@ section .content{ .nav-tabs .nav-item { border-bottom: 1px solid #fff; margin-left:2px; - + margin-right: -1.555rem; } #ul-navbar{ border-left: 1px solid #54A5AF; border-right: 1px solid #54A5AF; - + padding-right: 0px; } .nav > li > a{ color:#54A5AF; } +.nav-tabs > li > a { + color:#111 !important; +} .nav-tabs { - background-color: #eeeeee; + background-color: #ccc; } .nav-tabs .nav-link { - padding: 0.7286rem 0.2575 + padding: 0.7286rem 0.2575; + border-top-left-radius: 0rem; + border-top-right-radius: 0rem; } .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { - background-color: #fff; + background-color: #a1aade; border-left: 6px solid #111; color:#54A5AF; font-weight: bold; @@ -81,7 +86,7 @@ section .content{ } .sub_category_list{ background:#fff; - margin-top:8px; + margin-top:0px; } .sub_category_list > li{ list-style:none; @@ -274,4 +279,14 @@ i.logout_icon{ .set_add_icon{ display:none; +} + +.nav-tabs > li > a { + color:#111 !important; +} + + +.ls-closed section.content { + margin-left: 15px !important; + margin-right: 15px !important; } \ No newline at end of file diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 1aa2738c..e23da859 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -19,7 +19,7 @@ class HomeController < ApplicationController def index # @employees = Employee.all_emp_except_waiter.order("name asc") - @employees = Employee.all.order("name asc") + @employees = Employee.all.where("is_active = true").order("name asc") @login_form = LoginForm.new() render "layouts/login_dashboard", layout: false end @@ -52,29 +52,33 @@ class HomeController < ApplicationController @employee = Employee.login(@login_form.emp_id, @login_form.password) if @employee != nil - if @employee.role == "administrator" - session[:session_token] = @employee.token_session - redirect_to dashboard_path - elsif @employee.role == "cashier" - session[:session_token] = @employee.token_session - route_by_role(@employee) - elsif @employee.role == "manager" - session[:session_token] = @employee.token_session - redirect_to dashboard_path - elsif @employee.role == "supervisor" - session[:session_token] = @employee.token_session - redirect_to origami_root_path - elsif @employee.role == "waiter" - session[:session_token] = @employee.token_session - redirect_to origami_dashboard_path - elsif @employee.role == "account" - session[:session_token] = @employee.token_session - redirect_to reports_dailysale_index_path - elsif @employee.role == "kitchen" - session[:session_token] = @employee.token_session - redirect_to oqs_root_path + if @employee.is_active + if @employee.role == "administrator" + session[:session_token] = @employee.token_session + redirect_to dashboard_path + elsif @employee.role == "cashier" + session[:session_token] = @employee.token_session + route_by_role(@employee) + elsif @employee.role == "manager" + session[:session_token] = @employee.token_session + redirect_to dashboard_path + elsif @employee.role == "supervisor" + session[:session_token] = @employee.token_session + redirect_to origami_root_path + elsif @employee.role == "waiter" + session[:session_token] = @employee.token_session + redirect_to origami_dashboard_path + elsif @employee.role == "account" + session[:session_token] = @employee.token_session + redirect_to reports_dailysale_index_path + elsif @employee.role == "kitchen" + session[:session_token] = @employee.token_session + redirect_to oqs_root_path + else + render :index + end else - render :index + redirect_to root_path, :notice => "This Employee is not active" end else redirect_to root_path, :notice => "Username and Password doesn't match!" diff --git a/app/controllers/settings/employees_controller.rb b/app/controllers/settings/employees_controller.rb index cefb7b9c..7b558ea1 100755 --- a/app/controllers/settings/employees_controller.rb +++ b/app/controllers/settings/employees_controller.rb @@ -68,6 +68,6 @@ class Settings::EmployeesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def employee_params - params.require(:employee).permit(:name, :role, :emp_id, :password, :image_path) + params.require(:employee).permit(:name, :role, :is_active, :emp_id, :password, :image_path) end end diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 38d30fa8..0ba7f60b 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -5,7 +5,7 @@ <% type = request.path_info.include?('quick_service')%> <% modify_order = request.path_info.include?('modify_order')%> -
+
diff --git a/app/views/settings/employees/_form.html.erb b/app/views/settings/employees/_form.html.erb index ad50e9b8..70712c7b 100755 --- a/app/views/settings/employees/_form.html.erb +++ b/app/views/settings/employees/_form.html.erb @@ -7,6 +7,7 @@
<%= f.input :name %> + <%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %> <% if current_user.role == "administrator" %> <%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %> <% else %> From 6ecab8074e27d5a0e6caa6e579fc3a9e3816b988 Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 22 May 2018 19:19:46 +0630 Subject: [PATCH 39/42] change dashboard query --- .../origami/dashboard_controller.rb | 36 +++++++++---------- app/views/origami/payments/show.html.erb | 10 +++--- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/controllers/origami/dashboard_controller.rb b/app/controllers/origami/dashboard_controller.rb index 9977850f..a633c9e1 100644 --- a/app/controllers/origami/dashboard_controller.rb +++ b/app/controllers/origami/dashboard_controller.rb @@ -18,42 +18,42 @@ class Origami::DashboardController < BaseOrigamiController # .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)') # @inventories = StockJournal.inventory_balances(today).sum(:balance) - @total_sale = Sale.total_sale(today) - @total_count = Sale.total_count(today) - @total_card = Sale.total_card_sale(today) - @total_credit = Sale.credit_payment(today) + @total_sale = Sale.total_sale(today,current_user) + @total_count = Sale.total_count(today,current_user) + @total_card = Sale.total_card_sale(today,current_user) + @total_credit = Sale.credit_payment(today,current_user) @sale_data = Array.new - @total_payment_methods = Sale.total_payment_methods(today) + @total_payment_methods = Sale.total_payment_methods(today,current_user) @total_payment_methods.each do |payment| if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" - pay = Sale.payment_sale('card', today) + pay = Sale.payment_sale('card', today, current_user) @sale_data.push({'card' => pay.payment_amount}) else - pay = Sale.payment_sale(payment.payment_method, today) + pay = Sale.payment_sale(payment.payment_method, today, current_user) @sale_data.push({payment.payment_method => pay.payment_amount}) end end - @summ_sale = Sale.summary_sale_receipt(today) - @total_customer = Sale.total_customer(today) - @total_dinein = Sale.total_dinein(today) - @total_takeaway = Sale.total_takeaway(today) - @total_other_customer = Sale.total_other_customer(today) - @total_membership = Sale.total_membership(today) + @summ_sale = Sale.summary_sale_receipt(today,current_user) + @total_customer = Sale.total_customer(today,current_user) + @total_dinein = Sale.total_dinein(today,current_user) + @total_takeaway = Sale.total_takeaway(today,current_user) + @total_other_customer = Sale.total_other_customer(today,current_user) + @total_membership = Sale.total_membership(today,current_user) - @total_order = Sale.total_order(today) - @total_accounts = Sale.total_account(today) + @total_order = Sale.total_order(today,current_user) + @total_accounts = Sale.total_account(today,current_user) @account_data = Array.new @total_accounts.each do |account| - acc = Sale.account_data(account.account_id, today) + acc = Sale.account_data(account.account_id, today,current_user) if !acc.nil? @account_data.push({account.title => acc.cnt_acc, account.title + '_amount' => acc.total_acc}) end end - @top_items = Sale.top_items(today) - @total_foc_items = Sale.total_foc_items(today) + @top_items = Sale.top_items(today,current_user) + @total_foc_items = Sale.total_foc_items(today,current_user) # get printer info @print_settings = PrintSetting.get_precision_delimiter() diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index ae7245a4..fb4824ec 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -570,8 +570,8 @@ var customer_name = "<%= @customer.name %>"; if ($("#server_mode").val() != "cloud") { // first bill not used in cloud payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment"); - console.log(payment_type) - console.log(parseInt(jQuery.inArray("MPU", payment_type))) + // console.log(payment_type) + // console.log(parseInt(jQuery.inArray("MPU", payment_type))) if (member_id && member_discount) { if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){ $("#credit_payment").hide(); @@ -636,7 +636,7 @@ var customer_name = "<%= @customer.name %>"; $('#pay').click(function() { sub_total = $('#sub-total').text(); member = $('#membership_id').text(); - console.log(member) + // console.log(member) if (parseInt(jQuery.inArray("MPU", payment_type)) != -1 && $('.mpu').text() == 0 && sub_total != 0.0 && member) { swal("Oops","Please Pay with MPU Payment","warning"); }else if(parseInt(jQuery.inArray("Redeem", payment_type)) != -1 && $('#ppamount').text()==0 && sub_total != 0.0 && member){ @@ -1195,7 +1195,7 @@ var customer_name = "<%= @customer.name %>"; url: url, data: {}, success: function (result) { - console.log(result) + // console.log(result) if (result.status == true) { createAccessCode(code); if (type == "edit") { @@ -1330,7 +1330,7 @@ var customer_name = "<%= @customer.name %>"; url: url, data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code, success: function (result) { - console.log(result) + // console.log(result) // For Server Print - from jade if ($("#server_mode").val() == "cloud") { code2lab.printFile(result.filepath.substr(6), result.printer_url); From 1b4d144b4666c025e3133407e8779ad8547dd90b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 23 May 2018 10:29:32 +0630 Subject: [PATCH 40/42] migerate employee --- config/initializers/action_controller.rb | 2 +- db/migrate/20170403155230_create_employees.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index e0eb7455..1d8b678e 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -19,7 +19,7 @@ class ActionController::Base render :json => [{ status: false, message: 'Invalid Access!'}] end else - #check for license file + check for license file if check_license current_license(ENV["SX_PROVISION_URL"]) else diff --git a/db/migrate/20170403155230_create_employees.rb b/db/migrate/20170403155230_create_employees.rb index 4270b265..16e741d8 100755 --- a/db/migrate/20170403155230_create_employees.rb +++ b/db/migrate/20170403155230_create_employees.rb @@ -3,6 +3,7 @@ class CreateEmployees < ActiveRecord::Migration[5.1] create_table :employees do |t| t.string :name, :null => false t.string :role, :null => false, :default => "cashier" + t.boolean :is_active, :default => true t.string :emp_id, :null => false t.string :password_digest, :null => false t.string :token_session From ddeb2f258287bdc809536296b27e67c7b4f8c211 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 23 May 2018 14:53:11 +0630 Subject: [PATCH 41/42] update production commission --- app/controllers/origami/product_commissions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/origami/product_commissions_controller.rb b/app/controllers/origami/product_commissions_controller.rb index 31343fe5..1156827a 100755 --- a/app/controllers/origami/product_commissions_controller.rb +++ b/app/controllers/origami/product_commissions_controller.rb @@ -91,7 +91,7 @@ class Origami::ProductCommissionsController < BaseOrigamiController # @commission = Commission.where('product_code = ? AND is_active = ?', @menu_item.item_code, true).take Commission.all.each do |com| - if com.product_code.include? @menu_item.item_code && com.active == true + if com.product_code.include? @menu_item.item_code && com.is_active == true @commission = Commission.find(com.id) break end From 055ca1c95b50cd0848004548b091fb455af1114d Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 23 May 2018 15:38:35 +0630 Subject: [PATCH 42/42] update action controller --- config/initializers/action_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 1d8b678e..fb212f13 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -19,7 +19,7 @@ class ActionController::Base render :json => [{ status: false, message: 'Invalid Access!'}] end else - check for license file + # check for license file if check_license current_license(ENV["SX_PROVISION_URL"]) else