change customer UI and header css
This commit is contained in:
@@ -157,4 +157,115 @@ nav.pagination .page a:hover,
|
||||
i.logout_icon{
|
||||
position: relative;
|
||||
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 */
|
||||
@@ -542,4 +542,115 @@ nav.pagination .page a:hover,
|
||||
#amount_due{
|
||||
height: 50%;
|
||||
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 */
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -1,163 +1,225 @@
|
||||
<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| %>
|
||||
<span class="patch_method"></span>
|
||||
<%= f.hidden_field :id, :class => "form-control " %>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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 class="form-group <%= (flash["errors"]) ? "error" : "" %>">
|
||||
<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| %>
|
||||
<%
|
||||
str="[\"#{msg['name']}\"]"
|
||||
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 <%= (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">
|
||||
<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>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.miss") %>
|
||||
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs with-gap radio-col-indigo", :value=>"Mrs", :style=>"width: 30px"%>
|
||||
</label>
|
||||
<label class="font-15"><%= t("views.right_panel.detail.mrs") %>
|
||||
<%= f.radio_button :salutation,"Miss", :class => "salutation miss with-gap radio-col-indigo", :value=>"Miss", :style=>"width: 30px"%>
|
||||
</label>
|
||||
<label class="font-15">
|
||||
<%= 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>
|
||||
</div>
|
||||
<% 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>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "error" : "" %>">
|
||||
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %>
|
||||
<% flash.each do |test, msg| %>
|
||||
<%
|
||||
str="[\"#{msg['name']}\"]"
|
||||
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" : "" %>">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12">
|
||||
<%= f.input :email, :class => "form-control email" ,:required => true%>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.gender") %> :</label><br>
|
||||
<label><%= t("views.right_panel.detail.male") %>
|
||||
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label>
|
||||
<label><%= t("views.right_panel.detail.female") %>
|
||||
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label>
|
||||
</div>
|
||||
<% 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" %>
|
||||
</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"%>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
|
||||
</div>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
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 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"%>
|
||||
</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">
|
||||
<%= f.input :company, :class => "form-control col-md-6 company"%>
|
||||
<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>
|
||||
<div class="panel padding-10">
|
||||
<div class="menu-item-img">
|
||||
<% if f.object.image_path? %>
|
||||
<p><%= f.object.name %></p>
|
||||
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
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 :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
|
||||
<% 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" : "" %>">
|
||||
<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| %>
|
||||
<% str="[\"#{msg['card_no']}\"]"
|
||||
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 <%= (flash["errors"]) ? "error" : "" %>">
|
||||
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
|
||||
<div class="form-group">
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% 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 class="form-group">
|
||||
<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: " >
|
||||
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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 "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-info" disabled id="update_customer"><%= t("views.btn.update") %></button>
|
||||
<button type="button" class="btn btn-danger" id="reset"><%= t("views.btn.reset") %></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.customer_photo") %></label>
|
||||
<div class="panel padding-10">
|
||||
<div class="menu-item-img">
|
||||
<% if f.object.image_path? %>
|
||||
<p><%= f.object.name %></p>
|
||||
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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: " >
|
||||
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</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 class="form-group <%= (flash["errors"]) ? "error" : "" %>">
|
||||
<%= 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!('"]', '') %>
|
||||
<lable class="error col-red m-t-10" style="margin-top:-6px"><%= str %></lable>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<!-- <%= f.submit "Submit",:class => 'btn btn-primary ', :id => 'submit_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-info" disabled id="update_customer"><%= t("views.btn.update") %></button>
|
||||
<button type="button" class="btn btn-danger" id="reset"><%= t("views.btn.reset") %></button>
|
||||
</div>
|
||||
<%end%>
|
||||
</section>
|
||||
|
||||
|
||||
<div id="sxModal">
|
||||
|
||||
@@ -11,28 +11,31 @@
|
||||
</div>
|
||||
|
||||
<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="body">
|
||||
<div class="row p-l-20 p-t-20">
|
||||
<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 %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control">
|
||||
<input type="hidden" name="type" id="type" value="">
|
||||
<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="hidden" name="type" id="type" value="">
|
||||
</div>
|
||||
<!-- <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>
|
||||
<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"> -->
|
||||
<button type="submit" class="btn btn-sm bg-blue waves-effect"><%= t("views.btn.search") %></button>
|
||||
<!-- </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="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="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"><%= t("views.btn.qr_code") %></button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<table class="table table-hover table-striped" style="width:100%">
|
||||
<!-- <div class="table-responsive">
|
||||
@@ -50,11 +53,12 @@
|
||||
<tr>
|
||||
<th></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.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.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>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -74,8 +78,10 @@
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.customer_type rescue '-' %></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>
|
||||
<% if !@membership_types.nil? %>
|
||||
<% @membership_types.each do |member_type| %>
|
||||
@@ -85,9 +91,10 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td style="width:20px%;word-break: break-all;"><%= crm_customer.contact_no %></td>
|
||||
<td style="width:20px%;word-break: break-all;"><%= crm_customer.email %></td>
|
||||
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
|
||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||
<td>
|
||||
<%= link_to t("views.btn.show"), crm_customer_path(crm_customer), :class => "btn btn-md bg-blue waves-effect" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
@@ -95,36 +102,24 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<%= paginate @crm_customers %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @create_flag %>
|
||||
<div class="col-sm-4 col-md-4 col-lg-4">
|
||||
<!-- .row-form-input -->
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
<!-- .row-form-input -->
|
||||
</div>
|
||||
<% end %>
|
||||
</div> <!-- .end-of-row -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if @create_flag %>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="card">
|
||||
<div class="body" id="custom-slimscroll">
|
||||
<%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
|
||||
</div>
|
||||
</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>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
$(document).ready(function () {
|
||||
/*$('.datepicker').datepicker({
|
||||
format : 'dd-mm-yyyy',
|
||||
autoclose: true
|
||||
@@ -163,91 +158,127 @@ $(function() {
|
||||
$("#search").val(code);
|
||||
}
|
||||
|
||||
});
|
||||
/*new customer UI func:*/
|
||||
//Initialize tooltips
|
||||
$('.nav-tabs > li a[title]').tooltip();
|
||||
|
||||
//Wizard
|
||||
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
|
||||
|
||||
$(document).on('click',".customer_tr",function(){
|
||||
// if(this.checked){
|
||||
$(this).closest('tr').find('.checkbox_check').prop( "checked", true );
|
||||
//$( "#checkbox_check" ).prop( "checked", true );
|
||||
var sale_id = $("#sale_id").val() || 0;
|
||||
var customer_id = $(this).attr('data-ref');
|
||||
var $target = $(e.target);
|
||||
|
||||
if ($target.parent().hasClass('disabled')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if(sale_id != 0){
|
||||
// var url = "/"+customer_id;
|
||||
update_sale(customer_id,sale_id);
|
||||
}else{
|
||||
$(".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 url = "customers/" + customer_id + "/edit";
|
||||
}
|
||||
var $active = $('.wizard .nav-tabs li a.active');
|
||||
prevTab($active);
|
||||
|
||||
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});
|
||||
});
|
||||
/*new customer UI func:*/
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
// Selected for Taxes
|
||||
var taxes = JSON.stringify(data.tax_profiles);
|
||||
var parse_taxes = JSON.parse(taxes);
|
||||
$.each(parse_taxes, function(i, value){
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
});
|
||||
/*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*/
|
||||
|
||||
$('#customer_id').val(data.id);
|
||||
$('#customer_name').val(data.name);
|
||||
$('#customer_company').val(data.company);
|
||||
$('#customer_contact_no').val(data.contact_no);
|
||||
$('#customer_email').val(data.email);
|
||||
$('#customer_salutation').val(data.salutation);
|
||||
$('#customer_nrc_no').val(data.nrc_no);
|
||||
$('#customer_card_no').val(data.card_no);
|
||||
$('#customer_type').val(data.customer_type);
|
||||
$('#paypar_account_no').val(data.paypar_account_no);
|
||||
$('#customer_address').val(data.address);
|
||||
$('#customer_date_of_birth').val(data.date_of_birth);
|
||||
if(data.image_path.url!=undefined && data.image_path.url!=null){
|
||||
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
|
||||
}
|
||||
$('#customer_membership_type').val(data.membership_type);
|
||||
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
||||
if (data.gender == 'Male') {
|
||||
$('.male').prop( "checked", true )
|
||||
}else{
|
||||
$('.female').prop( "checked", true )
|
||||
}
|
||||
$(document).on('click',".customer_tr",function(){
|
||||
// if(this.checked){
|
||||
$(this).closest('tr').find('.checkbox_check').prop( "checked", true );
|
||||
//$( "#checkbox_check" ).prop( "checked", true );
|
||||
var sale_id = $("#sale_id").val() || 0;
|
||||
var customer_id = $(this).attr('data-ref');
|
||||
|
||||
if(data.salutation == 'Mr') {
|
||||
$('.mr').prop( "checked", true )
|
||||
}else if(data.salutation == 'Miss') {
|
||||
$('.miss').prop( "checked", true )
|
||||
}else if(data.salutation == 'Mrs'){
|
||||
$('.mrs').prop( "checked", true )
|
||||
}else{
|
||||
$('.mdm').prop( "checked", true )
|
||||
}
|
||||
if(sale_id != 0){
|
||||
// var url = "/"+customer_id;
|
||||
update_sale(customer_id,sale_id);
|
||||
}else{
|
||||
|
||||
$('.membership_authentication_code').val(data.membership_authentication_code);
|
||||
var url = "customers/" + customer_id + "/edit";
|
||||
}
|
||||
|
||||
$('#update_customer').removeAttr('disabled').val('');
|
||||
$('#update_customer').attr('value', 'Update');
|
||||
$('#submit_customer').attr('disabled','disabled');
|
||||
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});
|
||||
|
||||
$("#new_customer").attr('class', 'simple_form edit_customer');
|
||||
var id = "edit_customer_"+customer_id;
|
||||
$("#new_customer").attr('id', id);
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
// Selected for Taxes
|
||||
var taxes = JSON.stringify(data.tax_profiles);
|
||||
var parse_taxes = JSON.parse(taxes);
|
||||
$.each(parse_taxes, function(i, value){
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
});
|
||||
|
||||
$(".edit_customer").attr('id', id);
|
||||
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
|
||||
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
|
||||
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
//$(".edit_customer").attr('method', 'PATCH');
|
||||
}
|
||||
});
|
||||
// }else{
|
||||
$('#customer_id').val(data.id);
|
||||
$('#customer_name').val(data.name);
|
||||
$('#customer_company').val(data.company);
|
||||
$('#customer_contact_no').val(data.contact_no);
|
||||
$('#customer_email').val(data.email);
|
||||
$('#customer_salutation').val(data.salutation);
|
||||
$('#customer_nrc_no').val(data.nrc_no);
|
||||
$('#customer_card_no').val(data.card_no);
|
||||
$('#customer_type').val(data.customer_type);
|
||||
$('#paypar_account_no').val(data.paypar_account_no);
|
||||
$('#customer_address').val(data.address);
|
||||
$('#customer_date_of_birth').val(data.date_of_birth);
|
||||
if(data.image_path.url!=undefined && data.image_path.url!=null){
|
||||
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
|
||||
}
|
||||
$('#customer_membership_type').val(data.membership_type);
|
||||
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
||||
if (data.gender == 'Male') {
|
||||
$('.male').prop( "checked", true )
|
||||
}else{
|
||||
$('.female').prop( "checked", true )
|
||||
}
|
||||
|
||||
// }
|
||||
if(data.salutation == 'Mr') {
|
||||
$('.mr').prop( "checked", true )
|
||||
}else if(data.salutation == 'Miss') {
|
||||
$('.miss').prop( "checked", true )
|
||||
}else if(data.salutation == 'Mrs'){
|
||||
$('.mrs').prop( "checked", true )
|
||||
}else{
|
||||
$('.mdm').prop( "checked", true )
|
||||
}
|
||||
|
||||
$('.membership_authentication_code').val(data.membership_authentication_code);
|
||||
|
||||
$('#update_customer').removeAttr('disabled').val('');
|
||||
$('#update_customer').attr('value', 'Update');
|
||||
$('#submit_customer').attr('disabled','disabled');
|
||||
|
||||
$("#new_customer").attr('class', 'simple_form edit_customer');
|
||||
var id = "edit_customer_"+customer_id;
|
||||
$("#new_customer").attr('id', id);
|
||||
|
||||
$(".edit_customer").attr('id', id);
|
||||
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
|
||||
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
|
||||
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
//$(".edit_customer").attr('method', 'PATCH');
|
||||
}
|
||||
});
|
||||
// }else{
|
||||
|
||||
// }
|
||||
})
|
||||
|
||||
function update_sale(customer_id,sale_id) {
|
||||
@@ -289,5 +320,4 @@ $(document).on('click',".customer_tr",function(){
|
||||
$("#sxModal .btn_cancel").on('click',function(){
|
||||
$("#sxModal").hide();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -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="col-lg-11 col-md-11 col-sm-11">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<!-- Column One -->
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs tab-nav-right" role="tablist">
|
||||
@@ -13,6 +25,9 @@
|
||||
<li role="presentation" class="nav-item" >
|
||||
<a class="nav-link" data-toggle="tab" href="#sale" ><%= t :sale_details %></a>
|
||||
</li>
|
||||
<li role="presentation" class="nav-item" >
|
||||
<a class="nav-link" data-toggle="tab" href="#credit" ><%= t :credit %> <%= t :details %></a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
@@ -148,50 +163,68 @@
|
||||
|
||||
<div class="tab-pane" id="sale" role="tabpanel" style="min-height:670px; max-height:670px; ">
|
||||
<h5><%= t :sale_details %></h5>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.sub_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.total_discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.tax_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.sub_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @sales.each do |sale| %>
|
||||
<tr>
|
||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.total_discount %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.total_amount %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<tbody>
|
||||
<% @sales.each do |sale| %>
|
||||
<tr>
|
||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||
<td><%= sale.receipt_no %></td>
|
||||
<td><%= sale.total_discount %></td>
|
||||
<td><%= sale.total_tax %></td>
|
||||
<td><%= sale.total_amount %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td> <%= sale.sale_status %> </td>
|
||||
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</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 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>
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<div class="container-fluid">
|
||||
<!-- <div class="page-header">
|
||||
<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>
|
||||
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
|
||||
<span class="float-right">
|
||||
<a href="#" id="back">Back</a>
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ul>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
|
||||
<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="body">
|
||||
<div class="row p-t-20 p-l-20">
|
||||
@@ -46,242 +46,305 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-box-body clearfix" id="order-detail-slimscroll" style="">
|
||||
<div class="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></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>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<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="table-responsive">
|
||||
<table id="origami-crm-table" class="table table-striped" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><%= t("views.right_panel.detail.sr_no") %></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>Paypar No</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<tbody>
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||
<td>
|
||||
<% if !@membership_types.nil? %>
|
||||
<% @membership_types.each do |member_type| %>
|
||||
<% if member_type[1] == crm_customer.membership_type %>
|
||||
<%= member_type[0] %>
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
<td>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<%= @i += 1 %>
|
||||
<%else%>
|
||||
-
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= crm_customer.name %></td>
|
||||
<td><%= crm_customer.card_no rescue '-' %></td>
|
||||
<td>
|
||||
<% if !@membership_types.nil? %>
|
||||
<% @membership_types.each do |member_type| %>
|
||||
<% if member_type[1] == crm_customer.membership_type %>
|
||||
<%= member_type[0] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.contact_no %></td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.contact_no %></td>
|
||||
<td style="width:20%;word-break: break-all;"><%= crm_customer.email %></td>
|
||||
<!-- <td><%= crm_customer.paypar_account_no %></td> -->
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .end-of-col-md-8 -->
|
||||
<div class="col-sm-4 col-md-4 col-lg-4">
|
||||
<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="page" name="page" value="<%= @page %>" />
|
||||
<%if !@dining_facility.nil?%>
|
||||
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
|
||||
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
|
||||
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
|
||||
<% elsif @cashier_type == 'quick_service' %>
|
||||
<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="page" name="page" value="<%= @page %>" />
|
||||
<%else%>
|
||||
<input type="hidden" id="table_id" name="table_id" value="" />
|
||||
<input type="hidden" id="type" name="type" value="" />
|
||||
<input type="hidden" id="table_type" name="table_type" value="" />
|
||||
<%end%>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<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.error_notification %>
|
||||
<%= 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="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>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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 class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12">
|
||||
<%= f.input :name, :class => "form-control name", :required => true %>
|
||||
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</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%>
|
||||
|
||||
<% 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>
|
||||
|
||||
<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" %>
|
||||
</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"%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
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 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"%>
|
||||
</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="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> <!-- .end-of-step1 -->
|
||||
<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>
|
||||
<div class="panel padding-10">
|
||||
<div class="menu-item-img">
|
||||
<% if f.object.image_path? %>
|
||||
<p><%= f.object.name %></p>
|
||||
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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| %>
|
||||
<% str="[\"#{msg['card_no']}\"]"
|
||||
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 class="control-label"><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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: " >
|
||||
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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 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' %> -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .end-of-step2 -->
|
||||
</div> <!-- .end-of-tab-content -->
|
||||
<% end %>
|
||||
</div> <!-- .end-of-wizard -->
|
||||
</section> <!-- .end-of-section -->
|
||||
</div><!-- .end-of-col-md-4 -->
|
||||
</div> <!-- .end-of-row -->
|
||||
</div>
|
||||
</div>
|
||||
</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="type" name="type" value="<%= @cashier_type %>" />
|
||||
<input type="hidden" id="page" name="page" value="<%= @page %>" />
|
||||
<%if !@dining_facility.nil?%>
|
||||
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
|
||||
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
|
||||
<input type="hidden" id="table_type" name="table_type" value="<%= @dining_facility.type %>" />
|
||||
<% elsif @cashier_type == 'quick_service' %>
|
||||
<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="page" name="page" value="<%= @page %>" />
|
||||
<%else%>
|
||||
<input type="hidden" id="table_id" name="table_id" value="" />
|
||||
<input type="hidden" id="type" name="type" value="" />
|
||||
<input type="hidden" id="table_type" name="table_type" value="" />
|
||||
<%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| %>
|
||||
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
<div class="form-group">
|
||||
<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", :value=>"Mr"%></label>
|
||||
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.miss") %>
|
||||
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%></label>
|
||||
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mrs") %>
|
||||
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%></label>
|
||||
<label class="font-15 m-l-5"><%= t("views.right_panel.detail.mdm") %>
|
||||
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :name, :class => "form-control col-md-6 name", :required => true %>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.gender") %> :</label><br>
|
||||
<label><%= t("views.right_panel.detail.male") %>
|
||||
<%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%></label>
|
||||
<label><%= t("views.right_panel.detail.female") %>
|
||||
<%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.input :company, :class => "form-control col-md-6 company"%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['company']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% end -%>
|
||||
</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 class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= 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!('"]', '') %>
|
||||
<span class="help-block"><%= str %></span>
|
||||
<% 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>
|
||||
<input type="text" name="" value="<%=@count_customer%>" class="form-control" readonly="true">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.date_of_birth") %></label>
|
||||
<%= 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>
|
||||
<div class="panel padding-10">
|
||||
<div class="menu-item-img">
|
||||
<% if f.object.image_path? %>
|
||||
<p><%= f.object.name %></p>
|
||||
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||
<% else %>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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" >
|
||||
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</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 class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['name']}\"]"
|
||||
str.gsub!('["', '')
|
||||
str.gsub!('"]', '') %>
|
||||
<span class="help-block" style="margin-top:-10px"><%= str %></span>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
|
||||
<div class="input-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>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.select_membership_group") %></label>
|
||||
<select class="form-control col-md-12" name="member_group_id">
|
||||
<option value=""><%= t("views.right_panel.detail.select_membership_group") %></option>
|
||||
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.submit t("views.btn.submit"),:class => 'btn btn-primary btn-lg waves-effect', :id => 'submit_customer' %>
|
||||
<!-- <%= f.button :submit, "Update",:class => 'btn bg-blue btn-block', :disabled =>'', :id => 'update_customer' %> -->
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sxModal">
|
||||
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user