Pull from master
This commit is contained in:
@@ -219,3 +219,13 @@ function export_to(path)
|
|||||||
var form_params = $("#frm_report").serialize();
|
var form_params = $("#frm_report").serialize();
|
||||||
window.location = path+"?"+ form_params;
|
window.location = path+"?"+ form_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* chartkick js YAxis value override */
|
||||||
|
Chart.scaleService.updateScaleDefaults('linear', {
|
||||||
|
ticks: {
|
||||||
|
callback: function (value, index, values) {
|
||||||
|
return value/1000 + 'k';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/* chartkick js YAxis value override */
|
||||||
@@ -13,7 +13,11 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
|
|||||||
$('.table_'+data.table.id).removeClass('green');
|
$('.table_'+data.table.id).removeClass('green');
|
||||||
$('.table_'+data.table.id).addClass('blue');
|
$('.table_'+data.table.id).addClass('blue');
|
||||||
$('.new_text_'+data.table.id).removeClass('hide')
|
$('.new_text_'+data.table.id).removeClass('hide')
|
||||||
}else{
|
}else if(data.type == 'move'){
|
||||||
|
$('.table_'+data.table).removeClass('blue');
|
||||||
|
$('.table_'+data.table).addClass('green');
|
||||||
|
$('.table_'+data.change_to).addClass('blue');
|
||||||
|
}else{
|
||||||
$('.table_'+data.table.id).removeClass('red');
|
$('.table_'+data.table.id).removeClass('red');
|
||||||
$('.table_'+data.table.id).addClass('green');
|
$('.table_'+data.table.id).addClass('green');
|
||||||
$('.new_text_'+data.table.id).html('');
|
$('.new_text_'+data.table.id).html('');
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ class Origami::MoveroomController < BaseOrigamiController
|
|||||||
|
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||||
|
|
||||||
@status_order = ""
|
@status_order = ""
|
||||||
@status_sale = ""
|
@status_sale = ""
|
||||||
@@ -34,25 +34,25 @@ class Origami::MoveroomController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@status_order = 'order'
|
@status_order = 'order'
|
||||||
else
|
# else
|
||||||
sale = Sale.find(booking.sale_id)
|
# sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed" && sale.sale_status != "waste" && sale.sale_status != "spoile"
|
# if sale.sale_status != "completed" && sale.sale_status != "waste" && sale.sale_status != "spoile"
|
||||||
@sale_array.push(sale)
|
# @sale_array.push(sale)
|
||||||
if @status_order == 'order'
|
# if @status_order == 'order'
|
||||||
@status_order = 'sale'
|
# @status_order = 'sale'
|
||||||
end
|
# end
|
||||||
@booking= booking
|
# @booking= booking
|
||||||
@date = sale.created_at
|
# @date = sale.created_at
|
||||||
@status_sale = 'sale'
|
# @status_sale = 'sale'
|
||||||
@obj_sale = sale
|
# @obj_sale = sale
|
||||||
@customer = sale.customer
|
# @customer = sale.customer
|
||||||
accounts = @customer.tax_profiles
|
# accounts = @customer.tax_profiles
|
||||||
@account_arr =[]
|
# @account_arr =[]
|
||||||
accounts.each do |acc|
|
# accounts.each do |acc|
|
||||||
account = TaxProfile.find(acc)
|
# account = TaxProfile.find(acc)
|
||||||
@account_arr.push(account)
|
# @account_arr.push(account)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,52 +7,74 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
|
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.all
|
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||||
@orders = Order.all.order('date desc')
|
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||||
@dining = DiningFacility.find(params[:dining_id])
|
@dining = DiningFacility.find(params[:dining_id])
|
||||||
|
|
||||||
@status_order = ""
|
@status_order = ""
|
||||||
@status_sale = ""
|
@status_sale = ""
|
||||||
@sale_array = Array.new
|
@sale_array = Array.new
|
||||||
|
|
||||||
|
# if !bookings.nil?
|
||||||
|
# bookings.each do | booking |
|
||||||
|
# if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||||
|
# booking_array.push(booking)
|
||||||
|
# end
|
||||||
|
|
||||||
|
# booking.booking_orders.each do |booking_order|
|
||||||
|
# order = Order.find(booking_order.order_id)
|
||||||
|
# if order.status == 'new'
|
||||||
|
# order.order_items.each do |order_item|
|
||||||
|
# order_items.push(order_item)
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
@dining.bookings.each do |booking|
|
@dining.bookings.each do |booking|
|
||||||
if booking.sale_id.nil?
|
if booking.sale_id.nil?
|
||||||
@order_items = Array.new
|
@order_items = Array.new
|
||||||
booking.booking_orders.each do |booking_order|
|
if booking.booking_status != 'moved'
|
||||||
order = Order.find(booking_order.order_id)
|
booking.booking_orders.each do |booking_order|
|
||||||
@obj_order = order
|
order = Order.find(booking_order.order_id)
|
||||||
@customer = order.customer
|
@obj_order = order
|
||||||
@date = order.created_at
|
@customer = order.customer
|
||||||
@booking= booking
|
@date = order.created_at
|
||||||
order.order_items.each do |item|
|
@booking= booking
|
||||||
@order_items.push(item)
|
if order.status == 'new'
|
||||||
end
|
order.order_items.each do |item|
|
||||||
accounts = @customer.tax_profiles
|
@order_items.push(item)
|
||||||
@account_arr =[]
|
end
|
||||||
accounts.each do |acc|
|
end
|
||||||
account = TaxProfile.find(acc)
|
|
||||||
@account_arr.push(account)
|
accounts = @customer.tax_profiles
|
||||||
end
|
@account_arr =[]
|
||||||
end
|
accounts.each do |acc|
|
||||||
|
account = TaxProfile.find(acc)
|
||||||
|
@account_arr.push(account)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@status_order = 'order'
|
@status_order = 'order'
|
||||||
else
|
# else
|
||||||
sale = Sale.find(booking.sale_id)
|
# sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed" && sale.sale_status != "waste" && sale.sale_status != "spoile"
|
# if sale.sale_status != "completed" && sale.sale_status != "waste" && sale.sale_status != "spoile"
|
||||||
@sale_array.push(sale)
|
# @sale_array.push(sale)
|
||||||
if @status_order == 'order'
|
# if @status_order == 'order'
|
||||||
@status_order = 'sale'
|
# @status_order = 'sale'
|
||||||
end
|
# end
|
||||||
@booking= booking
|
# @booking= booking
|
||||||
@date = sale.created_at
|
# @date = sale.created_at
|
||||||
@status_sale = 'sale'
|
# @status_sale = 'sale'
|
||||||
@obj_sale = sale
|
# @obj_sale = sale
|
||||||
@customer = sale.customer
|
# @customer = sale.customer
|
||||||
accounts = @customer.tax_profiles
|
# accounts = @customer.tax_profiles
|
||||||
@account_arr =[]
|
# @account_arr =[]
|
||||||
accounts.each do |acc|
|
# accounts.each do |acc|
|
||||||
account = TaxProfile.find(acc)
|
# account = TaxProfile.find(acc)
|
||||||
@account_arr.push(account)
|
# @account_arr.push(account)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -105,5 +127,19 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
type = 'move'
|
||||||
|
from = getCloudDomain #get sub domain in cloud mode
|
||||||
|
ActionCable.server.broadcast "order_channel",table: change_from,type:type,from:from ,change_to:change_to
|
||||||
|
end
|
||||||
|
|
||||||
|
#get cloud domain
|
||||||
|
def getCloudDomain
|
||||||
|
from = ""
|
||||||
|
if ENV["SERVER_MODE"] == 'cloud'
|
||||||
|
from = request.subdomain + "." + request.domain
|
||||||
|
end
|
||||||
|
|
||||||
|
return from
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -139,11 +139,10 @@ class Promotion < ApplicationRecord
|
|||||||
# item = OrderItem.find_by_item_code(promo_product)
|
# item = OrderItem.find_by_item_code(promo_product)
|
||||||
item = OrderItem.where("item_code = '#{promo_product}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_code = '#{promo_product}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
end
|
end
|
||||||
source = Order.find(item.order_id).source
|
if !item.nil?
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion", item.price,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion", item.price,source)
|
||||||
puts "Charged - " + charge_qty.to_s
|
end
|
||||||
puts "FOC - " + foc_qty.to_s
|
|
||||||
end
|
end
|
||||||
# AA - 10 # 3 # BB # orderList, #S34345
|
# AA - 10 # 3 # BB # orderList, #S34345
|
||||||
def self.give_promotion_second_product(orderitem_count, foc_min_qty, promo_product, orderitem, sale_id)
|
def self.give_promotion_second_product(orderitem_count, foc_min_qty, promo_product, orderitem, sale_id)
|
||||||
@@ -155,9 +154,10 @@ class Promotion < ApplicationRecord
|
|||||||
end
|
end
|
||||||
# item = OrderItem.find_by_item_instance_code(promo_product)
|
# item = OrderItem.find_by_item_instance_code(promo_product)
|
||||||
item = OrderItem.where("item_instance_code = '#{promo_product}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{promo_product}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
|
if !item.nil?
|
||||||
source = Order.find(item.order_id).source
|
source = Order.find(item.order_id).source
|
||||||
update_existing_item(promotion_qty, item, sale_id, "promotion", item.price,source)
|
update_existing_item(promotion_qty, item, sale_id, "promotion", item.price,source)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -190,15 +190,21 @@ class Promotion < ApplicationRecord
|
|||||||
foc_qty = orderitem[1].to_i / foc_min_qty
|
foc_qty = orderitem[1].to_i / foc_min_qty
|
||||||
# item = OrderItem.find_by_item_instance_code(orderitem[0][0])
|
# item = OrderItem.find_by_item_instance_code(orderitem[0][0])
|
||||||
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
source = Order.find(item.order_id).source
|
if !item.nil?
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source)
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
foc_qty = orderitem[1].to_i / foc_min_qty
|
foc_qty = orderitem[1].to_i / foc_min_qty
|
||||||
# foc_qty = find_second_item_qty(sale_id, promo_product.item_code)
|
# foc_qty = find_second_item_qty(sale_id, promo_product.item_code)
|
||||||
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
||||||
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
source = Order.find(item.order_id).source
|
if !item.nil?
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -208,9 +214,12 @@ class Promotion < ApplicationRecord
|
|||||||
foc_qty = orderitem[1].to_i / foc_min_qty
|
foc_qty = orderitem[1].to_i / foc_min_qty
|
||||||
# item = OrderItem.find_by_item_instance_code(orderitem[0][0]) # need to specify with menu item instance
|
# item = OrderItem.find_by_item_instance_code(orderitem[0][0]) # need to specify with menu item instance
|
||||||
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
price = item.price.to_i - promo_product.net_price.to_i
|
if !item.nil?
|
||||||
source = Order.find(item.order_id).source
|
price = item.price.to_i - promo_product.net_price.to_i
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source)
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
order_qty = find_second_item_qty(sale_id, promo_product.item_code)# need to check for qty
|
order_qty = find_second_item_qty(sale_id, promo_product.item_code)# need to check for qty
|
||||||
foc_qty = orderitem[1].to_i / foc_min_qty
|
foc_qty = orderitem[1].to_i / foc_min_qty
|
||||||
@@ -220,9 +229,12 @@ class Promotion < ApplicationRecord
|
|||||||
end
|
end
|
||||||
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
||||||
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
price = item.price - promo_product.net_price
|
if !item.nil?
|
||||||
source = Order.find(item.order_id).source
|
price = item.price - promo_product.net_price
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion nett price", price,source)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -233,10 +245,13 @@ class Promotion < ApplicationRecord
|
|||||||
# item = OrderItem.find_by_item_instance_code(orderitem[0][0])
|
# item = OrderItem.find_by_item_instance_code(orderitem[0][0])
|
||||||
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{orderitem[0][0]}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
# total = orderitem[1].to_i * item.price
|
# total = orderitem[1].to_i * item.price
|
||||||
total = item.price
|
if !item.nil?
|
||||||
price = calculate_discount(total, promo_product.percentage)
|
total = item.price
|
||||||
source = Order.find(item.order_id).source
|
price = calculate_discount(total, promo_product.percentage)
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source)
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
order_qty = find_second_item_qty(sale_id, promo_product.item_code) #need to check
|
order_qty = find_second_item_qty(sale_id, promo_product.item_code) #need to check
|
||||||
foc_qty = orderitem[1].to_i / foc_min_qty
|
foc_qty = orderitem[1].to_i / foc_min_qty
|
||||||
@@ -248,10 +263,12 @@ class Promotion < ApplicationRecord
|
|||||||
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
# item = OrderItem.find_by_item_instance_code(promo_product.item_code)
|
||||||
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
item = OrderItem.where("item_instance_code = '#{promo_product.item_code}' and order_id = '#{orderitem[0][1]}'").first
|
||||||
# total = item.price * foc_qty
|
# total = item.price * foc_qty
|
||||||
total = item.price
|
if !item.nil?
|
||||||
price = calculate_discount(total, promo_product.percentage)
|
total = item.price
|
||||||
source = Order.find(item.order_id).source
|
price = calculate_discount(total, promo_product.percentage)
|
||||||
update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source)
|
source = Order.find(item.order_id).source
|
||||||
|
update_existing_item(foc_qty, item, sale_id, "promotion discount", price,source)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ if (@booking)
|
|||||||
end
|
end
|
||||||
|
|
||||||
json.order_items order_items do |item|
|
json.order_items order_items do |item|
|
||||||
|
total_set_menu = 0
|
||||||
# For YGN BBQ
|
# For YGN BBQ
|
||||||
if item.item_code.include? ("PSA_")
|
if item.item_code.include? ("PSA_")
|
||||||
adult_count += item.qty
|
adult_count += item.qty
|
||||||
@@ -46,6 +47,7 @@ if (@booking)
|
|||||||
child_spent += (item.price * item.qty)
|
child_spent += (item.price * item.qty)
|
||||||
end
|
end
|
||||||
# End YGN BBQ
|
# End YGN BBQ
|
||||||
|
|
||||||
json.order_items_id item.order_items_id
|
json.order_items_id item.order_items_id
|
||||||
json.order_id item.order_id
|
json.order_id item.order_id
|
||||||
json.item_code item.item_code
|
json.item_code item.item_code
|
||||||
@@ -57,7 +59,16 @@ if (@booking)
|
|||||||
json.options item.options
|
json.options item.options
|
||||||
json.remark item.remark
|
json.remark item.remark
|
||||||
json.item_status item.order_item_status
|
json.item_status item.order_item_status
|
||||||
@total_amount = @total_amount + (item.price * item.qty)
|
|
||||||
|
#start set menu item price
|
||||||
|
if !item.set_menu_items.nil? && item.set_menu_items != '[]'
|
||||||
|
JSON.parse(item.set_menu_items).each do |item_instance|
|
||||||
|
total_set_menu += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#end set menu item price
|
||||||
|
|
||||||
|
@total_amount = @total_amount + (item.price * item.qty) + total_set_menu
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -284,6 +284,7 @@
|
|||||||
unless @order_items.nil? || @order_items.empty?
|
unless @order_items.nil? || @order_items.empty?
|
||||||
count = 0
|
count = 0
|
||||||
@order_items.each do |order_item|
|
@order_items.each do |order_item|
|
||||||
|
set_item_prices = 0
|
||||||
count += 1
|
count += 1
|
||||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
@@ -301,7 +302,8 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !order_item.set_menu_items.nil? && order_item.set_menu_items != '[]'
|
<% if !order_item.set_menu_items.nil? && order_item.set_menu_items != '[]'
|
||||||
JSON.parse(order_item.set_menu_items).each do |item_instance| %>
|
JSON.parse(order_item.set_menu_items).each do |item_instance|
|
||||||
|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
|
||||||
<br><span class="font-13">
|
<br><span class="font-13">
|
||||||
<%= item_instance["item_instance_name"] %>
|
<%= item_instance["item_instance_name"] %>
|
||||||
<% if !item_instance["options"].nil? && !item_instance["options"].empty? %>
|
<% if !item_instance["options"].nil? && !item_instance["options"].empty? %>
|
||||||
@@ -313,10 +315,11 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end
|
<% end
|
||||||
|
sub_total += set_item_prices
|
||||||
end %>
|
end %>
|
||||||
</td>
|
</td>
|
||||||
<td class='item-attr'><%= order_item.qty %></td>
|
<td class='item-attr'><%= order_item.qty %></td>
|
||||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
<td class='item-attr'><%= (order_item.qty*order_item.price).to_f + set_item_prices %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
|
|
||||||
|
|||||||
@@ -269,8 +269,9 @@
|
|||||||
unless @order_items.nil? || @order_items.empty?
|
unless @order_items.nil? || @order_items.empty?
|
||||||
count = 0
|
count = 0
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
count += 1
|
set_item_prices = 0
|
||||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
count += 1
|
||||||
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
# unless order_item.price == 0 %>
|
# unless order_item.price == 0 %>
|
||||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||||
@@ -286,7 +287,8 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !order_item.set_menu_items.nil?
|
<% if !order_item.set_menu_items.nil?
|
||||||
JSON.parse(order_item.set_menu_items).each do |item_instance| %>
|
JSON.parse(order_item.set_menu_items).each do |item_instance|
|
||||||
|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
|
||||||
<br><span class="font-13">
|
<br><span class="font-13">
|
||||||
<%= item_instance["item_instance_name"] %>
|
<%= item_instance["item_instance_name"] %>
|
||||||
<% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %>
|
<% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %>
|
||||||
@@ -298,10 +300,11 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end
|
<% end
|
||||||
|
sub_total += set_item_prices
|
||||||
end %>
|
end %>
|
||||||
</td>
|
</td>
|
||||||
<td class='item-attr'><%= order_item.qty %></td>
|
<td class='item-attr'><%= order_item.qty %></td>
|
||||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
<td class='item-attr'><%= (order_item.qty*order_item.price).to_f + set_item_prices %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user