Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -17,4 +17,5 @@
|
||||
//= require turbolinks
|
||||
//= require cable
|
||||
//= require jquery-ui
|
||||
//= require bootstrap-datepicker
|
||||
//= require bootstrap-datepicker
|
||||
//= require bootstrap/modal
|
||||
@@ -23,22 +23,45 @@ $(document).ready(function(){
|
||||
// window.location.reload(1);
|
||||
// }, 10000);
|
||||
|
||||
$('.queue_station').on('click',function(){
|
||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
||||
var orderItem=$(this).children().children().children('.order-item').text();
|
||||
var orderQty=$(this).children().children().children('.order-qty').text();
|
||||
var orderBy=$(this).children().children().children().children('.order-by').text();
|
||||
var orderAt=$(this).children().children().children().children('.order-at').text();
|
||||
var orderCustomer=$(this).children().children('.order-customer').text();
|
||||
$('.queue_station').on('click',function(){
|
||||
var orderZone=$(this).children().children().children('.order-zone').text().trim();
|
||||
// var orderItem=$(this).children().children().children('.order-item').text();
|
||||
//var assigned_item_id = $(this).children().find(".assigned-order-item").text();
|
||||
var orderQty = $(this).children().children().children('.order-qty').text();
|
||||
var orderBy = $(this).children().children().children().children('.order-by').text();
|
||||
var orderAt = $(this).children().children().children().children('.order-at').text();
|
||||
var orderCustomer = $(this).children().children('.order-customer').text();
|
||||
var order_status = $(this).children().children('.order-status').text();
|
||||
|
||||
$('#order-title').text("ORDER DETAILS - " + orderZone);
|
||||
$('#order-by').text(orderBy);
|
||||
$('#order-at').text(orderAt);
|
||||
$('#order-customer').text(orderCustomer);
|
||||
$('#order-from').text(orderZone);
|
||||
// clear order items
|
||||
$("#oqs-order-details-table").children("tbody").empty();
|
||||
|
||||
$('#order-items').text(orderItem);
|
||||
$('#order-qty').text(orderQty);
|
||||
// Call get_order_items() for Order Items by dining
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/' + orderZone,
|
||||
data: { 'status' : order_status },
|
||||
success: function(res){
|
||||
for (i = 0; i < res.length; i++) {
|
||||
var data = JSON.stringify(res[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
|
||||
var order_item_row = "<tr>" +
|
||||
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + "</td>" +
|
||||
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
|
||||
"</tr>";
|
||||
$("#oqs-order-details-table").children("tbody").append(order_item_row);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// $('#order-items').text(orderItem);
|
||||
// $('#order-qty').text(orderQty);
|
||||
|
||||
$('.queue_station').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
@@ -50,7 +73,8 @@ $(document).ready(function(){
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
|
||||
|
||||
// Call update_delivery_status() for changed delivery and move to delivery
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/update_delivery',
|
||||
@@ -85,6 +109,7 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Item
|
||||
$('#print_order_item').on('click',function(){
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'id':assigned_item_id };
|
||||
@@ -95,6 +120,7 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Summary
|
||||
$('#print_order_summary').on('click',function(){
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'id':assigned_item_id };
|
||||
|
||||
@@ -121,7 +121,7 @@ $(document).ready(function(){
|
||||
|
||||
// Bill Request
|
||||
$('#request_bills').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
var order_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/request_bills'
|
||||
}
|
||||
@@ -133,7 +133,8 @@ $(document).ready(function(){
|
||||
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
var order_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/discount'
|
||||
}
|
||||
@@ -148,7 +149,7 @@ $(document).ready(function(){
|
||||
$("#pay-discount").on('click', function(e){
|
||||
e.preventDefault();
|
||||
var sale_id = $('#sale-id').text();
|
||||
var sale_item_id = $('.selected-item').attr('id');
|
||||
var sale_item_id = $('.selected-item').attr('id').substr(0,16);
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var grand_total = $('#order-grand-total').text();
|
||||
var discount_type = $('#discount-type').val();
|
||||
@@ -178,7 +179,7 @@ $(document).ready(function(){
|
||||
|
||||
// Payment for Bill
|
||||
$('#pay-bill').click(function() {
|
||||
var sale_id=$(".selected-item").find(".orders-id").text();
|
||||
var sale_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if(sale_id!=""){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}
|
||||
@@ -190,7 +191,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$('#customer').click(function() {
|
||||
var sale = $(".selected-item").find(".orders-id").text();
|
||||
var sale = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if (sale.substring(0, 3)=="SAL") {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
@@ -202,7 +203,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
$('#re-print').click(function() {
|
||||
var sale_id = $(".selected-item").find(".orders-id").text();
|
||||
var sale_id = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
@import "theme";
|
||||
@import "jquery-ui";
|
||||
@import "bootstrap-datepicker3";
|
||||
@import "bootstrap/modal";
|
||||
|
||||
/* Show it is fixed to the top */
|
||||
// body {
|
||||
@@ -10,4 +11,15 @@
|
||||
// padding-top: 4.5rem;
|
||||
// }
|
||||
|
||||
.selected-item {
|
||||
color: #fff !important;
|
||||
background-color: #ccc !important;
|
||||
}
|
||||
|
||||
.assign {
|
||||
color: #fff !important;
|
||||
background-color: red;
|
||||
}
|
||||
.assign .text-muted{
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
@@ -15,29 +15,29 @@ class Api::BillController < Api::ApiController
|
||||
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee)
|
||||
else
|
||||
@status = true
|
||||
@sale_id = booking.sale_id
|
||||
end
|
||||
end
|
||||
elsif (params[:order_id])
|
||||
@sale = Sale.new
|
||||
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
|
||||
|
||||
end
|
||||
|
||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.where('customer_id=' + @sale.customer_id)
|
||||
customer= Customer.where('customer_id=' + @sale_data.customer_id)
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# find order id by sale id
|
||||
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||
|
||||
# Calculate Food and Beverage Total
|
||||
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale.sale_items)
|
||||
|
||||
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,@sale.sale_items,@sale,customer.name, food_total, beverage_total)
|
||||
|
||||
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
# format.json { render :index, status: :created, location: @crm_customers }
|
||||
else
|
||||
|
||||
@crm_customers.destroy
|
||||
# @crm_customers.destroy
|
||||
if params[:sale_id]
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
|
||||
else
|
||||
|
||||
@@ -4,7 +4,8 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
# GET /crm/dining_queues
|
||||
# GET /crm/dining_queues.json
|
||||
def index
|
||||
@dining_queues = DiningQueue.all
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
@dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? ", today).order("queue_no asc")
|
||||
end
|
||||
|
||||
# GET /crm/dining_queues/1
|
||||
@@ -38,7 +39,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_queue_no(print_settings,@dining_queue)
|
||||
|
||||
format.html { redirect_to crm_dining_queues_path, notice: 'Dining queue was successfully created.' }
|
||||
format.html { redirect_to crm_dining_queues_path, notice: 'Queue was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @dining_queue }
|
||||
else
|
||||
format.html { render :new }
|
||||
@@ -52,7 +53,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @dining_queue.update(dining_queue_params)
|
||||
format.html { redirect_to crm_dining_queues_path, notice: 'Dining queue was successfully updated.' }
|
||||
format.html { redirect_to crm_dining_queues_path, notice: 'Queue was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @dining_queue }
|
||||
else
|
||||
format.html { render :edit }
|
||||
@@ -71,6 +72,27 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
end
|
||||
end
|
||||
|
||||
def assign
|
||||
@queue = DiningQueue.find(params[:id])
|
||||
@tables = DiningFacility.where("status = 'available' ")
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
end
|
||||
end
|
||||
|
||||
def assign_table
|
||||
queue = DiningQueue.find(params[:id])
|
||||
table_id = params[:table_id]
|
||||
|
||||
queue.update_attributes(dining_facility_id: table_id,status:"Assign")
|
||||
DiningFacility.find(table_id).update_attributes(status: "occupied")
|
||||
respond_to do |format|
|
||||
format.html { redirect_to crm_dining_queues_path, notice: 'Table was successfully assigned.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_dining_queue
|
||||
@@ -79,6 +101,6 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def dining_queue_params
|
||||
params.require(:dining_queue).permit(:name, :contact_no, :queue_no)
|
||||
params.require(:dining_queue).permit(:name, :contact_no, :queue_no,:status)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,6 +22,44 @@ class Oqs::HomeController < BaseOqsController
|
||||
@queue_stations_items
|
||||
end
|
||||
|
||||
# Get Order items
|
||||
def get_order_items
|
||||
items = []
|
||||
table_name = params[:table_id]
|
||||
status = params[:status]
|
||||
dining = DiningFacility.find_by_name(table_name);
|
||||
# oqpz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
|
||||
# if status == ""
|
||||
# AssignedOrderItem.where("order_queue_station_id=#{ oqpz.order_queue_station_id } AND delivery_status=0").find_each do |aoi|
|
||||
# oi = OrderItem.find_by_item_code(aoi.item_code)
|
||||
# items.push(oi)
|
||||
# end
|
||||
# else
|
||||
# AssignedOrderItem.where("order_queue_station_id=#{ oqpz.order_queue_station_id } AND delivery_status=1").find_each do |aoi|
|
||||
# oi = OrderItem.find_by_item_code(aoi.item_code)
|
||||
# items.push(oi)
|
||||
# end
|
||||
# end
|
||||
|
||||
booking = Booking.find_by_dining_facility_id(dining.id)
|
||||
BookingOrder.where("booking_id='#{ booking.booking_id }'").find_each do |bo|
|
||||
order=Order.find(bo.order_id)
|
||||
order.order_items.each do |oi|
|
||||
items.push(oi)
|
||||
end
|
||||
end
|
||||
|
||||
# booking_id = dining.get_new_booking
|
||||
# BookingOrder.where("booking_id='#{ booking_id }'").find_each do |bo|
|
||||
# order=Order.find(bo.order_id);
|
||||
# order.order_items.each do |oi|
|
||||
# items.push(oi)
|
||||
# end
|
||||
# end
|
||||
|
||||
render :json => items.to_json
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
@@ -43,15 +81,25 @@ class Oqs::HomeController < BaseOqsController
|
||||
|
||||
# Query for OQS with status
|
||||
def queue_items_query(status)
|
||||
# AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
# .joins(" left join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id
|
||||
# left join dining_facilities as df on df.zone_id = oqpz.zone_id
|
||||
# left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id
|
||||
# left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
# left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
||||
# left join customers as cus ON cus.customer_id = od.customer_id")
|
||||
# .where("assigned_order_items.delivery_status = #{status}")
|
||||
# .group("assigned_order_items.assigned_order_item_id")
|
||||
# .order("odt.item_name DESC")
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
.joins("left join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id
|
||||
left join dining_facilities as df on df.zone_id = oqpz.zone_id
|
||||
left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
||||
left join customers as cus ON cus.customer_id = od.customer_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
left join customers as cus ON cus.customer_id = od.customer_id
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
.order("odt.item_name DESC")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,8 +37,9 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@order_details = OrderItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if is_ajax == 1
|
||||
render :json => str.to_json
|
||||
else
|
||||
|
||||
@@ -47,7 +47,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
@balance = 0.00
|
||||
@accountable_type = ''
|
||||
if response["data"]==true
|
||||
if response["status"]==true
|
||||
response["data"].each do |res|
|
||||
if res["accountable_type"] == "RebateAccount"
|
||||
@balance = res["balance"]
|
||||
|
||||
@@ -71,6 +71,11 @@ class Settings::OrderQueueStationsController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_order_queue_station_params
|
||||
# <<<<<<< HEAD
|
||||
params.require(:order_queue_station).permit(:station_name, :is_active, :auto_print, :processing_items, :print_copy, :printer_name, :font_size, :cut_per_item, :use_alternate_name, :created_by)
|
||||
# =======
|
||||
# Don't Know { zone_ids: [] }
|
||||
# params.require(:order_queue_station).permit(:station_name, :is_active, :processing_items, :print_copy, :printer_name, :font_size, :cut_per_item, :use_alternate_name, :created_by,{ zone_ids: [] })
|
||||
# >>>>>>> b093a993ba002c92659bbb34338c55c031c11d87
|
||||
end
|
||||
end
|
||||
|
||||
81
app/controllers/settings/rooms_controller.rb
Normal file
81
app/controllers/settings/rooms_controller.rb
Normal file
@@ -0,0 +1,81 @@
|
||||
class Settings::RoomsController < ApplicationController
|
||||
before_action :set_settings_room, only: [:show, :edit, :update, :destroy]
|
||||
before_action :set_settings_zone, only: [:index, :show, :edit, :new, :update,:create]
|
||||
# GET /settings/rooms
|
||||
# GET /settings/rooms.json
|
||||
def index
|
||||
@settings_rooms = @zone.rooms
|
||||
end
|
||||
|
||||
# GET /settings/rooms/1
|
||||
# GET /settings/rooms/1.json
|
||||
def show
|
||||
@room = Room.find(params[:id])
|
||||
end
|
||||
|
||||
# GET /settings/rooms/new
|
||||
def new
|
||||
@settings_room = Room.new
|
||||
end
|
||||
|
||||
# GET /settings/rooms/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/rooms
|
||||
# POST /settings/rooms.json
|
||||
def create
|
||||
@settings_room = Room.new(settings_room_params)
|
||||
@settings_room.type = DiningFacility::ROOM_TYPE
|
||||
@settings_room.zone_id = params[:zone_id]
|
||||
respond_to do |format|
|
||||
if @settings_room.save
|
||||
format.html { redirect_to settings_zone_rooms_path, notice: 'Room was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_room }
|
||||
else
|
||||
puts "abc"
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_room.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/rooms/1
|
||||
# PATCH/PUT /settings/rooms/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_room.update(settings_room_params)
|
||||
format.html { redirect_to settings_zone_rooms_path, notice: 'Room was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_room }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_room.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/rooms/1
|
||||
# DELETE /settings/rooms/1.json
|
||||
def destroy
|
||||
@settings_room.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_zones_path, notice: 'Room was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_room
|
||||
@settings_room = Room.find(params[:id])
|
||||
end
|
||||
|
||||
def set_settings_zone
|
||||
@zone = Zone.find(params[:zone_id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_room_params
|
||||
params.require(:room).permit(:name, :status, :seater, :order_by,:is_active ,:id, :zone_id, :created_by)
|
||||
end
|
||||
end
|
||||
81
app/controllers/settings/tables_controller.rb
Normal file
81
app/controllers/settings/tables_controller.rb
Normal file
@@ -0,0 +1,81 @@
|
||||
class Settings::TablesController < ApplicationController
|
||||
before_action :set_settings_table, only: [:show, :edit, :update, :destroy]
|
||||
before_action :set_settings_zone, only: [:index, :show, :edit, :new, :update,:create]
|
||||
# GET /settings/tables
|
||||
# GET /settings/tables.json
|
||||
def index
|
||||
@settings_tables = @zone.tables
|
||||
end
|
||||
|
||||
# GET /settings/tables/1
|
||||
# GET /settings/tables/1.json
|
||||
def show
|
||||
@table = Table.find(params[:id])
|
||||
end
|
||||
|
||||
# GET /settings/tables/new
|
||||
def new
|
||||
@settings_table = Table.new
|
||||
end
|
||||
|
||||
# GET /settings/tables/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /settings/tables
|
||||
# POST /settings/tables.json
|
||||
def create
|
||||
@settings_table = Table.new(settings_table_params)
|
||||
@settings_table.type = DiningFacility::TABLE_TYPE
|
||||
@settings_table.zone_id = params[:zone_id]
|
||||
respond_to do |format|
|
||||
if @settings_table.save
|
||||
format.html { redirect_to settings_zone_tables_path, notice: 'Table was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_table }
|
||||
else
|
||||
puts "abc"
|
||||
format.html { render :new }
|
||||
format.json { render json: @settings_table.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /settings/tables/1
|
||||
# PATCH/PUT /settings/tables/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_table.update(settings_table_params)
|
||||
format.html { redirect_to settings_zone_tables_path, notice: 'Table was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_table }
|
||||
else
|
||||
format.html { render :edit }
|
||||
format.json { render json: @settings_table.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /settings/tables/1
|
||||
# DELETE /settings/tables/1.json
|
||||
def destroy
|
||||
@settings_table.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_zones_path, notice: 'Table was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_table
|
||||
@settings_table = Table.find(params[:id])
|
||||
end
|
||||
|
||||
def set_settings_zone
|
||||
@zone = Zone.find(params[:zone_id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_table_params
|
||||
params.require(:table).permit(:name, :status, :seater, :order_by,:is_active ,:id, :zone_id, :created_by)
|
||||
end
|
||||
end
|
||||
@@ -10,6 +10,8 @@ class Settings::ZonesController < ApplicationController
|
||||
# GET /settings/zones/1
|
||||
# GET /settings/zones/1.json
|
||||
def show
|
||||
@settings_tables = @settings_zone.tables
|
||||
@settings_rooms = @settings_zone.rooms
|
||||
end
|
||||
|
||||
# GET /settings/zones/new
|
||||
@@ -28,7 +30,7 @@ class Settings::ZonesController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @settings_zone.save
|
||||
format.html { redirect_to @settings_zone, notice: 'Zone was successfully created.' }
|
||||
format.html { redirect_to settings_zone_path(@settings_zone), notice: 'Zone was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_zone }
|
||||
else
|
||||
format.html { render :new }
|
||||
@@ -42,7 +44,7 @@ class Settings::ZonesController < ApplicationController
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @settings_zone.update(settings_zone_params)
|
||||
format.html { redirect_to @settings_zone, notice: 'Zone was successfully updated.' }
|
||||
format.html { redirect_to settings_zone_path(@settings_zone), notice: 'Zone was successfully updated.' }
|
||||
format.json { render :show, status: :ok, location: @settings_zone }
|
||||
else
|
||||
format.html { render :edit }
|
||||
@@ -56,7 +58,7 @@ class Settings::ZonesController < ApplicationController
|
||||
def destroy
|
||||
@settings_zone.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_zones_url, notice: 'Zone was successfully destroyed.' }
|
||||
format.html { redirect_to settings_zones_path, notice: 'Zone was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
@@ -69,6 +71,6 @@ class Settings::ZonesController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_zone_params
|
||||
params.require(:settings_zone).permit(:name, :is_active, :created_by)
|
||||
params.require(:zone).permit(:name, :is_active, :created_by)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,28 +9,8 @@ class Customer < ApplicationRecord
|
||||
validates_presence_of :name, :contact_no, :email
|
||||
validates :contact_no, uniqueness: true
|
||||
validates :email, uniqueness: true
|
||||
|
||||
paginates_per 50
|
||||
|
||||
# def self.get_member_group
|
||||
|
||||
# membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
# memberaction = MembershipAction.find_by_membership_type("get_all_member_group")
|
||||
# app_token = membership.auth_token.to_s
|
||||
|
||||
# url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
# response = HTTParty.get(url,
|
||||
# :body => { app_token: app_token}.to_json,
|
||||
# :headers => {
|
||||
# 'Content-Type' => 'application/json',
|
||||
# 'Accept' => 'application/json'
|
||||
# }
|
||||
# )
|
||||
# puts response.body, response.code, response.message, response.headers.inspect
|
||||
|
||||
# return response;
|
||||
|
||||
# end
|
||||
paginates_per 50
|
||||
|
||||
def self.get_member_account(customer)
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
@@ -38,13 +18,19 @@ class Customer < ApplicationRecord
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
# urltest =self.url_exist?(url)
|
||||
|
||||
begin
|
||||
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
end
|
||||
|
||||
return response;
|
||||
|
||||
@@ -59,6 +45,35 @@ class Customer < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
# require "net/http"
|
||||
# def self.url_exist?(url_string)
|
||||
# url = URI.parse(url_string)
|
||||
|
||||
|
||||
# req = Net::HTTP.new(url.host, url.port)
|
||||
# puts "hhhhhhhhhhhh"
|
||||
# puts req.to_json
|
||||
# req.use_ssl = (url.scheme == 'https')
|
||||
# puts "aaaaaaaaaaaa"
|
||||
# puts req.use_ssl?
|
||||
# path = url.path if url.path.present?
|
||||
# puts "bbbbbbbbbbbbb"
|
||||
# puts path
|
||||
# res = req.request_head(path || '/')
|
||||
# puts "cccccccccccccc"
|
||||
# puts res.to_json
|
||||
# puts "ddddddddd"
|
||||
# puts res.kind_of?(Net::HTTPRedirection)
|
||||
# if res.kind_of?(Net::HTTPRedirection)
|
||||
# url_exist?(res['location']) # Go after any redirect and make sure you can access the redirected URL
|
||||
# else
|
||||
# ! %W(4 5).include?(res.code[0]) # Not from 4xx or 5xx families
|
||||
# end
|
||||
# rescue Errno::ENOENT
|
||||
# false #false if can't find the server
|
||||
# end
|
||||
|
||||
|
||||
# def self.search(search)
|
||||
# where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
|
||||
# end
|
||||
|
||||
@@ -9,8 +9,24 @@ class DiningFacility < ApplicationRecord
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def get_current_booking
|
||||
puts "enter booking"
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
puts "enter booking"
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
|
||||
if booking.count > 0 then
|
||||
return booking[0].booking_id
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
def get_new_booking
|
||||
# query for new
|
||||
# if status
|
||||
# to ask when req bill booking_status?
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and sale_id is null and checkout_at is null").limit(1)
|
||||
# else
|
||||
# booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and sale_id not null").limit(1)
|
||||
# end
|
||||
|
||||
if booking.count > 0 then
|
||||
return booking[0].booking_id
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
class DiningQueue < ApplicationRecord
|
||||
|
||||
belongs_to :dining_facility, :optional => true
|
||||
def self.generate_queue_no
|
||||
queue_no = DiningQueue.all.count + 1
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? ", today).order("queue_no desc")
|
||||
queue_no = dining_queues.count + 1
|
||||
return queue_no
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -6,6 +6,9 @@ class Employee < ApplicationRecord
|
||||
validates :emp_id, uniqueness: true, numericality: true, length: {in: 1..4}, allow_blank: true
|
||||
validates :password, numericality: true, length: {in: 3..9}, allow_blank: true
|
||||
|
||||
def self.collection
|
||||
Employee.select("id, name").map { |e| [e.name, e.id] }
|
||||
end
|
||||
|
||||
def self.login(emp_id, password)
|
||||
user = Employee.find_by_emp_id(emp_id)
|
||||
|
||||
@@ -246,7 +246,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("sales.sale_status='completed'")
|
||||
.group("sales.sale_id,bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
||||
.group("sales.sale_id")
|
||||
# For PG
|
||||
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||
end
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
class OrderQueueStation < ApplicationRecord
|
||||
has_many :assigned_order_items
|
||||
has_many :order_items
|
||||
has_many :order_queue_process_by_zones
|
||||
has_many :zones, through: :order_queue_process_by_zones
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
@@ -18,19 +20,19 @@ class OrderQueueStation < ApplicationRecord
|
||||
oqs_stations.each do |oqs|
|
||||
#Get List of items -
|
||||
pq_items = JSON.parse(oqs.processing_items)
|
||||
|
||||
if oqs.id == oqpbz.order_queue_station_id
|
||||
|
||||
#Loop through the processing items
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
if (pq_item == order_item.item_code)
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
if (pq_item == order_item.item_code)
|
||||
if oqs.id == oqpbz.order_queue_station_id
|
||||
#Same Order_items can appear in two location.
|
||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||
end
|
||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#Print OQS where printing is require
|
||||
|
||||
@@ -23,6 +23,8 @@ class Sale < ApplicationRecord
|
||||
if (booking)
|
||||
Rails.logger.debug "Booking -> Booking Order Count -> " + booking.booking_orders.count.to_s
|
||||
#get all order attached to this booking and combine into 1 invoice
|
||||
|
||||
puts booking.booking_orders.length
|
||||
booking.booking_orders.each do |order|
|
||||
if booking.sale_id
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
||||
@@ -199,7 +201,7 @@ class Sale < ApplicationRecord
|
||||
#tax_profile - list by order_by
|
||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||
|
||||
#Creat new tax records
|
||||
# #Creat new tax records
|
||||
tax_profiles.each do |tax|
|
||||
sale_tax = SaleTax.new(:sale => self)
|
||||
sale_tax.tax_name = tax.name
|
||||
|
||||
@@ -30,6 +30,7 @@ class SaleItem < ApplicationRecord
|
||||
# end
|
||||
end
|
||||
|
||||
# Calculate food total and beverage total
|
||||
def self.calculate_food_beverage(sale_items)
|
||||
food_prices=0
|
||||
beverage_prices=0
|
||||
@@ -43,6 +44,7 @@ class SaleItem < ApplicationRecord
|
||||
return food_prices, beverage_prices
|
||||
end
|
||||
|
||||
# get food price or beverage price for item
|
||||
def self.get_price(sale_item_id)
|
||||
food_price=0
|
||||
beverage_price=0
|
||||
|
||||
@@ -260,12 +260,17 @@ class SalePayment < ApplicationRecord
|
||||
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id,
|
||||
|
||||
begin
|
||||
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id,
|
||||
receipt_no: receipt_no,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
})
|
||||
}, :timeout => 10)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
end
|
||||
|
||||
puts response.to_json
|
||||
end
|
||||
|
||||
@@ -2,7 +2,12 @@ class Zone < ApplicationRecord
|
||||
# model association
|
||||
has_many :tables, dependent: :destroy
|
||||
has_many :rooms, dependent: :destroy
|
||||
has_many :order_queue_stations
|
||||
|
||||
# validations
|
||||
validates_presence_of :name, :created_by
|
||||
|
||||
def self.collection
|
||||
Zone.select("id, name").map { |e| [e.name, e.id] }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -119,9 +119,9 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
pad_top(15) {
|
||||
text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
text_box "#{price.to_i}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{total_price.to_i}", :at =>[(item_name_width),y_position], :width =>self.total_width+5, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{qty}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{total_price}", :at =>[(item_name_width),y_position], :width =>self.total_width+5, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
move_down 3
|
||||
end
|
||||
@@ -172,7 +172,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "( " +"#{ st.tax_payable_amount }" +" )" , :size => self.item_font_size,:align => :right
|
||||
text "#{ st.tax_payable_amount }" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
<%= f.button :submit,"Create Queue" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
44
app/views/crm/dining_queues/assign.html.erb
Normal file
44
app/views/crm/dining_queues/assign.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= crm_dining_queues_path %>">Queue</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<%= form_tag crm_assign_table_path, :method => :post do %>
|
||||
<input type="hidden" name="id" value="<%=@queue.id%>">
|
||||
<div class="form-group">
|
||||
<label>Queue No</label>
|
||||
<input type="text" name="queue" class="form-control" readonly="true" value="<%=@queue.queue_no%>">
|
||||
|
||||
</div>
|
||||
<div class="form-inputs">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Select Table</label>
|
||||
<select class="selectpicker form-control col-md-12" name="table_id" style="height: 40px" >
|
||||
<% @tables.each do |table| %>
|
||||
<option value="<%= table.id %>">
|
||||
<%= table.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-default">Assign Table</button>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,38 +1,69 @@
|
||||
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Queue</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_crm_dining_queue_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Queue</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_crm_dining_queue_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:25%">Name</th>
|
||||
<th style="width:25%">Contact No</th>
|
||||
<th style="width:25%">Queue No</th>
|
||||
<th style="width:25%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div class="row">
|
||||
<div class="col-lg-11 col-md-11 col-sm-11" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
|
||||
<div class="row">
|
||||
<% @i = 0 %> .
|
||||
<% @dining_queues.each do |queue| %>
|
||||
<div class="col-md-3 ">
|
||||
<div class="card select-queue <%= !queue.status.nil? ? "assign" : ""%>" style="border:1px solid #ccc;margin-bottom: 10px ">
|
||||
<div class="card-block">
|
||||
<p class="hidden queue-id"><%= queue.id %></p>
|
||||
<p class="hidden queue-status"><%= queue.status %></p>
|
||||
<h4 class="card-title"><%= @i += 1 %> . Queue No </h4>
|
||||
<h1 style="text-align: center"><%= queue.queue_no %></h1>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Name : <%= queue.name %></small> <br>
|
||||
<small class="text-muted">Contact : <%= queue.contact_no %></small>
|
||||
<br>
|
||||
<small class="text-muted">Status : <%= queue.status rescue '-' %></small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" id="assign" class="btn btn-primary btn-lg btn-block" disabled>Assign</button>
|
||||
|
||||
</div>
|
||||
|
||||
<tbody>
|
||||
<% @dining_queues.each do |dining_queue| %>
|
||||
<tr>
|
||||
<td><%= dining_queue.name %></td>
|
||||
<td><%= dining_queue.contact_no %></td>
|
||||
<td><%= dining_queue.queue_no %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_crm_dining_queue_path(dining_queue) %> | <%= link_to 'Destroy', crm_dining_queue_path(dining_queue), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$(".select-queue").on("click", function(){
|
||||
$('.select-queue').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var status = $(this).find(".queue-status").text();
|
||||
if(status != "Assign"){
|
||||
$("#assign").removeAttr("disabled");
|
||||
}else{
|
||||
$("#assign").addAttr("disabled");
|
||||
}
|
||||
$("#assign").val($(this).find(".queue-id").text());
|
||||
}); //End Click
|
||||
|
||||
|
||||
});
|
||||
$('#assign').click(function() {
|
||||
var id = $(this).val();
|
||||
window.location.href = "dining_queues/"+id + "/assign"
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -14,6 +14,7 @@
|
||||
<li><%= link_to "Menu Item Options",settings_menu_item_options_path, :tabindex =>"-1" %></li>
|
||||
<hr>
|
||||
<li><%= link_to "Order Queue Stations",settings_order_queue_stations_path, :tabindex =>"-1" %></li>
|
||||
<li><%= link_to "Zones", settings_zones_path, :tabindex =>"-1" %></li>
|
||||
<hr>
|
||||
<li><%= link_to "Cashier Terminals ", settings_cashier_terminals_path, :tabindex =>"-1" %></li>
|
||||
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<p class="hidden order-status">completed</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
@@ -133,7 +134,7 @@
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS -</strong></div>
|
||||
<div><strong id="order-title">ORDER DETAILS - Table</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
@@ -159,7 +160,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow:auto">
|
||||
<table class="table">
|
||||
<table class="table" id="oqs-order-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
@@ -167,17 +168,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="order-items" style="width:80%; text-align:left">
|
||||
<!-- Menu Items Name <br/>
|
||||
Less Sweet, No MSG -->
|
||||
</td>
|
||||
<td id="order-qty" style="width:20%; text-align:right">
|
||||
<!-- 5 -->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- Bind With JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -354,17 +354,17 @@
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount">
|
||||
|
||||
<!-- <tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
|
||||
</tr> -->
|
||||
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<tr>
|
||||
<td style='text-align:center;'><%= sale.receipt_date.strftime("#{sale.receipt_date.day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='text-align:center;'><%=sale.receipt_no.to_s rescue ''%></td>
|
||||
<td style='text-align:center;'><%=sale.cashier_id rescue ''%></td>
|
||||
<td style='text-align:center;'><%=Employee.find(sale.cashier_id).name rescue ''%></td>
|
||||
<td style='text-align:center;'><%= number_with_delimiter(sprintf("%.2f",sale.total_amount.to_f), :delimiter => ',') %></td>
|
||||
<td style='text-align:center;'><%= number_with_delimiter(sprintf("%.2f",sale.total_discount.to_f), :delimiter => ',') %></td>
|
||||
<td style='text-align:center;'><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %></td>
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
<style type="text/css">
|
||||
div.form-inputs span{
|
||||
padding: 1%;
|
||||
}
|
||||
</style>
|
||||
<%= simple_form_for([:settings,@settings_order_queue_station]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
@@ -8,6 +13,8 @@
|
||||
<%= f.input :printer_name %>
|
||||
<%= f.input :font_size %>
|
||||
<%= f.input :print_copy %>
|
||||
<%= f.label "Select Zones", :class => 'control-label' %>
|
||||
<%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'ta'%>
|
||||
<%= f.input :cut_per_item %>
|
||||
<%= f.input :use_alternate_name %>
|
||||
<%= f.input :processing_items, as: :hidden %>
|
||||
|
||||
16
app/views/settings/rooms/_form.html.erb
Normal file
16
app/views/settings/rooms/_form.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<%= simple_form_for([:settings,@zone,@settings_room]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :status %>
|
||||
<%= f.input :seater %>
|
||||
<%= f.input :order_by %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :created_by, :collection => Employee.collection %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
2
app/views/settings/rooms/_settings_room.json.jbuilder
Normal file
2
app/views/settings/rooms/_settings_room.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_table, :id, :name, :status, :seater, :order_by, :is_active, :created_by, :created_at, :updated_at
|
||||
json.url settings_table_url(settings_room, format: :json)
|
||||
10
app/views/settings/rooms/edit.html.erb
Normal file
10
app/views/settings/rooms/edit.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_rooms_path %>">Rooms</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_table: @settings_room %>
|
||||
</div>
|
||||
51
app/views/settings/rooms/index.html.erb
Normal file
51
app/views/settings/rooms/index.html.erb
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li>Rooms</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_zone_room_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Type</th>
|
||||
<th>Seater</th>
|
||||
<th>Order by</th>
|
||||
<th>is Active</th>
|
||||
<th>Created By</th>
|
||||
<th>Created At</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_rooms.each do |room| %>
|
||||
<tr>
|
||||
<td><%= link_to room.name, settings_menu_path(room) %></td>
|
||||
<td><%= room.status %></td>
|
||||
<td>Room</td>
|
||||
<td><%= room.seater rescue "-" %></td>
|
||||
<td><%= room.order_by rescue "-" %></td>
|
||||
<td><%= room.is_active %></td>
|
||||
<% if Employee.exists?(room.created_by) %>
|
||||
<td><%= Employee.find(room.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= room.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= room.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_room_path(@zone,room) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_room_path(@zone,room), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
11
app/views/settings/rooms/new.html.erb
Normal file
11
app/views/settings/rooms/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_table: @settings_room %>
|
||||
</div>
|
||||
49
app/views/settings/rooms/show.html.erb
Normal file
49
app/views/settings/rooms/show.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_rooms_path %>">Rooms</a></li>
|
||||
<li>Details</li>
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Room</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Room</th>
|
||||
<th>Seater</th>
|
||||
<th>Order by</th>
|
||||
<th>is Active</th>
|
||||
<th>Created By</th>
|
||||
<th>Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= link_to @room.name, settings_menu_path(@room) %></td>
|
||||
<td><%= @room.status %></td>
|
||||
<td>Room</td>
|
||||
<td><%= @room.seater rescue "-" %></td>
|
||||
<td><%= @room.order_by rescue "-" %></td>
|
||||
<td><%= @room.is_active rescue "-" %></td>
|
||||
<% if Employee.exists?(@room.created_by) %>
|
||||
<td><%= Employee.find(@room.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= @room.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= @room.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_room_path(@zone,@room) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_room_path(@zone,@room), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
16
app/views/settings/tables/_form.html.erb
Normal file
16
app/views/settings/tables/_form.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<%= simple_form_for([:settings,@zone,@settings_table]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :status %>
|
||||
<%= f.input :seater %>
|
||||
<%= f.input :order_by %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :created_by, :collection => Employee.collection %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
2
app/views/settings/tables/_settings_table.json.jbuilder
Normal file
2
app/views/settings/tables/_settings_table.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_table, :id, :name, :status, :seater, :order_by, :is_active, :created_by, :created_at, :updated_at
|
||||
json.url settings_table_url(settings_table, format: :json)
|
||||
10
app/views/settings/tables/edit.html.erb
Normal file
10
app/views/settings/tables/edit.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_tables_path %>">Tables</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_table: @settings_table %>
|
||||
</div>
|
||||
49
app/views/settings/tables/index.html.erb
Normal file
49
app/views/settings/tables/index.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li>Tables</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_zone_table_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Seater</th>
|
||||
<th>Order by</th>
|
||||
<th>is Active</th>
|
||||
<th>Created By</th>
|
||||
<th>Created At</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_tables.each do |table| %>
|
||||
<tr>
|
||||
<td><%= link_to table.name, settings_menu_path(table) %></td>
|
||||
<td><%= table.status %></td>
|
||||
<td><%= table.seater rescue "-" %></td>
|
||||
<td><%= table.order_by rescue "-" %></td>
|
||||
<td><%= table.is_active %></td>
|
||||
<% if Employee.exists?(table.created_by) %>
|
||||
<td><%= Employee.find(table.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= table.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_table_path(@zone,table) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_table_path(@zone,table), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
11
app/views/settings/tables/new.html.erb
Normal file
11
app/views/settings/tables/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_table: @settings_table %>
|
||||
</div>
|
||||
47
app/views/settings/tables/show.html.erb
Normal file
47
app/views/settings/tables/show.html.erb
Normal file
@@ -0,0 +1,47 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_tables_path %>">Tables</a></li>
|
||||
<li>Details</li>
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Table</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Seater</th>
|
||||
<th>Order by</th>
|
||||
<th>is Active</th>
|
||||
<th>Created By</th>
|
||||
<th>Created At</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= link_to @table.name, settings_menu_path(@table) %></td>
|
||||
<td><%= @table.status %></td>
|
||||
<td><%= @table.seater rescue "-" %></td>
|
||||
<td><%= @table.order_by rescue "-" %></td>
|
||||
<td><%= @table.is_active rescue "-" %></td>
|
||||
<% if Employee.exists?(@table.created_by) %>
|
||||
<td><%= Employee.find(@table.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= @table.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= @table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_table_path(@zone,@table) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_table_path(@zone,@table), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,10 +1,10 @@
|
||||
<%= simple_form_for(@settings_zone) do |f| %>
|
||||
<%= simple_form_for([:settings,@settings_zone]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :is_active %>
|
||||
<%= f.input :created_by %>
|
||||
<%= f.input :created_by, :collection => Employee.collection %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<h1>Editing Settings Zone</h1>
|
||||
|
||||
<%= render 'form', settings_zone: @settings_zone %>
|
||||
|
||||
<%= link_to 'Show', @settings_zone %> |
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zones_path %>">Zones</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_zone: @settings_zone %>
|
||||
</div>
|
||||
|
||||
@@ -1,31 +1,41 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Settings Zones</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Is active</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_zones.each do |settings_zone| %>
|
||||
<tr>
|
||||
<td><%= settings_zone.name %></td>
|
||||
<td><%= settings_zone.is_active %></td>
|
||||
<td><%= settings_zone.created_by %></td>
|
||||
<td><%= link_to 'Show', settings_zone %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li>Zones</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_zone_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Is active</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<%= link_to 'New Settings Zone', new_settings_zone_path %>
|
||||
<tbody>
|
||||
<% @settings_zones.each do |settings_zone| %>
|
||||
<tr>
|
||||
<td><%= settings_zone.name %></td>
|
||||
<td><%= settings_zone.is_active %></td>
|
||||
<% if Employee.exists?(settings_zone.created_by) %>
|
||||
<td><%= Employee.find(settings_zone.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= settings_zone.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= link_to 'Show', settings_zone_path(settings_zone) %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_path(settings_zone), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,97 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zones_path %>">Zones</a></li>
|
||||
<li>Details</li>
|
||||
<span style="float: right">
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @settings_zone.name %>
|
||||
</p>
|
||||
<br/>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Zone</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Is active</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<p>
|
||||
<strong>Is active:</strong>
|
||||
<%= @settings_zone.is_active %>
|
||||
</p>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @settings_zone.name %></td>
|
||||
<td><%= @settings_zone.is_active %></td>
|
||||
<% if Employee.exists?(@settings_zone.created_by) %>
|
||||
<td><%= Employee.find(@settings_zone.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= @settings_zone.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %></td>
|
||||
<td><%= link_to 'Destroy', settings_zone_path(@settings_zone), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Dining Facilities
|
||||
<span style="float: right">
|
||||
<%= link_to "New Table",new_settings_zone_table_path(@settings_zone),:class => 'btn btn-primary btn-sm' %>
|
||||
<%= link_to "New Room",new_settings_zone_room_path(@settings_zone),:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Seater</th>
|
||||
<th>Is active</th>
|
||||
<th>Created by</th>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<p>
|
||||
<strong>Created by:</strong>
|
||||
<%= @settings_zone.created_by %>
|
||||
</p>
|
||||
|
||||
<%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %> |
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
<tbody>
|
||||
<% @settings_tables.each do |settings_table|%>
|
||||
<tr>
|
||||
<td><%= link_to settings_table.name, settings_zone_table_path(@settings_zone,settings_table) %></td>
|
||||
<td>Table</td>
|
||||
<td><%= settings_table.seater %></td>
|
||||
<td><%= settings_table.is_active %></td>
|
||||
<% if Employee.exists?(settings_table.created_by) %>
|
||||
<td><%= Employee.find(settings_table.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= settings_table.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= settings_table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_table_path(@settings_zone, settings_table) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% @settings_rooms.each do |room|%>
|
||||
<tr>
|
||||
<td><%= link_to room.name, settings_zone_room_path(@settings_zone,room) %></td>
|
||||
<td>Room</td>
|
||||
<td><%= room.seater %></td>
|
||||
<td><%= room.is_active %></td>
|
||||
<% if Employee.exists?(room.created_by) %>
|
||||
<td><%= Employee.find(room.created_by).name %></td>
|
||||
<% else %>
|
||||
<td><%= room.created_by %></td>
|
||||
<% end %>
|
||||
<td><%= room.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= link_to 'Edit', edit_settings_zone_room_path(@settings_zone, room) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -124,11 +124,15 @@ Rails.application.routes.draw do
|
||||
post "update_booking" , to: "bookings#update_booking", as: "update_booking"#assign and cancel
|
||||
get '/print/:id', to: "home#print_order"#print order for crm
|
||||
|
||||
get "/dining_queues/:id/assign" =>"dining_queues#assign", :as => "assign"
|
||||
post "/dining_queues/assign_table" =>"dining_queues#assign_table", :as => "assign_table"
|
||||
|
||||
end
|
||||
|
||||
#--------- Order Queue Station ------------#
|
||||
namespace :oqs do
|
||||
root "home#index"
|
||||
get "/:table_id", to: "home#get_order_items"
|
||||
|
||||
post 'update_delivery', to: "home#update_delivery_status"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ class CreateDiningFacilities < ActiveRecord::Migration[5.1]
|
||||
t.references :zone, foreign_key: true
|
||||
t.string :name, :null => false
|
||||
t.string :status, :null => false, :default => "available"
|
||||
t.string :type, :null => false, :default => "table"
|
||||
t.string :type, :null => false, :default => "Table"
|
||||
t.integer :seater, :null => false, :default => 2
|
||||
t.integer :order_by
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ class CreateDiningQueues < ActiveRecord::Migration[5.1]
|
||||
t.string :contact_no
|
||||
t.string :queue_no
|
||||
t.string :status
|
||||
t.references :dining_facility, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
Reference in New Issue
Block a user