Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -57,6 +57,9 @@ gem 'bcrypt', '~> 3.1.7'
|
|||||||
|
|
||||||
gem 'sidekiq'
|
gem 'sidekiq'
|
||||||
|
|
||||||
|
# XML parser
|
||||||
|
#gem 'nokogiri', '~> 1.6'
|
||||||
|
|
||||||
# Pagination
|
# Pagination
|
||||||
gem 'kaminari', '~> 0.16.3'
|
gem 'kaminari', '~> 0.16.3'
|
||||||
|
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ DEPENDENCIES
|
|||||||
kaminari (~> 0.16.3)
|
kaminari (~> 0.16.3)
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
|
nokogiri (~> 1.6)
|
||||||
pg
|
pg
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
//= require cable
|
//= require cable
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
// auto refresh every 5 seconds
|
||||||
|
setTimeout(function(){
|
||||||
|
window.location.reload(1);
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
$('.queue_station').on('click',function(){
|
$('.queue_station').on('click',function(){
|
||||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
var orderZone=$(this).children().children().children('.order-zone').text();
|
||||||
var orderItem=$(this).children().children().children('.order-item').text();
|
var orderItem=$(this).children().children().children('.order-item').text();
|
||||||
@@ -39,7 +44,8 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// complete for queue item
|
// complete for queue item
|
||||||
$('.order-complete').on('click',function(){
|
$('.order-complete').on('click',function(e){
|
||||||
|
//e.preventDefault();
|
||||||
var _self = $(this); // To know in ajax return
|
var _self = $(this); // To know in ajax return
|
||||||
var assigned_item_id=$(this).attr('id').substr(15);
|
var assigned_item_id=$(this).attr('id').substr(15);
|
||||||
var params = { 'id':assigned_item_id };
|
var params = { 'id':assigned_item_id };
|
||||||
@@ -72,6 +78,8 @@ $(document).ready(function(){
|
|||||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||||
|
|
||||||
alert("updated!");
|
alert("updated!");
|
||||||
|
// Page reload
|
||||||
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,8 +19,17 @@
|
|||||||
//= require bootstrap-datepicker
|
//= require bootstrap-datepicker
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
// auto refresh every 10 seconds
|
||||||
|
setTimeout(function(){
|
||||||
|
window.location.reload(1);
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
// For selected order return
|
||||||
|
var order_status = "";
|
||||||
|
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
|
||||||
|
|
||||||
// Enable/Disable Button
|
// Enable/Disable Button
|
||||||
control_button("disabled");
|
control_button(order_status);
|
||||||
|
|
||||||
$(".orders").on('click', function(){
|
$(".orders").on('click', function(){
|
||||||
$("#order-sub-total").text('');
|
$("#order-sub-total").text('');
|
||||||
@@ -38,10 +47,6 @@ $(document).ready(function(){
|
|||||||
// Enable/Disable Button
|
// Enable/Disable Button
|
||||||
control_button(order_status);
|
control_button(order_status);
|
||||||
|
|
||||||
//for customer button
|
|
||||||
$("#customer").removeAttr('disabled');
|
|
||||||
|
|
||||||
|
|
||||||
var customer_id=$(this).find(".customer-id").text();
|
var customer_id=$(this).find(".customer-id").text();
|
||||||
show_customer_details(customer_id);
|
show_customer_details(customer_id);
|
||||||
|
|
||||||
@@ -66,12 +71,15 @@ $(document).ready(function(){
|
|||||||
for (i = 0; i < result.length; i++) {
|
for (i = 0; i < result.length; i++) {
|
||||||
var data = JSON.stringify(result[i]);
|
var data = JSON.stringify(result[i]);
|
||||||
var parse_data = JSON.parse(data);
|
var parse_data = JSON.parse(data);
|
||||||
|
var show_date = "";
|
||||||
|
|
||||||
// Receipt Header
|
// Receipt Header
|
||||||
receipt_no = result[i].receipt_no;
|
receipt_no = result[i].receipt_no;
|
||||||
cashier = result[i].cashier_name;
|
cashier = result[i].cashier_name;
|
||||||
receipt_date = new Date(result[i].receipt_date);
|
if(result[i].receipt_date != null){
|
||||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
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_no").text(receipt_no);
|
$("#receipt_no").text(receipt_no);
|
||||||
$("#cashier").text(cashier == null ? "" : cashier);
|
$("#cashier").text(cashier == null ? "" : cashier);
|
||||||
@@ -285,16 +293,19 @@ $(document).ready(function(){
|
|||||||
/* Button Control by Status */
|
/* Button Control by Status */
|
||||||
function control_button(order_status){
|
function control_button(order_status){
|
||||||
if(order_status=="billed"){
|
if(order_status=="billed"){
|
||||||
|
$("#customer").prop('disabled', false);
|
||||||
$("#request_bills").prop('disabled', true);
|
$("#request_bills").prop('disabled', true);
|
||||||
$("#discount").prop('disabled', false);
|
$("#discount").prop('disabled', false);
|
||||||
$("#pay-bill").prop('disabled', false);
|
$("#pay-bill").prop('disabled', false);
|
||||||
}
|
}
|
||||||
else if(order_status=="new") {
|
else if(order_status=="new") {
|
||||||
|
$("#customer").prop('disabled', false);
|
||||||
$("#request_bills").prop('disabled', false);
|
$("#request_bills").prop('disabled', false);
|
||||||
$("#discount").prop('disabled', true);
|
$("#discount").prop('disabled', true);
|
||||||
$("#pay-bill").prop('disabled', true);
|
$("#pay-bill").prop('disabled', true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$("#customer").prop('disabled', true);
|
||||||
$("#request_bills").prop('disabled', true);
|
$("#request_bills").prop('disabled', true);
|
||||||
$("#discount").prop('disabled', true);
|
$("#discount").prop('disabled', true);
|
||||||
$("#pay-bill").prop('disabled', true);
|
$("#pay-bill").prop('disabled', true);
|
||||||
|
|||||||
@@ -16,5 +16,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.selected-item {
|
.selected-item {
|
||||||
|
color: #fff !important;
|
||||||
background-color: blue;
|
background-color: blue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,13 @@ class Oqs::PrintController < ApplicationController
|
|||||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
|
# printer for each stations
|
||||||
|
printer_name = assigned_item.order_queue_station.printer_name
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings,assigned_item.order_id, assigned_item.item_code )
|
order_queue_printer.print_order_item(printer_name,assigned_item.order_id, assigned_item.item_code )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
assigned_items.each do |ai|
|
assigned_items.each do |ai|
|
||||||
@@ -25,10 +28,13 @@ class Oqs::PrintController < ApplicationController
|
|||||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
|
# printer for each stations
|
||||||
|
printer_name = assigned_item.order_queue_station.printer_name
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_summary(print_settings,assigned_item.order_id)
|
order_queue_printer.print_order_summary(printer_name,assigned_item.order_id)
|
||||||
|
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
assigned_items.each do |ai|
|
assigned_items.each do |ai|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
@selected_item_type="Order"
|
@selected_item_type="Order"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts params[:booking_id]
|
|
||||||
|
|
||||||
@completed_orders = Order.get_completed_order()
|
@completed_orders = Order.get_completed_order()
|
||||||
@booking_orders = Order.get_booking_order_table()
|
@booking_orders = Order.get_booking_order_table()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Origami::RequestBillsController < BaseOrigamiController
|
|||||||
check_booking = Booking.find_by_booking_id(booking_id)
|
check_booking = Booking.find_by_booking_id(booking_id)
|
||||||
if check_booking.sale_id.nil?
|
if check_booking.sale_id.nil?
|
||||||
# Create Sale if it doesn't exist
|
# Create Sale if it doesn't exist
|
||||||
@status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee.name)
|
@status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee)
|
||||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -230,20 +230,25 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true)
|
.where("(orders.status = 'new' or orders.status = 'billed')")
|
||||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
.group("bookings.booking_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
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view booking order Table
|
#Origami: Cashier : to view booking order Table
|
||||||
def self.get_completed_order
|
def self.get_completed_order
|
||||||
completed_orders = Booking.select("sales.receipt_no,orders.status as order_status,orders.order_id,
|
completed_orders = Booking.select("sales.receipt_no, sales.sale_status, orders.status as order_status,orders.order_id,
|
||||||
bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id")
|
bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id")
|
||||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("sales.sale_status='completed'")
|
.where("sales.sale_status='completed'")
|
||||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
.group("sales.sale_id")
|
||||||
|
# For PG
|
||||||
|
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view order type Room
|
#Origami: Cashier : to view order type Room
|
||||||
@@ -255,10 +260,12 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
.joins("left join sale_orders on sale_orders.order_id = orders.order_id")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.joins("left join sales on sales.sale_id = sale_orders.sale_id")
|
.where("(orders.status = 'new' or orders.status = 'billed')")
|
||||||
.where("booking_orders.order_id IS NOT NULL 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
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view order type Room
|
#Origami: Cashier : to view order type Room
|
||||||
@@ -271,24 +278,36 @@ class Order < ApplicationRecord
|
|||||||
left join order_items on order_items.order_id = orders.order_id")
|
left join order_items on order_items.order_id = orders.order_id")
|
||||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
||||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no")
|
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#Origami: Cashier : to view orders
|
#Origami: Cashier : to view orders
|
||||||
def self.get_orders
|
def self.get_orders
|
||||||
from = Time.now.beginning_of_day.utc
|
from = Time.now.beginning_of_day.utc
|
||||||
to = Time.now.end_of_day.utc
|
to = Time.now.end_of_day.utc
|
||||||
orders = Order.select("orders.order_id as order_id,sales.receipt_no,orders.status as order_status, sales.sale_status as sale_status,
|
orders=Booking.select("sales.receipt_no, sales.sale_status as sale_status, orders.status as order_status,
|
||||||
orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id
|
orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id,
|
||||||
,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")
|
bookings.booking_id,orders.customer_id as customer_id,
|
||||||
.joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||||
left join bookings on bookings.booking_id = booking_orders.order_id
|
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||||
left join order_items on order_items.order_id = orders.order_id
|
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
left join sales on sales.sale_id = sale_orders.sale_id")
|
.where("(orders.status = 'new' or orders.status = 'billed')")
|
||||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
|
||||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id,orders.customer_id")
|
# orders = Order.select("orders.order_id as order_id,sales.receipt_no,orders.status as order_status, sales.sale_status as sale_status,
|
||||||
|
# orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id
|
||||||
|
# ,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||||
|
# .joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
||||||
|
# left join bookings on bookings.booking_id = booking_orders.order_id
|
||||||
|
# left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
|
# left join order_items on order_items.order_id = orders.order_id
|
||||||
|
# left join sale_orders on sale_orders.order_id = orders.order_id
|
||||||
|
# left join sales on sales.sale_id = sale_orders.sale_id")
|
||||||
|
# .where("(orders.status = 'new' or orders.status = 'billed')")
|
||||||
|
# .group("orders.order_id")
|
||||||
|
# For PG
|
||||||
|
# .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||||
|
# .group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id,orders.customer_id")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||||
|
|
||||||
def print_order_item(printer_settings,order_id, item_code)
|
def print_order_item(printer_name,order_id, item_code)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||||
pdf = OrderItemPdf.new(order_item[0],printer_settings)
|
pdf = OrderItemPdf.new(order_item[0])
|
||||||
pdf.render_file "tmp/receipt.pdf"
|
pdf.render_file "tmp/receipt.pdf"
|
||||||
self.print("tmp/receipt.pdf")
|
self.print("tmp/receipt.pdf", printer_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def print_order_summary(printer_settings,order_id)
|
def print_order_summary(printer_name,order_id)
|
||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
order=print_query('order_summary',order_id)
|
order=print_query('order_summary',order_id)
|
||||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||||
pdf = OrderSummaryPdf.new(order,printer_settings)
|
pdf = OrderSummaryPdf.new(order)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
self.print(filename)
|
self.print(filename, printer_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Query for OQS with status
|
# Query for OQS with status
|
||||||
|
|||||||
@@ -56,7 +56,12 @@ class Sale < ApplicationRecord
|
|||||||
#Default Tax - Values
|
#Default Tax - Values
|
||||||
self.tax_type = "exclusive"
|
self.tax_type = "exclusive"
|
||||||
|
|
||||||
self.requested_by = requested_by
|
# set cashier by current login
|
||||||
|
self.cashier_id = requested_by.id
|
||||||
|
self.cashier_name = requested_by.name
|
||||||
|
|
||||||
|
|
||||||
|
self.requested_by = requested_by.name
|
||||||
self.requested_at = DateTime.now.utc
|
self.requested_at = DateTime.now.utc
|
||||||
|
|
||||||
Rails.logger.debug "Order -> #{order.id} | order_status -> #{order.status}"
|
Rails.logger.debug "Order -> #{order.id} | order_status -> #{order.status}"
|
||||||
@@ -252,7 +257,7 @@ class Sale < ApplicationRecord
|
|||||||
if self.receipt_no.nil?
|
if self.receipt_no.nil?
|
||||||
prefix = DateTime.now().utc
|
prefix = DateTime.now().utc
|
||||||
#self.receipt_no = prefix.to_s + "/" + self.shit_id.to_s + "/" + SeedGenerator.new_receipt_no().to_s
|
#self.receipt_no = prefix.to_s + "/" + self.shit_id.to_s + "/" + SeedGenerator.new_receipt_no().to_s
|
||||||
self.receipt_no = prefix.strftime("%Y%m%d") + "/" + SeedGenerator.new_receipt_no().to_s
|
self.receipt_no = prefix.strftime("%Y%m%d") + "-" + SeedGenerator.new_receipt_no().to_s
|
||||||
|
|
||||||
self.receipt_date = prefix
|
self.receipt_date = prefix
|
||||||
Rails.logger.debug "Receipt No #{self.receipt_no} | Date #{ self.receipt_date.to_s}"
|
Rails.logger.debug "Receipt No #{self.receipt_no} | Date #{ self.receipt_date.to_s}"
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
class OrderItemPdf < Prawn::Document
|
class OrderItemPdf < Prawn::Document
|
||||||
attr_accessor :receipt_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:item_description_width
|
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||||
def initialize(order_item, print_settings)
|
def initialize(order_item)
|
||||||
self.page_width = 300
|
self.page_width = 254
|
||||||
self.page_height = 400
|
self.page_height = 1450
|
||||||
self.margin = 10
|
self.margin = 10
|
||||||
self.price_width = 50
|
self.price_width = 40 # No Need for item
|
||||||
self.qty_width = 50
|
self.qty_width = 34
|
||||||
self.item_width = self.page_width - (self.price_width + self.qty_width)
|
self.total_width = 40 # No Need for item
|
||||||
|
self.item_width = self.page_width - (self.qty_width + (self.margin*4))
|
||||||
self.item_height = 15
|
self.item_height = 15
|
||||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width)
|
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||||
self.receipt_width=130
|
self.label_width=80
|
||||||
|
|
||||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||||
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||||
@@ -17,10 +18,10 @@ class OrderItemPdf < Prawn::Document
|
|||||||
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
||||||
# font "public/fonts/Zawgyi-One.ttf"
|
# font "public/fonts/Zawgyi-One.ttf"
|
||||||
# font "public/fonts/padauk.ttf"
|
# font "public/fonts/padauk.ttf"
|
||||||
self.header_font_size = 12
|
self.header_font_size = 14
|
||||||
self.item_font_size = 10
|
self.item_font_size = 12
|
||||||
|
|
||||||
text "#{order_item.dining}", :size => self.header_font_size,:align => :center
|
text "#{order_item.dining}", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
@@ -35,36 +36,43 @@ class OrderItemPdf < Prawn::Document
|
|||||||
def order_info(order_by, order_at)
|
def order_info(order_by, order_at)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
bounding_box([0,y_position], :width => self.item_width - 50, :height => self.item_height) do
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
text "OrderBy:#{order_by} ", :size => self.item_font_size,:align => :left
|
text "OrderBy: #{order_by} ", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
bounding_box([self.item_width - 50,y_position], :width => self.item_width + 50, :height => self.item_height) do
|
move_down 5
|
||||||
text "Date:#{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
|
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
|
|
||||||
move_down 20
|
move_down 10
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write Order items to PDF
|
# Write Order items to PDF
|
||||||
def order_items(order_item)
|
def order_items(order_item)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
# No Need for Order Item
|
||||||
text "Item", :size => self.item_font_size,:align => :left
|
# bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
end
|
# text "Item", :size => self.item_font_size,:align => :left
|
||||||
|
# end
|
||||||
|
|
||||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
# bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||||
text "Qty", :size => self.item_font_size,:align => :right
|
# text "Qty", :size => self.item_font_size,:align => :right
|
||||||
end
|
# end
|
||||||
|
|
||||||
stroke_horizontal_rule
|
# stroke_horizontal_rule
|
||||||
move_down 5
|
# move_down 5
|
||||||
|
|
||||||
#Add Order Item
|
#Add Order Item
|
||||||
add_order_items(order_item)
|
add_order_items(order_item)
|
||||||
|
|
||||||
|
dash(1, :space => 1, :phase => 1)
|
||||||
|
stroke_horizontal_line 0, self.page_width
|
||||||
|
move_down 5
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add order items under order info
|
# Add order items under order info
|
||||||
@@ -78,7 +86,7 @@ class OrderItemPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||||
text "#{order_item.qty}", :size => self.item_font_size,:align => :right
|
text "[#{order_item.qty.to_i}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
class OrderSummaryPdf < Prawn::Document
|
class OrderSummaryPdf < Prawn::Document
|
||||||
attr_accessor :receipt_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:item_description_width
|
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||||
def initialize(order, print_settings)
|
def initialize(order)
|
||||||
self.page_width = 300
|
self.page_width = 254
|
||||||
self.page_height = 400
|
self.page_height = 1450
|
||||||
self.margin = 10
|
self.margin = 10
|
||||||
self.price_width = 60
|
self.price_width = 40 # No Need for item
|
||||||
self.qty_width = 60
|
self.qty_width = 34
|
||||||
self.item_width = self.page_width - (self.price_width + self.qty_width)
|
self.total_width = 40 # No Need for item
|
||||||
|
self.item_width = self.page_width - (self.qty_width + (self.margin*4))
|
||||||
self.item_height = 15
|
self.item_height = 15
|
||||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width)
|
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||||
self.receipt_width=130
|
self.label_width=100
|
||||||
|
|
||||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
self.header_font_size = 12
|
self.header_font_size = 12
|
||||||
self.item_font_size = 10
|
self.item_font_size = 10
|
||||||
|
|
||||||
text "#{order[0].dining}", :size => self.header_font_size,:align => :center
|
text "#{order[0].dining}", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
@@ -35,17 +36,19 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
def order_info(order_by, order_at)
|
def order_info(order_by, order_at)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
bounding_box([0,y_position], :width => self.item_width - 20, :height => self.item_height) do
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
text "OrderBy:#{order_by} ", :size => self.item_font_size,:align => :left
|
text "OrderBy: #{order_by} ", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
bounding_box([self.item_width - 20,y_position], :width => self.item_width + 20, :height => self.item_height) do
|
move_down 5
|
||||||
text "Date:#{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
|
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
|
|
||||||
move_down 20
|
move_down 10
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write Order items to PDF
|
# Write Order items to PDF
|
||||||
@@ -57,7 +60,7 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||||
text "Qty", :size => self.item_font_size,:align => :right
|
text "Qty", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
@@ -79,7 +82,7 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||||
text "#{odi.qty}", :size => self.item_font_size,:align => :right
|
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -31,28 +31,28 @@
|
|||||||
customer_id = ""
|
customer_id = ""
|
||||||
|
|
||||||
# For CSS- Class for Order? Sale?
|
# For CSS- Class for Order? Sale?
|
||||||
sale_status=""
|
# sale_status=""
|
||||||
if cpo.order_status == 'new'
|
# if cpo.order_status == 'new'
|
||||||
unique_id=cpo.booking_id
|
# unique_id=cpo.booking_id
|
||||||
|
|
||||||
customer_id=cpo.order_customer_id
|
# customer_id=cpo.order_customer_id
|
||||||
# check selected item and assign
|
# # check selected item and assign
|
||||||
if @selected_item != nil
|
# if @selected_item_type == "Sale"
|
||||||
if cpo.order_id == @selected_item.order_id
|
# if cpo.order_id == @selected_item.order_id
|
||||||
sale_status = sale_status + " selected-item"
|
# sale_status = sale_status + " selected-item"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
else
|
# else
|
||||||
unique_id=cpo.sale_id
|
unique_id=cpo.sale_id
|
||||||
customer_id=cpo.sale_customer_id
|
customer_id=cpo.sale_customer_id
|
||||||
sale_status="paid"
|
sale_status="paid"
|
||||||
# check selected item and assign
|
# check selected item and assign
|
||||||
if @selected_item != nil
|
if @selected_item != nil
|
||||||
if unique_id == @selected_item.sale_id
|
if unique_id == @selected_item.sale_id
|
||||||
sale_status = sale_status + " selected-item"
|
sale_status = sale_status + " selected-item"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# end
|
||||||
%>
|
%>
|
||||||
<div class="card orders <%= sale_status %>">
|
<div class="card orders <%= sale_status %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
@@ -69,9 +69,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Order Status :
|
Order Status :
|
||||||
<span class="orders-order-status">
|
<span class="orders-order-status"><%= cpo.sale_status %></span>
|
||||||
<%= cpo.order_status %>
|
|
||||||
</span>
|
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,6 +86,7 @@
|
|||||||
<%
|
<%
|
||||||
@booking_orders.each do |bko|
|
@booking_orders.each do |bko|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
|
puts bko.sale_status
|
||||||
if bko.sale_status == 'completed'
|
if bko.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -101,11 +100,11 @@
|
|||||||
unique_id=bko.booking_id
|
unique_id=bko.booking_id
|
||||||
customer_id=bko.order_customer_id
|
customer_id=bko.order_customer_id
|
||||||
# check selected item and assign
|
# check selected item and assign
|
||||||
if !@selected_item.nil?
|
# if @selected_item != nil
|
||||||
if bko.order_id == @selected_item.order_id
|
# if bko.order_id == @selected_item.order_id
|
||||||
sale_status = sale_status + " selected-item"
|
# sale_status = sale_status + " selected-item"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
else
|
else
|
||||||
unique_id=bko.sale_id
|
unique_id=bko.sale_id
|
||||||
customer_id=bko.sale_customer_id
|
customer_id=bko.sale_customer_id
|
||||||
@@ -132,9 +131,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Order Status :
|
Order Status :
|
||||||
<span class="orders-order-status">
|
<span class="orders-order-status"><%= bko.order_status %></span>
|
||||||
<%= bko.order_status %>
|
|
||||||
</span>
|
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -165,11 +162,11 @@
|
|||||||
unique_id=rmo.booking_id
|
unique_id=rmo.booking_id
|
||||||
customer_id=rmo.order_customer_id
|
customer_id=rmo.order_customer_id
|
||||||
# check selected item and assign
|
# check selected item and assign
|
||||||
if @selected_item != nil
|
# if @selected_item != nil
|
||||||
if rmo.order_id == @selected_item.order_id
|
# if rmo.order_id == @selected_item.order_id
|
||||||
sale_status = sale_status + " selected-item"
|
# sale_status = sale_status + " selected-item"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
else
|
else
|
||||||
unique_id=rmo.sale_id
|
unique_id=rmo.sale_id
|
||||||
customer_id=rmo.sale_customer_id
|
customer_id=rmo.sale_customer_id
|
||||||
@@ -196,9 +193,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Order Status :
|
Order Status :
|
||||||
<span class="orders-order-status">
|
<span class="orders-order-status"><%= rmo.order_status %></span>
|
||||||
<%= rmo.order_status %>
|
|
||||||
</span>
|
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -214,6 +209,7 @@
|
|||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<%
|
<%
|
||||||
@orders.each do |odr|
|
@orders.each do |odr|
|
||||||
|
puts odr
|
||||||
# No Show completed
|
# No Show completed
|
||||||
if odr.sale_status == 'completed'
|
if odr.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
@@ -227,11 +223,11 @@
|
|||||||
if odr.order_status == 'new'
|
if odr.order_status == 'new'
|
||||||
unique_id=odr.booking_id
|
unique_id=odr.booking_id
|
||||||
customer_id = odr.order_customer_id
|
customer_id = odr.order_customer_id
|
||||||
if @selected_item != nil
|
# if @selected_item != nil
|
||||||
if odr.order_id == @selected_item.order_id
|
# if odr.order_id == @selected_item.order_id
|
||||||
sale_status = sale_status + " selected-item"
|
# sale_status = sale_status + " selected-item"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
else
|
else
|
||||||
unique_id=odr.sale_id
|
unique_id=odr.sale_id
|
||||||
customer_id = odr.sale_customer_id
|
customer_id = odr.sale_customer_id
|
||||||
@@ -258,9 +254,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
Order Status :
|
Order Status :
|
||||||
<span class="orders-order-status">
|
<span class="orders-order-status"><%= odr.order_status %></span>
|
||||||
<%= odr.order_status %>
|
|
||||||
</span>
|
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -328,7 +322,6 @@
|
|||||||
|
|
||||||
<%
|
<%
|
||||||
# For Order Items
|
# For Order Items
|
||||||
sub_total = 0
|
|
||||||
if @selected_item_type == "Order"
|
if @selected_item_type == "Order"
|
||||||
@selected_item.order_items.each do |order_item|
|
@selected_item.order_items.each do |order_item|
|
||||||
sub_total += (order_item.qty*order_item.unit_price)
|
sub_total += (order_item.qty*order_item.unit_price)
|
||||||
@@ -386,13 +379,12 @@
|
|||||||
<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>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>Edit</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</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" disabled>Customer</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" disabled>Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block" disabled>Discount</button>
|
<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" 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" disabled>Pay</button>
|
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block">Pay</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,5 +18,6 @@
|
|||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= f.button :submit %>
|
<%= f.button :submit %>
|
||||||
|
<%= link_to 'Back', print_settings_path, :class => "btn btn-default" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<h1>Editing Print Setting</h1>
|
<div class="span12">
|
||||||
|
<div class="page-header">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
|
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||||
|
<li>Edit</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<%= render 'form', print_setting: @print_setting %>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
|
||||||
<%= render 'form', print_setting: @print_setting %>
|
|
||||||
|
|
||||||
<%= link_to 'Show', @print_setting %> |
|
|
||||||
<%= link_to 'Back', print_settings_path %>
|
|
||||||
|
|||||||
@@ -1,49 +1,55 @@
|
|||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
<div class="page-header">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="<%= %>">Home</a></li>
|
||||||
|
<li>Print Settings</li>
|
||||||
|
<span style="float: right">
|
||||||
|
<%= link_to t('.new', :default => t("helpers.links.new")),new_print_setting_path,:class => 'btn btn-primary btn-sm' %>
|
||||||
|
</span>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1>Print Settings</h1>
|
<br />
|
||||||
|
<div class="card">
|
||||||
<table>
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Unique code</th>
|
|
||||||
<th>Template</th>
|
|
||||||
<th>Db name</th>
|
|
||||||
<th>Db type</th>
|
|
||||||
<th>Db username</th>
|
|
||||||
<th>Db password</th>
|
|
||||||
<th>Printer name</th>
|
|
||||||
<th>Api settings</th>
|
|
||||||
<th>Page width</th>
|
|
||||||
<th>Page height</th>
|
|
||||||
<th>Print copies</th>
|
|
||||||
<th colspan="3"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<% @print_settings.each do |print_setting| %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= print_setting.name %></td>
|
<th>Name</th>
|
||||||
<td><%= print_setting.unique_code %></td>
|
<th>Unique code</th>
|
||||||
<td><%= print_setting.template %></td>
|
<th>Template</th>
|
||||||
<td><%= print_setting.db_name %></td>
|
<!-- <th>Db name</th>
|
||||||
<td><%= print_setting.db_type %></td>
|
<th>Db type</th>
|
||||||
<td><%= print_setting.db_username %></td>
|
<th>Db username</th>
|
||||||
<td><%= print_setting.db_password %></td>
|
<th>Db password</th> -->
|
||||||
<td><%= print_setting.printer_name %></td>
|
<th>Printer name</th>
|
||||||
<td><%= print_setting.api_settings %></td>
|
<th>Api settings</th>
|
||||||
<td><%= print_setting.page_width %></td>
|
<th>Page width</th>
|
||||||
<td><%= print_setting.page_height %></td>
|
<th>Page height</th>
|
||||||
<td><%= print_setting.print_copies %></td>
|
<th>Print copies</th>
|
||||||
<td><%= link_to 'Show', print_setting %></td>
|
<th colspan="3"></th>
|
||||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
|
||||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
</thead>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<br>
|
<tbody>
|
||||||
|
<% @print_settings.each do |print_setting| %>
|
||||||
<%= link_to 'New Print Setting', new_print_setting_path %>
|
<tr>
|
||||||
|
<td><%= print_setting.name %></td>
|
||||||
|
<td><%= print_setting.unique_code %></td>
|
||||||
|
<td><%= print_setting.template %></td>
|
||||||
|
<!-- <td><%= print_setting.db_name %></td>
|
||||||
|
<td><%= print_setting.db_type %></td>
|
||||||
|
<td><%= print_setting.db_username %></td>
|
||||||
|
<td><%= print_setting.db_password %></td> -->
|
||||||
|
<td><%= print_setting.printer_name %></td>
|
||||||
|
<td><%= print_setting.api_settings %></td>
|
||||||
|
<td><%= print_setting.page_width %></td>
|
||||||
|
<td><%= print_setting.page_height %></td>
|
||||||
|
<td><%= print_setting.print_copies %></td>
|
||||||
|
<td><%= link_to 'Show', print_setting %></td>
|
||||||
|
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||||
|
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
<h1>New Print Setting</h1>
|
<div class="span12">
|
||||||
|
<div class="page-header">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
|
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||||
|
<li>New</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<%= render 'form', print_setting: @print_setting %>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<%= render 'form', print_setting: @print_setting %>
|
|
||||||
|
|
||||||
<%= link_to 'Back', print_settings_path %>
|
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
<div class="page-header">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
|
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||||
|
<li>Show</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<strong>Name:</strong>
|
<strong>Name:</strong>
|
||||||
<%= @print_setting.name %>
|
<%= @print_setting.name %>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= root_path %>">Home</a></li>
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||||
<li>Edit</li>
|
<li>Edit</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'form', employee: @employee %>
|
<%= render 'form', employee: @employee %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= root_path %>">Home</a></li>
|
<li><a href="<%= root_path %>">Home</a></li>
|
||||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||||
<li>New</li>
|
<li>New</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<%= render 'form', employee: @employee %>
|
<%= render 'form', employee: @employee %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user