edit json builder booking order

This commit is contained in:
Wathon Aung
2017-04-20 17:56:00 +06:30
parent 0a97947259
commit 95b7f7b80d
3 changed files with 15 additions and 11 deletions

1
.ruby-version Normal file
View File

@@ -0,0 +1 @@
2.3.3

View File

@@ -12,10 +12,14 @@ if (@booking)
@total_tax = 0.00
if @booking.booking_orders
order_items = []
@booking.booking_orders.each do |bo|
order = Order.find(bo.order_id)
if (order.status == "new")
order_items = order.order_items
order_items = order_items + order.order_items
end
end
json.order_items order_items do |item|
json.item_instance_code item.item_code
json.item_name item.item_name
@@ -26,8 +30,7 @@ if (@booking)
json.item_status item.order_item_status
@total_amount = @total_amount + (item.price * item.qty)
end
end
end
end
json.sub_total @total_amount

BIN
dump.rdb Normal file

Binary file not shown.