change customer UI and header css

This commit is contained in:
phyusin
2018-09-13 11:58:57 +06:30
parent ffca0af445
commit 57adb09162
9 changed files with 995 additions and 542 deletions

View File

@@ -158,3 +158,114 @@ i.logout_icon{
position: relative; position: relative;
top: 5px; top: 5px;
} }
/*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 */

View File

@@ -543,3 +543,114 @@ nav.pagination .page a:hover,
height: 50%; height: 50%;
font-size: 20px; font-size: 20px;
} }
/*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 */

View File

@@ -286,13 +286,13 @@ section.content {
/* shop name margin */ /* shop name margin */
.shop-name-margin { .shop-name-margin {
margin-left : 20%; margin-left : 15%;
} }
/* shop name margin */ /* shop name margin */
/* online order margin */ /* online order margin */
.online-order-margin { .online-order-margin {
margin-left : 22%; margin-left : 13%;
margin-bottom : 9.9999px; margin-bottom : 9.9999px;
} }
/* online order margin */ /* online order margin */

View File

@@ -86,6 +86,10 @@ class Crm::CustomersController < BaseCrmController
end end
end end
params[:type] = nil
params[:customer_id] = params[:id]
@credit_sales = SalePayment.get_credit_sales(params)
#get customer amount #get customer amount
@customer = Customer.find(params[:id]) @customer = Customer.find(params[:id])
@response = Customer.get_membership_transactions(@customer) @response = Customer.get_membership_transactions(@customer)

View File

@@ -877,7 +877,9 @@ class SalePayment < ApplicationRecord
.joins("INNER JOIN sale_orders so ON so.sale_id = s.sale_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") .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}") 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 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}") 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}")

View File

