update quickservice
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
|
type = $('#type').val();
|
||||||
|
modify_order = $('#modify_order').val();
|
||||||
//click menu sidebar menu category
|
//click menu sidebar menu category
|
||||||
$(".product").on("click", function(){
|
$(".product").on("click", function(){
|
||||||
var url = $(this).attr('data-ref');
|
var url = $(this).attr('data-ref');
|
||||||
@@ -85,8 +88,13 @@ $(function() {
|
|||||||
function show_menu_item_list(url_item){
|
function show_menu_item_list(url_item){
|
||||||
var menu_list = $('.menu_items_list');
|
var menu_list = $('.menu_items_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
if ($('#type').val() == 'true') {
|
|
||||||
url_item = 'addorders/'+url_item
|
if (modify_order=="true" && type =="true") {
|
||||||
|
url_item = '../../../addorders/'+url_item;
|
||||||
|
}if(modify_order=="false" && type =="true"){
|
||||||
|
url_item = 'addorders/'+url_item
|
||||||
|
}else{
|
||||||
|
url_item = url_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
@@ -763,18 +771,27 @@ $(function() {
|
|||||||
|
|
||||||
// Pay Discount for Payment
|
// Pay Discount for Payment
|
||||||
$("#create_pay_order").on('click', function(e){
|
$("#create_pay_order").on('click', function(e){
|
||||||
|
|
||||||
$(this).attr('disabled', 'disabled');
|
$(this).attr('disabled', 'disabled');
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
type = "quick_service"
|
||||||
$("#oqs_loading_wrapper").show();
|
$("#oqs_loading_wrapper").show();
|
||||||
|
console.log(modify_order)
|
||||||
type = $('#type').val();
|
if (modify_order == "true") {
|
||||||
type = 'quick_service'
|
console.log($('#sale_id').text())
|
||||||
var table_type = $('#table_id').find("option:selected").data('type');
|
var ajax_url = '../../../quick_service/update_modify_order';
|
||||||
var table_id = $('#table_id').val();
|
var table_type = $('#table_type').text();
|
||||||
var customer_id = $('#customer_id').val();
|
var table_id = $('#table_id').text();
|
||||||
var booking_id = $('#booking_id').text();
|
var customer_id = $('#customer_id').text();
|
||||||
var ajax_url = 'addorders/create';
|
var booking_id = $('#booking_id').text();
|
||||||
|
var sale_id = $('#sale_id').text();
|
||||||
|
}else{
|
||||||
|
var ajax_url = 'addorders/create';
|
||||||
|
var table_type = $('#table_id').find("option:selected").data('type');
|
||||||
|
var table_id = $('#table_id').val();
|
||||||
|
var customer_id = $('#customer_id').val();
|
||||||
|
var booking_id = $('#booking_id').text();
|
||||||
|
var sale_id = ""
|
||||||
|
}
|
||||||
|
|
||||||
if (!booking_id.length > 0) {
|
if (!booking_id.length > 0) {
|
||||||
|
|
||||||
@@ -788,7 +805,8 @@ $(function() {
|
|||||||
var params = {'order_source': type, 'order_type': "dine_in",
|
var params = {'order_source': type, 'order_type': "dine_in",
|
||||||
'customer_id': customer_id, 'guest_info': "",
|
'customer_id': customer_id, 'guest_info': "",
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'order_items': order_items };
|
'order_items': order_items,'sale_id': sale_id };
|
||||||
|
console.log(params)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
@@ -799,7 +817,6 @@ $(function() {
|
|||||||
if (result.status) {
|
if (result.status) {
|
||||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
|
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
|
||||||
}
|
}
|
||||||
// window.location.href = "/origami/quick_service"
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1032,9 +1049,6 @@ $(function() {
|
|||||||
$(".sub_click").on("click", function(){
|
$(".sub_click").on("click", function(){
|
||||||
var menu_id = $(this).attr("data-id");
|
var menu_id = $(this).attr("data-id");
|
||||||
var url = "get_menu_sub_category/"+menu_id;
|
var url = "get_menu_sub_category/"+menu_id;
|
||||||
if ($('#type').val() == 'true') {
|
|
||||||
url = 'addorders/'+url
|
|
||||||
}
|
|
||||||
sub_category = $(this).find('.sub_category_list');
|
sub_category = $(this).find('.sub_category_list');
|
||||||
show_sub_category_list(url,sub_category);
|
show_sub_category_list(url,sub_category);
|
||||||
});
|
});
|
||||||
@@ -1043,6 +1057,14 @@ $(function() {
|
|||||||
//show menu item list when click menu category
|
//show menu item list when click menu category
|
||||||
function show_sub_category_list(url,sub_category){
|
function show_sub_category_list(url,sub_category){
|
||||||
|
|
||||||
|
if (modify_order == "true" && type =="true") {
|
||||||
|
var url = "../../../addorders/"+url;
|
||||||
|
}if(modify_order=="false" && type =="true"){
|
||||||
|
var url = 'addorders/'+url;
|
||||||
|
}else{
|
||||||
|
var url = url;
|
||||||
|
}
|
||||||
|
|
||||||
var menu_list = $('.sub_category_list');
|
var menu_list = $('.sub_category_list');
|
||||||
menu_list.empty();
|
menu_list.empty();
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
|
|||||||
@@ -69,13 +69,6 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
member_info = nil
|
member_info = nil
|
||||||
|
|
||||||
if params[:type] == "quick_service"
|
|
||||||
booking = Booking.find_by_sale_id(sale_id)
|
|
||||||
booking.booking_orders.each do |order|
|
|
||||||
Order.pay_process_order_queue(order.order_id,booking.dining_facility_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
@@ -147,6 +140,13 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid",current_balance,card_data)
|
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid",current_balance,card_data)
|
||||||
|
|
||||||
|
if params[:type] == "quick_service"
|
||||||
|
booking = Booking.find_by_sale_id(sale_id)
|
||||||
|
booking.booking_orders.each do |order|
|
||||||
|
Order.pay_process_order_queue(order.order_id,booking.dining_facility_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
def modify_order
|
def modify_order
|
||||||
@menu = MenuCategory.all.active
|
@menu = MenuCategory.all.active
|
||||||
@table_id = params[:id]
|
@table_id = params[:id]
|
||||||
|
@sale_id = params[:sale_id]
|
||||||
@table = DiningFacility.find(@table_id)
|
@table = DiningFacility.find(@table_id)
|
||||||
@booking = @table.get_booking
|
@booking = @table.get_booking
|
||||||
if @booking
|
if @booking
|
||||||
@@ -39,6 +40,90 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
render "origami/addorders/detail"
|
render "origami/addorders/detail"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_modify_order
|
||||||
|
Rails.logger.debug "Order Source - " + params[:order_source].to_s
|
||||||
|
Rails.logger.debug "Table ID - " + params[:table_id].to_s
|
||||||
|
is_extra_time = false
|
||||||
|
extra_time = ''
|
||||||
|
|
||||||
|
items_arr = []
|
||||||
|
JSON.parse(params[:order_items]).each { |i|
|
||||||
|
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
||||||
|
if i["item_instance_code"].include? "ext"
|
||||||
|
is_extra_time = true
|
||||||
|
arr_exts = i["item_instance_code"].split("_")
|
||||||
|
if arr_exts[1].match(/^(\d)+$/)
|
||||||
|
time = arr_exts[1].to_i*60*i["quantity"].to_i
|
||||||
|
extra_time = Time.at(time)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if i["parent_order_item_id"]
|
||||||
|
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": i["options"]}
|
||||||
|
else
|
||||||
|
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}
|
||||||
|
end
|
||||||
|
items_arr.push(items)
|
||||||
|
}
|
||||||
|
|
||||||
|
# begin
|
||||||
|
@order = Order.new
|
||||||
|
@order.source = params[:order_source]
|
||||||
|
@order.order_type = params[:order_type]
|
||||||
|
@order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||||
|
@order.items = items_arr
|
||||||
|
@order.guest = params[:guest_info]
|
||||||
|
@order.table_id = params[:table_id] # 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
|
||||||
|
|
||||||
|
#Create Table Booking or Room Booking
|
||||||
|
if !params["booking_id"].nil?
|
||||||
|
# check booking id is already completed.
|
||||||
|
booking = Booking.find(params[:booking_id])
|
||||||
|
|
||||||
|
if booking
|
||||||
|
if booking.dining_facility_id.to_i == params[:table_id].to_i && booking.booking_status != 'moved'
|
||||||
|
if !booking.sale_id.nil?
|
||||||
|
sale_status = check_order_with_booking(booking)
|
||||||
|
if sale_status
|
||||||
|
return return_json_status_with_code(400, "bill requested")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = params[:booking_id]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
sale_status = check_order_with_table(params[:table_id])
|
||||||
|
if sale_status
|
||||||
|
return return_json_status_with_code(400, "bill requested")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end #booking exists
|
||||||
|
else
|
||||||
|
sale_status = check_order_with_table(params[:table_id])
|
||||||
|
if sale_status
|
||||||
|
# return false , @message = "bill requested"
|
||||||
|
return return_json_status_with_code(400, "bill requested")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@status, @booking = @order.generate
|
||||||
|
|
||||||
|
if @status && @booking && @order.source == 'quick_service'
|
||||||
|
if params[:sale_id]
|
||||||
|
@sale = Sale.find(params[:sale_id])
|
||||||
|
update = Sale.add_to_existing_pending_invoice(@order.table_id,params[:sale_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
result = {:status=> true, :data => @sale }
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def get_menu_category ()
|
def get_menu_category ()
|
||||||
if (params[:id])
|
if (params[:id])
|
||||||
puts params[:id]
|
puts params[:id]
|
||||||
@@ -66,4 +151,44 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
@product = Product.all
|
@product = Product.all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# render json for http status code
|
||||||
|
def return_json_status_with_code(code, msg)
|
||||||
|
render status: code, json: {
|
||||||
|
message: msg,
|
||||||
|
booking_id: booking_id
|
||||||
|
}.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
def check_order_with_table(table_id)
|
||||||
|
table = DiningFacility.find(table_id)
|
||||||
|
if table
|
||||||
|
booking = table.get_current_booking
|
||||||
|
# puts booking
|
||||||
|
if booking
|
||||||
|
if !booking.sale_id.nil?
|
||||||
|
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"
|
||||||
|
@order.new_booking = true
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = booking.booking_id
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# this can always true
|
||||||
|
def check_order_with_booking(booking)
|
||||||
|
if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new"
|
||||||
|
@order.new_booking = true
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
@order.new_booking = false
|
||||||
|
@order.booking_id = params[:booking_id]
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -305,29 +305,10 @@ class Order < ApplicationRecord
|
|||||||
#Process order items and send to order queue
|
#Process order items and send to order queue
|
||||||
def self.pay_process_order_queue(id,table_id)
|
def self.pay_process_order_queue(id,table_id)
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
|
|
||||||
cup_status = `#{"sudo service cups status"}`
|
|
||||||
print_status = check_cup_status(cup_status)
|
|
||||||
|
|
||||||
if print_status
|
|
||||||
OrderQueueProcessorJob.perform_later(id, table_id)
|
OrderQueueProcessorJob.perform_later(id, table_id)
|
||||||
else
|
|
||||||
cup_start = `#{"sudo service cups start"}`
|
|
||||||
cup_status = `#{"sudo service cups status"}`
|
|
||||||
print_status = check_cup_status(cup_status)
|
|
||||||
|
|
||||||
if print_status
|
|
||||||
OrderQueueProcessorJob.perform_later(id, table_id)
|
|
||||||
else
|
|
||||||
msg = ' Print Error ! Please contact to service'
|
|
||||||
ActionCable.server.broadcast "call_waiter_channel",table: msg,time:'print_error'
|
|
||||||
OrderQueueProcessorJob.perform_later(id, table_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.check_cup_status(status)
|
def check_cup_status(status)
|
||||||
if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running"
|
if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running"
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1232,6 +1232,50 @@ end
|
|||||||
query = query.where("sales.sale_status = 'new' AND orders.status = 'billed' AND orders.source =? ","quick_service")
|
query = query.where("sales.sale_status = 'new' AND orders.status = 'billed' AND orders.source =? ","quick_service")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.add_to_existing_pending_invoice(dining,sale_id)
|
||||||
|
puts sale_id
|
||||||
|
table = DiningFacility.find(dining)
|
||||||
|
existing_booking = Booking.find_by_sale_id(sale_id)
|
||||||
|
puts existing_booking.to_json
|
||||||
|
table.bookings.each do |booking|
|
||||||
|
# if !booking.checkout_at.nil?
|
||||||
|
# existing_booking.update_attributes(checkout_at: checkout_at)
|
||||||
|
# end
|
||||||
|
|
||||||
|
if booking.sale_id.nil?
|
||||||
|
puts booking.to_json
|
||||||
|
booking.booking_orders.each do |booking_order|
|
||||||
|
|
||||||
|
booking.booking_status = 'moved'
|
||||||
|
order = Order.find(booking_order.order_id)
|
||||||
|
order.status = 'billed'
|
||||||
|
order.order_items.each do |item|
|
||||||
|
item.order_item_status = 'billed'
|
||||||
|
end
|
||||||
|
# create sale item
|
||||||
|
saleobj = Sale.find(sale_id)
|
||||||
|
puts "saleobj"
|
||||||
|
puts saleobj.to_json
|
||||||
|
order.order_items.each do |orer_item|
|
||||||
|
saleobj.add_item (orer_item)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Re-compute for add
|
||||||
|
saleobj.compute
|
||||||
|
saleobj.save
|
||||||
|
order.save
|
||||||
|
booking.save
|
||||||
|
end
|
||||||
|
|
||||||
|
booking_order = BookingOrder.where('booking_id=?',booking)
|
||||||
|
booking_order.each do |bo|
|
||||||
|
bo.booking_id = existing_booking.booking_id
|
||||||
|
bo.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% if can? :index, :home %>
|
<% if can? :index, :home %>
|
||||||
<li>
|
<li>
|
||||||
<a href="<%= origami_root_path %>">
|
<a href="<%= origami_dashboard_path %>">
|
||||||
<i class="material-icons">monetization_on</i>
|
<i class="material-icons">monetization_on</i>
|
||||||
<span><%= t :origami %></span>
|
<span><%= t :origami %></span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -5,7 +5,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% type = request.path_info.include?('quick_service')%>
|
<% type = request.path_info.include?('quick_service')%>
|
||||||
|
<% modify_order = request.path_info.include?('modify_order')%>
|
||||||
<input type="hidden" name="type" id="type" value="<%=type%>">
|
<input type="hidden" name="type" id="type" value="<%=type%>">
|
||||||
|
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
|
||||||
<div class="row m-t--20">
|
<div class="row m-t--20">
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<ul class="nav nav-tabs flex-column" role="tablist" id="ul-navbar">
|
<ul class="nav nav-tabs flex-column" role="tablist" id="ul-navbar">
|
||||||
@@ -78,15 +80,20 @@
|
|||||||
<div class="col-md-6 col-lg-6 col-sm-12">
|
<div class="col-md-6 col-lg-6 col-sm-12">
|
||||||
<strong id="order-title" class="font-14">ORDER DETAILS </strong>
|
<strong id="order-title" class="font-14">ORDER DETAILS </strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 col-lg-2 col-sm-6">Table</div>
|
<% if modify_order %>
|
||||||
<div class="col-md-4 col-lg-4 col-sm-6 m-t--5">
|
<div class="col-md-6 col-lg-6 col-sm-6">Table : <%=@table.name%></div>
|
||||||
<a class="btn btn-block bg-blue waves-effect select_table" data-toggle="modal" data-target="#TableModal">Select</a>
|
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||||
<input type="hidden" name="table_id" value="" id="table_id">
|
<p class="hidden" id="table_type"><%=@table.type%></p>
|
||||||
<%if @booking_id %>
|
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
||||||
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
|
||||||
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
|
<p class="hidden" id="sale_id"><%=@sale_id%></p>
|
||||||
<%end%>
|
<% else%>
|
||||||
</div>
|
<div class="col-md-2 col-lg-2 col-sm-6">Table</div>
|
||||||
|
<div class="col-md-4 col-lg-4 col-sm-6 m-t--5">
|
||||||
|
<a class="btn btn-block bg-blue waves-effect select_table" data-toggle="modal" data-target="#TableModal">Select</a>
|
||||||
|
<input type="hidden" name="table_id" value="" id="table_id">
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div>
|
<div>
|
||||||
@@ -125,24 +132,13 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% if type %>
|
<% if type %>
|
||||||
<div class="row clearfix hidden">
|
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
|
||||||
<div class="col-md-4 ">
|
|
||||||
<strong id="order-title" class="font-14">Customer</strong>
|
<button type="button" class="btn btn-primary btn-block create" id="create_pay_order" disabled="disabled"><%if modify_order%>Update Order & Pay<%else%>Create Order & Pay<%end%></button>
|
||||||
</div>
|
|
||||||
<!-- <div class="col-md-3">Table -</div> -->
|
|
||||||
<div class="col-md-8">
|
|
||||||
<select class="form-control m-t--5" id="customer_id" name="customer_id" >
|
|
||||||
<option value="">Select Customer</option>
|
|
||||||
<% @customer.each do |cus| %>
|
|
||||||
<option <%=(cus.customer_id == 'CUS-000000000001')? 'selected':''%> value="<%= cus.customer_id %>"><%= cus.name %></option>
|
|
||||||
<%end %>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-primary btn-block create" id="create_pay_order" disabled="disabled">Create Order & Pay</button>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if !modify_order %>
|
||||||
<button type="button" class="btn btn-primary btn-block create m-t-5" id="create_order" disabled="disabled">Create Order</button>
|
<button type="button" class="btn btn-primary btn-block create m-t-5" id="create_order" disabled="disabled">Create Order</button>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -333,7 +329,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if type %>
|
<% if type && !modify_order%>
|
||||||
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
<!-- Column Three -->
|
<!-- Column Three -->
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<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>
|
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||||
<button type="button" id="addorder" class="btn bg-blue btn-block">Pay</button>
|
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
|
||||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -136,7 +136,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
$('#addorder').on('click', function () {
|
$('#addorder').on('click', function () {
|
||||||
var table_id = "<%=@table_id%>";
|
var table_id = "<%=@table_id%>";
|
||||||
window.location.href = '/origami/quick_service/modify_order/' + table_id;
|
window.location.href = '/origami/quick_service/modify_order/' + table_id+"/"+$('#sale_id').val();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -91,8 +91,9 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
get "quick_service/pending_order" => "pending_order#index"
|
get "quick_service/pending_order" => "pending_order#index"
|
||||||
get "quick_service/pending_order/:sale_id" => "pending_order#show"
|
get "quick_service/pending_order/:sale_id" => "pending_order#show"
|
||||||
|
|
||||||
get "quick_service/modify_order/:id" => "quick_service#modify_order"
|
get "quick_service/modify_order/:id/:sale_id" => "quick_service#modify_order"
|
||||||
# post '/:quick_service/create' => "quick_service#create", :defaults => { :format => 'json' }
|
post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' }
|
||||||
|
|
||||||
|
|
||||||
resources :cash_ins, only: [:new, :create]
|
resources :cash_ins, only: [:new, :create]
|
||||||
resources :cash_outs, only: [:new, :create]
|
resources :cash_outs, only: [:new, :create]
|
||||||
|
|||||||
Reference in New Issue
Block a user