diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index f6005ebd..66714f33 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,9 +17,6 @@ //= require bootstrap/js/bootstrap-material-design.min //= require jquery_nested_form //= require cable -//= require tether -//= require bootstrap/js/popper.min -//= require bootstrap/js/bootstrap-material-design.min //= require momentjs/moment //= require bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker //= require multi-select/js/jquery.multi-select.js diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index d18a4726..35dce150 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -25,8 +25,7 @@ $(document).ready(function() { var method = $(this).attr('data-method'); var url = $(this).attr('data-ref'); var html_text = $(this).siblings( "#delete_text" ).html(); - //var page = url.substring(url.lastIndexOf('/') + 1); - console.log(location.href); + //var page = url.substring(url.lastIndexOf('/') + 1); swal({ title: "Confirmation", text: html_text, @@ -40,7 +39,7 @@ $(document).ready(function() { type: method, url: url , success: function(data) { - // console.log(data.url); + console.log(data.url); location.href = data.url; } }); diff --git a/app/assets/javascripts/login.js b/app/assets/javascripts/login.js index 92005cdb..28976f6b 100755 --- a/app/assets/javascripts/login.js +++ b/app/assets/javascripts/login.js @@ -11,7 +11,6 @@ // about supported directives. // //= require jquery -//= require jquery_nested_form //= require tether //= require bootstrap/js/popper.min //= require bootstrap/js/bootstrap-material-design.min diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 39152c58..de838a1e 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -158,7 +158,7 @@ select.form-control { } .long{ - width:43%; + width:49%; } .sold { @@ -240,7 +240,7 @@ select.form-control { /* End Colors */ .left{ - margin-left:20px; + margin-left:1px; } .bottom{ @@ -326,3 +326,15 @@ tr.discount-item-row:hover { -moz-opacity: 1; /* mozilla */ } + +/* For Payment Page */ + +.payment-long { + width:43%; +} + +.payment-left { + margin-left: 20px; +} + +/* End Payment Page */ diff --git a/app/controllers/settings/menu_item_instances_controller.rb b/app/controllers/settings/menu_item_instances_controller.rb index ac2acc7f..e9b67de2 100755 --- a/app/controllers/settings/menu_item_instances_controller.rb +++ b/app/controllers/settings/menu_item_instances_controller.rb @@ -134,10 +134,11 @@ class Settings::MenuItemInstancesController < ApplicationController item = MenuItem.find(catID.menu_item_id) category = MenuCategory.find(item.menu_category_id) end - respond_to do |format| - format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully destroyed.' } - format.json { head :no_content } - end + render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_item_path(category,catID) }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/set_menu_items_controller.rb b/app/controllers/settings/set_menu_items_controller.rb index f97aa09e..0c046d7c 100755 --- a/app/controllers/settings/set_menu_items_controller.rb +++ b/app/controllers/settings/set_menu_items_controller.rb @@ -105,13 +105,18 @@ class Settings::SetMenuItemsController < ApplicationController # DELETE /settings/menu_items/1 # DELETE /settings/menu_items/1.json def destroy + # item_id = @settings_menu_item.id + # category_id = @settings_menu_item.menu_category + path_to_file = @settings_menu_item.image_path.to_s File.delete(path_to_file) if File.exist?(path_to_file) abc = MenuItem.deleteRecursive(@settings_menu_item) - respond_to do |format| - format.html { redirect_to settings_menu_category_set_menu_items_path, notice: 'Menu item was successfully destroyed.' } - format.json { head :no_content } - end + + render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_items_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_category_set_menu_items_path(category_id,item_id), notice: 'Menu item was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/simple_menu_items_controller.rb b/app/controllers/settings/simple_menu_items_controller.rb index 319934ca..b37f6706 100755 --- a/app/controllers/settings/simple_menu_items_controller.rb +++ b/app/controllers/settings/simple_menu_items_controller.rb @@ -126,14 +126,15 @@ class Settings::SimpleMenuItemsController < ApplicationController # DELETE /settings/menu_items/1 # DELETE /settings/menu_items/1.json - def destroy + def destroy path_to_file = @settings_menu_item.image_path.to_s File.delete(path_to_file) if File.exist?(path_to_file) abc = MenuItem.deleteRecursive(@settings_menu_item) - respond_to do |format| - format.html { redirect_to settings_menu_category_simple_menu_items_path, notice: 'Menu item was successfully destroyed.' } - format.json { head :no_content } - end + render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_items_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_category_simple_menu_items_path, notice: 'Menu item was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/models/print_setting.rb b/app/models/print_setting.rb index 54afdfae..c326f715 100755 --- a/app/models/print_setting.rb +++ b/app/models/print_setting.rb @@ -1,4 +1,4 @@ class PrintSetting < ApplicationRecord # validations - validates_presence_of :name, :unique_code, :font, :api_settings, :printer_name, :page_width, :page_height, :print_copies, :heading_space + validates_presence_of :name, :unique_code, :printer_name, :page_width, :page_height end diff --git a/app/models/promotion.rb b/app/models/promotion.rb index bc1516cc..2edc9421 100755 --- a/app/models/promotion.rb +++ b/app/models/promotion.rb @@ -218,7 +218,7 @@ class Promotion < ApplicationRecord else foc_qty = find_second_item_qty(sale_id, promo_product.item_code) # give total qty is 1 - foc_qty = (foc_qty - foc_qty) + 1 + #foc_qty = (foc_qty - foc_qty) + 1 item = OrderItem.find_by_item_instance_code(promo_product.item_code) # total = item.price * foc_qty diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index cfaa96bd..ec129d07 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -248,15 +248,15 @@
-
1000
-
3000
+
1000
+
3000
-
5000
-
10000
+
5000
+
10000
-
Pay
+
Pay
@@ -264,7 +264,10 @@
- + @@ -275,12 +278,21 @@