fixed fonflict
This commit is contained in:
@@ -1,15 +1,3 @@
|
||||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
||||
//
|
||||
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
||||
// about supported directives.
|
||||
//
|
||||
//= require jquery
|
||||
//= require tether
|
||||
//= require bootstrap
|
||||
@@ -304,49 +292,9 @@ $(document).ready(function(){
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
// $(".orders").on('click', function(){
|
||||
// var dining_id = $(this).attr("data-id");
|
||||
// window.location.href = '/origami/' + dining_id;
|
||||
// })
|
||||
|
||||
});
|
||||
|
||||
/* Button Control by Status */
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', false);
|
||||
$("#pay-bill").prop('disabled', false);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}
|
||||
else if(order_status=="new") {
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', false);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}else if(order_status=="completed"){
|
||||
$("#re-print").prop('disabled', false);
|
||||
}
|
||||
else {
|
||||
$("#customer").prop('disabled', true);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* For Receipt - Update Balance */
|
||||
function update_balance(){
|
||||
var discount_type = $('#discount-type').val();
|
||||
var discount_amount = $('#discount-amount').val();
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var tax = $('#order-Tax').text();
|
||||
|
||||
// For Percentage Discount
|
||||
if(discount_type == 1){
|
||||
discount_amount=(sub_total*discount_amount)/100;
|
||||
}
|
||||
|
||||
var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount;
|
||||
$('#order-discount').text(discount_amount);
|
||||
$('#order-grand-total').text(total);
|
||||
}
|
||||
|
||||
352
app/assets/javascripts/origami_bk.js
Normal file
352
app/assets/javascripts/origami_bk.js
Normal file
@@ -0,0 +1,352 @@
|
||||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
||||
//
|
||||
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
||||
// about supported directives.
|
||||
//
|
||||
//= require jquery
|
||||
//= require tether
|
||||
//= require bootstrap
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require cable
|
||||
//= require jquery-ui
|
||||
//= require bootstrap-datepicker
|
||||
|
||||
$(document).ready(function(){
|
||||
// auto refresh every 60 seconds
|
||||
// setTimeout(function(){
|
||||
// window.location.reload(1);
|
||||
// }, 60000);
|
||||
|
||||
// For selected order return
|
||||
var order_status = "";
|
||||
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
|
||||
|
||||
// Enable/Disable Button
|
||||
control_button(order_status);
|
||||
|
||||
$(".orders").on('click', function(){
|
||||
$("#order-sub-total").text('');
|
||||
// $("#order-food").text('');
|
||||
// $("#order-beverage").text('');
|
||||
$("#order-discount").text('');
|
||||
$("#order-Tax").text('');
|
||||
$("#order-grand-total").text('');
|
||||
|
||||
var zone_name=$(this).find(".orders-table").text();
|
||||
var receipt_no=$(this).find(".orders-receipt-no").text();
|
||||
var unique_id = $(this).find(".orders-id").text();
|
||||
var order_status=$(this).find(".orders-order-status").text().trim();
|
||||
|
||||
// Enable/Disable Button
|
||||
control_button(order_status);
|
||||
|
||||
var customer_id=$(this).find(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
$("#re-print").val(unique_id);
|
||||
|
||||
var cashier="";
|
||||
var receipt_date="";
|
||||
var sub_total=0.0;
|
||||
var discount_amount=0;
|
||||
var tax_amount=0;
|
||||
var grand_total_amount=0;
|
||||
|
||||
$("#order-title").text("ORDER DETAILS - " + zone_name);
|
||||
// clear order items
|
||||
$("#order-items-table").children("tbody").empty();
|
||||
|
||||
// AJAX call for order
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/" + unique_id,
|
||||
data: { 'booking_id' : unique_id },
|
||||
success:function(result){
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var show_date = "";
|
||||
|
||||
// Receipt Header
|
||||
receipt_no = result[i].receipt_no;
|
||||
cashier = result[i].cashier_name;
|
||||
if(result[i].receipt_date != null){
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
}
|
||||
|
||||
//Receipt Charges
|
||||
sub_total += parseFloat(parse_data.price);
|
||||
|
||||
discount_amount = parse_data.discount_amount == null? '0.0' : parse_data.discount_amount;
|
||||
tax_amount = parse_data.tax_amount;
|
||||
grand_total_amount = parse_data.grand_total_amount;
|
||||
|
||||
// Ordered Items
|
||||
var order_items_rows = "<tr>" +
|
||||
"<td class='item-name'>" + parse_data.item_name + "</td>" +
|
||||
"<td class='item-attr'>" + parse_data.qty + "</td>" +
|
||||
"<td class='item-attr'>" + parse_data.price + "</td>" +
|
||||
"</tr>";
|
||||
|
||||
$("#order-items-table").children("tbody").append(order_items_rows);
|
||||
}
|
||||
|
||||
// Cashier Info
|
||||
$("#receipt_no").text(receipt_no);
|
||||
$("#cashier").text(cashier == null ? "" : cashier);
|
||||
$("#receipt_date").text(show_date);
|
||||
|
||||
// Payment Info
|
||||
$("#order-sub-total").text(sub_total);
|
||||
// $("#order-food").text('');
|
||||
// $("#order-beverage").text('');
|
||||
$("#order-discount").text(discount_amount);
|
||||
$("#order-Tax").text(tax_amount);
|
||||
$("#order-grand-total").text(grand_total_amount);
|
||||
}
|
||||
});
|
||||
// End AJAX Call
|
||||
|
||||
$('.orders').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
$('#request_bills').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/request_bills'
|
||||
}
|
||||
else {
|
||||
alert("Please select an order!");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/discount'
|
||||
}
|
||||
else {
|
||||
alert("Please select an order!");
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Pay Discount for Payment
|
||||
$("#pay-discount").on('click', function(e){
|
||||
e.preventDefault();
|
||||
var sale_id = $('#sale-id').text();
|
||||
var sale_item_id = $('.selected-item').attr('id').substr(0,16);
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var grand_total = $('#order-grand-total').text();
|
||||
var discount_type = $('#discount-type').val();
|
||||
var discount_value = $('#discount-amount').val();
|
||||
var discount_amount = discount_value;
|
||||
var ajax_url = "/origami/" + sale_id + "/discount";
|
||||
|
||||
if(sale_item_id != null){
|
||||
ajax_url = "/origami/" + sale_item_id + "/discount";
|
||||
sub_total = $("#"+sale_item_id).children().find("#item-total-price").text();
|
||||
}
|
||||
|
||||
// For Percentage Discount
|
||||
if(discount_type == 1){
|
||||
discount_amount=(sub_total*discount_value)/100;
|
||||
}
|
||||
|
||||
var params = {'sale_id': sale_id, 'sale_item_id': sale_item_id, 'grand_total' : grand_total, 'discount_type':discount_type, 'discount_value':discount_value, 'discount_amount':discount_amount};
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: params,
|
||||
success:function(result){ }
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Payment for Bill
|
||||
$('#pay-bill').click(function() {
|
||||
var sale_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if(sale_id!=""){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
}
|
||||
else {
|
||||
alert("Please select an order!");
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#customer').click(function() {
|
||||
var sale = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if (sale.substring(0, 3)=="SAL") {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
var sale_id = $(".selected-item").find(".order-cid").text();
|
||||
}
|
||||
window.location.href = '/origami/'+ sale_id + "/customers"
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#re-print').click(function() {
|
||||
var sale_id = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function show_customer_details(customer_id){
|
||||
|
||||
if(window.location.pathname.substring(0, 12) == "/origami/SAL"){
|
||||
var url = customer_id+"/get_customer/"
|
||||
}else{
|
||||
var url = "origami/"+customer_id+"/get_customer/"
|
||||
}
|
||||
|
||||
$('.customer_detail').removeClass('hide');
|
||||
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
if (data["response_data"]["data"].length) {
|
||||
$.each(data["response_data"]["data"], function (i) {
|
||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
var balance = data["response_data"]["data"][i]["balance"];
|
||||
if (data["response_data"]["status"]==true) {
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
row =
|
||||
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('.rebate_amount').addClass('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
}
|
||||
|
||||
/* For Receipt - Calculate discount or tax */
|
||||
$('.cashier_number').on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value=0;
|
||||
original_value = $('#discount-amount').val();
|
||||
|
||||
var input_type = $(this).attr("data-type");
|
||||
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
var input_value = $(this).attr("data-value");
|
||||
if (original_value == "0.0"){
|
||||
$('#discount-amount').val(input_value);
|
||||
update_balance();
|
||||
}
|
||||
else{
|
||||
$('#discount-amount').val(original_value + '' + input_value);
|
||||
update_balance();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value);
|
||||
$('#discount-amount').val(amount);
|
||||
$('#discount-type').val(1);
|
||||
update_balance();
|
||||
break;
|
||||
|
||||
case 'del' :
|
||||
var discount_text=$('#discount-amount').val();
|
||||
$('#discount-amount').val(discount_text.substr(0,discount_text.length-1));
|
||||
update_balance();
|
||||
break;
|
||||
|
||||
case 'clr':
|
||||
$('#discount-amount').val("0.0");
|
||||
update_balance();
|
||||
break;
|
||||
}
|
||||
|
||||
event.handled = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.discount-item-row').on('click',function(){
|
||||
$('.discount-item-row').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* Button Control by Status */
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', false);
|
||||
$("#pay-bill").prop('disabled', false);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}
|
||||
else if(order_status=="new") {
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', false);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}else if(order_status=="completed"){
|
||||
$("#re-print").prop('disabled', false);
|
||||
}
|
||||
else {
|
||||
$("#customer").prop('disabled', true);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
$("#re-print").prop('disabled', true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* For Receipt - Update Balance */
|
||||
function update_balance(){
|
||||
var discount_type = $('#discount-type').val();
|
||||
var discount_amount = $('#discount-amount').val();
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var tax = $('#order-Tax').text();
|
||||
|
||||
// For Percentage Discount
|
||||
if(discount_type == 1){
|
||||
discount_amount=(sub_total*discount_amount)/100;
|
||||
}
|
||||
|
||||
var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount;
|
||||
$('#order-discount').text(discount_amount);
|
||||
$('#order-grand-total').text(total);
|
||||
}
|
||||
@@ -47,11 +47,29 @@
|
||||
font-size:20px;
|
||||
color:white;
|
||||
}
|
||||
.payment{
|
||||
height:70px;line-height:70px;align:center;color:white;font-size:16px;margin-bottom:1px;
|
||||
}
|
||||
|
||||
.cash-color{
|
||||
background-color:#80CBC4;
|
||||
}
|
||||
|
||||
.credit-color{
|
||||
background-color:#FFCCBC;
|
||||
}
|
||||
.other-payment-color{
|
||||
background-color:#E1BEE7;
|
||||
}
|
||||
|
||||
.cashier_number:hover{
|
||||
background:#A9F5F2;
|
||||
}
|
||||
|
||||
.style2 {
|
||||
border-top: 3px double #8c8b8b;
|
||||
}
|
||||
|
||||
.long{
|
||||
width:49%;
|
||||
}
|
||||
@@ -89,6 +107,13 @@
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.display-none{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.text-white{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Colors */
|
||||
.purple {
|
||||
@@ -103,6 +128,10 @@
|
||||
background-color: #009900
|
||||
}
|
||||
|
||||
.orange{
|
||||
background-color: #FF8C00
|
||||
}
|
||||
|
||||
.left{
|
||||
margin-left:1px;
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@ class Oqs::HomeController < BaseOqsController
|
||||
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)
|
||||
# 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)
|
||||
# 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
|
||||
|
||||
@@ -49,7 +49,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
end
|
||||
end
|
||||
|
||||
# booking_id = dining.get_new_booking
|
||||
# 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|
|
||||
@@ -81,6 +81,8 @@ class Oqs::HomeController < BaseOqsController
|
||||
|
||||
# Query for OQS with status
|
||||
def queue_items_query(status)
|
||||
puts status
|
||||
puts "put what is 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
|
||||
@@ -88,9 +90,9 @@ class Oqs::HomeController < BaseOqsController
|
||||
# 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}")
|
||||
# .where("assigned_order_items.delivery_status = #{status}")
|
||||
# .group("assigned_order_items.assigned_order_item_id")
|
||||
# .order("odt.item_name DESC")
|
||||
# .order("odt.item_name DESC")
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
.joins(" left join order_queue_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
|
||||
@@ -99,7 +101,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
.group("assigned_order_items.assigned_order_item_id,oqs.station_name,oqs.is_active,df.name,odt.item_code,odt.item_name,odt.price, odt.qty, odt.item_order_by,cus.name,odt.created_at")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,84 +1,50 @@
|
||||
class Origami::HomeController < BaseOrigamiController
|
||||
before_action :set_dining, only: [:show]
|
||||
|
||||
def index
|
||||
if params[:booking_id] != nil
|
||||
type=params[:booking_id].split('-')[0];
|
||||
# Sale
|
||||
if type == "SAL"
|
||||
@selected_item = Sale.find(params[:booking_id])
|
||||
@selected_item_type="Sale"
|
||||
# Booking
|
||||
else
|
||||
@selected_item = Order.find(params[:booking_id])
|
||||
@selected_item_type="Order"
|
||||
end
|
||||
end
|
||||
|
||||
@completed_orders = Order.get_completed_order()
|
||||
@booking_orders = Order.get_booking_order_table()
|
||||
@booking_rooms = Order.get_booking_order_rooms()
|
||||
@orders = Order.get_orders()
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
end
|
||||
|
||||
def item_show
|
||||
selection(params[:booking_id],1)
|
||||
end
|
||||
|
||||
def selection(selected_id, is_ajax)
|
||||
str = []
|
||||
type=selected_id.split('-')[0];
|
||||
# Sale
|
||||
if type == "SAL"
|
||||
@order_details = SaleItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
# Booking
|
||||
else
|
||||
@order_details = OrderItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
end
|
||||
|
||||
if is_ajax == 1
|
||||
render :json => str.to_json
|
||||
else
|
||||
str
|
||||
# origami table detail
|
||||
def show
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@status_order = ""
|
||||
@dining.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj_order = order
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if @status_order == 'order'
|
||||
@status_order = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status_sale = 'sale'
|
||||
@obj_sale = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update_sale_by_customer
|
||||
private
|
||||
|
||||
id = params[:sale_id][0,3]
|
||||
if(id == "SAL")
|
||||
sale = Sale.find(params[:sale_id])
|
||||
else
|
||||
sale = Order.find(params[:sale_id])
|
||||
end
|
||||
|
||||
status = sale.update_attributes(customer_id: params[:customer_id])
|
||||
|
||||
if status == true
|
||||
render json: JSON.generate({:status => true})
|
||||
else
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def get_customer
|
||||
|
||||
@customer = Customer.find(params[:customer_id])
|
||||
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
respond_to do |format|
|
||||
format.js do
|
||||
render :json => {
|
||||
:response_data => response.as_json,
|
||||
:customer => @customer}
|
||||
end
|
||||
end
|
||||
end
|
||||
def set_dining
|
||||
@dining = DiningFacility.find(params[:dining_id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
84
app/controllers/origami/home_controller_bk.rb
Normal file
84
app/controllers/origami/home_controller_bk.rb
Normal file
@@ -0,0 +1,84 @@
|
||||
class Origami::HomeController < BaseOrigamiController
|
||||
def index
|
||||
if params[:booking_id] != nil
|
||||
type=params[:booking_id].split('-')[0];
|
||||
# Sale
|
||||
if type == "SAL"
|
||||
@selected_item = Sale.find(params[:booking_id])
|
||||
@selected_item_type="Sale"
|
||||
# Booking
|
||||
else
|
||||
@selected_item = Order.find(params[:booking_id])
|
||||
@selected_item_type="Order"
|
||||
end
|
||||
end
|
||||
|
||||
@completed_orders = Order.get_completed_order()
|
||||
@booking_orders = Order.get_booking_order_table()
|
||||
@booking_rooms = Order.get_booking_order_rooms()
|
||||
@orders = Order.get_orders()
|
||||
end
|
||||
|
||||
def item_show
|
||||
selection(params[:booking_id],1)
|
||||
end
|
||||
|
||||
def selection(selected_id, is_ajax)
|
||||
str = []
|
||||
type=selected_id.split('-')[0];
|
||||
# Sale
|
||||
if type == "SAL"
|
||||
@order_details = SaleItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
# Booking
|
||||
else
|
||||
@order_details = OrderItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
end
|
||||
|
||||
if is_ajax == 1
|
||||
render :json => str.to_json
|
||||
else
|
||||
str
|
||||
end
|
||||
end
|
||||
|
||||
def update_sale_by_customer
|
||||
|
||||
id = params[:sale_id][0,3]
|
||||
if(id == "SAL")
|
||||
sale = Sale.find(params[:sale_id])
|
||||
else
|
||||
sale = Order.find(params[:sale_id])
|
||||
end
|
||||
|
||||
status = sale.update_attributes(customer_id: params[:customer_id])
|
||||
|
||||
if status == true
|
||||
render json: JSON.generate({:status => true})
|
||||
else
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def get_customer
|
||||
|
||||
@customer = Customer.find(params[:customer_id])
|
||||
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
respond_to do |format|
|
||||
format.js do
|
||||
render :json => {
|
||||
:response_data => response.as_json,
|
||||
:customer => @customer}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
37
app/controllers/origami/moveroom_controller.rb
Normal file
37
app/controllers/origami/moveroom_controller.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
class Origami::MoveroomController < BaseOrigamiController
|
||||
|
||||
def move_dining
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
|
||||
@status_order = ""
|
||||
@dining = DiningFacility.find(params[:dining_id])
|
||||
@dining.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj_order = order
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if @status_order == 'order'
|
||||
@status_order = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status_sale = 'sale'
|
||||
@obj_sale = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
49
app/controllers/origami/movetable_controller.rb
Normal file
49
app/controllers/origami/movetable_controller.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
class Origami::MovetableController < BaseOrigamiController
|
||||
|
||||
def move_dining
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
|
||||
@status_order = ""
|
||||
@dining = DiningFacility.find(params[:dining_id])
|
||||
@dining.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj_order = order
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if @status_order == 'order'
|
||||
@status_order = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status_sale = 'sale'
|
||||
@obj_sale = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
booking_array = Array.new
|
||||
bookings.each do | booking |
|
||||
if booking.sale_id.nil? || booking.sale.sale_status != 'completed'
|
||||
booking_array.push(booking)
|
||||
end
|
||||
end
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
end
|
||||
end
|
||||
10
app/controllers/origami/orders_controller.rb
Normal file
10
app/controllers/origami/orders_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Origami::OrdersController < BaseOrigamiController
|
||||
|
||||
def show
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@order = Order.find(params[:order_id])
|
||||
end
|
||||
end
|
||||
@@ -4,8 +4,9 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
@sale = Sale.new
|
||||
sale_order=SaleOrder.new
|
||||
|
||||
booking_id = params[:id]
|
||||
check_booking = Booking.find_by_booking_id(booking_id)
|
||||
order_id = params[:id] # order_id
|
||||
bk_order = BookingOrder.find_by_order_id(order_id)
|
||||
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
|
||||
if check_booking.sale_id.nil?
|
||||
# Create Sale if it doesn't exist
|
||||
puts "current_login_employee"
|
||||
@@ -34,7 +35,9 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
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,member_info)
|
||||
redirect_to origami_path(@sale_data.sale_id)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
32
app/controllers/origami/rooms_controller.rb
Normal file
32
app/controllers/origami/rooms_controller.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class Origami::RoomsController < BaseOrigamiController
|
||||
|
||||
def show
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
@room.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj = order
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status = 'order'
|
||||
else
|
||||
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
@status = 'sale'
|
||||
@obj = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
10
app/controllers/origami/sales_controller.rb
Normal file
10
app/controllers/origami/sales_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Origami::SalesController < BaseOrigamiController
|
||||
|
||||
def show
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@sale = Sale.find(params[:sale_id])
|
||||
end
|
||||
end
|
||||
@@ -27,6 +27,7 @@ class Settings::OrderQueueStationsController < ApplicationController
|
||||
def create
|
||||
@settings_order_queue_station = OrderQueueStation.new(settings_order_queue_station_params)
|
||||
@settings_order_queue_station.created_by = current_login_employee.name
|
||||
@settings_order_queue_station.processing_items = "[]"
|
||||
respond_to do |format|
|
||||
if @settings_order_queue_station.save
|
||||
format.html { redirect_to settings_order_queue_stations_path, notice: 'Order queue station was successfully created.' }
|
||||
|
||||
@@ -10,6 +10,19 @@ class Booking < ApplicationRecord
|
||||
has_many :booking_orders
|
||||
has_many :orders, :through => :booking_orders
|
||||
|
||||
def self.update_dining_facility(booking_arr, newd, old)
|
||||
booking_arr.each do |booking|
|
||||
booking.dining_facility_id = newd
|
||||
booking.save
|
||||
end
|
||||
new_dining = DiningFacility.find(newd)
|
||||
new_dining.make_occupied
|
||||
old_dining = DiningFacility.find(old)
|
||||
old_dining.make_available
|
||||
|
||||
return new_dining.type
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class BookingOrder < ApplicationRecord
|
||||
#primary key - need to be unique
|
||||
#primary key - need to be unique
|
||||
|
||||
belongs_to :booking
|
||||
belongs_to :order
|
||||
|
||||
@@ -8,9 +8,19 @@ class DiningFacility < ApplicationRecord
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def make_available
|
||||
self.status = 'available'
|
||||
self.save
|
||||
end
|
||||
|
||||
def make_occupied
|
||||
self.status = 'occupied'
|
||||
self.save
|
||||
end
|
||||
|
||||
def get_current_booking
|
||||
puts "enter booking"
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
puts "enter booking"
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
|
||||
if booking.count > 0 then
|
||||
return booking[0].booking_id
|
||||
@@ -21,10 +31,10 @@ class DiningFacility < ApplicationRecord
|
||||
|
||||
def get_new_booking
|
||||
# query for new
|
||||
# if status
|
||||
# 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
|
||||
# else
|
||||
# booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and sale_id not null").limit(1)
|
||||
# end
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Order < ApplicationRecord
|
||||
|
||||
#internal references attributes for business logic control
|
||||
attr_accessor :items, :guest, :table_id, :new_booking, :booking_type, :employee_name, :booking_id
|
||||
|
||||
scope :active, -> { where("date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
|
||||
#Main Controller method to create new order - validate all inputs and generate new order
|
||||
# order_item : {
|
||||
# order_item_code : "",
|
||||
@@ -231,7 +231,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("(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
|
||||
# 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
|
||||
@@ -246,7 +246,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("sales.sale_status='completed'")
|
||||
.group("sales.sale_id")
|
||||
.group("sales.sale_id,bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
||||
# For PG
|
||||
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||
end
|
||||
@@ -262,7 +262,7 @@ class Order < ApplicationRecord
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("(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
|
||||
# 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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class Room < DiningFacility
|
||||
|
||||
has_many :bookings, :foreign_key => 'dining_facility_id'
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ class Sale < ApplicationRecord
|
||||
has_many :bookings
|
||||
|
||||
scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
|
||||
scope :complete_sale, -> { where("sale_status = 'completed' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
|
||||
|
||||
REPORT_TYPE = {
|
||||
"daily" => 0,
|
||||
@@ -31,7 +32,7 @@ class Sale < ApplicationRecord
|
||||
if (booking)
|
||||
Rails.logger.debug "Booking -> Booking Order Count -> " + booking.booking_orders.count.to_s
|
||||
#get all order attached to this booking and combine into 1 invoice
|
||||
|
||||
|
||||
booking.booking_orders.each do |order|
|
||||
if booking.sale_id
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
||||
@@ -289,15 +290,15 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.daily_sales_list(from,to)
|
||||
def self.daily_sales_list(from,to)
|
||||
payments_total = Sale.select("CAST((CONVERT_TZ(sales.receipt_date,'+00:00','+06:30')) AS DATE) as sale_date,
|
||||
SUM(case when (sale_payments.payment_method='mpu') then sale_payments.payment_amount else 0 end) as mpu_amount,
|
||||
SUM(case when (sale_payments.payment_method='master') then sale_payments.payment_amount else 0 end) as master_amount,
|
||||
SUM(case when (sale_payments.payment_method='visa') then sale_payments.payment_amount else 0 end) as visa_amount,
|
||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='credit') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='mpu') then sale_payments.payment_amount else 0 end) as mpu_amount,
|
||||
SUM(case when (sale_payments.payment_method='master') then sale_payments.payment_amount else 0 end) as master_amount,
|
||||
SUM(case when (sale_payments.payment_method='visa') then sale_payments.payment_amount else 0 end) as visa_amount,
|
||||
SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount,
|
||||
SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount,
|
||||
SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount,
|
||||
SUM(case when (sale_payments.payment_method='credit') then sale_payments.payment_amount else 0 end) as credit_amount,
|
||||
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
|
||||
.joins("join (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sale_payments on sale_payments.sale_id = sales.sale_id")
|
||||
.where("sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0", 'completed', from, to)
|
||||
@@ -312,27 +313,27 @@ class Sale < ApplicationRecord
|
||||
from_date = sale_date.beginning_of_day.utc - diff
|
||||
to_date = sale_date.end_of_day.utc - diff
|
||||
|
||||
total_sale = Sale.select("IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) as grand_total,
|
||||
IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0) as total_discount,
|
||||
IFNULL(SUM(case when (sale_status='void') then grand_total else 0 end),0) as void_amount,
|
||||
total_sale = Sale.select("IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) as grand_total,
|
||||
IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0) as total_discount,
|
||||
IFNULL(SUM(case when (sale_status='void') then grand_total else 0 end),0) as void_amount,
|
||||
IFNULL(SUM(case when (sale_status='completed') then rounding_adjustment else 0 end),0) as rounding_adj")
|
||||
.where("(sale_status = ? OR sale_status = ?) AND receipt_date between ? and ? AND total_amount != 0", 'completed', 'void', from_date, to_date)
|
||||
|
||||
|
||||
total_sale.each do |sale|
|
||||
grand_total = sale.grand_total
|
||||
total_discount = sale.total_discount
|
||||
void_amount = sale.void_amount
|
||||
total = {:sale_date => pay.sale_date,
|
||||
void_amount = sale.void_amount
|
||||
total = {:sale_date => pay.sale_date,
|
||||
:mpu_amount => pay.mpu_amount,
|
||||
:master_amount => pay.master_amount,
|
||||
:visa_amount => pay.visa_amount,
|
||||
:jcb_amount => pay.jcb_amount,
|
||||
:paypar_amount => pay.paypar_amount,
|
||||
:cash_amount => pay.cash_amount,
|
||||
:credit_amount => pay.credit_amount,
|
||||
:cash_amount => pay.cash_amount,
|
||||
:credit_amount => pay.credit_amount,
|
||||
:foc_amount => pay.foc_amount,
|
||||
:total_discount => total_discount,
|
||||
:grand_total => grand_total,
|
||||
:total_discount => total_discount,
|
||||
:grand_total => grand_total,
|
||||
:void_amount => void_amount,
|
||||
:rounding_adj => sale.rounding_adj}
|
||||
daily_total.push(total)
|
||||
|
||||
@@ -67,7 +67,7 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.get_paypar_account(url,token,membership_id,campaign_type_id,merchant_uid,auth_token)
|
||||
# Control for Paypar Cloud
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.get(url,
|
||||
:body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
@@ -93,25 +93,23 @@ class SalePayment < ApplicationRecord
|
||||
campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"]
|
||||
sale_data = Sale.find_by_sale_id(sale_id)
|
||||
|
||||
if sale_data
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.post(url,
|
||||
:body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipt_no:sale_data.receipt_no,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
puts "vvvvvvvvv"
|
||||
puts response.to_json
|
||||
rescue Net::OpenTimeout
|
||||
response = false
|
||||
end
|
||||
else
|
||||
response = false;
|
||||
end
|
||||
if sale_data
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.post(url,
|
||||
:body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipt_no:sale_data.receipt_no,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = false
|
||||
end
|
||||
else
|
||||
response = false;
|
||||
end
|
||||
|
||||
else
|
||||
response =false;
|
||||
@@ -247,10 +245,17 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
|
||||
def table_update_status(sale_obj)
|
||||
booking = Booking.find_by_sale_id(sale_obj.id)
|
||||
status = true
|
||||
booking = Booking.find_by_sale_id(sale_obj.id)
|
||||
if booking
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
if table
|
||||
bookings = table.bookings
|
||||
bookings.each do |tablebooking|
|
||||
if tablebooking.sale.sale_status != 'completed'
|
||||
status = false
|
||||
end
|
||||
end
|
||||
if status
|
||||
table.status = "available"
|
||||
table.save
|
||||
end
|
||||
@@ -283,7 +288,7 @@ class SalePayment < ApplicationRecord
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
# Control for Paypar Cloud
|
||||
# Control for Paypar Cloud
|
||||
begin
|
||||
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id,
|
||||
receipt_no: receipt_no,auth_token:auth_token}.to_json,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Table < DiningFacility
|
||||
has_many :dining_ins
|
||||
|
||||
has_many :bookings, :foreign_key => 'dining_facility_id'
|
||||
end
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
class TableBooking < Booking
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container-fluid" style="min-height:30px; padding-left:0px !important; padding-right:0px !important; background:#54A5AF; margin-bottom:5px">
|
||||
<div style="padding-top:5px;padding-bottom:5px;margin-left:15px; margin-right:15px;">
|
||||
<div style="float:left;margin-top:3px;text-align:left; width:300px;color:#ffffff">
|
||||
<strong>CASHIER STATION 1 - CLOCK</strong>
|
||||
<div style="float:left;margin-top:3px;text-align:left;color:#ffffff">
|
||||
<strong>Cashier Station 1 - <%= Time.now.strftime('%a, %d %b %Y %H:%M:%S %p') %></strong>
|
||||
</div>
|
||||
<div style="float:right; margin-top:3px; text-align:right;width:200px;color:#ffffff">
|
||||
<% if current_login_employee %>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<%= stylesheet_link_tag 'origami', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'origami', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -23,7 +23,7 @@
|
||||
<%=message%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
<div class="col-lg-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<%= crm_root_path %>">Home</a></li>
|
||||
<!-- <li class="active">
|
||||
<a href="<%= crm_customers_path %>">Customer</a>
|
||||
</li> -->
|
||||
<!-- <a href="<%= new_crm_customer_path%>" class="btn btn-primary pull-right">
|
||||
<i class="fa fa-plus-circle fa-lg"></i> Add Customer
|
||||
</a> -->
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,11 +9,11 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
|
||||
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
|
||||
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
@@ -47,7 +41,7 @@
|
||||
<% if @crm_customers.count > 0 %>
|
||||
<% @i = 0 %>
|
||||
<% @crm_customers.each do |crm_customer| %>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||
@@ -56,8 +50,8 @@
|
||||
<td><%= crm_customer.company rescue '-' %></td>
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -67,7 +61,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
<%= paginate @crm_customers %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -145,7 +139,6 @@
|
||||
|
||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||
<%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%>
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<% str="[\"#{msg['contact_no']}\"]"
|
||||
str.gsub!('["', '')
|
||||
@@ -174,7 +167,7 @@
|
||||
<option value="<%= member.value %>">
|
||||
<%= member.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@@ -214,13 +207,13 @@
|
||||
// var url = "/"+customer_id;
|
||||
update_sale(customer_id,sale_id);
|
||||
}else{
|
||||
|
||||
|
||||
var url = "customers/"+customer_id;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
@@ -267,7 +260,7 @@
|
||||
}
|
||||
});
|
||||
// }else{
|
||||
|
||||
|
||||
// }
|
||||
})
|
||||
|
||||
@@ -276,41 +269,36 @@
|
||||
title: 'Confirm!',
|
||||
content: 'Are You Sure to assign this customer!',
|
||||
buttons: {
|
||||
|
||||
|
||||
cancel: function () {
|
||||
|
||||
|
||||
},
|
||||
confirm: {
|
||||
text: 'Confirm',
|
||||
btnClass: 'btn-green',
|
||||
keys: ['enter', 'shift'],
|
||||
action: function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "update_sale" ,
|
||||
data: {customer_id:customer_id,sale_id:sale_id},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.status == true)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
window.location.href = '/origami'
|
||||
}else{
|
||||
alert('Record not found!');
|
||||
location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,388 +1,120 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="Completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@completed_orders.each do |cpo|
|
||||
# ToDo no need check new
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id = ""
|
||||
customer_id = ""
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="Completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
# For CSS- Class for Order? Sale?
|
||||
# sale_status=""
|
||||
# if cpo.order_status == 'new'
|
||||
# unique_id=cpo.booking_id
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
# customer_id=cpo.order_customer_id
|
||||
# # check selected item and assign
|
||||
# if @selected_item_type == "Sale"
|
||||
# if cpo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= cpo.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= cpo.table_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= cpo.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= cpo.sale_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_orders.each do |bko|
|
||||
# No Show completed
|
||||
if bko.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
if bko.order_status == 'new'
|
||||
unique_id=bko.booking_id
|
||||
customer_id=bko.order_customer_id
|
||||
# check selected item and assign
|
||||
# if @selected_item != nil
|
||||
# if bko.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=bko.sale_id
|
||||
customer_id=bko.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= bko.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= bko.table_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= bko.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= bko.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_rooms.each do |rmo|
|
||||
# No Show completed
|
||||
if rmo.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
|
||||
if rmo.order_status == 'new'
|
||||
unique_id=rmo.booking_id
|
||||
customer_id=rmo.order_customer_id
|
||||
# check selected item and assign
|
||||
# if @selected_item != nil
|
||||
# if rmo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=rmo.sale_id
|
||||
customer_id=rmo.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= rmo.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= rmo.room_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= rmo.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= rmo.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@orders.each do |odr|
|
||||
# No Show completed
|
||||
if odr.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
|
||||
if odr.order_status == 'new'
|
||||
unique_id=odr.booking_id
|
||||
customer_id = odr.order_customer_id
|
||||
# if @selected_item != nil
|
||||
# if odr.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=odr.sale_id
|
||||
customer_id = odr.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= odr.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= odr.table_name %></h4
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= odr.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= odr.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS -</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Receipt No: <span id="receipt_no"><%=@selected_item.receipt_no rescue ' '%></span></p>
|
||||
<!-- <p>Cashier: <span id="cashier"><%=@sale_data.cashier_name rescue ' '%></span></p> -->
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%=@selected_item.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
# For Sale Items
|
||||
sub_total = 0
|
||||
if @selected_item_type == "Sale"
|
||||
@selected_item.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
<%
|
||||
# For Order Items
|
||||
if @selected_item_type == "Order"
|
||||
@selected_item.order_items.each do |order_item|
|
||||
sub_total = sub_total + (order_item.qty*order_item.price)
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td class="charges-name"><strong>Food:</strong></td>
|
||||
<td class="item-attr"><strong id="order-food"></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Beverage:</strong></td>
|
||||
<td class="item-attr"><strong id="order-beverage"></strong></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
|
||||
</tr> -->
|
||||
|
||||
<!-- <tr class="rebate_amount"></tr> -->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block">Pay</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-lg btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block"> Refresh </button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
$(".rooms").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
$(".orders").on('click',function(){
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
388
app/views/origami/home/index_bk.html.erb
Normal file
388
app/views/origami/home/index_bk.html.erb
Normal file
@@ -0,0 +1,388 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="Completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@completed_orders.each do |cpo|
|
||||
# ToDo no need check new
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id = ""
|
||||
customer_id = ""
|
||||
|
||||
# For CSS- Class for Order? Sale?
|
||||
# sale_status=""
|
||||
# if cpo.order_status == 'new'
|
||||
# unique_id=cpo.booking_id
|
||||
|
||||
# customer_id=cpo.order_customer_id
|
||||
# # check selected item and assign
|
||||
# if @selected_item_type == "Sale"
|
||||
# if cpo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= cpo.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= cpo.table_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= cpo.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= cpo.sale_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_orders.each do |bko|
|
||||
# No Show completed
|
||||
if bko.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
if bko.order_status == 'new'
|
||||
unique_id=bko.booking_id
|
||||
customer_id=bko.order_customer_id
|
||||
# check selected item and assign
|
||||
# if @selected_item != nil
|
||||
# if bko.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=bko.sale_id
|
||||
customer_id=bko.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= bko.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= bko.table_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= bko.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= bko.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_rooms.each do |rmo|
|
||||
# No Show completed
|
||||
if rmo.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
|
||||
if rmo.order_status == 'new'
|
||||
unique_id=rmo.booking_id
|
||||
customer_id=rmo.order_customer_id
|
||||
# check selected item and assign
|
||||
# if @selected_item != nil
|
||||
# if rmo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=rmo.sale_id
|
||||
customer_id=rmo.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= rmo.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= rmo.room_name %></h4>
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= rmo.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= rmo.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@orders.each do |odr|
|
||||
# No Show completed
|
||||
if odr.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
# Assigned Id for new Order? Sale?
|
||||
unique_id=""
|
||||
customer_id=""
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
|
||||
if odr.order_status == 'new'
|
||||
unique_id=odr.booking_id
|
||||
customer_id = odr.order_customer_id
|
||||
# if @selected_item != nil
|
||||
# if odr.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=odr.sale_id
|
||||
customer_id = odr.sale_customer_id
|
||||
sale_status="sold"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
<p class="hidden orders-id"><%= unique_id %></p>
|
||||
<p class="hidden customer-id"><%= customer_id %></p>
|
||||
<p class="hidden order-cid"><%= odr.order_id %></p>
|
||||
<h4 class="card-title orders-table"><%= odr.table_name %></h4
|
||||
<p class="card-text">
|
||||
Receipt No :
|
||||
<span class="orders-receipt-no">
|
||||
<%= odr.receipt_no %>
|
||||
</span>
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status"><%= odr.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS -</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Receipt No: <span id="receipt_no"><%=@selected_item.receipt_no rescue ' '%></span></p>
|
||||
<!-- <p>Cashier: <span id="cashier"><%=@sale_data.cashier_name rescue ' '%></span></p> -->
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%=@selected_item.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
# For Sale Items
|
||||
sub_total = 0
|
||||
if @selected_item_type == "Sale"
|
||||
@selected_item.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
<%
|
||||
# For Order Items
|
||||
if @selected_item_type == "Order"
|
||||
@selected_item.order_items.each do |order_item|
|
||||
sub_total = sub_total + (order_item.qty*order_item.price)
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td class="charges-name"><strong>Food:</strong></td>
|
||||
<td class="item-attr"><strong id="order-food"></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Beverage:</strong></td>
|
||||
<td class="item-attr"><strong id="order-beverage"></strong></td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%=@selected_item.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
|
||||
</tr> -->
|
||||
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block">Pay</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-lg btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
294
app/views/origami/home/show.html.erb
Normal file
294
app/views/origami/home/show.html.erb
Normal file
@@ -0,0 +1,294 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<% if @status_order == 'order' %>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @obj_order.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<% if @status_sale == "sale" %>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
@order_items.each do |order_item |
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
<% if @status_order == 'order' %>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<% else %>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
$(".rooms").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
$(".orders").on('click',function(){
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
});
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
|
||||
$('#request_bills').click(function() {
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'order_id='+ order_id,
|
||||
success:function(result){
|
||||
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#move').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/movetable";
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
@@ -68,9 +68,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-type="nett" >Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett" >Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"><i class="fa fa-arrow-left fa-lg"></i> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett" >Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -133,6 +133,9 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
case 'del' :
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
case 'nett':
|
||||
var remain_amount = $('#validamount').val();
|
||||
$('#amount').text(remain_amount);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
207
app/views/origami/moveroom/move_dining.html.erb
Normal file
207
app/views/origami/moveroom/move_dining.html.erb
Normal file
@@ -0,0 +1,207 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - s -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title"> MOVE --> <span style='color:red'>' <%= @dining.name %>' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
||||
<input type='hidden' id="change_table_value" value="" />
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
$('.tables').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(" ' " + dining_name + " ' ")
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
$('.rooms').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(dining_name)
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$('#move_table').on('click',function(){
|
||||
change_to = $('#change_table_value').val();
|
||||
change_from = "<%= @dining.id %>";
|
||||
if (change_to == ""){
|
||||
alert("Please Select Room")
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_moving_path %>",
|
||||
data: "change_from="+ change_from + "&change_to=" + change_to,
|
||||
success:function(result){
|
||||
alert("Moving Success")
|
||||
if (result.get_type == 'Table'){
|
||||
window.location.href = '/origami/table/' + change_to;
|
||||
}else{
|
||||
window.location.href = '/origami/room/' + change_to;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/room/'+ "<%= @dining.id %>";
|
||||
})
|
||||
</script>
|
||||
207
app/views/origami/movetable/move_dining.html.erb
Normal file
207
app/views/origami/movetable/move_dining.html.erb
Normal file
@@ -0,0 +1,207 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - s -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title"> MOVE --> <span style='color:red'> ' <%= @dining.name %> ' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
||||
<input type='hidden' id="change_table_value" value="" />
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
$('.tables').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(" ' " + dining_name + " ' ")
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
$('.rooms').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(dining_name)
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$('#move_table').on('click',function(){
|
||||
change_to = $('#change_table_value').val();
|
||||
change_from = "<%= @dining.id %>";
|
||||
if (change_to == ""){
|
||||
alert("Please Select Table")
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_moving_path %>",
|
||||
data: "change_from="+ change_from + "&change_to=" + change_to,
|
||||
success:function(result){
|
||||
alert("Moving Success")
|
||||
if (result.get_type == 'Table'){
|
||||
window.location.href = '/origami/table/' + change_to;
|
||||
}else{
|
||||
window.location.href = '/origami/room/' + change_to;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/table/'+ "<%= @dining.id %>";
|
||||
})
|
||||
</script>
|
||||
2
app/views/origami/movetable/moving.json.jbuilder
Normal file
2
app/views/origami/movetable/moving.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.status true
|
||||
json.get_type @get_type
|
||||
@@ -68,9 +68,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-type="nett" >Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett" >Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
197
app/views/origami/orders/show.html.erb
Normal file
197
app/views/origami/orders/show.html.erb
Normal file
@@ -0,0 +1,197 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane " id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane active" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDERS DETAILS </strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @order.created_at.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
@order.order_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.item_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
$(".rooms").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
$(".orders").on('click',function(){
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
});
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-11col-md-11 col-sm-11">
|
||||
<div >
|
||||
<div >
|
||||
<% @payment_method_setting.each do |payment_method|%>
|
||||
@@ -8,6 +8,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -16,4 +20,8 @@ $('.others-payment').on('click',function(){
|
||||
var sale_id = $(this).attr("data-sale-id");
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment/" + input_type;
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/sale/<%= @sale_id %>/payment/';
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -90,31 +90,30 @@
|
||||
<div class="col-md-8"><strong style="font-size:18px;">Amount Due</strong></div>
|
||||
<div class="col-md-4"><strong><span id="amount_due" style="font-size:18px;"><%= @sale_data.grand_total %></span></strong></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<br>
|
||||
<div class="row payment cash-color">
|
||||
<div class="col-md-8">Cash</div>
|
||||
<div class="col-md-4" id="cash" ><%= @cash %></div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row" id="credit_payment">
|
||||
|
||||
<div class="row payment credit-color" id="credit_payment" >
|
||||
<div class="col-md-8">Credit</div>
|
||||
<div class="col-md-4" id="credit">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="row payment other-payment-color" id="card_payment" >
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="row payment other-payment-color" id="card_payment" >
|
||||
<div class="col-md-12">Other Payments</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="row payment other-payment-color" >
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
@@ -182,12 +181,12 @@
|
||||
<div class="col-md-4" id="mastercount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<hr>
|
||||
<hr class="style2">
|
||||
<div class="row">
|
||||
<div class="col-md-8">Balance</div>
|
||||
<div class="col-md-4"><span id='balance'><%= @sale_data.grand_total %></span></div>
|
||||
</div>
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -212,9 +211,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number" data-type="nett">Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett">Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -235,7 +234,7 @@
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> <i class="fa fa-arrow-left fa-lg"></i> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> FOC </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> Void </button>
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-type="nett">Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett">Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
1
app/views/origami/request_bills/print.json.jbuilder
Normal file
1
app/views/origami/request_bills/print.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
274
app/views/origami/rooms/show.html.erb
Normal file
274
app/views/origami/rooms/show.html.erb
Normal file
@@ -0,0 +1,274 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<% if @status == "order" %>
|
||||
<div><strong id="order-title">ORDER DETAILS </strong></div>
|
||||
<% else %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status == 'sale' %>
|
||||
<%= @obj.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @obj.created_at.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status == "sale"
|
||||
@obj.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%=@selected_item.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<% if @status == "sale" %>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @obj.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<%
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Added New Order
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
@order_items.each do |order_item |
|
||||
%>
|
||||
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id="move">Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
$(".rooms").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
$(".orders").on('click',function(){
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
});
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#move').on('click',function(){
|
||||
var dining_id = "<%= @room.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/moveroom";
|
||||
})
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
209
app/views/origami/sales/show.html.erb
Normal file
209
app/views/origami/sales/show.html.erb
Normal file
@@ -0,0 +1,209 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane active" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<%= @sale.receipt_no rescue '' %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @sale.created_at.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
@sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">VOID</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
$(".rooms").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
$(".orders").on('click',function(){
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
});
|
||||
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
@@ -68,9 +68,9 @@
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number" data-type="nett" >Nett</div>
|
||||
<div class=" cashier_number green" data-type="nett" >Nett</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 orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"><i class="fa fa-arrow-left fa-lg"></i> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Rails.application.config.assets.version = '1.0'
|
||||
|
||||
# --- Waiter/ Cashier - Orgiami ----
|
||||
Rails.application.config.assets.precompile += %w( origami.css )
|
||||
Rails.application.config.assets.precompile += %w( origami.js )
|
||||
# Rails.application.config.assets.precompile += %w( origami.js )
|
||||
# -- Order Queue Station -----
|
||||
Rails.application.config.assets.precompile += %w( OQS.css )
|
||||
Rails.application.config.assets.precompile += %w( OQS.js )
|
||||
|
||||
@@ -72,17 +72,24 @@ Rails.application.routes.draw do
|
||||
#--------- Cashier ------------#
|
||||
namespace :origami do
|
||||
root "home#index"
|
||||
get "/:booking_id" => "home#index" do #origami/:booking_id will show
|
||||
get "table/:dining_id" => "home#show" do #origami/:booking_id will show
|
||||
# resources :discounts, only: [:index,:new, :create ] #add discount type
|
||||
resources :customers #add customer type
|
||||
end
|
||||
post 'moving' => "movetable#moving"
|
||||
|
||||
get 'table/:dining_id/movetable' => "movetable#move_dining"
|
||||
get 'table/:dining_id/moveroom' => "moveroom#move_dining"
|
||||
get 'sale/:sale_id' => 'sales#show'
|
||||
get 'room/:room_id' => 'rooms#show'
|
||||
get 'order/:order_id' => "orders#show"
|
||||
|
||||
post '/:booking_id' => 'home#item_show'
|
||||
|
||||
get "/:id/discount" => "discounts#index"
|
||||
post "/:id/discount" => "discounts#create"
|
||||
|
||||
get "/:id/request_bills" => "request_bills#print"
|
||||
post "/:id/request_bills" => "request_bills#print"
|
||||
get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' }
|
||||
#--------- Payment ------------#
|
||||
get 'sale/:sale_id/payment' => 'payments#show'
|
||||
|
||||
Reference in New Issue
Block a user