diff --git a/Gemfile b/Gemfile index 0f13a68e..663d66d5 100644 --- a/Gemfile +++ b/Gemfile @@ -87,7 +87,7 @@ gem 'whenever', :require => false # XML parser #gem 'nokogiri', '~> 1.6' - +gem "select2-rails" # Pagination gem 'kaminari', '~> 1.0.1' diff --git a/Gemfile.lock b/Gemfile.lock index d780a96d..4e13e61f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,7 +65,7 @@ GEM builder (3.2.4) byebug (11.1.1) cancancan (1.17.0) - capistrano (3.12.0) + capistrano (3.12.1) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -171,7 +171,7 @@ GEM net-ssh (>= 2.6.5, < 6.0.0) net-ssh (5.2.0) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) pdf-core (0.7.0) pdfjs_viewer-rails (0.3.1) @@ -187,7 +187,7 @@ GEM rqrcode (>= 1.0.0) prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - puma (3.12.2) + puma (3.12.4) rack (2.0.9) rack-cors (1.1.1) rack (>= 2.0.0) @@ -235,13 +235,13 @@ GEM rqrcode_core (0.1.1) rspec-core (3.9.1) rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) + rspec-expectations (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) - rspec-rails (3.9.0) + rspec-rails (3.9.1) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -265,6 +265,8 @@ GEM tilt (>= 1.1, < 3) schema_to_scaffold (0.8.0) activesupport (>= 3.2.1) + select2-rails (4.0.3) + thor (~> 0.14) shoulda-matchers (3.1.3) activesupport (>= 4.0.0) sidekiq (5.2.8) @@ -288,12 +290,12 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sshkit (1.20.0) + sshkit (1.21.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) tether-rails (1.4.0) rails (>= 3.1) - thor (1.0.1) + thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) to_xls-rails (1.3.1) @@ -368,6 +370,7 @@ DEPENDENCIES rubyzip (= 1.0.0) sass-rails (~> 5.0) schema_to_scaffold + select2-rails shoulda-matchers (~> 3.1) sidekiq simple_form @@ -385,4 +388,4 @@ RUBY VERSION ruby 2.6.5p114 BUNDLED WITH - 2.0.2 + 2.1.4 diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 6ea9abf6..0c319877 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -619,7 +619,7 @@ $(function() { for(var field in attributes) { value = attributes[field]["values"]; - type = attributes[field]["type"] + type = attributes[field]["type"]; row = "
"+attributes[field]["type"]+"
"; $(value).each(function(i){ @@ -830,6 +830,7 @@ $(function() { item = get_item(item_data,"add_to_order"); customer_display_view(item,"add"); } + console.log(item_data); show_item_detail(item_data,"add_to_order"); calculate_sub_total(); code = $('#item_code').text() @@ -839,17 +840,20 @@ $(function() { // click plus icon for add $(document).on('click', '.add_icon', function(event){ - var item_data = $(this); - code = $(this).data('item-code'); - if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) { - item = get_item(item_data,"add_icon"); - customer_display_view(item,"add"); + if (window.location.pathname != '/settings/out_of_stock/new') { + var item_data = $(this); + code = $(this).data('item-code'); + if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) { + item = get_item(item_data,"add_icon"); + customer_display_view(item,"add"); + } + + show_item_detail(item_data,"add_icon"); + calculate_sub_total(); + autoScrollToItem(code) } - show_item_detail(item_data,"add_icon"); - calculate_sub_total(); - autoScrollToItem(code) }); //End Add Icon Click // scroll to element @@ -1270,6 +1274,8 @@ $(function() { }else{ window.location.href = "/origami/dashboard"; } + }else if(window.location.href.incluses("out_of_stock")){ + window.location.href = '/settings/out_of_stock'; }else{ var table_type = $('#table_type').text(); var table_id = $('#table_id').text(); @@ -1536,7 +1542,6 @@ $(function() { var menu_list = $('.menu_items_list'); menu_list.empty(); for(var field in menu_items) { - console.log(menu_items[field].instances); if (menu_items[field].is_sub_item == false) { instances = menu_items[field].instances ; @@ -1577,6 +1582,7 @@ $(function() { data_target = 'sx_item_detailModal'; data_modal = '' add_icon = "add_icon" + menu_instances = []; $(instances).each(function(i){ if (instances[i].is_default === true) { @@ -1589,6 +1595,10 @@ $(function() { promotion_price = instances[i].promotion_price; code = instances[i].code; out_of_stock = instances[i].out_of_stock; + menu_insta = [code,name,item_attributes]; + } + if(instances[i].out_of_stock === false){ + menu_instances.push(menu_insta); } }); } @@ -1635,6 +1645,7 @@ $(function() { +''+ price +'' + "
'+ price + '' +"
- + @@ -349,7 +349,7 @@ - - -
- -
-
- + + - -->