Merge branch 'ui_ux_changes' of bitbucket.org:code2lab/sxrestaurant into ui_ux_changes
This commit is contained in:
@@ -188,6 +188,10 @@ Add Base URL for DOEMAL
|
|||||||
1) settings/lookups => { type:order_reservation, name: BaseURL, value:'{doemal url}' }
|
1) settings/lookups => { type:order_reservation, name: BaseURL, value:'{doemal url}' }
|
||||||
2) settings/lookups => { type:order_reservation, name: Token, value:'{doemal token}' }
|
2) settings/lookups => { type:order_reservation, name: Token, value:'{doemal token}' }
|
||||||
|
|
||||||
|
Add Feature for Dine-in Cashier
|
||||||
|
** '0' means can not use dine-in cashier and '1' means can use dine-in cashier **
|
||||||
|
=> settings/lookups => { type:dinein_cashier, name: DineInCashier, value:'{0 or 1}' }
|
||||||
|
|
||||||
Add Feature for Quick Service
|
Add Feature for Quick Service
|
||||||
** '0' means can not use quick service and '1' means can use quick service **
|
** '0' means can not use quick service and '1' means can use quick service **
|
||||||
=> settings/lookups => { type:quick_service, name: QuickService, value:'{0 or 1}' }
|
=> settings/lookups => { type:quick_service, name: QuickService, value:'{0 or 1}' }
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ $(function() {
|
|||||||
|
|
||||||
$("#accepted").on("click", function(){
|
$("#accepted").on("click", function(){
|
||||||
if($(this).text().trim() == "ACCEPT"){
|
if($(this).text().trim() == "ACCEPT"){
|
||||||
|
$("#status").text($(this).attr("data-value"));
|
||||||
var requested_time = $("#requested_date_time").text();
|
var requested_time = $("#requested_date_time").text();
|
||||||
$("#requested_order_time").text(requested_time);
|
$("#requested_order_time").text(requested_time);
|
||||||
showTimePicker(requested_time);
|
showTimePicker(requested_time);
|
||||||
@@ -65,14 +66,17 @@ $(function() {
|
|||||||
var waiting_time = new Date(date_time+' '+$("#waiting_time").val());
|
var waiting_time = new Date(date_time+' '+$("#waiting_time").val());
|
||||||
// requested_time.setHours(requested_time.getHours() - 1);
|
// requested_time.setHours(requested_time.getHours() - 1);
|
||||||
// console.log(requested_time);
|
// console.log(requested_time);
|
||||||
|
// console.log(date_time);
|
||||||
if(waiting_time.getTime() < requested_time.getTime()){
|
if(waiting_time.getTime() < requested_time.getTime()){
|
||||||
var time_diff = (requested_time.getTime() - waiting_time.getTime());
|
var time_diff = (requested_time.getTime() - waiting_time.getTime());
|
||||||
var expected_time = (Math.floor(time_diff) / 1000) / 60;
|
var expected_time = (Math.floor(time_diff) / 1000) / 60;
|
||||||
callback_url(callback,ref_no,order_id,status,expected_time,waiting_time);
|
|
||||||
}else{
|
}else{
|
||||||
$("#waiting_time").val("");
|
var time_diff = (waiting_time.getTime() - requested_time.getTime());
|
||||||
$("#waiting_timeErr").text("Expected waiting time is greater than requested time!");
|
var expected_time = (Math.floor(time_diff) / 1000) / 60;
|
||||||
|
// $("#waiting_time").val("");
|
||||||
|
// $("#waiting_timeErr").text("Expected waiting time is greater than requested time!");
|
||||||
}
|
}
|
||||||
|
callback_url(callback,ref_no,order_id,status,expected_time,waiting_time);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -278,9 +282,9 @@ function callback_url(callback,ref_no,order_id,status,time,exptime){
|
|||||||
function timeFormat(date){
|
function timeFormat(date){
|
||||||
var isPM = date.getHours() >= 12;
|
var isPM = date.getHours() >= 12;
|
||||||
var isMidday = date.getHours() == 12;
|
var isMidday = date.getHours() == 12;
|
||||||
var time = [date.getHours() - (isPM && !isMidday ? 12 : 0),
|
var time = [(date.getHours()>10? date.getHours() : '0'+date.getHours()) - (isPM && !isMidday ? 12 : 0),
|
||||||
date.getMinutes() || '00'].join(':') +
|
(date.getMinutes()>10? date.getMinutes() : '0'+date.getMinutes()) || '00'].join(':') +
|
||||||
(isPM ? ' PM' : 'AM');
|
(isPM ? ' PM' : ' AM');
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -248,3 +248,26 @@ i.logout_icon{
|
|||||||
.list-menu > a:hover{
|
.list-menu > a:hover{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
.cashier_number{
|
||||||
|
width: 33%;
|
||||||
|
height:58px;
|
||||||
|
line-height:58px;
|
||||||
|
text-align:center;
|
||||||
|
background:#54A5AF;
|
||||||
|
// float:left;
|
||||||
|
// margin:2px;
|
||||||
|
font-size:20px;
|
||||||
|
color:white;
|
||||||
|
// cursor:pointer;
|
||||||
|
}
|
||||||
|
.border-top{
|
||||||
|
border-top:1px solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-right{
|
||||||
|
border-right:1px solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-left{
|
||||||
|
border-left:1px solid #fff;
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
@import "BSBMaterial/style";
|
@import "BSBMaterial/style";
|
||||||
@import "BSBMaterial/themes/all-themes";
|
@import "BSBMaterial/themes/all-themes";
|
||||||
@import "reset";
|
@import "reset";
|
||||||
|
@import "fileinput.min";
|
||||||
|
|
||||||
|
|
||||||
/* Reset */
|
/* Reset */
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
helper_method :shop_detail, :current_token
|
helper_method :shop_detail, :current_token
|
||||||
|
|
||||||
@@ -22,10 +23,6 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
}.to_json
|
}.to_json
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if ENV["SERVER_MODE"] != 'cloud'
|
|
||||||
protect_from_forgery with: :exception
|
|
||||||
end
|
|
||||||
|
|
||||||
if current_user.nil?
|
if current_user.nil?
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ class Origami::AddordersController < BaseOrigamiController
|
|||||||
if check_mobile
|
if check_mobile
|
||||||
@webview = true
|
@webview = true
|
||||||
end
|
end
|
||||||
|
|
||||||
today = DateTime.now
|
|
||||||
day = Date.today.wday
|
|
||||||
@menus = Menu.all
|
@menus = Menu.all
|
||||||
@menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
@menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc')
|
||||||
@table_id = params[:id]
|
@table_id = params[:id]
|
||||||
|
|||||||
@@ -56,6 +56,13 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
# get printer info
|
# get printer info
|
||||||
@print_settings = PrintSetting.get_precision_delimiter()
|
@print_settings = PrintSetting.get_precision_delimiter()
|
||||||
@current_user = current_user
|
@current_user = current_user
|
||||||
|
#dine-in cashier
|
||||||
|
dinein_cashier = Lookup.collection_of('dinein_cashier')
|
||||||
|
@dinein_cashier = 0
|
||||||
|
if !dinein_cashier[0].nil?
|
||||||
|
@dinein_cashier = dinein_cashier[0][1]
|
||||||
|
end
|
||||||
|
|
||||||
#quick service
|
#quick service
|
||||||
quick_service = Lookup.collection_of('quick_service')
|
quick_service = Lookup.collection_of('quick_service')
|
||||||
@quick_service = 0
|
@quick_service = 0
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
def check_emp_access_code
|
def check_emp_access_code
|
||||||
pin_code = params[:code]
|
pin_code = params[:code]
|
||||||
employee = Employee.find_by_emp_id(pin_code)
|
employee = Employee.find_by_emp_id(pin_code)
|
||||||
if employee && employee.role == "manager"
|
if employee && (employee.role == "manager" || employee.role == "supervisor")
|
||||||
result = {:status=> true, :message=>"Success" }
|
result = {:status=> true, :message=>"Success" }
|
||||||
else
|
else
|
||||||
result = {:status=> false, :message=>"Invalid Access Code" }
|
result = {:status=> false, :message=>"Invalid Access Code" }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Origami::OrderReservationController < BaseOrigamiController
|
class Origami::OrderReservationController < BaseOrigamiController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@order = OrderReservation.latest_order
|
@order = OrderReservation.latest_order #.active
|
||||||
@count_on_order = OrderReservation.get_count_on_order
|
@count_on_order = OrderReservation.get_count_on_order
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class Origami::OtherChargesController < BaseOrigamiController
|
|||||||
else
|
else
|
||||||
@table = nil
|
@table = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -80,7 +79,5 @@ class Origami::OtherChargesController < BaseOrigamiController
|
|||||||
dining = {:table_id => table_id, :table_type => table.type }
|
dining = {:table_id => table_id, :table_type => table.type }
|
||||||
render :json => dining.to_json
|
render :json => dining.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -279,6 +279,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||||
@rounding_adj = new_total-saleObj.grand_total
|
@rounding_adj = new_total-saleObj.grand_total
|
||||||
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj)
|
||||||
|
@sale_data.grand_total = new_total
|
||||||
|
@sale_data.old_grand_total = saleObj.grand_total
|
||||||
|
@sale_data.rounding_adjustment = @rounding_adj
|
||||||
else
|
else
|
||||||
@rounding_adj = @sale_data.rounding_adjustment
|
@rounding_adj = @sale_data.rounding_adjustment
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
|
|
||||||
if oqs.auto_print && order_source != "quick_service"
|
if oqs.auto_print && order_source != "quick_service"
|
||||||
if oqs_order_items.length > 0
|
if oqs_order_items.length > 0
|
||||||
|
if oqs.cut_per_item
|
||||||
|
print_slip_item(oqs, order, oqs_order_items)
|
||||||
|
else
|
||||||
print_slip(oqs, order, oqs_order_items)
|
print_slip(oqs, order, oqs_order_items)
|
||||||
|
end
|
||||||
is_auto_printed = true
|
is_auto_printed = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -92,7 +96,11 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
|
|
||||||
if oqs.auto_print && order_source != "quick_service"
|
if oqs.auto_print && order_source != "quick_service"
|
||||||
if oqs_order_items.length > 0
|
if oqs_order_items.length > 0
|
||||||
|
if oqs.cut_per_item
|
||||||
|
print_slip_item(oqs, order, oqs_order_items)
|
||||||
|
else
|
||||||
print_slip(oqs, order, oqs_order_items)
|
print_slip(oqs, order, oqs_order_items)
|
||||||
|
end
|
||||||
is_auto_printed = true
|
is_auto_printed = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -138,7 +146,11 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
|
|
||||||
if oqs.auto_print
|
if oqs.auto_print
|
||||||
if oqs_order_items.length > 0
|
if oqs_order_items.length > 0
|
||||||
|
if oqs.cut_per_item
|
||||||
|
print_slip_item(oqs, order, oqs_order_items)
|
||||||
|
else
|
||||||
print_slip(oqs, order, oqs_order_items)
|
print_slip(oqs, order, oqs_order_items)
|
||||||
|
end
|
||||||
is_auto_printed = true
|
is_auto_printed = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -166,7 +178,11 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
|
|
||||||
if oqs.auto_print
|
if oqs.auto_print
|
||||||
if oqs_order_items.length > 0
|
if oqs_order_items.length > 0
|
||||||
|
if oqs.cut_per_item
|
||||||
|
print_slip_item(oqs, order, oqs_order_items)
|
||||||
|
else
|
||||||
print_slip(oqs, order, oqs_order_items)
|
print_slip(oqs, order, oqs_order_items)
|
||||||
|
end
|
||||||
is_auto_printed = true
|
is_auto_printed = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -211,7 +227,7 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
#Print order_item in 1 slip per item
|
#Print order_item in 1 slip per item
|
||||||
def print_slip_item(oqs, assigned_item)
|
def print_slip_item(oqs, order, assigned_items)
|
||||||
order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
||||||
unique_code="OrderItemPdf"
|
unique_code="OrderItemPdf"
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
@@ -232,14 +248,17 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
# order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
||||||
# print when complete click
|
# print when complete click
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs,item.order_id, order_item.order_items_id, print_status="" )
|
if !assigned_items.nil?
|
||||||
|
assigned_items.each do |order_item|
|
||||||
|
order_queue_printer.print_order_item(print_settings, oqs,order_item.order_id, order_item.order_items_id, print_status="" )
|
||||||
|
end
|
||||||
|
end
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
assigned_order_item.each do |ai|
|
AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai|
|
||||||
ai.print_status=true
|
ai.print_status=true
|
||||||
ai.save
|
ai.save
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class OrderReservation < ApplicationRecord
|
|||||||
has_many :order_reservation_items
|
has_many :order_reservation_items
|
||||||
has_one :delivery
|
has_one :delivery
|
||||||
|
|
||||||
|
scope :active, -> { where("created_at BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") }
|
||||||
scope :latest_order, -> { order("order_reservation_id desc, created_at desc") }
|
scope :latest_order, -> { order("order_reservation_id desc, created_at desc") }
|
||||||
|
|
||||||
SEND_TO_KITCHEN = "send_to_kitchen"
|
SEND_TO_KITCHEN = "send_to_kitchen"
|
||||||
@@ -218,7 +219,7 @@ class OrderReservation < ApplicationRecord
|
|||||||
|
|
||||||
def self.check_order_send_to_kitchen
|
def self.check_order_send_to_kitchen
|
||||||
today = Time.now.utc
|
today = Time.now.utc
|
||||||
order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}'")
|
order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}' and expected_waiting_time < '#{today}'")
|
||||||
if order_reservation.length > 0
|
if order_reservation.length > 0
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation
|
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation
|
||||||
@@ -228,7 +229,7 @@ class OrderReservation < ApplicationRecord
|
|||||||
|
|
||||||
def self.check_order_ready_to_delivery
|
def self.check_order_ready_to_delivery
|
||||||
today = Time.now.utc
|
today = Time.now.utc
|
||||||
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}'")
|
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}' and expected_waiting_time < '#{today}'")
|
||||||
if order_reservation.length > 0
|
if order_reservation.length > 0
|
||||||
if ENV["SERVER_MODE"] == 'cloud'
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation
|
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ class OrderSetItemPdf < Prawn::Document
|
|||||||
def initialize(print_settings,order_set_item, print_status, options, alt_name, before_updated_qty)
|
def initialize(print_settings,order_set_item, print_status, options, alt_name, before_updated_qty)
|
||||||
self.page_width = print_settings.page_width
|
self.page_width = print_settings.page_width
|
||||||
self.page_height = print_settings.page_height
|
self.page_height = print_settings.page_height
|
||||||
self.header_font_size = printer_settings.header_font_size.to_i
|
self.header_font_size = print_settings.header_font_size.to_i
|
||||||
self.item_font_size = printer_settings.item_font_size.to_i
|
self.item_font_size = print_settings.item_font_size.to_i
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
self.price_width = 40 # No Need for item
|
self.price_width = 40 # No Need for item
|
||||||
self.qty_width = 40
|
self.qty_width = 40
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
||||||
price = item.unit_price
|
price = item.unit_price
|
||||||
product_name = item.product_name
|
product_name = item.product_name
|
||||||
total_qty += item.qty
|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class CommissionerImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class CustomerImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class EmployeeImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class ProductImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class ShopImageUploader < CarrierWave::Uploader::Base
|
|||||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename
|
||||||
|
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||||
|
end
|
||||||
|
|
||||||
# def cache_dir
|
# def cache_dir
|
||||||
# '/tmp/images'
|
# '/tmp/images'
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
||||||
:membership_id, :membership_type, :membership_authentication_code,
|
:membership_id, :membership_type, :membership_authentication_code,
|
||||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles
|
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles
|
||||||
json.url crm_customer_url(@crm_customer, format: :json)
|
json.url crm_customer_url(@crm_customer, format: :json)
|
||||||
@@ -205,6 +205,9 @@ $(document).on('click',".customer_tr",function(){
|
|||||||
$('#paypar_account_no').val(data.paypar_account_no);
|
$('#paypar_account_no').val(data.paypar_account_no);
|
||||||
$('#customer_address').val(data.address);
|
$('#customer_address').val(data.address);
|
||||||
$('#customer_date_of_birth').val(data.date_of_birth);
|
$('#customer_date_of_birth').val(data.date_of_birth);
|
||||||
|
if(data.image_path.url!=undefined && data.image_path.url!=null){
|
||||||
|
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
|
||||||
|
}
|
||||||
$('#customer_membership_type').val(data.membership_type);
|
$('#customer_membership_type').val(data.membership_type);
|
||||||
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
||||||
if (data.gender == 'Male') {
|
if (data.gender == 'Male') {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
||||||
:membership_id, :membership_type, :membership_authentication_code,
|
:membership_id, :membership_type, :membership_authentication_code,
|
||||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles
|
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles
|
||||||
json.url crm_customer_url(@crm_customer, format: :json)
|
json.url crm_customer_url(@crm_customer, format: :json)
|
||||||
|
|||||||
@@ -313,7 +313,7 @@
|
|||||||
<div class="col-md-3 cashier_number border-top border-left" data-value="9" data-type="num">9</div>
|
<div class="col-md-3 cashier_number border-top border-left" data-value="9" data-type="num">9</div>
|
||||||
<div class="col-md-3 cashier_number border-top border-left" data-value="0" data-type="num">0</div>
|
<div class="col-md-3 cashier_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||||
<div class="col-md-3 cashier_number border-top border-left" data-value="00" data-type="num">00</div>
|
<div class="col-md-3 cashier_number border-top border-left" data-value="00" data-type="num">00</div>
|
||||||
<div class="col-md-3 cashier_number border-top border-left orange" data-type="clr">Clr</div>
|
<div class="col-md-3 cashier_number border-top border-left bg-orange" data-type="clr">Clr</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
@@ -207,6 +207,21 @@
|
|||||||
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><%= t("views.right_panel.detail.customer_photo") %></label>
|
||||||
|
<div class="panel padding-10">
|
||||||
|
<div class="menu-item-img">
|
||||||
|
<% if f.object.image_path? %>
|
||||||
|
<p><%= f.object.name %></p>
|
||||||
|
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
|
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
|
||||||
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
|
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @dinein_cashier == '1' %>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 cashier_view">
|
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 cashier_view">
|
||||||
<div class="info-box bg-green">
|
<div class="info-box bg-green">
|
||||||
<div class="icon" >
|
<div class="icon" >
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<% if @order_reservation == '1' %>
|
<% if @order_reservation == '1' %>
|
||||||
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 order_reservation">
|
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 order_reservation">
|
||||||
<div class="info-box bg-blue">
|
<div class="info-box bg-blue">
|
||||||
|
|||||||
@@ -487,8 +487,13 @@
|
|||||||
<% if current_login_employee.role != "waiter" %>
|
<% if current_login_employee.role != "waiter" %>
|
||||||
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> -->
|
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> -->
|
||||||
|
<% if current_login_employee.role == "cashier" %>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||||
|
<% else %>
|
||||||
|
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||||
|
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if current_login_employee.role != "waiter" %>
|
<% if current_login_employee.role != "waiter" %>
|
||||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||||
|
|||||||
@@ -355,13 +355,13 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td colspan="2" class="body-td align-left">
|
||||||
<span class="font-13">ADDRESS</span><br>
|
<span class="font-13">ADDRESS</span><br>
|
||||||
<b id="address"></b>
|
<b id="address"></b>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="body-td align-left">
|
<td colspan="2" class="body-td align-left">
|
||||||
<span class="font-13">DELEVERY</span><br>
|
<span class="font-13">DELEVERY</span><br>
|
||||||
<b id="delivery_to"></b>
|
<b id="delivery_to"></b>
|
||||||
</td>
|
</td>
|
||||||
@@ -378,7 +378,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<p id="ref_no" class="hidden"></p>
|
<p id="ref_no" class="hidden"></p>
|
||||||
<p id="callback_url" class="hidden"></p>
|
<p id="callback_url" class="hidden"></p>
|
||||||
<p id="order_id" class="hidden"></p>
|
<p id="order_id" class="hidden"></p>
|
||||||
@@ -412,3 +412,5 @@
|
|||||||
<div id="notify_new_order"></div>
|
<div id="notify_new_order"></div>
|
||||||
<div id="notify_order_send_to_kitchen"></div>
|
<div id="notify_order_send_to_kitchen"></div>
|
||||||
<div id="notify_order_ready_to_delivery"></div>
|
<div id="notify_order_ready_to_delivery"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -350,20 +350,30 @@
|
|||||||
<i class="material-icons">reply</i>
|
<i class="material-icons">reply</i>
|
||||||
Back
|
Back
|
||||||
</button>
|
</button>
|
||||||
<!-- <button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
<!-- -->
|
||||||
|
<% if current_login_employee.role == "cashier" %>
|
||||||
|
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
||||||
|
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||||
|
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="waste"> Waste</a>
|
||||||
|
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="spoile"> Spoile</a>
|
||||||
|
<% else %>
|
||||||
|
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
||||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
||||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button> -->
|
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
<% end %>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="waste"> Waste</a>
|
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="spoile"> Spoile</a>
|
|
||||||
<% if @cashier_type=="quick_service" %>
|
<% if @cashier_type=="quick_service" %>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||||
|
<% if current_login_employee.role == "cashier" %>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
|
||||||
|
<% else %>
|
||||||
|
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
|
|||||||
@@ -199,12 +199,73 @@
|
|||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||||
<% if @sale.sale_status != 'void' %>
|
<% if @sale.sale_status != 'void' %>
|
||||||
|
<% if current_login_employee.role == "cashier" %>
|
||||||
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||||
|
<% else %>
|
||||||
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>
|
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog modal-sm" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
||||||
|
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||||
|
<input type="text" id="access_code" class="access_code form-control col-md-12 ">
|
||||||
|
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="2" data-type="num">2</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="3" data-type="num">3</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="4" data-type="num">4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom p-l-15 p-r-15">
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="5" data-type="num">5</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="6" data-type="num">6</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="7" data-type="num">7</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="8" data-type="num">8</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom p-l-15 p-r-15">
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="9" data-type="num">9</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||||
|
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
||||||
|
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="voidModalLabel">Please Enter Reason for Void</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="remark">
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer ">
|
||||||
|
<div class="row p-r-20">
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-red waves-effect " id="void" active="true">VOID</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5">
|
||||||
|
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".tables").on('click', function(){
|
$(".tables").on('click', function(){
|
||||||
@@ -247,7 +308,14 @@ $('#back').on('click',function(){
|
|||||||
// // });
|
// // });
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
$(document).on('click', '.access_modal', function(event){
|
||||||
|
type = $(this).data("type");
|
||||||
|
$(".ok").attr("data-action",type)
|
||||||
|
$('#AccessCodeModal').modal('show');
|
||||||
|
});
|
||||||
$('#void').on('click', function () {
|
$('#void').on('click', function () {
|
||||||
|
var access_code = localStorage.getItem("access_code");
|
||||||
swal({
|
swal({
|
||||||
title: "Alert",
|
title: "Alert",
|
||||||
text: "Are you sure want to Void?",
|
text: "Are you sure want to Void?",
|
||||||
@@ -259,10 +327,12 @@ $('#back').on('click',function(){
|
|||||||
}, function (isConfirm) {
|
}, function (isConfirm) {
|
||||||
if (isConfirm) {
|
if (isConfirm) {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
var ajax_url = "/origami/sale/" + sale_id +'/'+'cashier'+ '/void';
|
||||||
|
// var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
|
data: {'access_code':access_code},
|
||||||
success: function () {
|
success: function () {
|
||||||
window.location.href = '/origami/sale/'+sale_id;
|
window.location.href = '/origami/sale/'+sale_id;
|
||||||
}
|
}
|
||||||
@@ -271,10 +341,52 @@ $('#back').on('click',function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function check_emp_access_code(access_code,type) {
|
||||||
|
var url = "/origami/check_emp_access_code/" + access_code ;
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: url,
|
||||||
|
data: {},
|
||||||
|
success: function (result) {
|
||||||
|
console.log(result)
|
||||||
|
if (result.status == true) {
|
||||||
|
createAccessCode(code);
|
||||||
|
if (type == "edit") {
|
||||||
|
var dining_id = $('#dining').text();
|
||||||
|
var sale_id = $('#sale_id').text();
|
||||||
|
if (dining_id) {
|
||||||
|
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||||
|
}else{
|
||||||
|
window.location.href = "/origami/table/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||||
|
}
|
||||||
|
}else if(type == "void"){
|
||||||
|
$('#AccessCodeModal').modal('hide');
|
||||||
|
$('#voidModal').modal('show');
|
||||||
|
// overall_void();
|
||||||
|
}else if(type == "waste") {
|
||||||
|
// $('#AccessCodeModal').modal('hide');
|
||||||
|
// $('#focModal').modal('show');
|
||||||
|
waste_and_spoilage("waste")
|
||||||
|
}else if(type == "spoile") {
|
||||||
|
// $('#AccessCodeModal').modal('hide');
|
||||||
|
// $('#voidModal').modal('show');
|
||||||
|
waste_and_spoilage("spoile")
|
||||||
|
}else if(type == "foc"){
|
||||||
|
$('#AccessCodeModal').modal('hide');
|
||||||
|
$('#focModal').modal('show');
|
||||||
|
// overall_foc();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
swal("Opps",result.message,"warning")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#re-print').click(function() {
|
$('#re-print').click(function() {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,42 +5,65 @@
|
|||||||
|
|
||||||
<table class="table table-striped" border="0">
|
<table class="table table-striped" border="0">
|
||||||
<h5 class="p-l-10 p-t-10">Report For <%= @sale_type? @sale_type : 'Waste' %></h5>
|
<h5 class="p-l-10 p-t-10">Report For <%= @sale_type? @sale_type : 'Waste' %></h5>
|
||||||
<% @sale_data.each do |sale| %>
|
<% receipt_arr = Array.new %>
|
||||||
|
<% menu_cat_arr = Array.new %>
|
||||||
|
<% footer_arr = Array.new %>
|
||||||
|
<% count = 0 %>
|
||||||
<% waste_and_spoil_item_count = 0%>
|
<% waste_and_spoil_item_count = 0%>
|
||||||
|
|
||||||
|
<% @sale_data.each do |sale| %>
|
||||||
|
<% if !receipt_arr.include?(sale.receipt_no) %>
|
||||||
<thead>
|
<thead>
|
||||||
|
<td> </td>
|
||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<strong>Receipt No :<%= sale.receipt_no %></strong>
|
<strong>Receipt No :<%= sale.receipt_no %></strong>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
<td colspan="3" style="text-align:right"><strong>Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %></strong></td>
|
<td colspan="3" style="text-align:right"><strong>Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td ><strong>Item Name</strong></td>
|
<td><strong>Menu Category</strong></td>
|
||||||
<td ><strong>Item Code</strong></td>
|
<td><strong>Item Name</strong></td>
|
||||||
|
<td><strong>Item Code</strong></td>
|
||||||
<td><strong>Qty</strong></td>
|
<td><strong>Qty</strong></td>
|
||||||
<td><strong>Price</strong></td>
|
<td><strong>Price</strong></td>
|
||||||
<td><strong>Total Price</strong></td>
|
<td><strong>Total Price</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<% receipt_arr.push(sale.receipt_no) %>
|
||||||
|
<% menu_cat_arr.clear %>
|
||||||
|
<% count = 0 %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% sale.sale_items.each do |item| %>
|
<tbody>
|
||||||
<% if !item.item_instance_code.nil?%>
|
|
||||||
<% waste_and_spoil_item_count += item.qty.to_i%>
|
<% if !sale.item_instance_code.nil?%>
|
||||||
|
<% waste_and_spoil_item_count += sale.qty.to_i %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= item.product_name %></td>
|
<% if !menu_cat_arr.include?(sale.name) %>
|
||||||
<td><%= item.product_code %></td>
|
<td><%= sale.name %></td>
|
||||||
<td><%= item.qty %></td>
|
<% menu_cat_arr.push(sale.name) %>
|
||||||
<td><%= item.price %></td>
|
<% else %>
|
||||||
<td><%= item.price %></td>
|
<td> </td>
|
||||||
|
<% end %>
|
||||||
|
<td><%= sale.product_name %></td>
|
||||||
|
<td><%= sale.product_code %></td>
|
||||||
|
<td><%= sale.qty.to_i %></td>
|
||||||
|
<td><%= sale.unit_price %></td>
|
||||||
|
<td><%= sale.price %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% count = count + 1 %>
|
||||||
|
<% if sale.sale_items.count == count %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
||||||
<td><span class="underline" style="text-align:right">
|
<td>
|
||||||
|
<span class="underline" style="text-align:right">
|
||||||
<strong><%= waste_and_spoil_item_count %></strong>
|
<strong><%= waste_and_spoil_item_count %></strong>
|
||||||
|
<% waste_and_spoil_item_count = 0%>
|
||||||
</span></td>
|
</span></td>
|
||||||
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
||||||
<td >
|
<td >
|
||||||
@@ -49,6 +72,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% footer_arr.push(sale.sale_id) %>
|
||||||
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
redis: &redis
|
|
||||||
adapter: redis
|
|
||||||
url: redis://localhost:6379/1
|
|
||||||
|
|
||||||
production: *redis
|
|
||||||
development: *redis
|
|
||||||
test: *redis
|
|
||||||
@@ -8,7 +8,7 @@ class ActionController::Base
|
|||||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||||
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||||
if (!@license.nil?)
|
if (!@license.nil?)
|
||||||
logger.info "Location - " + @license.dbhost
|
logger.info "Location - " + @license.dbschema
|
||||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||||
# authenticate_session_token
|
# authenticate_session_token
|
||||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||||
@@ -97,7 +97,7 @@ class ActionController::API
|
|||||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||||
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||||
if (!@license.nil?)
|
if (!@license.nil?)
|
||||||
# logger.info "Location - " + @license.dbhost
|
logger.info "Location - " + @license.dbschema
|
||||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||||
# authenticate_session_token
|
# authenticate_session_token
|
||||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
# Puma can serve each request in a thread from an internal thread pool.
|
|
||||||
# The `threads` method setting takes two numbers a minimum and maximum.
|
|
||||||
# Any libraries that use thread pools should be configured to match
|
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
|
||||||
# and maximum, this matches the default thread size of Active Record.
|
|
||||||
#
|
|
||||||
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
|
||||||
threads threads_count, threads_count
|
|
||||||
|
|
||||||
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
|
||||||
#
|
|
||||||
port ENV.fetch("PORT") { 3000 }
|
|
||||||
|
|
||||||
# Specifies the `environment` that Puma will run in.
|
|
||||||
#
|
|
||||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
|
||||||
# Workers are forked webserver processes. If using threads and workers together
|
|
||||||
# the concurrency of the application would be max `threads` * `workers`.
|
|
||||||
# Workers do not work on JRuby or Windows (both of which do not support
|
|
||||||
# processes).
|
|
||||||
#
|
|
||||||
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
|
||||||
# This directive tells Puma to first boot the application and load code
|
|
||||||
# before forking the application. This takes advantage of Copy On Write
|
|
||||||
# process behavior so workers use less memory. If you use this option
|
|
||||||
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
|
||||||
# block.
|
|
||||||
#
|
|
||||||
# preload_app!
|
|
||||||
|
|
||||||
# The code in the `on_worker_boot` will be called if you are using
|
|
||||||
# clustered mode by specifying a number of `workers`. After each worker
|
|
||||||
# process is booted this block will be run, if you are using `preload_app!`
|
|
||||||
# option you will want to use this block to reconnect to any threads
|
|
||||||
# or connections that may have been created at application boot, Ruby
|
|
||||||
# cannot share connections between processes.
|
|
||||||
#
|
|
||||||
# on_worker_boot do
|
|
||||||
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Allow puma to be restarted by `rails restart` command.
|
|
||||||
|
|
||||||
plugin :tmp_restart
|
|
||||||
@@ -14,14 +14,14 @@ every 1.minutes do
|
|||||||
runner "DiningFacility.checkin_time"
|
runner "DiningFacility.checkin_time"
|
||||||
end
|
end
|
||||||
|
|
||||||
every 3.minutes do
|
every 10.minutes do
|
||||||
runner "OrderReservation.check_new_order"
|
runner "OrderReservation.check_new_order"
|
||||||
end
|
end
|
||||||
|
|
||||||
every 5.minutes do
|
every 10.minutes do
|
||||||
runner "OrderReservation.check_order_send_to_kitchen"
|
runner "OrderReservation.check_order_send_to_kitchen"
|
||||||
end
|
end
|
||||||
|
|
||||||
every 5.minutes do
|
every 10.minutes do
|
||||||
runner "OrderReservation.check_order_ready_to_delivery"
|
runner "OrderReservation.check_order_ready_to_delivery"
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user