merge with origin master
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
//= require cable
|
//= require cable
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
// auto refresh every 10 seconds
|
// auto refresh every 10 seconds
|
||||||
// setTimeout(function(){
|
// setTimeout(function(){
|
||||||
// window.location.reload(1);
|
// window.location.reload(1);
|
||||||
@@ -67,10 +68,10 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// complete for queue item
|
// complete for queue item
|
||||||
$('.order-complete').on('click',function(e){
|
$('.order-complete').on('click',function(e){
|
||||||
//e.preventDefault();
|
//e.preventDefault();
|
||||||
var _self = $(this); // To know in ajax return
|
var _self = $(this); // To know in ajax return
|
||||||
var assigned_item_id=$(this).attr('id').substr(15);
|
var assigned_item_id=$(this).attr('id').substr(15);
|
||||||
var params = { 'id':assigned_item_id };
|
var params = { 'id':assigned_item_id };
|
||||||
|
|
||||||
// Call update_delivery_status() for changed delivery and move to delivery
|
// Call update_delivery_status() for changed delivery and move to delivery
|
||||||
@@ -79,8 +80,8 @@ $(document).ready(function(){
|
|||||||
url: '/oqs/update_delivery',
|
url: '/oqs/update_delivery',
|
||||||
data: params,
|
data: params,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data){
|
success: function(data){
|
||||||
for (i = 0; i < data.length; i++) {
|
for (i = 0; i < data.length; i++) {
|
||||||
var queue_station = $('#assigned_queue_' + data[i]).parent().parent(".queue_station");
|
var queue_station = $('#assigned_queue_' + data[i]).parent().parent(".queue_station");
|
||||||
var station = queue_station.parent().parent().attr('id');
|
var station = queue_station.parent().parent().attr('id');
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Remove a queue card from current station
|
// Remove a queue card from current station
|
||||||
queue_station.children('.card-footer').remove();
|
queue_station.children('.card-footer').remove();
|
||||||
|
|
||||||
// Add removed queue card from station to completed
|
// Add removed queue card from station to completed
|
||||||
$("#completed").children('.card-columns').append(queue_station);
|
$("#completed").children('.card-columns').append(queue_station);
|
||||||
|
|
||||||
@@ -97,35 +98,35 @@ $(document).ready(function(){
|
|||||||
var station_count=parseInt($("#"+station+"_count").text()) - 1;
|
var station_count=parseInt($("#"+station+"_count").text()) - 1;
|
||||||
$("#"+station+"_count").text(station_count);
|
$("#"+station+"_count").text(station_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update queue item count in completed station
|
// update queue item count in completed station
|
||||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||||
|
|
||||||
alert("updated!");
|
alert("updated!");
|
||||||
// Page reload
|
// Page reload
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Print Order Item
|
// Print Order Item
|
||||||
$('#print_order_item').on('click',function(){
|
$('#print_order_item').on('click',function(){
|
||||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||||
var params = { 'id':assigned_item_id };
|
var params = { 'id':assigned_item_id };
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: '/oqs/print/print/'+assigned_item_id,
|
url: '/oqs/print/print/'+assigned_item_id,
|
||||||
success: function(data){ }
|
success: function(data){ }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Print Order Summary
|
// Print Order Summary
|
||||||
$('#print_order_summary').on('click',function(){
|
$('#print_order_summary').on('click',function(){
|
||||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||||
var params = { 'id':assigned_item_id };
|
var params = { 'id':assigned_item_id };
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||||
success: function(data){ }
|
success: function(data){ }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,15 +32,12 @@ class Api::BillController < Api::ApiController
|
|||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
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
|
# Calculate Food and Beverage Total
|
||||||
|
|
||||||
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale_items)
|
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
|
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
|
||||||
redirect_to origami_path(@sale_data.sale_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
class Oqs::HomeController < BaseOqsController
|
class Oqs::HomeController < BaseOqsController
|
||||||
def index
|
def index
|
||||||
queue_stations=OrderQueueStation.all
|
queue_stations=OrderQueueStation.all
|
||||||
|
|
||||||
@queue_items_details = queue_items_query(0)
|
@queue_items_details = queue_items_query(0)
|
||||||
|
|
||||||
@queue_completed_item = queue_items_query(1)
|
@queue_completed_item = queue_items_query(1)
|
||||||
|
|
||||||
@queue_stations_items=Array.new
|
@queue_stations_items=Array.new
|
||||||
|
|
||||||
# Calculate Count for each station tab
|
# Calculate Count for each station tab
|
||||||
queue_stations.each do |que|
|
queue_stations.each do |que|
|
||||||
i=0
|
i=0
|
||||||
@queue_items_details.each do |qid|
|
@queue_items_details.each do |qid|
|
||||||
if qid.station_name == que.station_name
|
if qid.station_name == que.station_name
|
||||||
i=i+1
|
i=i+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@queue_stations_items.push({:station_name => que.station_name, :is_active => que.is_active ,:item_count => i })
|
@queue_stations_items.push({:station_name => que.station_name, :is_active => que.is_active ,:item_count => i })
|
||||||
end
|
end
|
||||||
|
|
||||||
@queue_stations_items
|
@queue_stations_items
|
||||||
@@ -73,10 +73,10 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
# update delivery status for completed same order items
|
# update delivery status for completed same order items
|
||||||
assigned_items.each do |ai|
|
assigned_items.each do |ai|
|
||||||
ai.delivery_status=true
|
ai.delivery_status=true
|
||||||
ai.save
|
ai.save
|
||||||
removed_item.push(ai.assigned_order_item_id)
|
removed_item.push(ai.assigned_order_item_id)
|
||||||
end
|
end
|
||||||
render :json => removed_item.to_json
|
render :json => removed_item.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with status
|
||||||
@@ -103,4 +103,3 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
.group("assigned_order_items.assigned_order_item_id")
|
.group("assigned_order_items.assigned_order_item_id")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class Origami::HomeController < BaseOrigamiController
|
class Origami::HomeController < BaseOrigamiController
|
||||||
def index
|
def index
|
||||||
if params[:booking_id] != nil
|
if params[:booking_id] != nil
|
||||||
type=params[:booking_id].split('-')[0];
|
type=params[:booking_id].split('-')[0];
|
||||||
# Sale
|
# Sale
|
||||||
if type == "SAL"
|
if type == "SAL"
|
||||||
@selected_item = Sale.find(params[:booking_id])
|
@selected_item = Sale.find(params[:booking_id])
|
||||||
@selected_item_type="Sale"
|
@selected_item_type="Sale"
|
||||||
@@ -10,23 +10,23 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
@selected_item = Order.find(params[:booking_id])
|
@selected_item = Order.find(params[:booking_id])
|
||||||
@selected_item_type="Order"
|
@selected_item_type="Order"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@completed_orders = Order.get_completed_order()
|
@completed_orders = Order.get_completed_order()
|
||||||
@booking_orders = Order.get_booking_order_table()
|
@booking_orders = Order.get_booking_order_table()
|
||||||
@booking_rooms = Order.get_booking_order_rooms()
|
@booking_rooms = Order.get_booking_order_rooms()
|
||||||
@orders = Order.get_orders()
|
@orders = Order.get_orders()
|
||||||
end
|
end
|
||||||
|
|
||||||
def item_show
|
def item_show
|
||||||
selection(params[:booking_id],1)
|
selection(params[:booking_id],1)
|
||||||
end
|
end
|
||||||
|
|
||||||
def selection(selected_id, is_ajax)
|
def selection(selected_id, is_ajax)
|
||||||
str = []
|
str = []
|
||||||
type=selected_id.split('-')[0];
|
type=selected_id.split('-')[0];
|
||||||
# Sale
|
# Sale
|
||||||
if type == "SAL"
|
if type == "SAL"
|
||||||
@order_details = SaleItem.get_order_items_details(params[:booking_id])
|
@order_details = SaleItem.get_order_items_details(params[:booking_id])
|
||||||
@order_details.each do |ord_detail|
|
@order_details.each do |ord_detail|
|
||||||
@@ -39,7 +39,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
str.push(ord_detail)
|
str.push(ord_detail)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if is_ajax == 1
|
if is_ajax == 1
|
||||||
render :json => str.to_json
|
render :json => str.to_json
|
||||||
else
|
else
|
||||||
@@ -55,21 +55,21 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
sale = Order.find(params[:sale_id])
|
sale = Order.find(params[:sale_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
status = sale.update_attributes(customer_id: params[:customer_id])
|
status = sale.update_attributes(customer_id: params[:customer_id])
|
||||||
|
|
||||||
if status == true
|
if status == true
|
||||||
render json: JSON.generate({:status => true})
|
render json: JSON.generate({:status => true})
|
||||||
else
|
else
|
||||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_customer
|
def get_customer
|
||||||
|
|
||||||
@customer = Customer.find(params[:customer_id])
|
@customer = Customer.find(params[:customer_id])
|
||||||
|
|
||||||
response = Customer.get_member_account(@customer)
|
response = Customer.get_member_account(@customer)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
@@ -20,11 +20,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
# Calculate Food and Beverage Total
|
# Calculate Food and Beverage Total
|
||||||
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -41,7 +40,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
|
|
||||||
#get customer amount
|
#get customer amount
|
||||||
@customer = Customer.find(@sale_data.customer_id)
|
@customer = Customer.find(@sale_data.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
response = Customer.get_member_account(@customer)
|
response = Customer.get_member_account(@customer)
|
||||||
@@ -84,19 +83,19 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
# Calculate Food and Beverage Total
|
# Calculate Food and Beverage Total
|
||||||
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::TABLE_TYPE,true)
|
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::TABLE_TYPE,true)
|
||||||
.group("bookings.booking_id")
|
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
||||||
# For PG
|
# For PG
|
||||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true
|
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true
|
||||||
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||||
@@ -262,7 +262,7 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::ROOM_TYPE,true)
|
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::ROOM_TYPE,true)
|
||||||
.group("bookings.booking_id")
|
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id")
|
||||||
# For PG
|
# For PG
|
||||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true
|
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true
|
||||||
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id
|
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
self.print(filename)
|
self.print(filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
def print_receipt_payment_by_foc(sale_id)
|
def print_receipt_payment_by_foc(sale_id)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
@@ -70,6 +70,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total, member_info)
|
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total, member_info)
|
||||||
|
|
||||||
pdf.render_file "tmp/receipt_bill.pdf"
|
pdf.render_file "tmp/receipt_bill.pdf"
|
||||||
self.print("tmp/receipt_bill.pdf")
|
self.print("tmp/receipt_bill.pdf")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
self.item_height = 15
|
self.item_height = 15
|
||||||
self.item_description_width = (self.page_width-20) / 2
|
self.item_description_width = (self.page_width-20) / 2
|
||||||
self.label_width = 100
|
self.label_width = 100
|
||||||
|
|
||||||
# @item_width = self.page_width.to_i / 2
|
# @item_width = self.page_width.to_i / 2
|
||||||
# @qty_width = @item_width.to_i / 3
|
# @qty_width = @item_width.to_i / 3
|
||||||
# @double = @qty_width * 1.3
|
# @double = @qty_width * 1.3
|
||||||
@@ -36,7 +35,6 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
if member_info != nil
|
if member_info != nil
|
||||||
member_info(member_info)
|
member_info(member_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
footer
|
footer
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -206,10 +204,10 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
|
|
||||||
# show member information
|
# show member information
|
||||||
def member_info(member_info)
|
def member_info(member_info)
|
||||||
|
|
||||||
move_down 7
|
move_down 7
|
||||||
if member_info["status"] == true
|
if member_info["status"] == true
|
||||||
member_info["data"].each do |res|
|
member_info["data"].each do |res|
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
@@ -219,9 +217,9 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||||
text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right
|
text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def footer
|
def footer
|
||||||
|
|||||||
@@ -82,10 +82,10 @@
|
|||||||
|
|
||||||
<!--- Panel 1 - Table Orders -->
|
<!--- Panel 1 - Table Orders -->
|
||||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<%
|
<%
|
||||||
@booking_orders.each do |bko|
|
@booking_orders.each do |bko|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
if bko.sale_status == 'completed'
|
if bko.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<%
|
<%
|
||||||
@booking_rooms.each do |rmo|
|
@booking_rooms.each do |rmo|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
if rmo.sale_status == 'completed'
|
if rmo.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -207,8 +207,8 @@
|
|||||||
<div class="tab-pane" id="orders" role="tabpanel">
|
<div class="tab-pane" id="orders" role="tabpanel">
|
||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<%
|
<%
|
||||||
@orders.each do |odr|
|
@orders.each do |odr|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
if odr.sale_status == 'completed'
|
if odr.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -289,7 +289,7 @@
|
|||||||
<p>Customer : <span id="customer_name"></span></p>
|
<p>Customer : <span id="customer_name"></span></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<table class="table table-striped" id="order-items-table">
|
<table class="table table-striped" id="order-items-table">
|
||||||
@@ -300,14 +300,14 @@
|
|||||||
<th class="item-attr">Price</td>
|
<th class="item-attr">Price</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<%
|
<%
|
||||||
# For Sale Items
|
# For Sale Items
|
||||||
sub_total = 0
|
sub_total = 0
|
||||||
if @selected_item_type == "Sale"
|
if @selected_item_type == "Sale"
|
||||||
@selected_item.sale_items.each do |sale_item|
|
@selected_item.sale_items.each do |sale_item|
|
||||||
sub_total += (sale_item.qty*sale_item.unit_price)
|
sub_total += (sale_item.qty*sale_item.unit_price)
|
||||||
%>
|
%>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='item-name'><%= sale_item.product_name %></td>
|
<td class='item-name'><%= sale_item.product_name %></td>
|
||||||
<td class='item-attr'><%= sale_item.qty %></td>
|
<td class='item-attr'><%= sale_item.qty %></td>
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
%>
|
%>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
# For Order Items
|
# For Order Items
|
||||||
if @selected_item_type == "Order"
|
if @selected_item_type == "Order"
|
||||||
@selected_item.order_items.each do |order_item|
|
@selected_item.order_items.each do |order_item|
|
||||||
sub_total += (order_item.qty*order_item.unit_price)
|
sub_total += (order_item.qty*order_item.unit_price)
|
||||||
@@ -354,6 +354,7 @@
|
|||||||
<td class="charges-name"><strong>Discount:</strong></td>
|
<td class="charges-name"><strong>Discount:</strong></td>
|
||||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- <tr>
|
<!-- <tr>
|
||||||
<td class="charges-name"><strong>Tax:</strong></td>
|
<td class="charges-name"><strong>Tax:</strong></td>
|
||||||
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
||||||
@@ -362,9 +363,8 @@
|
|||||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
<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>
|
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
|
||||||
</tr> -->
|
</tr> -->
|
||||||
<tr class="rebate_amount">
|
|
||||||
|
<tr class="rebate_amount"></tr>
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||||
<label class="col-lg-4 col-md-4 col-sm-4">Available Redeem Amount</label>
|
<label class="col-lg-4 col-md-4 col-sm-4"> Rebat Balance </label>
|
||||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@membership_rebate_balance%>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@membership_rebate_balance%>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
|
<div class=" cashier_number " data-type="nett">Nett</div>
|
||||||
<div class=" cashier_number red left" data-type="del">Del</div>
|
<div class=" cashier_number red left" data-type="del">Del</div>
|
||||||
<div class=" cashier_number green left" data-type="clr">Clr</div>
|
<div class=" cashier_number green left" data-type="clr">Clr</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -123,6 +123,9 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
case 'del' :
|
case 'del' :
|
||||||
var cash=$('#used_amount').text();
|
var cash=$('#used_amount').text();
|
||||||
$('#used_amount').text(cash.substr(0,cash.length-1));
|
$('#used_amount').text(cash.substr(0,cash.length-1));
|
||||||
|
case 'nett':
|
||||||
|
alert($('#valid_amount').text())
|
||||||
|
$('#used_amount').text($('#valid_amount').text());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ div.form-inputs span{
|
|||||||
<div class="form-inputs">
|
<div class="form-inputs">
|
||||||
<%= f.input :station_name %>
|
<%= f.input :station_name %>
|
||||||
<%= f.input :is_active %>
|
<%= f.input :is_active %>
|
||||||
<%= f.input :auto_print %>
|
|
||||||
<%= f.input :printer_name %>
|
<%= f.input :printer_name %>
|
||||||
<%= f.input :font_size %>
|
<%= f.input :font_size %>
|
||||||
<%= f.input :print_copy %>
|
<%= f.input :print_copy %>
|
||||||
@@ -18,7 +18,7 @@ div.form-inputs span{
|
|||||||
<%= f.input :cut_per_item %>
|
<%= f.input :cut_per_item %>
|
||||||
<%= f.input :use_alternate_name %>
|
<%= f.input :use_alternate_name %>
|
||||||
<%= f.input :processing_items, as: :hidden %>
|
<%= f.input :processing_items, as: :hidden %>
|
||||||
|
<%= f.input :auto_print %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace :clear do
|
|||||||
Sale.delete_all
|
Sale.delete_all
|
||||||
SaleAudit.delete_all
|
SaleAudit.delete_all
|
||||||
SalePayment.delete_all
|
SalePayment.delete_all
|
||||||
|
DiningFacility.update_all(status:'available')
|
||||||
puts "Clear Data Done."
|
puts "Clear Data Done."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user