From 57adb091624b6a1e9c9574a77a1a068ae4f334dd Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 13 Sep 2018 11:58:57 +0630 Subject: [PATCH] change customer UI and header css --- app/assets/stylesheets/CRM.scss | 113 +++- app/assets/stylesheets/origami.scss | 113 +++- app/assets/stylesheets/reset.css | 4 +- app/controllers/crm/customers_controller.rb | 4 + app/models/sale_payment.rb | 6 +- app/views/crm/customers/_new_form.html.erb | 360 +++++++------ app/views/crm/customers/index.html.erb | 256 +++++---- app/views/crm/customers/show.html.erb | 117 ++-- app/views/origami/customers/index.html.erb | 564 ++++++++++++-------- 9 files changed, 995 insertions(+), 542 deletions(-) diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index 5bfab409..de416831 100755 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -157,4 +157,115 @@ nav.pagination .page a:hover, i.logout_icon{ position: relative; top: 5px; -} \ No newline at end of file +} + +/*customer modal UI */ + .wizard { + background: #f1f1f1; + padding: 10px; + } + .wizard .nav-tabs { + position: relative; + border: 0px; + } + .wizard > div.wizard-inner { + position: relative; + margin: 0 0 0 145px !important; + } + .connecting-line{ + height:12px; + background: #e0e0e0; + position: absolute; + width: 105%; + margin: 0 auto; + left: 0; + right: 0; + top:38%; + z-index: 1; + border-radius: 15px; + } + .active-line{ + height:12px; + background: #e0e0e0; + position: absolute; + width: 5%; + margin: 0 auto; + left: 0; + right: 0; + top:61%; + z-index: 1; + border-radius: 15px !important; + } + .connecting-line a.active{ + background-color: #2ED4E0; + } + .border-right{ + border-radius: 15px 0 0 15px; + } + .border-left{ + border-radius: 0; + } + .wizard .nav-tabs > li { + margin-bottom: -20px; + } + .wizard .nav-tabs > li > a.active > a, .wizard .nav-tabs > li > a.active > a:hover, .wizard .nav-tabs > li > a.active > a:focus { + cursor: default; + border: 0; + color:#2ED4E0; + border-bottom-color: transparent; + } + .nav-tabs li p{ + padding-top:40px; + font-size: 14px; + text-align: center; + } + .list-inline{ + text-align: center; + } + span.round-tab { + width: 28px; + height: 28px; + line-height: 28px; + display: inline-block; + border-radius: 100px; + background:#DFE3E4; + border: 2px solid #fff; + z-index:1; + position:absolute; + text-align: center; + font-size: 16px; + } + .wizard li > a.active span.round-tab{ + background:#2196F3; + color:white; + border: 1px solid #fff; + } + span.round-tab:hover{ + color: white; + border: 1px solid #fff; + background-color:#2196F3; + } + .wizard .nav-tabs > li { + width: 25%; + } + .wizard .nav-tabs > li a{ + width: 28px; + height: 28px; + margin: 18px auto; + border-radius: 100%; + padding: 0; + color: #777; + } + .wizard .tab-pane { + position: relative; + padding-top: 5px; + border-top: 1px solid #fff; + margin-top: 20px; + } + .next-step:hover, .next-step, .prev-step:hover, .prev-step{ + position: relative; + background-color: #2196F3; + font-size: 14px; + color: #FFFFFF; + } +/*customer modal UI */ \ No newline at end of file diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index dc60703c..a879e4b4 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -542,4 +542,115 @@ nav.pagination .page a:hover, #amount_due{ height: 50%; font-size: 20px; -} \ No newline at end of file +} + +/*customer modal UI */ + .wizard { + background: #f1f1f1; + padding: 10px; + } + .wizard .nav-tabs { + position: relative; + border: 0px; + } + .wizard > div.wizard-inner { + position: relative; + margin: 0 0 0 145px !important; + } + .connecting-line{ + height:12px; + background: #e0e0e0; + position: absolute; + width: 110%; + margin: 0 auto; + left: 0; + right: 0; + top:38%; + z-index: 1; + border-radius: 15px; + } + .active-line{ + height:12px; + background: #e0e0e0; + position: absolute; + width: 5%; + margin: 0 auto; + left: 0; + right: 0; + top:61%; + z-index: 1; + border-radius: 15px !important; + } + .connecting-line a.active{ + background-color: #2ED4E0; + } + .border-right{ + border-radius: 15px 0 0 15px; + } + .border-left{ + border-radius: 0; + } + .wizard .nav-tabs > li { + margin-bottom: -20px; + } + .wizard .nav-tabs > li > a.active > a, .wizard .nav-tabs > li > a.active > a:hover, .wizard .nav-tabs > li > a.active > a:focus { + cursor: default; + border: 0; + color:#2ED4E0; + border-bottom-color: transparent; + } + .nav-tabs li p{ + padding-top:40px; + font-size: 14px; + text-align: center; + } + .list-inline{ + text-align: center; + } + span.round-tab { + width: 28px; + height: 28px; + line-height: 28px; + display: inline-block; + border-radius: 100px; + background:#DFE3E4; + border: 2px solid #fff; + z-index:1; + position:absolute; + text-align: center; + font-size: 16px; + } + .wizard li > a.active span.round-tab{ + background:#2196F3; + color:white; + border: 1px solid #fff; + } + span.round-tab:hover{ + color: white; + border: 1px solid #fff; + background-color:#2196F3; + } + .wizard .nav-tabs > li { + width: 25%; + } + .wizard .nav-tabs > li a{ + width: 28px; + height: 28px; + margin: 18px auto; + border-radius: 100%; + padding: 0; + color: #777; + } + .wizard .tab-pane { + position: relative; + padding-top: 5px; + border-top: 1px solid #fff; + margin-top: 20px; + } + .next-step:hover, .next-step, .prev-step:hover, .prev-step{ + position: relative; + background-color: #2196F3; + font-size: 14px; + color: #FFFFFF; + } +/*customer modal UI */ \ No newline at end of file diff --git a/app/assets/stylesheets/reset.css b/app/assets/stylesheets/reset.css index 1326a293..14a803e3 100644 --- a/app/assets/stylesheets/reset.css +++ b/app/assets/stylesheets/reset.css @@ -286,13 +286,13 @@ section.content { /* shop name margin */ .shop-name-margin { - margin-left : 20%; + margin-left : 15%; } /* shop name margin */ /* online order margin */ .online-order-margin { - margin-left : 22%; + margin-left : 13%; margin-bottom : 9.9999px; } /* online order margin */ diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index a64d7af4..9648a246 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -86,6 +86,10 @@ class Crm::CustomersController < BaseCrmController end end + params[:type] = nil + params[:customer_id] = params[:id] + @credit_sales = SalePayment.get_credit_sales(params) + #get customer amount @customer = Customer.find(params[:id]) @response = Customer.get_membership_transactions(@customer) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 97ee07a7..59da1581 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -876,8 +876,10 @@ class SalePayment < ApplicationRecord .joins("INNER JOIN customers c ON c.customer_id = s.customer_id") .joins("INNER JOIN sale_orders so ON so.sale_id = s.sale_id") .joins("INNER JOIN orders o ON o.order_id = so.order_id") - - if params[:type] == "cashier" + + if params[:type].nil? + query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}") + elsif params[:type] == "cashier" query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' AND o.source='#{params[:type]}' OR o.source='emenu' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}") else query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' AND o.source='#{params[:type]}' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}") diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 5dcb86b0..c2e0aff4 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -1,163 +1,225 @@ +
+
+
+
+ +
+ <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> + + <%= f.hidden_field :id, :class => "form-control " %> +
+
+ +
+
+ +
+ +
+
+
-<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> - -<%= f.hidden_field :id, :class => "form-control " %> +
+
+
+   +   +   + +
+
+
"> +
+ <%= f.input :name, :class => "form-control name", :required => true %> + <% flash.each do |test, msg| %> + <% + str="[\"#{msg['name']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%> +
+
+
"> +
+ <%= f.input :contact_no, :class => "form-control contact_no" ,:required => true%> -
-
-   -   -   - -
+ <% flash.each do |name, msg| %> + <% str="[\"#{msg['contact_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
-
"> - <%= f.input :name, :class => "form-control col-md-6 name", :required => true %> - <% flash.each do |test, msg| %> - <% - str="[\"#{msg['name']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
+
"> +
+ <%= f.input :email, :class => "form-control email" ,:required => true%> -
-
- - -
+ <% flash.each do |name, msg| %> + <% str="[\"#{msg['email']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
+
+
+
+ + +
+
+
+
+ <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %> +
+
+
+
+ <%= f.input :company, :class => "form-control col-md-6 company"%> -
- <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %> -
+ <% flash.each do |name, msg| %> + <% str="[\"#{msg['company']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%> +
+
+
+
+ + <%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%> +
+
+
+
+ <%= f.input :address, :class => "form-control address" %> +
+
-
- <%= f.input :company, :class => "form-control col-md-6 company"%> +
+
+ +
+
+
+
+ +
+
+ +
+ + <%= f.file_field :image_path, :class => "img-thumbnail" %> +
+
+
+
+
+ + +
+
- <% flash.each do |name, msg| %> - <% str="[\"#{msg['company']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
-
"> - <%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%> +
+
+ <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control tax_profiles" %> +
+
- <% flash.each do |name, msg| %> - <% str="[\"#{msg['contact_no']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end %> -
+
"> +
+ <%= f.input :card_no, :class => "form-control card_no"%> + <% flash.each do |name, msg| %> + <% str="[\"#{msg['card_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
-
"> - <%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%> +
+
+ +
+ +
+
+
+
- <% flash.each do |name, msg| %> - <% str="[\"#{msg['email']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end %> -
- -
- <%= f.input :address, :class => "form-control col-md-6 address" %> -
- -
- -
- +
+
+ + +
+
+
+
+ + + + + +
+
+
+
+
+ <%end%>
-
- -
- - <%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%> -
- -
- -
- - <%= f.file_field :image_path, :class => "img-thumbnail" %> -
-
- -
- - -
- -
- <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %> -
- -
"> - <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> - <% flash.each do |name, msg| %> - <% str="[\"#{msg['card_no']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end %> -
- -
- -
- -
-
-
- -
- - - -
- -
- - - - -
-<%end%> +
diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index ceb28f1c..69d5f29f 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -11,28 +11,31 @@
-
+
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
-
- - +
+ +
- - +
+ + - - + + +
<% end %>
-
+
+ <%= paginate @crm_customers %>
+ <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %> + + + <% end %> + - <% if @create_flag %> -
-
-
- <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %> -
-
- - -
- <% end %> + diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 5a904000..5b642d13 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -1,5 +1,17 @@ +
+ +
-
+
@@ -148,50 +163,68 @@
<%= t :sale_details %>
-
-
- - - - - - - - - - - - - +
+
<%= t("views.right_panel.detail.sale_id") %><%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.total_discount") %><%= t("views.right_panel.detail.tax_amount") %><%= t("views.right_panel.detail.sub_total") %><%= t("views.right_panel.detail.grand_total") %><%= t :cashier %><%= t("views.right_panel.detail.sales_status") %><%= t("views.right_panel.detail.receipt_date") %>
+ + + + + + + + + + + + + - - <% @sales.each do |sale| %> - - - - - - - - - - - - <% end %> - -
<%= t("views.right_panel.detail.sale_id") %><%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.total_discount") %><%= t("views.right_panel.detail.tax_amount") %><%= t("views.right_panel.detail.sub_total") %><%= t("views.right_panel.detail.grand_total") %><%= t :cashier %><%= t("views.right_panel.detail.sales_status") %><%= t("views.right_panel.detail.receipt_date") %>
<%= link_to sale.sale_id, transactions_sale_path(sale) %><%= sale.receipt_no %><%= sale.total_discount %><%= sale.total_tax %><%= sale.total_amount %><%= sale.grand_total rescue '-' %><%= sale.cashier_name rescue '-' %> <%= sale.sale_status %> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
-
-
- + + <% @sales.each do |sale| %> + + <%= link_to sale.sale_id, transactions_sale_path(sale) %> + <%= sale.receipt_no %> + <%= sale.total_discount %> + <%= sale.total_tax %> + <%= sale.total_amount %> + <%= sale.grand_total rescue '-' %> + <%= sale.cashier_name rescue '-' %> + <%= sale.sale_status %> + <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> + + <% end %> + + +
+
+ +
+
<%= t :credit %> <%= t :details %>
+ + + + + + + + + <% if !@credit_sales.nil? %> + <% @credit_sales.each do |credit| %> + + + + + + + <% end %> + <% end %> + +
<%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %><%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.credit_amount") %>
<%= credit.sale_date.utc.getlocal.strftime("%e %b %Y %I:%M%p") %><%= credit.receipt_no %><%= credit.cashier_name %><%= credit.payment_amount %>
+
+
+
- - -
diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 9644cba1..bdc8e342 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -1,18 +1,18 @@
- - Back + <%= link_to 'Back', dashboard_path %> -
--> +
-
+
@@ -46,242 +46,305 @@ <% end %>
-
-
- - - - - - - - - - - - - +
+
+ <%= paginate @crm_customers %> +
+
+
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.membership_type") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %>
+ + + + + + + + + + + + - - <% if @crm_customers.count > 0 %> - <% @i = 0 %> - <% @crm_customers.each do |crm_customer| %> + + <% if @crm_customers.count > 0 %> + <% @i = 0 %> + <% @crm_customers.each do |crm_customer| %> - - - - - - + + + + + + + + + + <% end %> - - - - + <%else%> + + <% end %> + +
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.membership_type") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %>
- - <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> - <%= @i += 1 %> - <%else%> - - - <% end %> - <%= crm_customer.name %><%= crm_customer.card_no rescue '-' %> - <% if !@membership_types.nil? %> - <% @membership_types.each do |member_type| %> - <% if member_type[1] == crm_customer.membership_type %> - <%= member_type[0] %> +
+ + <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <%= @i += 1 %> + <%else%> + - <% end %> - <% end %> + <%= crm_customer.name %><%= crm_customer.card_no rescue '-' %> + <% if !@membership_types.nil? %> + <% @membership_types.each do |member_type| %> + <% if member_type[1] == crm_customer.membership_type %> + <%= member_type[0] %> + <% end %> + <% end %> + <% end %> + <%= crm_customer.contact_no %><%= crm_customer.email %>
<%= crm_customer.contact_no %><%= crm_customer.email %>

There are no record for your search

+
+
+
+
+ + + + <%if !@dining_facility.nil?%> + + + + <% elsif @cashier_type == 'quick_service' %> + + + + <%else%> + + + + <%end%> - - <% end %> - <%else%> -

There are no record for your search

- <% end %> - - -
+
+
+
+
+ +
+ <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> + + <%= f.error_notification %> + <%= f.hidden_field :id, :class => "form-control col-md-6 " %> +
+
+
+
+ +
+ +
+
+
+
+
+
+   +   +   + +
+
+
"> +
+ <%= f.input :name, :class => "form-control name", :required => true %> - <%= paginate @crm_customers %> -
-
+ <% flash.each do |name, msg| %> + <% str="[\"#{msg['name']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%> +
+
+
"> +
+ <%= f.input :contact_no, :class => "form-control contact_no" ,:required => true%> + + <% flash.each do |name, msg| %> + <% str="[\"#{msg['contact_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
+ +
"> +
+ <%= f.input :email, :class => "form-control email" ,:required => true%> + + <% flash.each do |name, msg| %> + <% str="[\"#{msg['email']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
+
+
+
+ + +
+
+
+
+ <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %> +
+
+
+
+ <%= f.input :company, :class => "form-control col-md-6 company"%> + + <% flash.each do |name, msg| %> + <% str="[\"#{msg['company']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%> +
+
+
+
+ + <%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%> +
+
+
+
+ <%= f.input :address, :class => "form-control address" %> +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+ + <%= f.file_field :image_path, :class => "img-thumbnail" %> +
+
+
+
+
+ + +
+
+ +
+
+ <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control tax_profiles" %> +
+
+ +
"> +
+ <%= f.input :card_no, :class => "form-control card_no"%> + <% flash.each do |name, msg| %> + <% str="[\"#{msg['card_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
+ +
+
+ +
+ +
+
+
+
+ +
+
+ + +
+
+
+
+ + <%= f.submit t("views.btn.submit"),:class => 'btn bg-blue btn-md waves-effect', :id => 'submit_customer' %> + +
+
+
+
+ <% end %> +
+ +
+
- - - - - - <%if !@dining_facility.nil?%> - - - - <% elsif @cashier_type == 'quick_service' %> - - - - <%else%> - - - - <%end%> - <% if @create_flag %> -
-
-
- <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> - - - <%= f.error_notification %> - <%= f.hidden_field :id, :class => "form-control col-md-6 " %> -
-
- - - - -
- -
"> - <%= f.input :name, :class => "form-control col-md-6 name", :required => true %> - - <% flash.each do |name, msg| %> - <% str="[\"#{msg['name']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
- -
-
- - -
- -
- <%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %> -
-
- <%= f.input :company, :class => "form-control col-md-6 company"%> - - <% flash.each do |name, msg| %> - <% str="[\"#{msg['company']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
-
"> - <%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%> - - <% flash.each do |name, msg| %> - <% str="[\"#{msg['contact_no']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
- -
"> - <%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%> - <% flash.each do |name, msg| %> - <% str="[\"#{msg['contact_no']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
- -
- <%= f.input :address, :class => "form-control col-md-6 address" %> -
- -
- - -
-
- - <%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%> -
- -
- -
- - <%= f.file_field :image_path, :class => "img-thumbnail" %> -
-
- -
- - -
- -
- <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %> -
- -
"> - <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> - <% flash.each do |name, msg| %> - <% str="[\"#{msg['name']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
-
- -
- -
-
-
- -
- - -
- -
- <%= f.submit t("views.btn.submit"),:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %> - -
- <%end%> -
-
-
- <% end %> - -
- -
@@ -361,8 +424,45 @@ } },100); }); + + /*new customer UI func:*/ + //Initialize tooltips + $('.nav-tabs > li a[title]').tooltip(); + + //Wizard + $('a[data-toggle="tab"]').on('show.bs.tab', function (e) { + + var $target = $(e.target); + + if ($target.parent().hasClass('disabled')) { + return false; + } + }); + + $(".next-step").click(function (e) { + var $active = $('.wizard .nav-tabs li a.active'); + $active.parent().next().removeClass('disabled'); + nextTab($active); + $('.wizard .nav-tabs li.active .connecting-line').css({"border-bottom-left-radius": 0, "border-top-left-radius": 0}); + }); + $(".prev-step").click(function (e) { + + var $active = $('.wizard .nav-tabs li a.active'); + prevTab($active); + + }); + /*new customer UI func:*/ }); + /*customer UI tab btn*/ + function nextTab(elem) { + $(elem).parent().next().find('a[data-toggle="tab"]').click(); + } + function prevTab(elem) { + $(elem).parent().prev().find('a[data-toggle="tab"]').click(); + } + /*customer UI tab btn*/ + // Read NFC card no from java function getCardNo(){