@@ -1,27 +1,61 @@
<section>
<div class="wizard">
<div class="wizard-inner">
<div class="active-line"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item">
<div class="connecting-line border-right"></div>
<a href="#step1" class="nav-link active" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1">
<span class="round-tab">
1
</span>
</a>
</li>
<li role="presentation" class="nav-item disabled">
<div class="connecting-line"></div>
<a href="#complete" class="nav-link disable" data-toggle="tab" aria-controls="complete" role="tab" title="Complete">
<span class="round-tab">
2
</span>
</a>
</li>
</ul>
</div>
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
<%= f.hidden_field :id, :class => "form-control " %>
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" id="step1">
<!-- <h4>Step 1</h4> -->
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.sr_no") %></label>
<div class="form-line disabled">
<input type="text" name="" value="<%=@count_customer%>" class="form-control" disabled="" >
</div>
</div>
</div>
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> <div class="form-group">
<span class="patch_method"></span> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.hidden_field :id, :class => "form-control " %> <label for="customer[salutation]" class="control-label"> <%= t("views.right_panel.detail.salutation") %> :</label><br>
<label class="font-12 radio-inline">
<div class="form-group"> <%= f.radio_button :salutation,"Mr", :class => "salutation mr with-gap radio-col-indigo", :value=>"Mr"%><%= t("views.right_panel.detail.mr") %>
<label> <%= t("views.right_panel.detail.salutation") %> :</label><br>
<label class="font-15"><%= t("views.right_panel.detail.mr") %>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr with-gap radio-col-indigo", :value=>"Mr", :style=>"width: 30px"%>
</label>&nbsp; </label>&nbsp;
<label class="font-15"><%= t("views.right_panel.detail.miss") %> <label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs", :style=>"width: 30px"%> <%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs"%><%= t("views.right_panel.detail.miss") %>
</label>&nbsp; </label>&nbsp;
<label class="font-15"><%= t("views.right_panel.detail.mrs") %> <label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss", :style=>"width: 30px"%> <%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss"%><%= t("views.right_panel.detail.mrs") %>
</label>&nbsp; </label>&nbsp;
<label class="font-15"> <label class="font-12 radio-inline">
<%= t("views.right_panel.detail.mdm") %> <%= f.radio_button :salutation,"Mdm", :class => "salutation mdm with-gap radio-col-indigo", :value=>"Mdm"%><%= t("views.right_panel.detail.mdm") %>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm with-gap radio-col-indigo", :value=>"Mdm", :style=>"width: 30px"%>
</label> </label>
</div> </div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>"> <div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :name, :class => "form-control name", :required => true %>
<% flash.each do |test, msg| %> <% flash.each do |test, msg| %>
<% <%
str="[\"#{msg['name']}\"]" str="[\"#{msg['name']}\"]"
@@ -29,21 +63,49 @@
str.gsub!('"]', '') %> str.gsub!('"]', '') %>
<lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable> <lable class="error col-red m-t--10" style="margin-top:-6px"><%= str %></lable>
<% end -%> <% end -%>
</div> </div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :contact_no, :class => "form-control contact_no" ,:required => true%>
<div class="form-group"> <% flash.each do |name, msg| %>
<label><%= t("views.right_panel.detail.gender") %> :</label><br> <% str="[\"#{msg['contact_no']}\"]"
<label><%= t("views.right_panel.detail.male") %> str.gsub!('["', '')
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label> str.gsub!('"]', '') %>
<label><%= t("views.right_panel.detail.female") %> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label> <% end %>
</div> </div>
</div>
<div class="form-group"> <div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :email, :class => "form-control email" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['email']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label for="customer[gender]" class="control-label"><%= t("views.right_panel.detail.gender") %> :</label><br>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male"%><%= t("views.right_panel.detail.male") %></label>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female"%><%= t("views.right_panel.detail.female") %></label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %> <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :company, :class => "form-control col-md-6 company"%> <%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %> <% flash.each do |name, msg| %>
@@ -52,46 +114,30 @@
str.gsub!('"]', '') %> str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end -%> <% end -%>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<%= 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!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['email']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
<div class="form-group">
<%= f.input :address, :class => "form-control col-md-6 address" %>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.sr_no") %></label>
<div class="form-line disabled">
<input type="text" name="" value="<%=@count_customer%>" class="form-control" disabled="" >
</div> </div>
</div> </div>
<div class="form-group">
<div class="form-group"> <div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.date_of_birth") %></label> <label class="control-label"><%= t("views.right_panel.detail.date_of_birth") %></label>
<%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%> <%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%>
</div> </div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :address, :class => "form-control address" %>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue btn-info-full next-step">Next</button>
</div>
</div>
</div>
<div class="tab-pane" role="tabpanel" id="complete">
<!-- <h4>Step 2</h4> -->
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.customer_photo") %></label> <label><%= t("views.right_panel.detail.customer_photo") %></label>
<div class="panel padding-10"> <div class="panel padding-10">
<div class="menu-item-img"> <div class="menu-item-img">
@@ -104,9 +150,10 @@
</div> </div>
<%= f.file_field :image_path, :class => "img-thumbnail" %> <%= f.file_field :image_path, :class => "img-thumbnail" %>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.select_customer_type") %></label> <label><%= t("views.right_panel.detail.select_customer_type") %></label>
<select class="form-control col-md-12 selectpicker show-tick" id="customer_type" name="customer[customer_type]" style="height: " > <select class="form-control col-md-12 selectpicker show-tick" id="customer_type" name="customer[customer_type]" style="height: " >
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %> <% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
@@ -114,32 +161,40 @@
<%= ct.name %></option> <%= ct.name %></option>
<%end %> <%end %>
</select> </select>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %> <div class="col-sm-12 col-md-12 col-lg-12">
</div> <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control tax_profiles" %>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>"> <div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :card_no, :class => "form-control card_no"%>
<% flash.each do |name, msg| %> <% flash.each do |name, msg| %>
<% str="[\"#{msg['card_no']}\"]" <% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '') str.gsub!('["', '')
str.gsub!('"]', '') %> str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %> <% end %>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label> <div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
<div class="-group"> <div class="-group">
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly/> <input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly/>
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div> <div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.select_membership_group") %></label> <div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.select_membership_group") %></label>
<select class="form-control col-md-12 selectpicker show-tick" name="member_group_id" style="height: " > <select class="form-control col-md-12 selectpicker show-tick" name="member_group_id" style="height: " >
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option> <option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %> <% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
@@ -147,17 +202,24 @@
<%= member.name %></option> <%= member.name %></option>
<%end %> <%end %>
</select> </select>
</div>
</div> </div>
<div class="form-group">
<div class="form-group"> <div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue prev-step">Prev</button>
<!-- <%= f.submit "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %> <!-- <%= f.submit "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %>
<%= f.submit "Update",:class => 'btn btn-info ', :disabled =>'', :id => 'update_customer' %> --> <%= f.submit "Update",:class => 'btn btn-info ', :disabled =>'', :id => 'update_customer' %> -->
<button type="submit" class="btn btn-primary" id="submit_customer"><%= t("views.btn.submit") %></button> <button type="submit" class="btn btn-primary" id="submit_customer"><%= t("views.btn.submit") %></button>
<button type="submit" class="btn btn-info" disabled id="update_customer"><%= t("views.btn.update") %></button> <button type="submit" class="btn btn-info" disabled id="update_customer"><%= t("views.btn.update") %></button>
<button type="button" class="btn btn-danger" id="reset"><%= t("views.btn.reset") %></button> <button type="button" class="btn btn-danger" id="reset"><%= t("views.btn.reset") %></button>
</div> </div>
<%end%> </div>
</div>
<div class="clearfix"></div>
</div>
<%end%>
</div>
</section>
<div id="sxModal"> <div id="sxModal">

