major fix taxable price for sale and other sale and oqs
This commit is contained in:
@@ -67,7 +67,7 @@ $(document).on('turbolinks:load', function() {
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
|
||||
row ='<div class="card queue_station animated " data-date="'+data[field]["order_id"]+'">'
|
||||
row ='<div class="card queue_station animated " data-order-no="'+data[field]["order_id"]+'">'
|
||||
+'<div class="card-block">'
|
||||
+'<div class="row">'
|
||||
+'<span class="col-md-4 order-zone-type font-13">'+data[field]["table_type"]+'-'+ data[field]["zone"] +'</span>'
|
||||
@@ -109,6 +109,7 @@ $(document).on('turbolinks:load', function() {
|
||||
}
|
||||
|
||||
$(document).on('click', '.queue_station', function(event){
|
||||
var orderNo = $(this).attr('data-order-no');
|
||||
var orderZone=$(this).children().children().children('.order-zone').text().trim();
|
||||
var orderZoneType=$(this).children().children().children('.order-zone-type').text().trim();
|
||||
// var orderItem=$(this).children().children().children('.order-item').text();
|
||||
@@ -129,7 +130,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// Call get_order_items() for Order Items by dining
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/' + orderZone,
|
||||
url: '/oqs/' + orderNo,
|
||||
data: { 'status' : order_status },
|
||||
success: function(res){
|
||||
|
||||
@@ -231,6 +232,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// Print Order Summary
|
||||
// $('#print_order_summary').on('click',function(){
|
||||
$(document).on('click', '#print_order_summary', function(event){
|
||||
var orderNo = $('.selected-item').attr('data-order-no');
|
||||
var table_name=$('.selected-item').children().children().children('.order-zone').text().trim();
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'table_name':table_name };
|
||||
|
||||
@@ -115,236 +115,3 @@ function export_to(path)
|
||||
var form_params = $("#frm_report").serialize();
|
||||
window.location = path+"?"+ form_params;
|
||||
}
|
||||
|
||||
/*Oqs Js file */
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$(".nav-completed").on("click", function(){
|
||||
$("#completed").removeClass('hide')
|
||||
$(".oqs_append").addClass('hide')
|
||||
});
|
||||
|
||||
$(".oqs_click").on("click", function(){
|
||||
$(".oqs_click").removeClass('oqs_active');
|
||||
$(".queue_station").removeClass('queue_station_box');
|
||||
$("#completed").addClass('hide');
|
||||
$(".oqs_append").removeClass('hide');
|
||||
$(this).addClass('oqs_active');
|
||||
$(".queue_station").addClass('queue_station_box');
|
||||
var oqs_id = $(this).find(".oqs-id").text();
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
show_details(url);
|
||||
|
||||
}); //End Click
|
||||
|
||||
function show_details(url){
|
||||
var oqs_append = $('.oqs_append');
|
||||
oqs_append.empty();
|
||||
var filter = $('.filter').text();
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {'filter':filter},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
for(var field in data) {
|
||||
var price = parseFloat(data[field].price).toFixed(2);
|
||||
|
||||
if (data[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = data.options;
|
||||
}
|
||||
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
|
||||
row ='<div class="card queue_station" data-date="'+data[field]["order_id"]+'">'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
+'<span class="order-zone-type">'+data[field]["table_type"]+'- </span>'
|
||||
+'<span class="order-zone">'+ data[field]["zone"] +'</span>'
|
||||
+'<small class="pull-right">'+ data[field]["order_id"] +'- </small>'
|
||||
+'</h4>'
|
||||
|
||||
+'<h4>'
|
||||
+'<span class="order-item">'+ data[field]["item_name"] +'- </span>'
|
||||
+'<span class="order-qty">'+ data[field]["qty"] +'- </span>'
|
||||
+'</h4>'
|
||||
|
||||
+'<p class="card-text item-options">'+ options +'</p>'
|
||||
|
||||
+'<p class="card-text">'
|
||||
+'<small class="text-muted">Order at'
|
||||
+'<span class="order-at">'+ show_date +'</span> - '
|
||||
|
||||
+'<span class="order-by">'+ data[field]["item_order_by"] +'</span> '
|
||||
+'</small> '
|
||||
+'</p>'
|
||||
|
||||
+'<p class="hidden order-customer">'+ data[field]["customer_name"] +'</p> '
|
||||
+'<p class="hidden assigned-order-item">'+ data[field]["assigned_order_item_id"] +'</p> '
|
||||
+'</div>'
|
||||
|
||||
+'<div class="card-footer">'
|
||||
+'<button id="edit_'+ data[field]["assigned_order_item_id"]+'" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+' <button id="assigned_queue_' + data[field]["assigned_order_item_id"] +'" class="btn btn-primary order-item order-complete">COMPLETE</button>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>';
|
||||
|
||||
|
||||
|
||||
$('.oqs_append').append(row);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '.queue_station', function(event){
|
||||
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();
|
||||
// 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');
|
||||
});
|
||||
|
||||
$(document).on('click', '.order-item-edit', function(event){
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(5);
|
||||
window.location.href = '/oqs/'+ assigned_item_id + "/edit"
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
|
||||
$(document).on('click', '.order-complete', function(event){
|
||||
//e.preventDefault();
|
||||
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',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
for (i = 0; i < data.length; i++) {
|
||||
var queue_station = $('#assigned_queue_' + data[i]).parent().parent(".queue_station");
|
||||
var station = queue_station.parent().parent().attr('id');
|
||||
|
||||
// Remove a queue card from current station
|
||||
queue_station.remove();
|
||||
|
||||
// Remove a queue card from current station
|
||||
queue_station.children('.card-footer').remove();
|
||||
|
||||
// Add removed queue card from station to completed
|
||||
$("#completed").children('.card-columns').append(queue_station);
|
||||
|
||||
// update queue item count in each station
|
||||
var station_count=parseInt($("#"+station+"_count").text()) - 1;
|
||||
$("#"+station+"_count").text(station_count);
|
||||
}
|
||||
|
||||
// update queue item count in completed station
|
||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||
|
||||
alert("updated!");
|
||||
// Page reload
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Item
|
||||
$(document).on('click', '#print_order_item', function(event){
|
||||
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
||||
var params = { 'options':options };
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
// Print Order Summary
|
||||
// $('#print_order_summary').on('click',function(){
|
||||
$(document).on('click', '#print_order_summary', function(event){
|
||||
var table_name=$('.selected-item').children().children().children('.order-zone').text().trim();
|
||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var params = { 'table_name':table_name };
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||
data: params,
|
||||
success: function(data){ }
|
||||
});
|
||||
});
|
||||
|
||||
// Qty update for OQS Edit Controller
|
||||
$('#qty-update').on('click', function(){
|
||||
var qty_weight = $("input[name='qty_weight']").val();
|
||||
var remarks = $("textarea[name='remarks']").val();
|
||||
var order_items_id = $(this).attr('data-id');
|
||||
var params = { 'order_items_id': order_items_id, 'qty_weight': qty_weight, 'remarks': remarks }
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/' + order_items_id,
|
||||
data: params,
|
||||
success: function(result){
|
||||
alert("Updated!");
|
||||
window.location.href = '/oqs';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
|
||||
if (oqs_id == items[field]["order_queue_station_id"]) {
|
||||
|
||||
row ='<div class="card queue_station animated shake queue_station_box" data-date="'+items[field]["order_id"]+'">'
|
||||
row ='<div class="card queue_station animated shake queue_station_box" data-order-no="'+items[field]["order_id"]+'">'
|
||||
+'<strong class="hidden">'+items[field]["order_id"]+'</strong>'
|
||||
+'<div class="card-block">'
|
||||
|
||||
@@ -75,11 +75,9 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
var $divs = $("div.queue_station");
|
||||
var SortListDivs = $divs.sort(function (a, b) {
|
||||
|
||||
first = $(a).attr('data-date');
|
||||
next = $(b).attr('data-date');
|
||||
console.log(first);
|
||||
console.log("hi")
|
||||
console.log(next);
|
||||
first = $(a).attr('data-order-no');
|
||||
next = $(b).attr('data-order-no');
|
||||
|
||||
return parseInt(next.substring(4, 16)) - parseInt(first.substring(4, 16));
|
||||
});
|
||||
$("#oqs_container").html(SortListDivs);
|
||||
|
||||
@@ -44,9 +44,9 @@ class Oqs::HomeController < BaseOqsController
|
||||
# Get Order items
|
||||
def get_order_items
|
||||
items = []
|
||||
table_name = params[:table_id]
|
||||
order_no = params[:order_no]
|
||||
status = params[:status]
|
||||
dining = DiningFacility.find_by_name(table_name);
|
||||
# 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|
|
||||
@@ -60,22 +60,18 @@ class Oqs::HomeController < BaseOqsController
|
||||
# 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
|
||||
# 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
|
||||
|
||||
OrderItem.where("order_id='#{ order_no }'").find_each do |oi|
|
||||
items.push(oi)
|
||||
end
|
||||
|
||||
render :json => items.to_json
|
||||
end
|
||||
|
||||
@@ -132,7 +128,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
.where("assigned_order_items.delivery_status = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs} ")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.order("assigned_order_items.assigned_order_item_id desc")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
.group("odt.order_items_id")
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -40,13 +40,16 @@ class Oqs::PrintController < ApplicationController
|
||||
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
||||
|
||||
# get dining
|
||||
dining = DiningFacility.find_by_name(table_name);
|
||||
booking = Booking.find_by_dining_facility_id(dining.id)
|
||||
# dining = DiningFacility.find_by_name(table_name);
|
||||
# booking = Booking.find_by_dining_facility_id(dining.id)
|
||||
|
||||
# Get Booking ID
|
||||
booking_id = BookingOrder.where("order_id='#{assigned_item.order_id}'").pluck(:booking_id)[0]
|
||||
|
||||
# print when complete click
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_booking_summary(print_settings,oqs, booking.booking_id, print_status)
|
||||
order_queue_printer.print_booking_summary(print_settings,oqs, booking_id, print_status)
|
||||
|
||||
# update print status for completed same order items
|
||||
assigned_items.each do |ai|
|
||||
|
||||
@@ -40,10 +40,10 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
sale_item.product_alt_name = ""
|
||||
sale_item.remark = "Discount"
|
||||
|
||||
sale_item.qty = 1
|
||||
sale_item.unit_price = di["price"]
|
||||
sale_item.qty = -1
|
||||
sale_item.unit_price = di["price"] * -1
|
||||
sale_item.taxable_price = di["price"]
|
||||
sale_item.is_taxable = 0
|
||||
sale_item.is_taxable = 1
|
||||
sale_item.account_id = origin_sale_item.account_id
|
||||
|
||||
sale_item.price = di["price"]
|
||||
|
||||
@@ -36,11 +36,11 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
|
||||
sale_item.qty = 1
|
||||
sale_item.unit_price = di["price"]
|
||||
sale_item.taxable_price = 0
|
||||
sale_item.is_taxable = 0
|
||||
sale_item.taxable_price = di["price"] * 1
|
||||
sale_item.is_taxable = 1
|
||||
sale_item.account_id = 0
|
||||
|
||||
sale_item.price = di["price"]
|
||||
sale_item.price = di["price"] * 1
|
||||
sale_item.save
|
||||
|
||||
action_by = current_user.id
|
||||
|
||||
@@ -57,11 +57,15 @@ class Settings::DiningChargesController < ApplicationController
|
||||
@dining_charge.minimum_free_time = DateTime.parse(dining_charge_params["minimum_free_time"])
|
||||
@dining_charge.charge_block = DateTime.parse(dining_charge_params["charge_block"])
|
||||
@dining_charge.time_rounding_block = DateTime.parse(dining_charge_params["time_rounding_block"])
|
||||
|
||||
if @dining_charge.update(dining_charge_params)
|
||||
@dining_charge.minimum_free_time = DateTime.parse(dining_charge_params["minimum_free_time"])
|
||||
@dining_charge.charge_block = DateTime.parse(dining_charge_params["charge_block"])
|
||||
@dining_charge.time_rounding_block = DateTime.parse(dining_charge_params["time_rounding_block"])
|
||||
# @dining_charge.minimum_free_time = @dining_charge.minimum_free_time.to_datetime.advance(hours: +6, minutes: +30)
|
||||
# @dining_charge.charge_block = @dining_charge.charge_block.to_datetime.advance(hours: +6, minutes: +30)
|
||||
# @dining_charge.time_rounding_block = @dining_charge.time_rounding_block.to_datetime.advance(hours: +6, minutes: +30)
|
||||
# @dining_charge.save
|
||||
@dining_charge.save
|
||||
if @table
|
||||
format.html { redirect_to settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' }
|
||||
else
|
||||
|
||||
@@ -4,16 +4,16 @@ class DiningCharge < ApplicationRecord
|
||||
|
||||
def self.amount_calculate(dining_charges_obj, checkin , checkout)
|
||||
# note :: the first Charge Block will cost all, the Time rounding block will included in 2nd Charge Block
|
||||
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
|
||||
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
|
||||
block_count = 0
|
||||
price = 0
|
||||
minutes = DiningCharge.time_diff(checkout, checkin)
|
||||
free_time = DiningCharge.convert_to_minutes(dining_charges_obj.minimum_free_time.utc.localtime.strftime('%H:%M'))
|
||||
free_time = DiningCharge.convert_to_minutes(dining_charges_obj.minimum_free_time.utc.strftime('%H:%M'))
|
||||
dining_minutes = minutes #- free_time # stayminutes - free minutes
|
||||
if dining_minutes <= free_time
|
||||
price = 0
|
||||
else
|
||||
charge_type = dining_charges_obj.charge_type
|
||||
charge_type = dining_charges_obj.charge_type
|
||||
if charge_type == 'hr'
|
||||
block_count, price = DiningCharge.charges(dining_charges_obj, dining_minutes, 'hr')
|
||||
elsif charge_type == 'day'
|
||||
@@ -30,7 +30,7 @@ class DiningCharge < ApplicationRecord
|
||||
# dining charges calculate
|
||||
def self.charges(chargesObj, dining_minutes, type)
|
||||
solid_price = 0
|
||||
charge_block = DiningCharge.convert_to_minutes(chargesObj.charge_block.utc.localtime.strftime('%H:%M'))
|
||||
charge_block = DiningCharge.convert_to_minutes(chargesObj.charge_block.utc.strftime('%H:%M'))
|
||||
|
||||
result = dining_minutes / charge_block
|
||||
if result.to_i < 1
|
||||
@@ -40,7 +40,7 @@ class DiningCharge < ApplicationRecord
|
||||
solid_price = result * chargesObj.unit_price
|
||||
|
||||
remain_value = dining_minutes % charge_block
|
||||
rounding_time = DiningCharge.convert_to_minutes(chargesObj.time_rounding_block.utc.localtime.strftime('%H:%M'))
|
||||
rounding_time = DiningCharge.convert_to_minutes(chargesObj.time_rounding_block.utc.strftime('%H:%M'))
|
||||
roundingblock = remain_value / rounding_time
|
||||
if roundingblock.to_i < 1
|
||||
# no time rounding block
|
||||
|
||||
@@ -98,7 +98,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
end
|
||||
# For Print Order Summary
|
||||
else
|
||||
filename = "tmp/booking_summary.pdf"
|
||||
filename = "tmp/booking_summary.pdf"
|
||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name)
|
||||
pdf.render_file filename
|
||||
if oqs.print_copy
|
||||
|
||||
@@ -164,7 +164,7 @@ class Promotion < ApplicationRecord
|
||||
sale_item.qty = qty * (-1)
|
||||
|
||||
sale_item.unit_price = item_price # * (-1)
|
||||
sale_item.taxable_price = qty * item_price # * (-1)
|
||||
sale_item.taxable_price = (qty * item_price) * (-1)
|
||||
sale_item.price = qty * item_price * (-1)
|
||||
|
||||
sale_item.is_taxable = 1
|
||||
|
||||
@@ -48,7 +48,7 @@ class Sale < ApplicationRecord
|
||||
|
||||
# dining charges
|
||||
charges = DiningCharge.where('dining_facility_id=?',booking.dining_facility_id).take
|
||||
if !charges.nil?
|
||||
if !charges.nil?
|
||||
block_count, diningprice = DiningCharge.amount_calculate(charges, booking.checkin_at, booking.checkout_at)
|
||||
dining_time = booking.checkin_at.strftime('%H:%M %p').to_s + " - " + booking.checkout_at.strftime('%H:%M %p').to_s
|
||||
create_saleitem_diningcharges(charges, block_count, diningprice, booking.dining_facility.name, dining_time)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<%
|
||||
@queue_completed_item.each do |qid|
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card queue_station" data-order-no="<%= qid.order_id %>">
|
||||
<div class="card-block">
|
||||
<div class="row">
|
||||
<span class="col-md-4 order-zone-type font-13"><%= qid.type %>-<%= qid.zone %></span>
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
<!-- Action Panel -->
|
||||
<div>
|
||||
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
|
||||
<button id="charge_other" class="btn bg-success btn-block action-btn">Enter</button>
|
||||
<button id="charge_other" class="btn bg-primary btn-block action-btn">Enter</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<i class="material-icons">access_time</i>
|
||||
</span>
|
||||
<% if !@dining_charge.minimum_free_time.nil?%>
|
||||
<input type="text" name="dining_charge[minimum_free_time]" value="<%= @dining_charge.minimum_free_time.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)...">
|
||||
<input type="text" name="dining_charge[minimum_free_time]" value="<%= @dining_charge.minimum_free_time.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)...">
|
||||
<% else %>
|
||||
<input type="text" name="dining_charge[minimum_free_time]" class="timepicker form-control col-md-8" placeholder="Free Time(hh:mm)...">
|
||||
<% end %>
|
||||
@@ -28,7 +28,7 @@
|
||||
<i class="material-icons">access_time</i>
|
||||
</span>
|
||||
<% if !@dining_charge.charge_block.nil?%>
|
||||
<input type="text" name="dining_charge[charge_block]" value="<%= @dining_charge.charge_block.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)...">
|
||||
<input type="text" name="dining_charge[charge_block]" value="<%= @dining_charge.charge_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)...">
|
||||
<% else %>
|
||||
<input type="text" name="dining_charge[charge_block]" class="timepicker form-control col-md-8" placeholder="Time for Charges(hh:mm)...">
|
||||
<% end %>
|
||||
@@ -43,7 +43,7 @@
|
||||
<i class="material-icons">access_time</i>
|
||||
</span>
|
||||
<% if !@dining_charge.time_rounding_block.nil?%>
|
||||
<input type="text" name="dining_charge[time_rounding_block]" value="<%= @dining_charge.time_rounding_block.utc.getlocal.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Rounding Time...">
|
||||
<input type="text" name="dining_charge[time_rounding_block]" value="<%= @dining_charge.time_rounding_block.utc.strftime('%H:%M') %>" class="timepicker form-control col-md-8" placeholder="Rounding Time...">
|
||||
<% else %>
|
||||
<input type="text" name="dining_charge[time_rounding_block]" class="timepicker form-control col-md-8" placeholder="Rounding Time...">
|
||||
<% end %>
|
||||
|
||||
@@ -1,10 +1,48 @@
|
||||
application_path = Rails.root #ENV.fetch("SX_PATH") {'/home/superuser/Application/production/sxrestaurant'}
|
||||
directory application_path
|
||||
# Puma can serve each request in a thread from an internal thread pool.
|
||||
# The `threads` method setting takes two numbers a minimum and maximum.
|
||||
# Any libraries that use thread pools should be configured to match
|
||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||
# and maximum, this matches the default thread size of Active Record.
|
||||
#
|
||||
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
||||
threads threads_count, threads_count
|
||||
|
||||
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
||||
#
|
||||
port ENV.fetch("PORT") { 3000 }
|
||||
|
||||
# Specifies the `environment` that Puma will run in.
|
||||
#
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
daemonize true
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
port ENV.fetch("PORT") { 62158 }
|
||||
workers 2
|
||||
preload_app!
|
||||
|
||||
# Specifies the number of `workers` to boot in clustered mode.
|
||||
# Workers are forked webserver processes. If using threads and workers together
|
||||
# the concurrency of the application would be max `threads` * `workers`.
|
||||
# Workers do not work on JRuby or Windows (both of which do not support
|
||||
# processes).
|
||||
#
|
||||
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
||||
|
||||
# Use the `preload_app!` method when specifying a `workers` number.
|
||||
# This directive tells Puma to first boot the application and load code
|
||||
# before forking the application. This takes advantage of Copy On Write
|
||||
# process behavior so workers use less memory. If you use this option
|
||||
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
||||
# block.
|
||||
#
|
||||
# preload_app!
|
||||
|
||||
# The code in the `on_worker_boot` will be called if you are using
|
||||
# clustered mode by specifying a number of `workers`. After each worker
|
||||
# process is booted this block will be run, if you are using `preload_app!`
|
||||
# option you will want to use this block to reconnect to any threads
|
||||
# or connections that may have been created at application boot, Ruby
|
||||
# cannot share connections between processes.
|
||||
#
|
||||
# on_worker_boot do
|
||||
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
||||
# end
|
||||
|
||||
# Allow puma to be restarted by `rails restart` command.
|
||||
|
||||
plugin :tmp_restart
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
application_path = '/home/superuser/Application/production/sxrestaurant'
|
||||
directory application_path
|
||||
environment 'production'
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
daemonize true
|
||||
pidfile "#{application_path}/tmp/pids/puma.pid"
|
||||
state_path "#{application_path}/tmp/pids/puma.state"
|
||||
pidfile "#{application_path}/tmp/puma/pid"
|
||||
state_path "#{application_path}/tmp/puma/state"
|
||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||
bind 'tcp://0.0.0.0:9292'
|
||||
port ENV.fetch("PORT") { 62158 }
|
||||
workers 2
|
||||
preload_app!
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
#--------- Order Queue Station ------------#
|
||||
namespace :oqs do
|
||||
root "home#index"
|
||||
get "/:table_id", to: "home#get_order_items"
|
||||
get "/:order_no", to: "home#get_order_items"
|
||||
|
||||
post 'update_delivery', to: "home#update_delivery_status"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user