diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index cf6782dd..4f14b531 100644 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -52,4 +52,33 @@ @include media-breakpoint-only(xl) { column-count: 5; } +} + +#sxModal { + display: none; + overflow: auto; + width: 100%; + height: 100%; + background-color: #000; + background-color: rgba(0,0,0,0.4); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1100; +} + +#sxModal-Content { + position: relative; + left: 42%; + top: 30%; + background-color: #d9534f; + color: #fff; + text-align: center; + width: 200px; + height: 200px; + padding-top: 5%; + border-radius: 100px; + z-index: 1101; } \ No newline at end of file diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index 57c5a36d..74a8032f 100644 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -24,4 +24,4 @@ width: 49%; font-size: 18px; margin: 0px 0px 5px 0px; -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 7935b50e..62a17d2c 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -211,3 +211,32 @@ tr.discount-item-row:hover { margin-left:-40px !important; margin-top:-40px !important; } + +#sxModal { + display: none; + overflow: auto; + width: 100%; + height: 100%; + background-color: #000; + background-color: rgba(0,0,0,0.4); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1100; +} + +#sxModal-Content { + position: relative; + left: 42%; + top: 30%; + background-color: #d9534f; + color: #fff; + text-align: center; + width: 200px; + height: 200px; + padding-top: 5%; + border-radius: 100px; + z-index: 1101; +} diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index bbfdb912..ab79b9e8 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -81,6 +81,7 @@ class Crm::CustomersController < BaseCrmController address = customer_params[:address] nrc = customer_params[:nrc_no] card_no = customer_params[:card_no] + paypar_account_no = customer_params[:paypar_account_no] member_group_id = params[:member_group_id] if member_group_id.present? @@ -95,6 +96,7 @@ class Crm::CustomersController < BaseCrmController response = HTTParty.post(url, :body => {name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc,card_no:card_no, + paypar_account_no: paypar_account_no, member_group_id: member_group_id, merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { @@ -172,6 +174,7 @@ end address = customer_params[:address] nrc = customer_params[:nrc_no] card_no = customer_params[:card_no] + paypar_account_no = customer_params[:paypar_account_no] id = @crm_customer.membership_id member_group_id = params[:member_group_id] @@ -187,6 +190,7 @@ end response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc, + paypar_account_no: paypar_account_no, card_no:card_no,member_group_id: member_group_id, merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { @@ -231,6 +235,7 @@ end response = HTTParty.post(url, :body => {name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc,card_no:card_no, + paypar_account_no: paypar_account_no, id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', @@ -287,6 +292,6 @@ end def customer_params params.require(:customer).permit(:name, :company, :contact_no, :email, - :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no) + :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no) end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index fb37dbdc..29e9d371 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -84,7 +84,7 @@ class HomeController < ApplicationController if !shift.nil? redirect_to origami_root_path else - redirect_to dashboard_path + redirect_to crm_customers_path end elsif employee.role == "cashier" #check if cashier has existing open cashier diff --git a/app/models/customer.rb b/app/models/customer.rb index 2f09ff12..83a652d3 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -10,6 +10,7 @@ class Customer < ApplicationRecord validates :contact_no, uniqueness: true validates :email, uniqueness: true validates :card_no, uniqueness: true + validates :paypar_account_no, uniqueness: true paginates_per 50 diff --git a/app/views/crm/customers/_crm_customer.json.jbuilder b/app/views/crm/customers/_crm_customer.json.jbuilder index 1b1b237e..c0d66225 100644 --- a/app/views/crm/customers/_crm_customer.json.jbuilder +++ b/app/views/crm/customers/_crm_customer.json.jbuilder @@ -1,2 +1,2 @@ -json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at,:salutation, :gender,:nrc_no,:address,:card_no +json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at,:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no json.url crm_customer_url(crm_customer, format: :json) diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 66a16b2b..b51aac36 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -1,7 +1,5 @@
- <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> - <%= f.hidden_field :id, :class => "form-control col-md-6 " %> @@ -15,6 +13,14 @@ <% end -%>
+
+ +
+ +
+
+
+

@@ -107,11 +113,40 @@
-
<%= f.button :submit, "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %> <%= f.button :submit, "Update",:class => 'btn btn-primary ', :disabled =>'', :id => 'update_customer' %> <%= f.button :button, "Reset",:class => 'btn btn-danger ', :id => 'reset' %>
<%end%> - \ No newline at end of file + + +
+

Card Tap

+
+ + \ No newline at end of file diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index a44aed2f..955395ef 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -119,7 +119,7 @@ $(document).on('click',".customer_tr",function(){ url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { $('#customer_id').val(data.id); $('#customer_name').val(data.name); $('#customer_company').val(data.company); @@ -128,6 +128,7 @@ $(document).on('click',".customer_tr",function(){ $('#customer_salutation').val(data.salutation); $('#customer_nrc_no').val(data.nrc_no); $('#customer_card_no').val(data.card_no); + $('#paypar_account_no').val(data.paypar_account_no); $('#customer_address').val(data.address); $('#customer_date_of_birth').val(data.date_of_birth); $('#customer_membership_type').val(data.membership_type); diff --git a/app/views/crm/customers/show.json.jbuilder b/app/views/crm/customers/show.json.jbuilder index 86901801..5fd0410a 100644 --- a/app/views/crm/customers/show.json.jbuilder +++ b/app/views/crm/customers/show.json.jbuilder @@ -1,4 +1,4 @@ json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, - :salutation, :gender,:nrc_no,:address,:card_no + :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no json.url crm_customer_url(@crm_customer, format: :json) diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index a1d359e8..4d03d48f 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -34,6 +34,7 @@ Company Contact no Email + @@ -54,7 +55,7 @@ <%= crm_customer.company rescue '-' %> <%= crm_customer.contact_no %> <%= crm_customer.email %> - + <% end %> @@ -89,6 +90,14 @@ <%= str %> <% end -%> +
+ +
+ <%= #f.input :paypar_account_no, :id => "paypar_account_no", :class => "form-control" %> + +
+
+

@@ -192,6 +201,10 @@
+
+

Card Tap

+
+