View File

@@ -11,28 +11,31 @@
</div> </div>
<div class="row clearfix"> <div class="row clearfix">
<div class="<%= @create_flag ? 'col-lg-8 col-md-8 col-sm-8' : 'col-lg-12 col-md-12 col-sm-12' %>"> <div class="col-lg-12 col-md-12 col-sm-12">
<div class="card"> <div class="card">
<div class="body"> <div class="body">
<div class="row p-l-20 p-t-20"> <div class="row p-l-20 p-t-20">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %> <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12"> <div class="col-sm-5 col-md-5 col-lg-5">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control"> <input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
<input type="hidden" name="type" id="type" value=""> <input type="hidden" name="type" id="type" value="">
</div> </div>
<div class="col-sm-4 col-md-4 col-lg-4">
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"> --> <!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"> -->
<button type="submit" class="btn btn-sm bg-blue waves-effect" style="height: 30%;margin-right: 10px;"><%= t("views.btn.search") %></button> <button type="submit" class="btn btn-sm bg-blue waves-effect"><%= t("views.btn.search") %></button>
<!-- </div> --> <!-- </div> -->
<button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;"><%= t("views.btn.memeber_card") %></button> <button type="button" id="member_acc_no" class="btn bg-green btn-sm waves-effect"><%= t("views.btn.memeber_card") %></button>
<button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect" style="height: 30%;margin-right: 10px;"><%= t("views.btn.qr_code") %></button> <button type="button" id="qr_code" class="btn bg-green btn-sm waves-effect"><%= t("views.btn.qr_code") %></button>
</div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
<%= paginate @crm_customers %>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover table-striped" style="width:100%"> <table class="table table-hover table-striped" style="width:100%">
<!-- <div class="table-responsive"> <!-- <div class="table-responsive">
@@ -50,11 +53,12 @@
<tr> <tr>
<th></th> <th></th>
<th><%= t("views.right_panel.detail.sr_no") %></th> <th><%= t("views.right_panel.detail.sr_no") %></th>
<th><%= t :customer %> <%= t("views.right_panel.detail.type") %></th>
<th><%= t("views.right_panel.detail.name") %></th> <th><%= t("views.right_panel.detail.name") %></th>
<th><%= t("views.right_panel.detail.card_no") %></th>
<th><%= t("views.right_panel.detail.membership_type") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.email") %></th> <th style="width:20%"><%= t("views.right_panel.detail.email") %></th>
<th style="width:20%"><%= t("views.right_panel.detail.contact_no") %></th>
<th><%= t("views.right_panel.detail.membership_type") %></th>
<th><%= t("views.right_panel.detail.card_no") %></th>
<th><%= t("views.right_panel.detail.action") %></th> <th><%= t("views.right_panel.detail.action") %></th>
</tr> </tr>
</thead> </thead>
@@ -74,8 +78,10 @@
- -
<% end %> <% end %>
</td> </td>
<td><%= crm_customer.customer_type rescue '-' %></td>
<td><%= crm_customer.name %></td> <td><%= crm_customer.name %></td>
<td><%= crm_customer.card_no rescue '-' %></td> <td style="width:20px%;word-break: break-all;"><%= crm_customer.email %></td>
<td style="width:20px%;word-break: break-all;"><%= crm_customer.contact_no %></td>
<td> <td>
<% if !@membership_types.nil? %> <% if !@membership_types.nil? %>
<% @membership_types.each do |member_type| %> <% @membership_types.each do |member_type| %>
@@ -85,9 +91,10 @@
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
<td style="width:20px%;word-break: break-all;"><%= crm_customer.contact_no %></td> <td><%= crm_customer.card_no rescue '-' %></td>
<td style="width:20px%;word-break: break-all;"><%= crm_customer.email %></td> <td>
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td> <%= link_to t("views.btn.show"), crm_customer_path(crm_customer), :class => "btn btn-md bg-blue waves-effect" %>
</td>
</tr> </tr>
<% end %> <% end %>
<% else %> <% else %>
@@ -95,36 +102,24 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<br>
<%= paginate @crm_customers %>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div>
<% if @create_flag %> <% if @create_flag %>
<div class="col-lg-4 col-md-4 col-sm-4"> <div class="col-sm-4 col-md-4 col-lg-4">
<div class="card"> <!-- .row-form-input -->
<div class="body" id="custom-slimscroll">
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %> <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
</div> <!-- .row-form-input -->
</div>
<!-- <div class="col-lg-1 col-md-1 col-sm-1 ">
<br>
<a href="<%= dashboard_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div> -->
</div> </div>
<% end %> <% end %>
</div> <!-- .end-of-row -->
</div>
</div>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () {
$(function() {
/*$('.datepicker').datepicker({ /*$('.datepicker').datepicker({
format : 'dd-mm-yyyy', format : 'dd-mm-yyyy',
autoclose: true autoclose: true
@@ -163,9 +158,45 @@ $(function() {
$("#search").val(code); $("#search").val(code);
} }
}); /*new customer UI func:*/
//Initialize tooltips
$('.nav-tabs > li a[title]').tooltip();
$(document).on('click',".customer_tr",function(){ //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*/
$(document).on('click',".customer_tr",function(){
// if(this.checked){ // if(this.checked){
$(this).closest('tr').find('.checkbox_check').prop( "checked", true ); $(this).closest('tr').find('.checkbox_check').prop( "checked", true );
//$( "#checkbox_check" ).prop( "checked", true ); //$( "#checkbox_check" ).prop( "checked", true );
@@ -289,5 +320,4 @@ $(document).on('click',".customer_tr",function(){
$("#sxModal .btn_cancel").on('click',function(){ $("#sxModal .btn_cancel").on('click',function(){
$("#sxModal").hide(); $("#sxModal").hide();
}); });
</script> </script>

View File

@@ -1,5 +1,17 @@
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ul>
</div>
<div class="row"> <div class="row">
<div class="col-lg-11 col-md-11 col-sm-11"> <div class="col-lg-12 col-md-12 col-sm-12">
<!-- Column One --> <!-- Column One -->
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs tab-nav-right" role="tablist"> <ul class="nav nav-tabs tab-nav-right" role="tablist">
@@ -13,6 +25,9 @@
<li role="presentation" class="nav-item" > <li role="presentation" class="nav-item" >
<a class="nav-link" data-toggle="tab" href="#sale" ><%= t :sale_details %></a> <a class="nav-link" data-toggle="tab" href="#sale" ><%= t :sale_details %></a>
</li> </li>
<li role="presentation" class="nav-item" >
<a class="nav-link" data-toggle="tab" href="#credit" ><%= t :credit %> <%= t :details %></a>
</li>
</ul> </ul>
<!-- Nav tabs - End --> <!-- Nav tabs - End -->
@@ -183,15 +198,33 @@
</div> </div>
</div> </div>
<div class="tab-pane" id="credit" role="tabpanel" style="min-height:670px; max-height:670px; ">
<h5><%= t :credit %> <%= t :details %></h5>
<table class="table table-responsive tbl_credit_lists">
<thead>
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody>
<% if !@credit_sales.nil? %>
<% @credit_sales.each do |credit| %>
<tr>
<td><%= credit.sale_date.utc.getlocal.strftime("%e %b %Y %I:%M%p") %></td>
<td><%= credit.receipt_no %></td>
<td><%= credit.cashier_name %></td>
<td><%= credit.payment_amount %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
<div class="col-lg-1 col-md-1 col-sm-1">
<a href="<%= crm_customers_path%>" class="btn btn-default btn-sm">
<i class="material-icons">reply</i><%= t("views.btn.back") %>
</a>
</div> </div>
</div> </div>

View File

@@ -1,18 +1,18 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- <div class="page-header"> <div class="page-header">
<ul class="breadcrumb"> <ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li> <li class="breadcrumb-item active">CRM</li>
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> <!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<span class="float-right"> <span class="float-right">
<a href="#" id="back">Back</a> <%= link_to 'Back', dashboard_path %>
</span> </span>
</ul> </ul>
</div> --> </div>
<div class="row"> <div class="row">
<div class="<%= @create_flag ? 'col-lg-8 col-md-8 col-sm-8' : 'col-lg-11 col-md-11 col-sm-11' %>"> <div class="col-lg-12 col-md-12 col-sm-12">
<div class="card"> <div class="card">
<div class="body"> <div class="body">
<div class="row p-t-20 p-l-20"> <div class="row p-t-20 p-l-20">
@@ -46,6 +46,9 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
<%= paginate @crm_customers %>
<div class="main-box-body clearfix" id="order-detail-slimscroll" style=""> <div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
<div class="table-responsive"> <div class="table-responsive">
<table id="origami-crm-table" class="table table-striped" style="width:100%"> <table id="origami-crm-table" class="table table-striped" style="width:100%">
@@ -99,16 +102,10 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<br>
<%= paginate @crm_customers %>
</div> </div>
</div> </div>
</div> </div> <!-- .end-of-col-md-8 -->
</div> <div class="col-sm-4 col-md-4 col-lg-4">
</div>
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" /> <input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<input type="hidden" id="type" name="type" value="<%= @cashier_type %>" /> <input type="hidden" id="type" name="type" value="<%= @cashier_type %>" />
<input type="hidden" id="page" name="page" value="<%= @page %>" /> <input type="hidden" id="page" name="page" value="<%= @page %>" />
@@ -125,29 +122,64 @@
<input type="hidden" id="type" name="type" value="" /> <input type="hidden" id="type" name="type" value="" />
<input type="hidden" id="table_type" name="table_type" value="" /> <input type="hidden" id="table_type" name="table_type" value="" />
<%end%> <%end%>
<% if @create_flag %>
<div class="col-lg-3 col-md-3 col-sm-3" >
<div class="card">
<div class="body" id="custom-slimscroll">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<section>
<div class="wizard">
<div class="wizard-inner">
<div class="active-line"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item">
<div class="connecting-line border-right"></div>
<a href="#step1" class="nav-link active" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1">
<span class="round-tab">
1
</span>
</a>
</li>
<li role="presentation" class="nav-item disabled">
<div class="connecting-line"></div>
<a href="#complete" class="nav-link disable" data-toggle="tab" aria-controls="complete" role="tab" title="Complete">
<span class="round-tab">
2
</span>
</a>
</li>
</ul>
</div>
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span> <span class="patch_method"></span>
<%= f.error_notification %> <%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %> <%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" id="step1">
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.salutation") %> :</label><br> <div class="col-sm-12 col-md-12 col-lg-12">
<label class="font-15"><%= t("views.right_panel.detail.mr") %> <label><%= t("views.right_panel.detail.sr_no") %></label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%></label> <div class="form-line disabled">
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.miss") %> <input type="text" name="" value="<%=@count_customer%>" class="form-control" disabled="" >
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%></label> </div>
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mrs") %> </div>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%></label> </div>
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mdm") %> <div class="form-group">
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%></label> <div class="col-sm-12 col-md-12 col-lg-12">
<label for="customer[salutation]" class="control-label"> <%= t("views.right_panel.detail.salutation") %> :</label><br>
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mr", :class => "salutation mr with-gap radio-col-indigo", :value=>"Mr"%><%= t("views.right_panel.detail.mr") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs"%><%= t("views.right_panel.detail.miss") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss"%><%= t("views.right_panel.detail.mrs") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm with-gap radio-col-indigo", :value=>"Mdm"%><%= t("views.right_panel.detail.mdm") %>
</label>
</div>
</div> </div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>"> <div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :name, :class => "form-control name", :required => true %>
<% flash.each do |name, msg| %> <% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]" <% str="[\"#{msg['name']}\"]"
@@ -156,63 +188,80 @@
<span class="help-block"><%= str %></span> <span class="help-block"><%= str %></span>
<% end -%> <% end -%>
</div> </div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :contact_no, :class => "form-control contact_no" ,:required => true%>
<div class="form-group"> <% flash.each do |name, msg| %>
<label><%= t("views.right_panel.detail.gender") %> :</label><br> <% str="[\"#{msg['contact_no']}\"]"
<label><%= t("views.right_panel.detail.male") %> str.gsub!('["', '')
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label> str.gsub!('"]', '') %>
<label><%= t("views.right_panel.detail.female") %> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label> <% end %>
</div>
</div> </div>
<div class="form-group"> <div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :email, :class => "form-control email" ,:required => true%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['email']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end %>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label for="customer[gender]" class="control-label"><%= t("views.right_panel.detail.gender") %> :</label><br>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male"%><%= t("views.right_panel.detail.male") %></label>
<label class="font-12 radio-inline">
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female"%><%= t("views.right_panel.detail.female") %></label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
</div>
</div>
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :company, :class => "form-control col-md-6 company"%> <%= f.input :company, :class => "form-control col-md-6 company"%>
<% flash.each do |name, msg| %> <% flash.each do |name, msg| %>
<% str="[\"#{msg['company']}\"]" <% str="[\"#{msg['company']}\"]"
str.gsub!('["', '') str.gsub!('["', '')
str.gsub!('"]', '') %> str.gsub!('"]', '') %>
<span class="help-block"><%= str %></span> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end -%> <% end -%>
</div> </div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= 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!('"]', '') %>
<span class="help-block"><%= str %></span>
<% end -%>
</div> </div>
<div class="form-group">
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>"> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%> <label class="control-label"><%= t("views.right_panel.detail.date_of_birth") %></label>
<% flash.each do |name, msg| %> <%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%>
<% str="[\"#{msg['contact_no']}\"]" </div>
str.gsub!('["', '') </div>
str.gsub!('"]', '') %> <div class="form-group">
<span class="help-block"><%= str %></span> <div class="col-sm-12 col-md-12 col-lg-12">
<% end -%> <%= f.input :address, :class => "form-control address" %>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<%= f.input :address, :class => "form-control col-md-6 address" %> <div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue btn-info-full next-step">Next</button>
</div> </div>
<div class="form-group">
<label><%= t("views.right_panel.detail.sr_no") %></label>
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
</div> </div>
</div> <!-- .end-of-step1 -->
<div class="tab-pane" role="tabpanel" id="complete">
<!-- <h4>Step 2</h4> -->
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.date_of_birth") %></label> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.customer_photo") %></label> <label><%= t("views.right_panel.detail.customer_photo") %></label>
<div class="panel padding-10"> <div class="panel padding-10">
<div class="menu-item-img"> <div class="menu-item-img">
@@ -226,41 +275,51 @@
<%= f.file_field :image_path, :class => "img-thumbnail" %> <%= f.file_field :image_path, :class => "img-thumbnail" %>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label><%= t("views.right_panel.detail.select_customer_type") %></label> <label><%= t("views.right_panel.detail.select_customer_type") %></label>
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" > <select class="form-control col-md-12 selectpicker show-tick" id="customer_type" name="customer[customer_type]" style="height: " >
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %> <% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
<option value="<%= ct.value %>"> <option value="<%= ct.value %>">
<%= ct.name %></option> <%= ct.name %></option>
<%end %> <%end %>
</select> </select>
</div> </div>
<div class="form-group">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
</div> </div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>"> <div class="form-group">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%> <div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control tax_profiles" %>
</div>
</div>
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :card_no, :class => "form-control card_no"%>
<% flash.each do |name, msg| %> <% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]" <% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '') str.gsub!('["', '')
str.gsub!('"]', '') %> str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-10px"><%= str %></span> <lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
<% end -%> <% end %>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label> <div class="col-sm-12 col-md-12 col-lg-12">
<div class="input-group"> <label class="control-label"><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly /> <div class="-group">
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly/>
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div> <div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<label><%= t("views.right_panel.detail.select_membership_group") %></label> <div class="col-sm-12 col-md-12 col-lg-12">
<select class="form-control col-md-12" name="member_group_id"> <label class="control-label"><%= t("views.right_panel.detail.select_membership_group") %></label>
<select class="form-control col-md-12 selectpicker show-tick" name="member_group_id" style="height: " >
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option> <option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %> <% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
<option value="<%= member.value %>"> <option value="<%= member.value %>">
@@ -268,19 +327,23 @@
<%end %> <%end %>
</select> </select>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<%= f.submit t("views.btn.submit"),:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %> <div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue prev-step">Prev</button>
<%= f.submit t("views.btn.submit"),:class => 'btn bg-blue btn-md waves-effect', :id => 'submit_customer' %>
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> --> <!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
</div> </div>
<%end%>
</div>
</div>
</div> </div>
</div><!-- .end-of-step2 -->
</div> <!-- .end-of-tab-content -->
<% end %> <% end %>
<!-- Column Three --> </div> <!-- .end-of-wizard -->
<div class="col-lg-1 col-md-1 col-sm-1"> </section> <!-- .end-of-section -->
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button> </div><!-- .end-of-col-md-4 -->
</div> <!-- .end-of-row -->
</div>
</div>
</div> </div>
</div> </div>
@@ -361,8 +424,45 @@
} }
},100); },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 // Read NFC card no from java
function getCardNo(){ function getCardNo(){