Merge branch 'doemal_ordering'
This commit is contained in:
135
app/assets/javascripts/order_reservation.js
Normal file
135
app/assets/javascripts/order_reservation.js
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
|
||||||
|
$(function() {
|
||||||
|
|
||||||
|
$(".nav-item").on("click", function(){
|
||||||
|
type = $(this).attr("data-type");
|
||||||
|
if (type == "pending") {
|
||||||
|
$('#accepted').text("Accepted");
|
||||||
|
$('#accepted').attr("data-value","accepted");
|
||||||
|
}else if(type == "processing"){
|
||||||
|
$('#accepted').text("SEND TO KITCHEN");
|
||||||
|
$('#accepted').attr("data-value","processed");
|
||||||
|
}else if(type == "delivery"){
|
||||||
|
$('#accepted').text("READY TO DELIVERY");
|
||||||
|
$('#accepted').attr("data-value","delivery");
|
||||||
|
}else if(type == "completed"){
|
||||||
|
$('#accepted').text("PICK-UP");
|
||||||
|
$('#accepted').attr("data-value","completed");
|
||||||
|
}
|
||||||
|
console.log(type)
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery(function(){
|
||||||
|
jQuery('.first-1').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".custom-tr").on("click", function(){
|
||||||
|
$(".custom-tr").removeClass("tr-active");
|
||||||
|
$(this).addClass("tr-active");
|
||||||
|
var order_id = $(this).attr("data-id");
|
||||||
|
var url = "order_reservation/get_order/"+order_id;
|
||||||
|
show_order_detail(url);
|
||||||
|
});
|
||||||
|
|
||||||
|
//show order list
|
||||||
|
function show_order_detail(url){
|
||||||
|
//Start Ajax
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
data: {},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
var delivery = data["delivery"]
|
||||||
|
var items = data["order_items"]
|
||||||
|
|
||||||
|
var item_list = $('.summary-items');
|
||||||
|
item_list.empty();
|
||||||
|
|
||||||
|
for(var i in items) {
|
||||||
|
var total = items[i].qty*items[i].unit_price;
|
||||||
|
row = '<tr>'
|
||||||
|
+'<td width ="70%" class="body-td align-left">'+items[i].item_name
|
||||||
|
+' <br><span class="font-13">'+items[i].qty+ '<span class="col-blue"> <b>X</b>'+items[i].unit_price+'</span></span>'
|
||||||
|
+'</td>'
|
||||||
|
+'<td width ="30%" class="body-td align-right">'+ total +'</td>'
|
||||||
|
+'</tr>';
|
||||||
|
$('.summary-items').append(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#sub_total').text(data.total_amount);
|
||||||
|
$('#delivery_fee').text(delivery.delivery_fee);
|
||||||
|
$('#total_charges').text(0);
|
||||||
|
$('#total_tax').text(data.total_tax);
|
||||||
|
$('#grand_total').text(data.grand_total);
|
||||||
|
|
||||||
|
var address = delivery.address +', ' +delivery.township+", (" +delivery.direction_address+")"
|
||||||
|
$('#customer_name').text(data.customer_name);
|
||||||
|
$('#phone').text(data.phone);
|
||||||
|
$('#address').text(address);
|
||||||
|
$('#delivery_to').text(delivery.provider);
|
||||||
|
|
||||||
|
$('#ref_no').text(data.transaction_ref);
|
||||||
|
$('#callback_url').text(data.callback_url);
|
||||||
|
$('#order_id').text(data.order_reservation_id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//end Ajax
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#accepted").on("click", function(){
|
||||||
|
var status = $(this).attr("data-value");
|
||||||
|
var order_id = $('#order_id').text();
|
||||||
|
var url = 'order_reservation/update';
|
||||||
|
var callback = $('#callback_url').text();
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {'order_id': order_id, 'status': status},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
console.log(data)
|
||||||
|
if (data.status) {
|
||||||
|
// callback_url(callback,data.message)
|
||||||
|
swal("Information","Order has been +'data.status'+","success");
|
||||||
|
window.location.href = '/origami/order_reservation';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#cancel").on("click", function(){
|
||||||
|
var status = $(this).attr("data-value");
|
||||||
|
var order_id = $('#order_id').text();
|
||||||
|
var url = 'order_reservation/update';
|
||||||
|
var callback = $('#callback_url').text();
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {'order_id': order_id, 'status': status},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
console.log(data)
|
||||||
|
if (data.status) {
|
||||||
|
console.log(data)
|
||||||
|
// callback_url(callback,data.message)
|
||||||
|
swal("Information","Order has been +'data.status'+","warning");
|
||||||
|
window.location.href = '/origami/order_reservation';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function callback_url(url,message){
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
88
app/assets/stylesheets/order_reservation.scss
Normal file
88
app/assets/stylesheets/order_reservation.scss
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
.nav-tabs > li.active > a,
|
||||||
|
.nav-tabs > li.active > a:hover,
|
||||||
|
.nav-tabs > li.active > a:focus {
|
||||||
|
border-bottom: 2px solid #2196F3 ;
|
||||||
|
bottom: 2px ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-tabs .nav-link {
|
||||||
|
padding: 0.5286em .33em;
|
||||||
|
}
|
||||||
|
.nav-tabs li a.active {
|
||||||
|
color: #111 !important;
|
||||||
|
border-bottom: 0px solid #fff !important;
|
||||||
|
}
|
||||||
|
.nav-tabs .nav-link.active {
|
||||||
|
color: #111;
|
||||||
|
border-color: #fff;
|
||||||
|
}
|
||||||
|
.nav-tabs > li > a {
|
||||||
|
margin-right: 0px;
|
||||||
|
color:#fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-tabs > li > a {
|
||||||
|
border-bottom: 2px solid #2196F3;
|
||||||
|
bottom: 2px;
|
||||||
|
}
|
||||||
|
.nav-tabs.tab-col-teal > li > a:before {
|
||||||
|
border-bottom: 0px solid #009688;
|
||||||
|
}
|
||||||
|
.nav-tabs .nav-item{
|
||||||
|
margin-bottom: 2px ;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
color:#fff;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: -1px !important;
|
||||||
|
}
|
||||||
|
.nav-tabs .nav-link.active > p{
|
||||||
|
color: #111;
|
||||||
|
border-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Custosm Class*/
|
||||||
|
.table .header-td{
|
||||||
|
border-top:0px solid !important;
|
||||||
|
border-bottom: 0px solid !important;
|
||||||
|
padding:3px 7px !important;
|
||||||
|
border-top:0px solid !important;
|
||||||
|
border-bottom: 0px solid !important;
|
||||||
|
}
|
||||||
|
.custom-card-block .table td:first-child,
|
||||||
|
.custom-card-block .table td:nth-child(2),
|
||||||
|
.custom-card-footer .table td:first-child,
|
||||||
|
.custom-card-footer .table td:nth-child(2){
|
||||||
|
border-top:0px solid !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-card-footer .footer-td ,
|
||||||
|
.grand-card-footer .footer-td {
|
||||||
|
border-top:0px solid !important;
|
||||||
|
border-bottom:0px solid !important;
|
||||||
|
font-weight: bold;
|
||||||
|
padding:6px 10px;
|
||||||
|
}
|
||||||
|
.custom-card-header{
|
||||||
|
border-bottom: 1px solid #F8BBD0 !important;
|
||||||
|
padding:13px 5px !important;
|
||||||
|
}
|
||||||
|
.custom-card-footer{
|
||||||
|
border-top: 1px solid #F8BBD0 !important;
|
||||||
|
}
|
||||||
|
.custom-card-block,
|
||||||
|
.grand-card-footer,
|
||||||
|
.custom-card-footer{
|
||||||
|
padding :5px !important;
|
||||||
|
}
|
||||||
|
.custom-table{
|
||||||
|
background-color:#F3E5F5;
|
||||||
|
}
|
||||||
|
.custom-table tbody tr td,
|
||||||
|
.custom-table tbody tr th{
|
||||||
|
border-top: 1px solid #FFEBEE;
|
||||||
|
border-bottom: 1px solid #FFEBEE;
|
||||||
|
}
|
||||||
|
.tr-active{
|
||||||
|
background-color : #FFCDD2;
|
||||||
|
}
|
||||||
@@ -111,7 +111,8 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
items_arr.push(items)
|
items_arr.push(items)
|
||||||
}
|
}
|
||||||
|
puts items_arr.to_json
|
||||||
|
puts "sssssssssssssssssssssss"
|
||||||
# begin
|
# begin
|
||||||
# if params[:order_source] == "quick_service"
|
# if params[:order_source] == "quick_service"
|
||||||
# customer_id = "CUS-000000000002" # for no customer id from mobile
|
# customer_id = "CUS-000000000002" # for no customer id from mobile
|
||||||
|
|||||||
@@ -1,12 +1,40 @@
|
|||||||
class Origami::OrderReservationController < BaseOrigamiController
|
class Origami::OrderReservationController < BaseOrigamiController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@webview = check_mobile
|
@order = OrderReservation.all
|
||||||
@shop = Shop::ShopDetail
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@id = params[:order_id]
|
||||||
|
@status = params[:status]
|
||||||
|
@order = OrderReservation.find(@id)
|
||||||
|
|
||||||
|
status = true
|
||||||
|
|
||||||
|
if status
|
||||||
|
if @status == "processed"
|
||||||
|
OrderReservation.create_doemal_order(@order)
|
||||||
|
else
|
||||||
|
if @status == "cancel"
|
||||||
|
result = {:status=> true, :message => "cancelled" }
|
||||||
|
else
|
||||||
|
result = {:status=> true, :message => "accepted" }
|
||||||
|
end
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
result = {:status=> false, :message => "Order not accepted !" }
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_order
|
||||||
|
if (params[:id])
|
||||||
|
@order = OrderReservation.find(params[:id])
|
||||||
|
return @order
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,55 @@ class OrderReservation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.create_doemal_order(order)
|
||||||
|
|
||||||
|
is_extra_time = false
|
||||||
|
extra_time = ''
|
||||||
|
|
||||||
|
items_arr = []
|
||||||
|
count = 1
|
||||||
|
order.order_reservation_items.each { |i|
|
||||||
|
i.item_instance_code = i.item_instance_code.downcase.to_s
|
||||||
|
|
||||||
|
items = {"order_item_id": count,"item_instance_code": i.item_instance_code,"quantity": i.qty,"options": []}
|
||||||
|
count += 1
|
||||||
|
items_arr.push(items)
|
||||||
|
}
|
||||||
|
|
||||||
|
puts items_arr.to_json
|
||||||
|
puts "sssssssssssssssssssssss"
|
||||||
|
customer_id = order.customer_id
|
||||||
|
|
||||||
|
@order = Order.new
|
||||||
|
@order.source = "doemal_order"
|
||||||
|
@order.order_type = "delivery"
|
||||||
|
@order.customer_id = customer_id
|
||||||
|
@order.items = items_arr
|
||||||
|
@order.guest = ''
|
||||||
|
@order.table_id = nil # this is dining facilities's id
|
||||||
|
@order.new_booking = true
|
||||||
|
@order.waiters = current_login_employee.name
|
||||||
|
@order.employee_name = current_login_employee.name
|
||||||
|
|
||||||
|
@order.is_extra_time = is_extra_time
|
||||||
|
@order.extra_time = extra_time
|
||||||
|
|
||||||
|
@status, @booking = @order.generate
|
||||||
|
|
||||||
|
# Order.send_customer_view(@booking)
|
||||||
|
|
||||||
|
|
||||||
|
if @status && @booking
|
||||||
|
|
||||||
|
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||||
|
# for second display
|
||||||
|
|
||||||
|
result = {:status=> @status, :data => @sale }
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
self.order_reservation_id = SeedGenerator.generate_id(self.class.name, "ODRS")
|
self.order_reservation_id = SeedGenerator.generate_id(self.class.name, "ODRS")
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
json.id item.order_reservation_items_id
|
||||||
|
json.order_id item.order_reservation_id
|
||||||
|
json.item_status item.item_status
|
||||||
|
json.item_code item.item_code
|
||||||
|
json.item_instance_code item.item_instance_code
|
||||||
|
json.item_name item.item_name
|
||||||
|
json.alt_name item.alt_name
|
||||||
|
json.set_menu_items item.set_menu_items
|
||||||
|
json.account_id item.account_id
|
||||||
|
json.qty item.qty
|
||||||
|
json.unit_price item.unit_price
|
||||||
|
json.price item.price
|
||||||
|
json.remark item.remark
|
||||||
|
json.options item.options
|
||||||
|
json.taxable item.taxable
|
||||||
25
app/views/origami/order_reservation/get_order.json.jbuilder
Normal file
25
app/views/origami/order_reservation/get_order.json.jbuilder
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
if @order
|
||||||
|
|
||||||
|
json.(@order, :order_reservation_id,:order_reservation_type,:customer_id,
|
||||||
|
:requested_time,:callback_url,:transaction_ref,:item_count,:total_customer,:payment_type,
|
||||||
|
:payment_status,:payment_ref,:total_amount,:total_tax,
|
||||||
|
:discount_amount,:grand_total,:status,:order_remark,
|
||||||
|
:reservation_remark)
|
||||||
|
@delivery = Delivery.find_by_order_reservation_id(@order.order_reservation_id)
|
||||||
|
if @delivery
|
||||||
|
json.delivery do |json|
|
||||||
|
# json.(@article.author, :id, :name)
|
||||||
|
json.(@delivery, :provider,:delivery_type,:township,
|
||||||
|
:address,:direction_address,:delivery_fee,:remark)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if @order.order_reservation_items
|
||||||
|
json.order_items @order.order_reservation_items do |item|
|
||||||
|
json.partial! 'origami/order_reservation/order_item', item: item
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@customer = Customer.find(@order.customer_id)
|
||||||
|
|
||||||
|
json.customer_name @customer.name
|
||||||
|
json.phone @customer.contact_no
|
||||||
|
end
|
||||||
@@ -1,17 +1,19 @@
|
|||||||
|
<%= stylesheet_link_tag 'order_reservation', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
|
<%= javascript_include_tag 'order_reservation', 'data-turbolinks-track': 'reload' %>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row m-t--10">
|
<div class="row m-t--10">
|
||||||
<div class="col-lg-4 col-md-4 col-sm-4" style="margin:0px 0px 0px -5px !important ">
|
<div class="col-lg-4 col-md-4 col-sm-4" style="margin:0px 0px 0px -5px !important ">
|
||||||
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||||
<li class="nav-item active" data-color="#F44336" style="background-color: #F44336;">
|
<li class="nav-item active" data-color="#F44336" data-type="pending" style="background-color: #F44336;">
|
||||||
<a class="nav-link" data-toggle="tab" href="#pending" role="tab"><p class="num">4</p> <%= t :pending %></a>
|
<a class="nav-link" data-toggle="tab" href="#pending" role="tab"><p class="num">4</p> <%= t :pending %></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" data-color="#673AB7" style="background-color: #673AB7;">
|
<li class="nav-item" data-color="#673AB7" data-type="processing" style="background-color: #673AB7;">
|
||||||
<a class="nav-link" data-toggle="tab" href="#processing" role="tab"><p class="num">4</p> <%= t :processing %></a>
|
<a class="nav-link" data-toggle="tab" href="#processing" role="tab"><p class="num">4</p> <%= t :process %></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" data-color="#009688" style="background-color: #009688;">
|
<li class="nav-item" data-color="#009688" data-type="delivery" style="background-color: #009688;">
|
||||||
<a class="nav-link" data-toggle="tab" href="#delivery" role="tab"><p class="num">4</p> <%= t :delivering %></a>
|
<a class="nav-link" data-toggle="tab" href="#delivery" role="tab"><p class="num">4</p> <%= t :delivery %></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" data-color="#03A9F4" style="background-color: #03A9F4;">
|
<li class="nav-item" data-color="#03A9F4" data-type="completed" style="background-color: #03A9F4;">
|
||||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab"><p class="num">4</p> <%= t :completed %></a>
|
<a class="nav-link" data-toggle="tab" href="#completed" role="tab"><p class="num">4</p> <%= t :completed %></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -22,62 +24,26 @@
|
|||||||
<div id="menu-slimscroll" data-height="50">
|
<div id="menu-slimscroll" data-height="50">
|
||||||
<table class="table table-stripe custom-table">
|
<table class="table table-stripe custom-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<% i=1
|
||||||
<td width ="5%" class="align-left">
|
@order.each do |order| %>
|
||||||
1
|
<% if order.status == 'new' %>
|
||||||
</td>
|
<tr class="custom-tr first-<%=i%>" style="" data-id="<%=order.order_reservation_id%>">
|
||||||
<td width ="30%" class="align-center">
|
<td width ="5%" class="align-left">
|
||||||
3:30 PM
|
<%=i%>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
13000
|
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
<%=order.grand_total%>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td width ="30%" class="align-center">
|
||||||
<tr>
|
<span class="font-10 col-blue"><%=order.status%></span>
|
||||||
<td width ="5%" class="align-left">
|
</td>
|
||||||
2
|
</tr>
|
||||||
</td>
|
<%i+=1%>
|
||||||
<td width ="30%" class="align-center">
|
<%end%>
|
||||||
3:30 PM
|
<%end%>
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="5%" class="align-left">
|
|
||||||
3
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
3:30 PM
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="5%" class="align-left">
|
|
||||||
4
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
3:30 PM
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -90,35 +56,26 @@
|
|||||||
<div id="menu-slimscroll" data-height="50">
|
<div id="menu-slimscroll" data-height="50">
|
||||||
<table class="table table-stripe custom-table">
|
<table class="table table-stripe custom-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<% i=1
|
||||||
<td width ="5%" class="align-left">
|
@order.each do |order| %>
|
||||||
1
|
<% if order.status == 'accepted' %>
|
||||||
</td>
|
<tr class="custom-tr " style="" data-id="<%=order.order_reservation_id%>">
|
||||||
<td width ="30%" class="align-center">
|
<td width ="5%" class="align-left">
|
||||||
3:30 PM
|
<%=i%>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
13000
|
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
<%=order.grand_total%>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td width ="30%" class="align-center">
|
||||||
<tr>
|
<span class="font-10 col-blue"><%=order.status%></span>
|
||||||
<td width ="5%" class="align-left">
|
</td>
|
||||||
2
|
</tr>
|
||||||
</td>
|
<%i+=1%>
|
||||||
<td width ="30%" class="align-center">
|
<%end%>
|
||||||
3:30 PM
|
<%end%>
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -130,89 +87,57 @@
|
|||||||
<div id="menu-slimscroll" data-height="50">
|
<div id="menu-slimscroll" data-height="50">
|
||||||
<table class="table table-stripe custom-table">
|
<table class="table table-stripe custom-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<% i=1
|
||||||
<td width ="5%" class="align-left">
|
@order.each do |order| %>
|
||||||
1
|
<% if order.status == 'processed' %>
|
||||||
</td>
|
<tr class="custom-tr" style="" data-id="<%=order.order_reservation_id%>">
|
||||||
<td width ="30%" class="align-center">
|
<td width ="5%" class="align-left">
|
||||||
3:30 PM
|
<%=i%>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
13000
|
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
<%=order.grand_total%>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td width ="30%" class="align-center">
|
||||||
<tr>
|
<span class="font-10 col-blue"><%=order.status%></span>
|
||||||
<td width ="5%" class="align-left">
|
</td>
|
||||||
2
|
</tr>
|
||||||
</td>
|
<%i+=1%>
|
||||||
<td width ="30%" class="align-center">
|
<%end%>
|
||||||
3:30 PM
|
<%end%>
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="5%" class="align-left">
|
|
||||||
3
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
3:30 PM
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--- Panel 3 - Orders -->
|
<!--- Panel 3 - Orders -->
|
||||||
<div class="tab-pane dining" id="completed" role="tabpanel">
|
<div class="tab-pane dining" id="delivery" role="tabpanel">
|
||||||
<div class="card-block font-13">
|
<div class="card-block font-13">
|
||||||
<div id="menu-slimscroll" data-height="50">
|
<div id="menu-slimscroll" data-height="50">
|
||||||
<table class="table table-stripe custom-table">
|
<table class="table table-stripe custom-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<% i=1
|
||||||
<td width ="5%" class="align-left">
|
@order.each do |order| %>
|
||||||
1
|
<% if order.status == 'completed' %>
|
||||||
</td>
|
<tr class="custom-tr" style="" data-id="<%=order.order_reservation_id%>">
|
||||||
<td width ="30%" class="align-center">
|
<td width ="5%" class="align-left">
|
||||||
3:30 PM
|
<%=i%>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
13000
|
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="align-center">
|
<td width ="30%" class="align-center">
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
<%=order.grand_total%>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td width ="30%" class="align-center">
|
||||||
<tr>
|
<span class="font-10 col-blue"><%=order.status%></span>
|
||||||
<td width ="5%" class="align-left">
|
</td>
|
||||||
3
|
</tr>
|
||||||
</td>
|
<%i+=1%>
|
||||||
<td width ="30%" class="align-center">
|
<%end%>
|
||||||
3:30 PM
|
<%end%>
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
13000
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="align-center">
|
|
||||||
<span class="font-10 col-blue">STATUS</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -227,7 +152,8 @@
|
|||||||
<div class="card-header custom-card-header" style="color:">
|
<div class="card-header custom-card-header" style="color:">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="70%" class="header-td align-left"><b class="col-pink font-16">No.11</b>
|
<td width ="70%" class="header-td align-left">
|
||||||
|
<b class="col-pink font-16">No.11</b>
|
||||||
<span class="font-13">(DELIVERY)</span>
|
<span class="font-13">(DELIVERY)</span>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="header-td font-16 align-right"><b>0065 4321</b></td>
|
<td width ="30%" class="header-td font-16 align-right"><b>0065 4321</b></td>
|
||||||
@@ -236,50 +162,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-block custom-card-block">
|
<div class="card-block custom-card-block">
|
||||||
<div id="order-detail-slimscroll" data-height="220">
|
<div id="order-detail-slimscroll" data-height="220">
|
||||||
<table class="table">
|
<table class="table summary-items">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<!-- <tr>
|
||||||
<td width ="70%" class="body-td align-left">
|
<td width ="70%" class="body-td align-left">
|
||||||
MENU ITEM 01
|
MENU ITEM 01
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
<td width ="30%" class="body-td align-right">1400.00</td>
|
||||||
</tr>
|
</tr> -->
|
||||||
<tr>
|
|
||||||
<td width ="70%" class="body-td align-left">
|
|
||||||
MENU ITEM 01
|
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="70%" class="body-td align-left">
|
|
||||||
MENU ITEM 01
|
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="70%" class="body-td align-left">
|
|
||||||
MENU ITEM 01
|
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="70%" class="body-td align-left">
|
|
||||||
MENU ITEM 01
|
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width ="70%" class="body-td align-left">
|
|
||||||
MENU ITEM 01
|
|
||||||
<br><span class="font-13">2 <span class="col-blue">X700</span></span>
|
|
||||||
</td>
|
|
||||||
<td width ="30%" class="body-td align-right">1400.00</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -288,28 +179,28 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="70%" class="footer-td align-left">
|
<td width ="70%" class="footer-td align-left" >
|
||||||
SUB TOTAL
|
SUB TOTAL
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="footer-td align-right">1400.00</td>
|
<td width ="30%" class="footer-td align-right" id="sub_total">0.00</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="70%" class="footer-td align-left">
|
<td width ="70%" class="footer-td align-left">
|
||||||
DELIVERY FEES (PICK-UP)
|
DELIVERY FEES (PICK-UP)
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="footer-td align-right">1400.00</td>
|
<td width ="30%" class="footer-td align-right" id="delivery_fee">0.00</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="70%" class="footer-td align-left">
|
<td width ="70%" class="footer-td align-left">
|
||||||
CONVENIENCE CHARGES
|
CONVENIENCE CHARGES
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="footer-td align-right">1400.00</td>
|
<td width ="30%" class="footer-td align-right" id="total_charges">0.00</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="70%" class="footer-td align-left">
|
<td width ="70%" class="footer-td align-left">
|
||||||
GOVERNMENT TAX
|
GOVERNMENT TAX
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="footer-td align-right">1400.00</td>
|
<td width ="30%" class="footer-td align-right" id="total_tax">0.00</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -321,14 +212,27 @@
|
|||||||
<td width ="70%" class="footer-td align-left col-blue">
|
<td width ="70%" class="footer-td align-left col-blue">
|
||||||
GRAND TOTAL
|
GRAND TOTAL
|
||||||
</td>
|
</td>
|
||||||
<td width ="30%" class="footer-td align-right col-blue">1400.00</td>
|
<td width ="30%" class="footer-td align-right col-blue" id="grand_total">0.00</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width ="50%" class="footer-td align-left col-blue">
|
<td width ="50%" class="footer-td align-left col-blue">
|
||||||
<button type="button" class="btn btn-lg bg-blue waves-effect" data-dismiss="modal"><strong>DECLINE</strong></button>
|
<button type="button" class="btn btn-lg bg-red waves-effect" id="cancel" data-value="cancel">
|
||||||
|
<strong>DECLINE</strong>
|
||||||
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td width ="50%" class="footer-td align-right col-blue">
|
<td width ="50%" class="footer-td align-right col-blue">
|
||||||
<button type="button" class="btn btn-lg bg-blue waves-effect" data-dismiss="modal"><strong>ACCEPT</strong></button>
|
<button type="button" class="btn btn-lg bg-blue waves-effect " id="accepted" data-value="accepted">
|
||||||
|
ACCEPT
|
||||||
|
</button>
|
||||||
|
<!-- <button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="delivery">
|
||||||
|
<strong>SEND TO KITCHEN</strong>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="completed">
|
||||||
|
<strong>READY TO DELIVERY</strong>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="pick-up">
|
||||||
|
<strong>PICK UP</strong>
|
||||||
|
</button> -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -353,119 +257,41 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td class="body-td align-left">
|
||||||
<span class="font-13">NAME</span><br>
|
<span class="font-13">NAME</span><br>
|
||||||
<b>DAW AYE AYE</b>
|
<b id="customer_name"></b>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td class="body-td align-left">
|
||||||
<span class="font-13">PHONE</span><br>
|
<span class="font-13">PHONE</span><br>
|
||||||
<b>09 8765 4321 098</b>
|
<b id="phone"></b>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td class="body-td align-left">
|
||||||
<span class="font-13">ADDRESS</span><br>
|
<span class="font-13">ADDRESS</span><br>
|
||||||
<b>No. (12), 3rd floor, zay kyee Street, kyi myin dine
|
<b id="address"></b>
|
||||||
infront of Nya Zay Main Entrance</b>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td class="body-td align-left">
|
||||||
<span class="font-13">DELEVER TO</span><br>
|
<span class="font-13">DELEVERY</span><br>
|
||||||
<b>HOME</b>
|
<b id="delivery_to"></b>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<style type="text/css">
|
<p id="ref_no"></p>
|
||||||
.nav-tabs > li.active > a,
|
<p id="callback_url"></p>
|
||||||
.nav-tabs > li.active > a:hover,
|
<p id="order_id"></p>
|
||||||
.nav-tabs > li.active > a:focus {
|
<p id="status"></p>
|
||||||
border-bottom: 2px solid #2196F3 ;
|
<script type="text/javascript">
|
||||||
bottom: 2px ;
|
jQuery(function(){
|
||||||
}
|
jQuery('.first-1').click();
|
||||||
|
});
|
||||||
|
|
||||||
.nav-tabs .nav-link {
|
</script>
|
||||||
padding: 0.5286em .33em;
|
|
||||||
}
|
|
||||||
.nav-tabs li a.active {
|
|
||||||
color: #111 !important;
|
|
||||||
border-bottom: 0px solid #fff !important;
|
|
||||||
}
|
|
||||||
.nav-tabs .nav-link.active {
|
|
||||||
color: #111;
|
|
||||||
border-color: #fff;
|
|
||||||
}
|
|
||||||
.nav-tabs > li > a {
|
|
||||||
margin-right: 0px;
|
|
||||||
color:#fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-tabs > li > a {
|
|
||||||
border-bottom: 2px solid #2196F3;
|
|
||||||
bottom: 2px;
|
|
||||||
}
|
|
||||||
.nav-tabs.tab-col-teal > li > a:before {
|
|
||||||
border-bottom: 0px solid #009688;
|
|
||||||
}
|
|
||||||
.nav-tabs .nav-item{
|
|
||||||
margin-bottom: 2px ;
|
|
||||||
}
|
|
||||||
.num{
|
|
||||||
color:#fff;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: -1px !important;
|
|
||||||
}
|
|
||||||
.nav-tabs .nav-link.active > p{
|
|
||||||
color: #111;
|
|
||||||
border-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Custosm Class*/
|
|
||||||
.table .header-td{
|
|
||||||
border-top:0px solid !important;
|
|
||||||
border-bottom: 0px solid !important;
|
|
||||||
padding:3px 7px !important;
|
|
||||||
border-top:0px solid !important;
|
|
||||||
border-bottom: 0px solid !important;
|
|
||||||
}
|
|
||||||
.custom-card-block .table td:first-child,
|
|
||||||
.custom-card-block .table td:nth-child(2),
|
|
||||||
.custom-card-footer .table td:first-child,
|
|
||||||
.custom-card-footer .table td:nth-child(2){
|
|
||||||
border-top:0px solid !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-card-footer .footer-td ,
|
|
||||||
.grand-card-footer .footer-td {
|
|
||||||
border-top:0px solid !important;
|
|
||||||
border-bottom:0px solid !important;
|
|
||||||
font-weight: bold;
|
|
||||||
padding:5px 10px;
|
|
||||||
}
|
|
||||||
.custom-card-header{
|
|
||||||
border-bottom: 1px solid #F8BBD0 !important;
|
|
||||||
padding:13px 5px !important;
|
|
||||||
}
|
|
||||||
.custom-card-footer{
|
|
||||||
border-top: 1px solid #F8BBD0 !important;
|
|
||||||
}
|
|
||||||
.custom-card-block,
|
|
||||||
.grand-card-footer,
|
|
||||||
.custom-card-footer{
|
|
||||||
padding :5px !important;
|
|
||||||
}
|
|
||||||
.custom-table{
|
|
||||||
background-color:#F3E5F5;
|
|
||||||
}
|
|
||||||
.custom-table tbody tr td,
|
|
||||||
.custom-table tbody tr th{
|
|
||||||
border-top: 1px solid #FFEBEE;
|
|
||||||
border-bottom: 1px solid #FFEBEE;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -37,7 +37,7 @@ Rails.application.config.assets.precompile += %w( CRM.js )
|
|||||||
# --- Image Uploader ----
|
# --- Image Uploader ----
|
||||||
Rails.application.config.assets.precompile += %w( fileinput.min.js )
|
Rails.application.config.assets.precompile += %w( fileinput.min.js )
|
||||||
|
|
||||||
# --- Customer/ Customer - Crm ----
|
# --- Add order/ Add order - Crm ----
|
||||||
Rails.application.config.assets.precompile += %w( addorder.css )
|
Rails.application.config.assets.precompile += %w( addorder.css )
|
||||||
Rails.application.config.assets.precompile += %w( addorder.js )
|
Rails.application.config.assets.precompile += %w( addorder.js )
|
||||||
|
|
||||||
@@ -53,4 +53,9 @@ Rails.application.config.assets.precompile += %w( sx-sidebar.css )
|
|||||||
Rails.application.config.assets.precompile += %w( inventory_definitions.css )
|
Rails.application.config.assets.precompile += %w( inventory_definitions.css )
|
||||||
Rails.application.config.assets.precompile += %w( inventory.js )
|
Rails.application.config.assets.precompile += %w( inventory.js )
|
||||||
|
|
||||||
|
# --- Customer/ Customer - Crm ----
|
||||||
|
Rails.application.config.assets.precompile += %w( order_reservation.css )
|
||||||
|
Rails.application.config.assets.precompile += %w( order_reservation.js )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -266,6 +266,9 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
|
|
||||||
#order and reservation
|
#order and reservation
|
||||||
resources :order_reservation
|
resources :order_reservation
|
||||||
|
get 'order_reservation/get_order/:id' => "order_reservation#get_order",:as => "get_order", :defaults => { :format => 'json' }
|
||||||
|
post 'order_reservation/update', to: "order_reservation#update" , :defaults => { :format => 'json' }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------- Waiter/Ordering Station ------------#
|
#--------- Waiter/Ordering Station ------------#
|
||||||
|
|||||||
Reference in New Issue
Block a user