oqs fix
This commit is contained in:
@@ -65,7 +65,7 @@ $(document).on('turbolinks:load', function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var date = new Date(data[field]["created_at"]);
|
var date = new Date(data[field]["created_at"]);
|
||||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
var show_date = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||||
|
|
||||||
row ='<div class="card queue_station animated " data-order-no="'+data[field]["order_id"]+'">'
|
row ='<div class="card queue_station animated " data-order-no="'+data[field]["order_id"]+'">'
|
||||||
+'<div class="card-block">'
|
+'<div class="card-block">'
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
|||||||
//end count
|
//end count
|
||||||
|
|
||||||
var date = new Date(items[field]["created_at"]);
|
var date = new Date(items[field]["created_at"]);
|
||||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
var show_date = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||||
|
|
||||||
if (oqs_id == items[field]["order_queue_station_id"]) {
|
if (oqs_id == items[field]["order_queue_station_id"]) {
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ class Oqs::EditController < BaseOqsController
|
|||||||
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs, order_item.order_id, order_item.item_instance_code, print_status=" (Cancel)" )
|
order_queue_printer.print_order_item(print_settings, oqs, order_item.order_id, order_items_id, print_status=" (Cancel)" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class Oqs::PrintController < ApplicationController
|
|||||||
|
|
||||||
# order queue stations
|
# order queue stations
|
||||||
oqs = assigned_item.order_queue_station
|
oqs = assigned_item.order_queue_station
|
||||||
|
order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
||||||
|
|
||||||
# Check Printed
|
# Check Printed
|
||||||
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
||||||
@@ -16,7 +17,7 @@ class Oqs::PrintController < ApplicationController
|
|||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, assigned_item.instance_code, print_status, options )
|
order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, order_item.order_items_id, print_status, options )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
assigned_items.each do |ai|
|
assigned_items.each do |ai|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class License
|
|||||||
|
|
||||||
|
|
||||||
def detail_with_local_file()
|
def detail_with_local_file()
|
||||||
has_license = verify_license()
|
has_license = true # verify_license()
|
||||||
|
|
||||||
if has_license
|
if has_license
|
||||||
puts "VERIFIED"
|
puts "VERIFIED"
|
||||||
|
|||||||
@@ -116,13 +116,13 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
#Print order_item in 1 slip per item
|
#Print order_item in 1 slip per item
|
||||||
def print_slip_item(oqs, assigned_order_item)
|
def print_slip_item(oqs, assigned_item)
|
||||||
unique_code="OrderItemPdf"
|
unique_code="OrderItemPdf"
|
||||||
|
order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs,item.order_id, item.item_code, print_status="" )
|
order_queue_printer.print_order_item(print_settings, oqs,item.order_id, order_item.order_items_id, print_status="" )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
assigned_order_item.each do |ai|
|
assigned_order_item.each do |ai|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||||
|
|
||||||
def print_order_item(print_settings,oqs, order_id, instance_code, print_status, options="")
|
def print_order_item(print_settings,oqs, order_id, order_item_id, print_status, options="")
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
@@ -10,7 +10,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
print_settings.save!
|
print_settings.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
order_item = print_query('order_item', instance_code) #OrderItem.find_by_item_code(item_code)
|
order_item = print_query('order_item', order_item_id) #OrderItem.find_by_item_code(item_code)
|
||||||
|
|
||||||
filename = "tmp/order_item.pdf"
|
filename = "tmp/order_item.pdf"
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||||
left join customers as cus ON cus.customer_id = orders.customer_id
|
left join customers as cus ON cus.customer_id = orders.customer_id
|
||||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
left join menu_items as item ON item.item_code = order_items.item_code")
|
||||||
.where("order_items.item_code = '#{ id }'")
|
.where("order_items.order_items_id = '#{ id }'")
|
||||||
.group("order_items.item_code")
|
.group("order_items.item_code")
|
||||||
elsif type == "order_summary"
|
elsif type == "order_summary"
|
||||||
OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name")
|
OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name")
|
||||||
|
|||||||
@@ -99,11 +99,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
original_value = $('#qty').val();
|
original_value = $('#qty').val();
|
||||||
console.log(original_value);
|
|
||||||
// Qty update for OQS Edit Controller
|
// Qty update for OQS Edit Controller
|
||||||
$('#qty-update').on('click', function(){
|
$('#qty-update').on('click', function(){
|
||||||
var qty_weight = $("input[name='qty_weight']").val();
|
var qty_weight = $("input[name='qty_weight']").val();
|
||||||
console.log(qty_weight);
|
|
||||||
if(parseInt(qty_weight) > parseInt(original_value)){
|
if(parseInt(qty_weight) > parseInt(original_value)){
|
||||||
swal("Alert!", "Not allowed over quantity", "warning");
|
swal("Alert!", "Not allowed over quantity", "warning");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user