update customer view and order add column table and orderby
This commit is contained in:
@@ -120,3 +120,32 @@
|
||||
.bottom{
|
||||
margin-bottom:1px;
|
||||
}
|
||||
|
||||
/*Pagination*/
|
||||
nav.pagination {
|
||||
margin:10px;
|
||||
|
||||
}
|
||||
nav.pagination .current{
|
||||
background-color:#1f91f3;
|
||||
color:#fff;
|
||||
padding:4px 10px;
|
||||
margin-top:-4px;
|
||||
}
|
||||
nav.pagination .page a,.next a,.last a,.prev a,.first a{
|
||||
padding:6.5px 10px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
nav.pagination .page a:hover,
|
||||
a:focus {
|
||||
background-color: #ccc;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
nav.pagination .page a:hover,
|
||||
.first a:hover,.last a:hover,.prev a:hover,.next a:hover{
|
||||
background-color: #ccc;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
|
||||
@@ -33,12 +33,14 @@ class Crm::CustomersController < BaseCrmController
|
||||
end
|
||||
end
|
||||
end
|
||||
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(15)
|
||||
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(5)
|
||||
@crm_customer = Customer.new
|
||||
@count_customer = Customer.count_customer
|
||||
|
||||
@taxes = TaxProfile.all.order("order_by asc")
|
||||
|
||||
@filter = filter
|
||||
|
||||
# if flash["errors"]
|
||||
# @crm_customer.valid?
|
||||
# end
|
||||
|
||||
@@ -34,7 +34,7 @@ class Transactions::OrdersController < ApplicationController
|
||||
def show
|
||||
|
||||
@order = Order.find(params[:id])
|
||||
|
||||
@dining = BookingOrder.find_by_order_id(@order.order_id).booking.dining_facility
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @order }
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label> <%= t("views.right_panel.detail.salutation") %> :</label><br>
|
||||
<label class="font-13"><%= t("views.right_panel.detail.mr") %>
|
||||
<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-13 m-l--15"><%= t("views.right_panel.detail.miss") %>
|
||||
<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-13 m-l--15"><%= t("views.right_panel.detail.mrs") %>
|
||||
<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-13 m-l--15">
|
||||
<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>
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-9 col-md-9 col-sm-9">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<!-- <div class="main-box-body clearfix"> -->
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-hover table-striped">
|
||||
<!-- <div class="table-responsive">
|
||||
@@ -55,36 +53,34 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @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><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<% 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><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="7"><strong><p style="text-align: center;margin-bottom: -1px">There is no data for search <%=@filter%>....</p></strong></td></tr>
|
||||
<% end %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.order_id") %></th>
|
||||
|
||||
<th><%= t :table %>/<%= t :room %></th>
|
||||
<th><%= t("views.right_panel.detail.order_by") %></th>
|
||||
<th><%= t("views.right_panel.detail.type") %></th>
|
||||
<th><%= t :customer %></th>
|
||||
<th><%= t("views.right_panel.detail.order_status") %></th>
|
||||
@@ -57,10 +60,14 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @orders.each do |order| %>
|
||||
<% @orders.each do |order|
|
||||
@dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td><%= link_to order.order_id, transactions_order_path(order) %></td>
|
||||
<td><%= @dining.type %>-<%= @dining.name %></td>
|
||||
<td><%= order.waiters %></td>
|
||||
<td><%= order.order_type %></td>
|
||||
<td><%= order.customer.name rescue '-' %></td>
|
||||
<td><%= order.status %></td>
|
||||
|
||||
@@ -17,21 +17,25 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t :table %>/<%= t :room %></th>
|
||||
<th><%= t("views.right_panel.detail.order_by") %></th>
|
||||
<th><%= t("views.right_panel.detail.type") %></th>
|
||||
<th><%= t :customer %></th>
|
||||
<th><%= t("views.right_panel.detail.order_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.order_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.order_by") %></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @dining.type %>-<%= @dining.name %></td>
|
||||
<td> <%= @order.waiters rescue '-' %> </td>
|
||||
<td><%= @order.order_type %></td>
|
||||
<td><%= @order.customer.name rescue '-' %></td>
|
||||
<td><%= @order.status %></td>
|
||||
<td> <%= @order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
<td> <%= @order.waiters rescue '-' %> </td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user