From a74573709a1ab038f62ae3a134488f032d3ab05f Mon Sep 17 00:00:00 2001 From: Myat Zin Wai Maw Date: Mon, 22 Apr 2019 14:24:16 +0630 Subject: [PATCH 1/2] - --- config/license.yml | 15 +++++++++++++++ config/puma.rb | 19 +++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 config/license.yml diff --git a/config/license.yml b/config/license.yml new file mode 100644 index 00000000..42f5be11 --- /dev/null +++ b/config/license.yml @@ -0,0 +1,15 @@ +iv_key: 0zVzQvzlcJhc1d1EuA2HRg== +shop_name: aungcafe +email: devops@code2lab.com +telephone: +fax: +address: +dbhost: NGg7s8bJBfbDrkIeQhV+obOyEtgxtI3Dvf+b+eBm0P+r3aT+dBqHnwVEaIwsafXPFNXavhR/C0iyni1Lszkfyw== +dbschema: X+F4yj1eQlGPiMtsgZQCqWi2NIdBLUCEj35vF4XQDZc= +dbusername: 5CSlQR48ZAiRwWlTxzOZcw== +dbpassword: uzPlzsPjbWhJHcbStJSS0A== +api_token: RaZKWQwnKpvbdJvyAiMGGZPUKuJkWbE +app_token: dCKGOGvdFsCzOUrvhdrFqoOaAUzwtEUC +plan_sku: Qy0IoCIrNawRA2WjS3aLPg== +renewable_date: vGwTpixrL9biHkxdRdGctA== +plan_name: E9Njdqdou4eMpPaWDevpT95fpksDti2xvY+0u3PzKp0= diff --git a/config/puma.rb b/config/puma.rb index cd3f0829..1ce2a468 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,11 +1,10 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path +#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! - +#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 8f81eb8e4aec179265ccc716c56c1721c9364a36 Mon Sep 17 00:00:00 2001 From: Myat Zin Wai Maw Date: Mon, 22 Apr 2019 17:24:20 +0630 Subject: [PATCH 2/2] customer filter with card no --- app/controllers/crm/customers_controller.rb | 7 ++++++- app/views/crm/customers/index.html.erb | 16 +++++++++++++++- config/initializers/action_controller.rb | 10 +++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 0af08e5d..21c2d373 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -6,8 +6,13 @@ class Crm::CustomersController < BaseCrmController # GET /crm/customers.json def index filter = params[:filter] + filter_card_no = params[:filter_card_no] type = params[:type] - if filter.nil? + if filter_card_no=="" + @crm_customers = Customer.all + elsif !filter_card_no.nil? + @crm_customers=Customer.where("card_no=?",filter_card_no) + elsif filter.nil? || filter_card_no=="" @crm_customers = Customer.all else @crm_customers = Customer.search(filter) diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index b949291b..76d1dce8 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -15,7 +15,7 @@
-
+
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
@@ -32,6 +32,20 @@
<% end %>
+
+ <%= form_tag crm_customers_path, :method => :get do %> +
+
+ +
+
+ + + +
+
+ <%end %> +
diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index fb212f13..cab8fe5d 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