Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-11-23 12:15:01 +06:30
11 changed files with 97 additions and 57 deletions

View File

@@ -886,27 +886,33 @@ $(function() {
$('.keypress_qty').keyup(function(e){ $('.keypress_qty').keyup(function(e){
id = $(this).attr('id'); id = $(this).attr('id');
value = $(this).val(); value = $(this).val();
$('.change_qty').attr('value',value);
if (id=="count") { if ($.isNumeric(value)) {
price = $("#unit_price").text(); $('.change_qty').attr('value',value);
$("#total_price").text(value*price); if (id=="count") {
}else{ price = $("#unit_price").text();
var item_row = $('.selected-instance'); $("#total_price").text(value*price);
price = $("#set_unit_price").text();
set_total_price = $("#set_total_price").text();
$(".set_change_qty").val(value);
if (item_row.length > 1) {
total = 0 ;
$(item_row).each(function(i){
total += value * $(item_row[i]).attr('data-price');
total_price = total;
});
}else{ }else{
total_price = value*price; var item_row = $('.selected-instance');
price = $("#set_unit_price").text();
set_total_price = $("#set_total_price").text();
$(".set_change_qty").val(value);
if (item_row.length > 1) {
total = 0 ;
$(item_row).each(function(i){
total += value * $(item_row[i]).attr('data-price');
total_price = total;
});
}else{
total_price = value*price;
}
$("#set_total_price").text(total_price);
} }
$("#set_total_price").text(total_price); }else{
$('#'+id).val(1);
swal("Opps","Please enter number for qty","warning");
} }
}); });

View File

@@ -6,9 +6,6 @@
@import "sweetalert/sweetalert.css"; @import "sweetalert/sweetalert.css";
@import "multi-select/css/multi-select.css"; @import "multi-select/css/multi-select.css";
@import "bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker"; @import "bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker";
@import "jquery-ui/jquery-ui.css";
@import "jquery-ui/jquery-ui.structure.css";
@import "jquery-ui/jquery-ui.theme.css";
@import "morrisjs/morris"; @import "morrisjs/morris";
@import "BSBMaterial/style"; @import "BSBMaterial/style";
@import "BSBMaterial/themes/all-themes"; @import "BSBMaterial/themes/all-themes";
@@ -120,3 +117,32 @@
.bottom{ .bottom{
margin-bottom:1px; 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;
}

View File

@@ -33,12 +33,14 @@ class Crm::CustomersController < BaseCrmController
end end
end 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(20)
@crm_customer = Customer.new @crm_customer = Customer.new
@count_customer = Customer.count_customer @count_customer = Customer.count_customer
@taxes = TaxProfile.all.order("order_by asc") @taxes = TaxProfile.all.order("order_by asc")
@filter = filter
# if flash["errors"] # if flash["errors"]
# @crm_customer.valid? # @crm_customer.valid?
# end # end

View File

@@ -72,6 +72,6 @@ class Settings::MembershipActionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def settings_membership_action_params def settings_membership_action_params
params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by, :additional_parameter) params.require(:membership_action).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by)
end end
end end

View File

@@ -71,6 +71,6 @@ class Settings::ShopsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def shop_params def shop_params
params.require(:shop).permit(:name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order) params.require(:shop).permit(:name,:address,:city,:township,:state,:country,:phone_no,:reservation_no,:license,:activated_at,:license_data,:base_currency,:cloud_token,:cloud_url,:owner_token,:id_prefix,:is_rounding_adj,:quick_sale_summary,:calc_tax_order,:show_account_info)
end end
end end

View File

@@ -34,7 +34,7 @@ class Transactions::OrdersController < ApplicationController
def show def show
@order = Order.find(params[:id]) @order = Order.find(params[:id])
@dining = BookingOrder.find_by_order_id(@order.order_id).booking.dining_facility
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
format.json { render json: @order } format.json { render json: @order }

View File

@@ -13,8 +13,6 @@
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-9 col-md-9 col-sm-9"> <div class="col-lg-9 col-md-9 col-sm-9">
<div class="card"> <div class="card">
<div class="body">
<!-- <div class="main-box-body clearfix"> -->
<div class="body table-responsive"> <div class="body table-responsive">
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
<!-- <div class="table-responsive"> <!-- <div class="table-responsive">
@@ -55,36 +53,34 @@
</thead> </thead>
<tbody> <tbody>
<% @i = 0 %> <% if @crm_customers.count > 0 %>
<% @crm_customers.each do |crm_customer| %> <% @i = 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>"> <tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td> <td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td> <input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td> <td>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<%= @i += 1 %> <%= @i += 1 %>
<%else%> <%else%>
- -
<% end %> <% end %>
</td> </td>
<td><%= crm_customer.name %></td> <td><%= crm_customer.name %></td>
<td><%= crm_customer.card_no rescue '-' %></td> <td><%= crm_customer.card_no rescue '-' %></td>
<td><%= crm_customer.contact_no %></td> <td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td> <td><%= crm_customer.email %></td>
<td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td> <td><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %></td>
</tr>
</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 %> <% end %>
</tbody> </tbody>
</table> </table>
<br> <br>
<%= paginate @crm_customers %> <%= paginate @crm_customers %>
</div> </div>
<!-- </div> -->
</div>
</div> </div>
</div> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <div class="col-lg-3 col-md-3 col-sm-3">

View File

@@ -140,7 +140,7 @@
</button> </button>
</span> </span>
<input type="number" value="1" id="count" class="change_qty keypress_qty form-control col-md-12 "> <input type="text" value="1" id="count" class="change_qty keypress_qty form-control col-md-12 ">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" class="btn btn-success btn-number" value="+" id="plus"> <button type="button" class="btn btn-success btn-number" value="+" id="plus">
<i class="material-icons">add</i> <i class="material-icons">add</i>
@@ -214,7 +214,7 @@
<i class="material-icons">remove</i> <i class="material-icons">remove</i>
</button> </button>
</span> </span>
<input type="number" value="1" id="set_count" class="set_change_qty keypress_qty form-control col-md-12 "> <input type="text" value="1" id="set_count" class="set_change_qty keypress_qty form-control col-md-12 ">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" class="btn btn-success btn-number" value="+" id="set_plus"> <button type="button" class="btn btn-success btn-number" value="+" id="set_plus">
<i class="material-icons">add</i> <i class="material-icons">add</i>

View File

@@ -11,7 +11,6 @@
<%= f.input :gateway_url %> <%= f.input :gateway_url %>
<%= f.input :auth_token %> <%= f.input :auth_token %>
<%= f.input :merchant_account_id %> <%= f.input :merchant_account_id %>
<%= f.input :additional_parameter, as: :text %>
<%= f.input :created_by %> <%= f.input :created_by %>
</div> </div>

View File

@@ -48,6 +48,9 @@
<tr> <tr>
<th><%= t("views.right_panel.detail.order_id") %></th> <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("views.right_panel.detail.type") %></th>
<th><%= t :customer %></th> <th><%= t :customer %></th>
<th><%= t("views.right_panel.detail.order_status") %></th> <th><%= t("views.right_panel.detail.order_status") %></th>
@@ -57,10 +60,14 @@
</thead> </thead>
<tbody> <tbody>
<% @orders.each do |order| %> <% @orders.each do |order|
@dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility
%>
<tr> <tr>
<td><%= link_to order.order_id, transactions_order_path(order) %></td> <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.order_type %></td>
<td><%= order.customer.name rescue '-' %></td> <td><%= order.customer.name rescue '-' %></td>
<td><%= order.status %></td> <td><%= order.status %></td>

View File

@@ -17,21 +17,25 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <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("views.right_panel.detail.type") %></th>
<th><%= t :customer %></th> <th><%= t :customer %></th>
<th><%= t("views.right_panel.detail.order_status") %></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_date") %></th>
<th><%= t("views.right_panel.detail.order_by") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><%= @dining.type %>-<%= @dining.name %></td>
<td> <%= @order.waiters rescue '-' %> </td>
<td><%= @order.order_type %></td> <td><%= @order.order_type %></td>
<td><%= @order.customer.name rescue '-' %></td> <td><%= @order.customer.name rescue '-' %></td>
<td><%= @order.status %></td> <td><%= @order.status %></td>
<td> <%= @order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td> <td> <%= @order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
<td> <%= @order.waiters rescue '-' %> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>