diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 2bbae4be..fdd66e15 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -886,27 +886,33 @@ $(function() { $('.keypress_qty').keyup(function(e){ - id = $(this).attr('id'); + id = $(this).attr('id'); value = $(this).val(); - $('.change_qty').attr('value',value); - if (id=="count") { - price = $("#unit_price").text(); - $("#total_price").text(value*price); - }else{ - var item_row = $('.selected-instance'); - price = $("#set_unit_price").text(); - set_total_price = $("#set_total_price").text(); - $(".set_change_qty").val(value); - if (item_row.length > 1) { - total = 0 ; - $(item_row).each(function(i){ - total += value * $(item_row[i]).attr('data-price'); - total_price = total; - }); + + if ($.isNumeric(value)) { + $('.change_qty').attr('value',value); + if (id=="count") { + price = $("#unit_price").text(); + $("#total_price").text(value*price); }else{ - total_price = value*price; + var item_row = $('.selected-instance'); + price = $("#set_unit_price").text(); + set_total_price = $("#set_total_price").text(); + $(".set_change_qty").val(value); + if (item_row.length > 1) { + total = 0 ; + $(item_row).each(function(i){ + total += value * $(item_row[i]).attr('data-price'); + total_price = total; + }); + }else{ + total_price = value*price; + } + $("#set_total_price").text(total_price); } - $("#set_total_price").text(total_price); + }else{ + $('#'+id).val(1); + swal("Opps","Please enter number for qty","warning"); } }); diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index 9e9daa84..ec599464 100755 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -6,9 +6,6 @@ @import "sweetalert/sweetalert.css"; @import "multi-select/css/multi-select.css"; @import "bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker"; -@import "jquery-ui/jquery-ui.css"; -@import "jquery-ui/jquery-ui.structure.css"; -@import "jquery-ui/jquery-ui.theme.css"; @import "morrisjs/morris"; @import "BSBMaterial/style"; @import "BSBMaterial/themes/all-themes"; @@ -120,3 +117,32 @@ .bottom{ margin-bottom:1px; } + +/*Pagination*/ +nav.pagination { + margin:10px; + +} +nav.pagination .current{ + background-color:#1f91f3; + color:#fff; + padding:4px 10px; + margin-top:-4px; +} +nav.pagination .page a,.next a,.last a,.prev a,.first a{ + padding:6.5px 10px; + margin-left: 3px; +} + +nav.pagination .page a:hover, +a:focus { + background-color: #ccc; + text-decoration: none; + +} +nav.pagination .page a:hover, +.first a:hover,.last a:hover,.prev a:hover,.next a:hover{ + background-color: #ccc; + text-decoration: none; + +} diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 2a277144..f95b54a9 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -33,12 +33,14 @@ class Crm::CustomersController < BaseCrmController end end end - @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(15) + @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(20) @crm_customer = Customer.new @count_customer = Customer.count_customer @taxes = TaxProfile.all.order("order_by asc") + @filter = filter + # if flash["errors"] # @crm_customer.valid? # end diff --git a/app/controllers/settings/membership_actions_controller.rb b/app/controllers/settings/membership_actions_controller.rb index 4f22a285..a41f7ad2 100755 --- a/app/controllers/settings/membership_actions_controller.rb +++ b/app/controllers/settings/membership_actions_controller.rb @@ -72,6 +72,6 @@ class Settings::MembershipActionsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_membership_action_params - params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by, :additional_parameter) + params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by) end end diff --git a/app/controllers/settings/shops_controller.rb b/app/controllers/settings/shops_controller.rb index 25c8456d..a48bcb9a 100644 --- a/app/controllers/settings/shops_controller.rb +++ b/app/controllers/settings/shops_controller.rb @@ -71,6 +71,6 @@ class Settings::ShopsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def shop_params - params.require(:shop).permit(:name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order) + params.require(:shop).permit(:name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info) end end diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb index 7bc1e969..a76fa385 100755 --- a/app/controllers/transactions/orders_controller.rb +++ b/app/controllers/transactions/orders_controller.rb @@ -34,7 +34,7 @@ class Transactions::OrdersController < ApplicationController def show @order = Order.find(params[:id]) - + @dining = BookingOrder.find_by_order_id(@order.order_id).booking.dining_facility respond_to do |format| format.html # show.html.erb format.json { render json: @order } diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 168afe28..091d8e51 100755 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -13,8 +13,6 @@
-
-
-
diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 150ea55d..59e782b4 100755 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -140,7 +140,7 @@ - + - +
diff --git a/app/views/transactions/orders/index.html.erb b/app/views/transactions/orders/index.html.erb index c0846ac8..ce8a7607 100755 --- a/app/views/transactions/orders/index.html.erb +++ b/app/views/transactions/orders/index.html.erb @@ -48,6 +48,9 @@ + + + @@ -57,10 +60,14 @@ - <% @orders.each do |order| %> + <% @orders.each do |order| + @dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility + %> + + diff --git a/app/views/transactions/orders/show.html.erb b/app/views/transactions/orders/show.html.erb index 58ff8de4..0a487437 100755 --- a/app/views/transactions/orders/show.html.erb +++ b/app/views/transactions/orders/show.html.erb @@ -17,21 +17,25 @@
<%= t("views.right_panel.detail.order_id") %><%= t :table %>/<%= t :room %><%= t("views.right_panel.detail.order_by") %> <%= t("views.right_panel.detail.type") %> <%= t :customer %> <%= t("views.right_panel.detail.order_status") %>
<%= link_to order.order_id, transactions_order_path(order) %><%= @dining.type %>-<%= @dining.name %><%= order.waiters %> <%= order.order_type %> <%= order.customer.name rescue '-' %> <%= order.status %>
+ + - + + + - +
<%= t :table %>/<%= t :room %><%= t("views.right_panel.detail.order_by") %> <%= t("views.right_panel.detail.type") %> <%= t :customer %> <%= t("views.right_panel.detail.order_status") %> <%= t("views.right_panel.detail.order_date") %><%= t("views.right_panel.detail.order_by") %>
<%= @dining.type %>-<%= @dining.name %> <%= @order.waiters rescue '-' %> <%= @order.order_type %> <%= @order.customer.name rescue '-' %> <%= @order.status %> <%= @order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> <%= @order.waiters rescue '-' %>