diff --git a/app/views/api/orders/view_orders.json.jbuilder b/app/views/api/orders/view_orders.json.jbuilder
index dd72a3a3..9118b87f 100755
--- a/app/views/api/orders/view_orders.json.jbuilder
+++ b/app/views/api/orders/view_orders.json.jbuilder
@@ -36,6 +36,7 @@ if (@booking)
end
json.order_items order_items do |item|
+ total_set_menu = 0
# For YGN BBQ
if item.item_code.include? ("PSA_")
adult_count += item.qty
@@ -46,6 +47,7 @@ if (@booking)
child_spent += (item.price * item.qty)
end
# End YGN BBQ
+
json.order_items_id item.order_items_id
json.order_id item.order_id
json.item_code item.item_code
@@ -57,7 +59,16 @@ if (@booking)
json.options item.options
json.remark item.remark
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
diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index 986bed5f..b6039c00 100755
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -284,6 +284,7 @@
unless @order_items.nil? || @order_items.empty?
count = 0
@order_items.each do |order_item|
+ set_item_prices = 0
count += 1
sub_total = sub_total + (order_item.price * order_item.qty)
@@ -301,7 +302,8 @@
<% end %>
<% 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 %>
<%= item_instance["item_instance_name"] %>
<% if !item_instance["options"].nil? && !item_instance["options"].empty? %>
@@ -313,10 +315,11 @@
<% end %>
<% end
+ sub_total += set_item_prices
end %>