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 @@