app order

This commit is contained in:
Myat Zin Wai Maw
2019-12-02 17:48:36 +06:30
parent cac6994ccb
commit 600d3973cd
4 changed files with 14 additions and 12 deletions

View File

@@ -1060,7 +1060,8 @@ $(function() {
window.location.href = '/origami/'+type+'/pending_order/' + $('#sale_id').text();
}else{
if(result.current_user_role == 'foodcourt_cashier'){
window.location.href = "/foodcourt/sale/"+result.data["sale_id"]+"/"+type+"/payment"; }
window.location.href = "/foodcourt/sale/"+result.data["sale_id"]+"/"+type+"/payment";
}
else{
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment";
}

View File

@@ -91,6 +91,9 @@ class Foodcourt::OrdersController < BaseFoodcourtController
.where("orders.source='app' and bookings.shop_code='#{@shop.shop_code}'").order("created_at desc")
end
def app_order_by_booking
@order_items = OrderItems.joins("JOIN orders ON orders.order_id=order_items.order_id")
.joins("JOIN booking_orders ON booking_orders.order_id=orders.order_id")
.where("orders.source='app' and booking_orders.booking_id='#{params[:booking_id]}'").order("created_at desc")
end
end

View File

@@ -104,7 +104,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
end
#orders print out
if type == "quick_service"
# if type == "quick_service"
booking = Booking.find_by_sale_id(sale_id)
if booking.dining_facility_id.to_i>0
table_id = booking.dining_facility_id
@@ -127,7 +127,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order,from:from
end
end
# end
#for card sale data
card_data = Array.new

View File

@@ -3,15 +3,13 @@
<div id="oqs_loading"></div>
</div>
<div class="row m-t--20">
<div class="col-md-9 col-lg-9 col-sm-12 m-t-10">
</div>
<div class="col-md-3 col-lg-3 col-sm-12 m-t-10">
<div class="card-header" style="padding: 0.12rem 0.25rem">
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<div class="col-md-9 col-lg-9 col-sm-9 m-t-10" >
<div class="card">
<div class="card-block" style="">
<div class="card-text" id="custom-slimscroll">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>