Conflict fix din settings_backend
This commit is contained in:
@@ -18,3 +18,4 @@
|
|||||||
//= require cable
|
//= require cable
|
||||||
//= require jquery-ui
|
//= require jquery-ui
|
||||||
//= require bootstrap-datepicker
|
//= require bootstrap-datepicker
|
||||||
|
//= require bootstrap/modal
|
||||||
@@ -17,27 +17,51 @@
|
|||||||
//= 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);
|
||||||
// }, 10000);
|
// }, 10000);
|
||||||
|
|
||||||
$('.queue_station').on('click',function(){
|
$('.queue_station').on('click',function(){
|
||||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
var orderZone=$(this).children().children().children('.order-zone').text().trim();
|
||||||
var orderItem=$(this).children().children().children('.order-item').text();
|
// 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 orderQty = $(this).children().children().children('.order-qty').text();
|
||||||
var orderBy = $(this).children().children().children().children('.order-by').text();
|
var orderBy = $(this).children().children().children().children('.order-by').text();
|
||||||
var orderAt = $(this).children().children().children().children('.order-at').text();
|
var orderAt = $(this).children().children().children().children('.order-at').text();
|
||||||
var orderCustomer = $(this).children().children('.order-customer').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-title').text("ORDER DETAILS - " + orderZone);
|
||||||
$('#order-by').text(orderBy);
|
$('#order-by').text(orderBy);
|
||||||
$('#order-at').text(orderAt);
|
$('#order-at').text(orderAt);
|
||||||
$('#order-customer').text(orderCustomer);
|
$('#order-customer').text(orderCustomer);
|
||||||
$('#order-from').text(orderZone);
|
$('#order-from').text(orderZone);
|
||||||
|
// clear order items
|
||||||
|
$("#oqs-order-details-table").children("tbody").empty();
|
||||||
|
|
||||||
$('#order-items').text(orderItem);
|
// Call get_order_items() for Order Items by dining
|
||||||
$('#order-qty').text(orderQty);
|
$.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');
|
$('.queue_station').removeClass('selected-item');
|
||||||
$(this).addClass('selected-item');
|
$(this).addClass('selected-item');
|
||||||
@@ -50,6 +74,7 @@ $(document).ready(function(){
|
|||||||
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
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/oqs/update_delivery',
|
url: '/oqs/update_delivery',
|
||||||
@@ -84,6 +109,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 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 };
|
||||||
@@ -94,6 +120,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 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 };
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Bill Request
|
// Bill Request
|
||||||
$('#request_bills').click(function() {
|
$('#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!=""){
|
if(order_id!=""){
|
||||||
window.location.href = '/origami/' + order_id + '/request_bills'
|
window.location.href = '/origami/' + order_id + '/request_bills'
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,8 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Discount for Payment
|
// Discount for Payment
|
||||||
$('#discount').click(function() {
|
$('#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!=""){
|
if(order_id!=""){
|
||||||
window.location.href = '/origami/' + order_id + '/discount'
|
window.location.href = '/origami/' + order_id + '/discount'
|
||||||
}
|
}
|
||||||
@@ -148,7 +149,7 @@ $(document).ready(function(){
|
|||||||
$("#pay-discount").on('click', function(e){
|
$("#pay-discount").on('click', function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var sale_id = $('#sale-id').text();
|
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 sub_total = $('#order-sub-total').text();
|
||||||
var grand_total = $('#order-grand-total').text();
|
var grand_total = $('#order-grand-total').text();
|
||||||
var discount_type = $('#discount-type').val();
|
var discount_type = $('#discount-type').val();
|
||||||
@@ -178,7 +179,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Payment for Bill
|
// Payment for Bill
|
||||||
$('#pay-bill').click(function() {
|
$('#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!=""){
|
if(sale_id!=""){
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||||
}
|
}
|
||||||
@@ -190,7 +191,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#customer').click(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") {
|
if (sale.substring(0, 3)=="SAL") {
|
||||||
var sale_id = sale
|
var sale_id = sale
|
||||||
}else{
|
}else{
|
||||||
@@ -202,7 +203,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#re-print').click(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"
|
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||||
|
|
||||||
@@ -227,6 +228,7 @@ $(document).ready(function(){
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$("#customer_name").text(data["customer"].name);
|
$("#customer_name").text(data["customer"].name);
|
||||||
|
if (data["response_data"]["data"].length) {
|
||||||
$.each(data["response_data"]["data"], function (i) {
|
$.each(data["response_data"]["data"], function (i) {
|
||||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||||
var balance = data["response_data"]["data"][i]["balance"];
|
var balance = data["response_data"]["data"][i]["balance"];
|
||||||
@@ -241,6 +243,9 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$('.rebate_amount').addClass('hide');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//End Ajax
|
//End Ajax
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
@import "theme";
|
@import "theme";
|
||||||
@import "jquery-ui";
|
@import "jquery-ui";
|
||||||
@import "bootstrap-datepicker3";
|
@import "bootstrap-datepicker3";
|
||||||
|
@import "bootstrap/modal";
|
||||||
|
|
||||||
/* Show it is fixed to the top */
|
/* Show it is fixed to the top */
|
||||||
// body {
|
// body {
|
||||||
@@ -10,4 +11,15 @@
|
|||||||
// padding-top: 4.5rem;
|
// 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,13 +15,29 @@ class Api::BillController < Api::ApiController
|
|||||||
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee)
|
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee)
|
||||||
else
|
else
|
||||||
@status = true
|
@status = true
|
||||||
|
@sale_id = booking.sale_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
|
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
|
||||||
|
|
||||||
end
|
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_data.customer_id)
|
||||||
|
|
||||||
|
# get printer info
|
||||||
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
|
# Calculate Food and Beverage Total
|
||||||
|
|
||||||
|
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale_items)
|
||||||
|
|
||||||
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Api::OrdersController < Api::ApiController
|
|||||||
@order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
@order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||||
@order.items = params[:order_items]
|
@order.items = params[:order_items]
|
||||||
@order.guest = params[:guest_info]
|
@order.guest = params[:guest_info]
|
||||||
@order.table_id = params[:table_id]
|
@order.table_id = params[:table_id] # this is dining facilities's id
|
||||||
@order.new_booking = true
|
@order.new_booking = true
|
||||||
@order.employee_name = current_login_employee.name
|
@order.employee_name = current_login_employee.name
|
||||||
#Create Table Booking or Room Booking
|
#Create Table Booking or Room Booking
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
# format.json { render :index, status: :created, location: @crm_customers }
|
# format.json { render :index, status: :created, location: @crm_customers }
|
||||||
else
|
else
|
||||||
|
|
||||||
@crm_customers.destroy
|
# @crm_customers.destroy
|
||||||
if params[:sale_id]
|
if params[:sale_id]
|
||||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
|
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ class Crm::DiningQueuesController < BaseCrmController
|
|||||||
# GET /crm/dining_queues
|
# GET /crm/dining_queues
|
||||||
# GET /crm/dining_queues.json
|
# GET /crm/dining_queues.json
|
||||||
def index
|
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
|
end
|
||||||
|
|
||||||
# GET /crm/dining_queues/1
|
# GET /crm/dining_queues/1
|
||||||
@@ -38,7 +39,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
|||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_queue_no(print_settings,@dining_queue)
|
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 }
|
format.json { render :show, status: :created, location: @dining_queue }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
@@ -52,7 +53,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
|||||||
def update
|
def update
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @dining_queue.update(dining_queue_params)
|
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 }
|
format.json { render :show, status: :ok, location: @dining_queue }
|
||||||
else
|
else
|
||||||
format.html { render :edit }
|
format.html { render :edit }
|
||||||
@@ -71,6 +72,27 @@ class Crm::DiningQueuesController < BaseCrmController
|
|||||||
end
|
end
|
||||||
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
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_dining_queue
|
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.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def dining_queue_params
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,6 +22,44 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
@queue_stations_items
|
@queue_stations_items
|
||||||
end
|
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
|
def show
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,16 +81,25 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with status
|
||||||
def queue_items_query(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")
|
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
|
.joins(" left join order_queue_stations as oqs on oqs.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 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 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")
|
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}")
|
.where("assigned_order_items.delivery_status = #{status}")
|
||||||
.group("assigned_order_items.assigned_order_item_id")
|
.group("assigned_order_items.assigned_order_item_id")
|
||||||
.order("odt.item_name DESC")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ class Oqs::PrintController < ApplicationController
|
|||||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
# printer for each stations
|
# order queue stations
|
||||||
printer_name = assigned_item.order_queue_station.printer_name
|
oqs = assigned_item.order_queue_station
|
||||||
|
|
||||||
# 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(printer_name,assigned_item.order_id, assigned_item.item_code )
|
order_queue_printer.print_order_item(oqs,assigned_item.order_id, assigned_item.item_code )
|
||||||
|
|
||||||
# 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|
|
||||||
@@ -28,13 +28,13 @@ class Oqs::PrintController < ApplicationController
|
|||||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
# printer for each stations
|
# order queue stations
|
||||||
printer_name = assigned_item.order_queue_station.printer_name
|
oqs = assigned_item.order_queue_station
|
||||||
|
|
||||||
# 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_summary(printer_name,assigned_item.order_id)
|
order_queue_printer.print_order_summary(oqs,assigned_item.order_id)
|
||||||
|
|
||||||
# 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|
|
||||||
|
|||||||
@@ -39,6 +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
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ 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)
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
@balance = 0.00
|
@balance = 0.00
|
||||||
@accountable_type = ''
|
@accountable_type = ''
|
||||||
if response["data"]==true
|
if response["status"]==true
|
||||||
response["data"].each do |res|
|
response["data"].each do |res|
|
||||||
if res["accountable_type"] == "RebateAccount"
|
if res["accountable_type"] == "RebateAccount"
|
||||||
@balance = res["balance"]
|
@balance = res["balance"]
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ class Settings::OrderQueueStationsController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def settings_order_queue_station_params
|
def settings_order_queue_station_params
|
||||||
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: [] })
|
# <<<<<<< 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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class OrderQueueProcessorJob < ApplicationJob
|
class OrderQueueProcessorJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :default
|
||||||
|
|
||||||
def perform(order_id)
|
def perform(order_id, table_id)
|
||||||
# Do something later
|
# Do something later
|
||||||
#Order ID
|
#Order ID
|
||||||
order = Order.find(order_id)
|
order = Order.find(order_id)
|
||||||
@@ -10,7 +10,7 @@ class OrderQueueProcessorJob < ApplicationJob
|
|||||||
#Execute orders and send to order stations
|
#Execute orders and send to order stations
|
||||||
if order
|
if order
|
||||||
oqs = OrderQueueStation.new
|
oqs = OrderQueueStation.new
|
||||||
oqs.process_order(order)
|
oqs.process_order(order, table_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,39 +12,25 @@ class Customer < ApplicationRecord
|
|||||||
|
|
||||||
paginates_per 50
|
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
|
|
||||||
|
|
||||||
def self.get_member_account(customer)
|
def self.get_member_account(customer)
|
||||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||||
merchant_uid = memberaction.merchant_account_id.to_s
|
merchant_uid = memberaction.merchant_account_id.to_s
|
||||||
auth_token = memberaction.auth_token.to_s
|
auth_token = memberaction.auth_token.to_s
|
||||||
url = membership.gateway_url.to_s + memberaction.gateway_url.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,
|
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
}
|
},
|
||||||
|
:timeout => 10
|
||||||
)
|
)
|
||||||
|
rescue Net::OpenTimeout
|
||||||
|
response = { status: false }
|
||||||
|
end
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
||||||
@@ -59,6 +45,35 @@ class Customer < ApplicationRecord
|
|||||||
end
|
end
|
||||||
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)
|
# def self.search(search)
|
||||||
# where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
|
# where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -18,4 +18,20 @@ class DiningFacility < ApplicationRecord
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
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
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
class DiningQueue < ApplicationRecord
|
class DiningQueue < ApplicationRecord
|
||||||
|
belongs_to :dining_facility, :optional => true
|
||||||
def self.generate_queue_no
|
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
|
return queue_no
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -199,7 +199,7 @@ class Order < ApplicationRecord
|
|||||||
#Process order items and send to order queue
|
#Process order items and send to order queue
|
||||||
def process_order_queue
|
def process_order_queue
|
||||||
#Send to background job for processing
|
#Send to background job for processing
|
||||||
OrderQueueProcessorJob.perform_later(self.id)
|
OrderQueueProcessorJob.perform_later(self.id, self.table_id)
|
||||||
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
|
||||||
@@ -246,7 +246,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("sales.sale_status='completed'")
|
.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
|
# For PG
|
||||||
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||||
end
|
end
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
|
|
||||||
scope :active, -> {where(is_active: true)}
|
scope :active, -> {where(is_active: true)}
|
||||||
|
|
||||||
def process_order (order)
|
def process_order (order, table_id)
|
||||||
oqs_stations = OrderQueueStation.active
|
oqs_stations = OrderQueueStation.active
|
||||||
|
dining=DiningFacility.find(table_id)
|
||||||
|
oqpbz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
|
||||||
|
|
||||||
order_items = order.order_items
|
order_items = order.order_items
|
||||||
#Assign OQS id to order Items
|
#Assign OQS id to order Items
|
||||||
@@ -24,11 +26,12 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
#Processing through the looping items
|
#Processing through the looping items
|
||||||
order_items.each do |order_item|
|
order_items.each do |order_item|
|
||||||
if (pq_item == order_item.item_code)
|
if (pq_item == order_item.item_code)
|
||||||
|
if oqs.id == oqpbz.order_queue_station_id
|
||||||
#Same Order_items can appear in two location.
|
#Same Order_items can appear in two location.
|
||||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,44 @@
|
|||||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||||
|
|
||||||
def print_order_item(printer_name,order_id, item_code)
|
def print_order_item(oqs,order_id, item_code)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||||
pdf = OrderItemPdf.new(order_item[0])
|
pdf = OrderItemPdf.new(order_item[0])
|
||||||
pdf.render_file "tmp/receipt.pdf"
|
pdf.render_file "tmp/receipt.pdf"
|
||||||
self.print("tmp/receipt.pdf", printer_name)
|
if oqs.print_copy
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
else
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def print_order_summary(printer_name,order_id)
|
def print_order_summary(oqs,order_id)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order=print_query('order_summary',order_id)
|
order=print_query('order_summary',order_id)
|
||||||
|
# For Print Per Item
|
||||||
|
if oqs.cut_per_item
|
||||||
|
order.each do|odi|
|
||||||
|
pdf = OrderItemPdf.new(odi)
|
||||||
|
pdf.render_file "tmp/receipt.pdf"
|
||||||
|
if oqs.print_copy
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
else
|
||||||
|
self.print("tmp/receipt.pdf", oqs.printer_name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# For Print Order Summary
|
||||||
|
else
|
||||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||||
pdf = OrderSummaryPdf.new(order)
|
pdf = OrderSummaryPdf.new(order)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
self.print(filename, oqs.printer_name)
|
||||||
self.print(filename, printer_name)
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with status
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class Sale < ApplicationRecord
|
|||||||
if (booking)
|
if (booking)
|
||||||
Rails.logger.debug "Booking -> Booking Order Count -> " + booking.booking_orders.count.to_s
|
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
|
#get all order attached to this booking and combine into 1 invoice
|
||||||
|
|
||||||
|
puts booking.booking_orders.length
|
||||||
booking.booking_orders.each do |order|
|
booking.booking_orders.each do |order|
|
||||||
if booking.sale_id
|
if booking.sale_id
|
||||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
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_profile - list by order_by
|
||||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
|
|
||||||
#Creat new tax records
|
# #Creat new tax records
|
||||||
tax_profiles.each do |tax|
|
tax_profiles.each do |tax|
|
||||||
sale_tax = SaleTax.new(:sale => self)
|
sale_tax = SaleTax.new(:sale => self)
|
||||||
sale_tax.tax_name = tax.name
|
sale_tax.tax_name = tax.name
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class SaleItem < ApplicationRecord
|
|||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Calculate food total and beverage total
|
||||||
def self.calculate_food_beverage(sale_items)
|
def self.calculate_food_beverage(sale_items)
|
||||||
food_prices=0
|
food_prices=0
|
||||||
beverage_prices=0
|
beverage_prices=0
|
||||||
@@ -45,6 +46,7 @@ class SaleItem < ApplicationRecord
|
|||||||
return food_prices, beverage_prices
|
return food_prices, beverage_prices
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# get food price or beverage price for item
|
||||||
def self.get_price(sale_item_id)
|
def self.get_price(sale_item_id)
|
||||||
food_price=0
|
food_price=0
|
||||||
beverage_price=0
|
beverage_price=0
|
||||||
|
|||||||
@@ -265,13 +265,17 @@ class SalePayment < ApplicationRecord
|
|||||||
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
|
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
|
||||||
auth_token = memberaction.auth_token.to_s
|
auth_token = memberaction.auth_token.to_s
|
||||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
|
|
||||||
|
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,
|
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,
|
receipt_no: receipt_no,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
})
|
}, :timeout => 10)
|
||||||
puts "haha"
|
rescue Net::OpenTimeout
|
||||||
|
response = { status: false }
|
||||||
|
end
|
||||||
puts response.to_json
|
puts response.to_json
|
||||||
end
|
end
|
||||||
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
|
||||||
|
|
||||||
@@ -121,9 +119,9 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
|
|
||||||
pad_top(15) {
|
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 "#{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 "#{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.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 "#{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.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 "#{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
|
move_down 3
|
||||||
end
|
end
|
||||||
@@ -174,7 +172,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
|
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
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 "( " +"#{ 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
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -229,7 +227,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
text "*** Thank You ***", :left_margin => -10, :size => self.header_font_size,:align => :center
|
text "Thank You! See you Again", :left_margin => -10, :size => self.header_font_size,:align => :center
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,26 +1,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
|
|
||||||
<!-- Nav tabs -->
|
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" data-toggle="tab" href="#queue" role="tab">Customer Details </a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link " data-toggle="tab" href="#booking" role="tab">Orders </a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Sales</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<!-- Nav tabs - End -->
|
|
||||||
|
|
||||||
<div class="tab-content">
|
|
||||||
|
|
||||||
<div class="tab-pane active" id="queue" role="tabpanel"">
|
<div class="tab-pane active" id="queue" role="tabpanel"">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3"></div>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<br>
|
<br>
|
||||||
<h4>Customer Profile</h4>
|
<h4>Customer Profile</h4>
|
||||||
@@ -51,11 +33,8 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3"></div>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
<br>
|
||||||
<h4>Membership Detail</h4>
|
<h4>Membership Detail</h4>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
@@ -78,8 +57,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Nav tabs -->
|
||||||
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
|
<!-- <li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="tab" href="#queue" role="tab">Customer Details </a>
|
||||||
|
</li> -->
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link " data-toggle="tab" href="#booking" role="tab">Orders </a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Sales</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- Nav tabs - End -->
|
||||||
|
<div class="tab-content">
|
||||||
<div class="tab-pane" id="booking" role="tabpanel">
|
<div class="tab-pane" id="booking" role="tabpanel">
|
||||||
<h3>Order Details</h3>
|
<h3>Order Details</h3>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@@ -114,7 +107,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane" id="customer" role="tabpanel">
|
<div class="tab-pane" id="customer" role="tabpanel">
|
||||||
<h3>Sale Details</h3>
|
<h3>Sale Details</h3>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@@ -146,7 +138,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= f.button :submit %>
|
<%= f.button :submit,"Create Queue" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% 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,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= %>">Home</a></li>
|
<li><a href="<%= %>">Home</a></li>
|
||||||
@@ -10,29 +8,62 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<div class="row">
|
||||||
<div class="card">
|
<div class="col-lg-11 col-md-11 col-sm-11" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||||
<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>
|
|
||||||
|
|
||||||
<tbody>
|
<div class="row">
|
||||||
<% @dining_queues.each do |dining_queue| %>
|
<% @i = 0 %> .
|
||||||
<tr>
|
<% @dining_queues.each do |queue| %>
|
||||||
<td><%= dining_queue.name %></td>
|
<div class="col-md-3 ">
|
||||||
<td><%= dining_queue.contact_no %></td>
|
<div class="card select-queue <%= !queue.status.nil? ? "assign" : ""%>" style="border:1px solid #ccc;margin-bottom: 10px ">
|
||||||
<td><%= dining_queue.queue_no %></td>
|
<div class="card-block">
|
||||||
<td>
|
<p class="hidden queue-id"><%= queue.id %></p>
|
||||||
<%= 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>
|
<p class="hidden queue-status"><%= queue.status %></p>
|
||||||
</tr>
|
<h4 class="card-title"><%= @i += 1 %> . Queue No </h4>
|
||||||
<% end %>
|
<h1 style="text-align: center"><%= queue.queue_no %></h1>
|
||||||
</tbody>
|
<p class="card-text">
|
||||||
</table>
|
<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>
|
||||||
|
|
||||||
|
</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>
|
||||||
|
|
||||||
|
</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>
|
||||||
@@ -60,6 +60,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
|
<p class="hidden order-status">completed</p>
|
||||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||||
</div>
|
</div>
|
||||||
@@ -133,7 +134,7 @@
|
|||||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||||
<div class="card" >
|
<div class="card" >
|
||||||
<div class="card-header">
|
<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>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
@@ -159,7 +160,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow:auto">
|
<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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:80%; text-align:left">Items</th>
|
<th style="width:80%; text-align:left">Items</th>
|
||||||
@@ -167,17 +168,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<!-- Bind With JS -->
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -354,17 +354,17 @@
|
|||||||
<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>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<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>
|
<tr class="rebate_amount"></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -235,7 +235,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Foc </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block"> FOC </button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block"> Void </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block"> Void </button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
|
||||||
</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>
|
||||||
@@ -129,6 +129,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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<tr>
|
<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_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.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_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",sale.total_discount.to_f), :delimiter => ',') %></td>
|
||||||
<td style='text-align:center;'><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %></td>
|
<td style='text-align:center;'><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %></td>
|
||||||
|
|||||||
@@ -9,6 +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 :printer_name %>
|
<%= f.input :printer_name %>
|
||||||
<%= f.input :font_size %>
|
<%= f.input :font_size %>
|
||||||
<%= f.input :print_copy %>
|
<%= f.input :print_copy %>
|
||||||
@@ -17,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">
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Station name</th>
|
<th>Station name</th>
|
||||||
<th>Is active</th>
|
<th>Is active</th>
|
||||||
|
<th>Auto Print</th>
|
||||||
<th>Print copy</th>
|
<th>Print copy</th>
|
||||||
<th>Printer name</th>
|
<th>Printer name</th>
|
||||||
<th>Cut per item</th>
|
<th>Cut per item</th>
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to settings_order_queue_station.station_name, settings_order_queue_station_path(settings_order_queue_station) %></td>
|
<td><%= link_to settings_order_queue_station.station_name, settings_order_queue_station_path(settings_order_queue_station) %></td>
|
||||||
<td><%= settings_order_queue_station.is_active %></td>
|
<td><%= settings_order_queue_station.is_active %></td>
|
||||||
|
<td><%= settings_order_queue_station.auto_print %></td>
|
||||||
<td><%= settings_order_queue_station.print_copy %></td>
|
<td><%= settings_order_queue_station.print_copy %></td>
|
||||||
<td><%= settings_order_queue_station.printer_name %></td>
|
<td><%= settings_order_queue_station.printer_name %></td>
|
||||||
<td><%= settings_order_queue_station.cut_per_item %></td>
|
<td><%= settings_order_queue_station.cut_per_item %></td>
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
<%= @settings_order_queue_station.is_active %>
|
<%= @settings_order_queue_station.is_active %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Auto Print:</strong>
|
||||||
|
<%= @settings_order_queue_station.auto_print %>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>Processing items:</strong>
|
<strong>Processing items:</strong>
|
||||||
<%= @settings_order_queue_station.processing_items %>
|
<%= @settings_order_queue_station.processing_items %>
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
<th>Order status</th>
|
<th>Order status</th>
|
||||||
<th>Order date</th>
|
<th>Order date</th>
|
||||||
<th>Items Count</th>
|
<th>Items Count</th>
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -42,13 +41,13 @@
|
|||||||
<% @orders.each do |order| %>
|
<% @orders.each do |order| %>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= order.order_id %></td>
|
<td><%= link_to order.order_id, transactions_order_path(order) %></td>
|
||||||
<td><%= order.order_type %></td>
|
<td><%= order.order_type %></td>
|
||||||
<td><%= order.customer.name rescue '-' %></td>
|
<td><%= order.customer.name rescue '-' %></td>
|
||||||
<td><%= order.status %></td>
|
<td><%= order.status %></td>
|
||||||
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
|
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
|
||||||
<td> <%= order.item_count %> </td>
|
<td> <%= order.item_count %> </td>
|
||||||
<td><%= link_to 'Show', transactions_order_path(order) %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -8,13 +8,18 @@
|
|||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="<%= transactions_orders_path %>"><%= @order.order_id %></a>
|
<a href="<%= transactions_orders_path %>"><%= @order.order_id %></a>
|
||||||
</li>
|
</li>
|
||||||
|
<span style="float: right">
|
||||||
|
<a href="<%= transactions_orders_path%>" class="btn btn-primary btn-sm">
|
||||||
|
<i class="fa fa-arrow-left fa-xs"></i> Back
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||||
<div class="main-box-body clearfix">
|
<div class="main-box-body clearfix">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
@@ -46,7 +51,7 @@
|
|||||||
<th>Qty</th>
|
<th>Qty</th>
|
||||||
<th> Unit Price</th>
|
<th> Unit Price</th>
|
||||||
<th>Total Price</th>
|
<th>Total Price</th>
|
||||||
<th>Option</th>
|
<!-- <th>Option</th> -->
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Order By</th>
|
<th>Order By</th>
|
||||||
<th>Created at</th>
|
<th>Created at</th>
|
||||||
@@ -62,7 +67,7 @@
|
|||||||
<td><%= order.qty %></td>
|
<td><%= order.qty %></td>
|
||||||
<td><%= order.price %></td>
|
<td><%= order.price %></td>
|
||||||
<td><%= order.qty * order.price %></td>
|
<td><%= order.qty * order.price %></td>
|
||||||
<td> <%= order.options %> </td>
|
<!-- <td> <%= order.options %> </td> -->
|
||||||
<td> <%= order.order_item_status %> </td>
|
<td> <%= order.order_item_status %> </td>
|
||||||
<td> <%= order.item_order_by %> </td>
|
<td> <%= order.item_order_by %> </td>
|
||||||
<td> <%= order.created_at.strftime("%d-%m-%Y") %> </td>
|
<td> <%= order.created_at.strftime("%d-%m-%Y") %> </td>
|
||||||
@@ -70,13 +75,16 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<a href="<%= transactions_orders_path%>" class="btn btn-primary pull-left">
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- <div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
|
<a href="<%= transactions_orders_path%>" class="btn btn-primary">
|
||||||
<i class="fa fa-arrow-left fa-xs"></i> Back
|
<i class="fa fa-arrow-left fa-xs"></i> Back
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
<th>Cashier</th>
|
<th>Cashier</th>
|
||||||
<th>Sales status</th>
|
<th>Sales status</th>
|
||||||
<th>Receipt Date</th>
|
<th>Receipt Date</th>
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -44,14 +43,13 @@
|
|||||||
<% if @sales != 0 %>
|
<% if @sales != 0 %>
|
||||||
<% @sales.each do |sale| %>
|
<% @sales.each do |sale| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= sale.sale_id %></td>
|
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||||
<td><%= sale.receipt_no %></td>
|
<td><%= sale.receipt_no %></td>
|
||||||
<td><%= sale.grand_total rescue '-' %></td>
|
<td><%= sale.grand_total rescue '-' %></td>
|
||||||
<td><%= sale.total_tax %></td>
|
<td><%= sale.total_tax %></td>
|
||||||
<td><%= sale.cashier_name rescue '-' %></td>
|
<td><%= sale.cashier_name rescue '-' %></td>
|
||||||
<td> <%= sale.sale_status %> </td>
|
<td> <%= sale.sale_status %> </td>
|
||||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
|
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
|
||||||
<td><%= link_to 'Show', transactions_sale_path(sale) %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -8,11 +8,24 @@
|
|||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="<%= transactions_sale_path(@sale.sale_id) %>"><%= @sale.sale_id %></a>
|
<a href="<%= transactions_sale_path(@sale.sale_id) %>"><%= @sale.sale_id %></a>
|
||||||
</li>
|
</li>
|
||||||
|
<span style="float: right">
|
||||||
|
<a href="<%= transactions_sales_path%>" class="btn btn-primary btn-sm">
|
||||||
|
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<a href="<%= transactions_void_path(@sale)%>" class="btn btn-danger btn-sm">
|
||||||
|
<i class="fa fa-trash fa-lg"></i> Void Sale
|
||||||
|
</a>
|
||||||
|
<a href="<%= transactions_manual_complete_sale_path(@sale)%>" class="btn btn-success btn-sm" disabled>
|
||||||
|
<i class="fa fa-invoice fa-lg"></i> Complete Sale
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
|
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
@@ -29,7 +42,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<!-- Nav tabs - End -->
|
<!-- Nav tabs - End -->
|
||||||
|
|
||||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
<div class="tab-content" style="min-height:670px; max-height:670px;">
|
||||||
|
|
||||||
<div class="tab-pane active" id="queue" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
|
<div class="tab-pane active" id="queue" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@@ -53,7 +66,7 @@
|
|||||||
<td><%= @sale.receipt_no %></td>
|
<td><%= @sale.receipt_no %></td>
|
||||||
<td><%= @sale.cashier_name rescue '-' %></td>
|
<td><%= @sale.cashier_name rescue '-' %></td>
|
||||||
<td> <%= @sale.sale_status %> </td>
|
<td> <%= @sale.sale_status %> </td>
|
||||||
<td> <%= @sale.requested_at.strftime("%d-%m-%Y") %> </td>
|
<td> <%= @sale.requested_at %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="border-top:2px solid #000">
|
<tr style="border-top:2px solid #000">
|
||||||
<th>Sale item name</th>
|
<th>Sale item name</th>
|
||||||
@@ -82,12 +95,13 @@
|
|||||||
<td>Discount</td>
|
<td>Discount</td>
|
||||||
<td colspan="2"><%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
<td colspan="2"><%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% @sale.sale_taxes.each do |r|%>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 style="text-align:center"></td>
|
<td colspan=2 style="text-align:center"></td>
|
||||||
<td>Tax</td>
|
<td><%= r.tax_name %> </td>
|
||||||
<td colspan="2"><%= number_with_precision(@sale.total_tax, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
<td colspan="2"><%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 style="text-align:center"></td>
|
<td colspan=2 style="text-align:center"></td>
|
||||||
<td>Grand Total</td>
|
<td>Grand Total</td>
|
||||||
@@ -99,21 +113,24 @@
|
|||||||
<td>Pay Amount</td>
|
<td>Pay Amount</td>
|
||||||
<td colspan="2"><%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
<td colspan="2"><%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan=2 style="text-align:center"></td>
|
|
||||||
<td>Change</td>
|
|
||||||
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
|
||||||
</tr>
|
|
||||||
<% @sale_receivables.each do |r|%>
|
<% @sale_receivables.each do |r|%>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 style="text-align:center"></td>
|
<td colspan=2 style="text-align:center"></td>
|
||||||
<td>Payment <%= r.payment_method rescue ' '%></td>
|
<td>Payment <%= r.payment_method rescue ' '%></td>
|
||||||
<td colspan="2"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
|
<td colspan="2"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan=2 style="text-align:center"></td>
|
||||||
|
<td>Change</td>
|
||||||
|
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -160,7 +177,61 @@
|
|||||||
<div class="tab-pane" id="customer" role="tabpanel">
|
<div class="tab-pane" id="customer" role="tabpanel">
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<!-- -->
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<br>
|
||||||
|
<h4>Customer Profile</h4>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<td><%= @customer.name %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Email</th>
|
||||||
|
<td><%= @customer.email %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Contact no</th>
|
||||||
|
<td><%= @customer.contact_no %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Company</th>
|
||||||
|
<td><%= @customer.company %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Date Of Birth</th>
|
||||||
|
<td><%= @customer.date_of_birth %> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<br>
|
||||||
|
<h4>Membership Detail</h4>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<% if @membership == 0 %>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">"There is no membership data"</td>
|
||||||
|
</tr>
|
||||||
|
<% else %>
|
||||||
|
<% @membership.each do |member| %>
|
||||||
|
<tr>
|
||||||
|
<th><%= member["accountable_type"] %></th>
|
||||||
|
<td><%= member["balance"] %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -168,20 +239,19 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<!-- <div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary btn-lg">
|
||||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Temporary No Needs -->
|
|
||||||
<a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-danger pull-right btn-lg">
|
|
||||||
|
|
||||||
|
<a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-danger btn-lg">
|
||||||
<i class="fa fa-trash fa-lg"></i> Void Sale
|
<i class="fa fa-trash fa-lg"></i> Void Sale
|
||||||
</a>
|
</a>
|
||||||
<a href="<%= transactions_manual_complete_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-success pull-right btn-lg">
|
<a href="<%= transactions_manual_complete_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-success btn-lg">
|
||||||
<i class="fa fa-invoice fa-lg"></i> Complete Sale
|
<i class="fa fa-invoice fa-lg"></i> Complete Sale
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -124,11 +124,15 @@ Rails.application.routes.draw do
|
|||||||
post "update_booking" , to: "bookings#update_booking", as: "update_booking"#assign and cancel
|
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 '/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
|
end
|
||||||
|
|
||||||
#--------- Order Queue Station ------------#
|
#--------- Order Queue Station ------------#
|
||||||
namespace :oqs do
|
namespace :oqs do
|
||||||
root "home#index"
|
root "home#index"
|
||||||
|
get "/:table_id", to: "home#get_order_items"
|
||||||
|
|
||||||
post 'update_delivery', to: "home#update_delivery_status"
|
post 'update_delivery', to: "home#update_delivery_status"
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class CreateOrderQueueStations < ActiveRecord::Migration[5.1]
|
|||||||
t.integer :font_size, :null => false, :default => 10
|
t.integer :font_size, :null => false, :default => 10
|
||||||
t.boolean :cut_per_item, :null => false, :default => false
|
t.boolean :cut_per_item, :null => false, :default => false
|
||||||
t.boolean :use_alternate_name, :null => false, :default => false
|
t.boolean :use_alternate_name, :null => false, :default => false
|
||||||
|
t.boolean :auto_print, :null => false, :default => false
|
||||||
t.string :created_by, :null => false
|
t.string :created_by, :null => false
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class CreateDiningQueues < ActiveRecord::Migration[5.1]
|
|||||||
t.string :contact_no
|
t.string :contact_no
|
||||||
t.string :queue_no
|
t.string :queue_no
|
||||||
t.string :status
|
t.string :status
|
||||||
|
t.references :dining_facility, foreign_key: true
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
@@ -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