queue and crm view updated

This commit is contained in:
Aung Myo
2017-06-09 09:29:25 +06:30
parent ea4f50e779
commit 35277ac000
41 changed files with 685 additions and 318 deletions

View File

@@ -0,0 +1,38 @@
if (@customer)
json.id @customer.customer_id
json.name @customer.name
json.email @customer.email
json.contact_no @customer.contact_no
json.date_of_birth @customer.date_of_birth
@total_amount = 0.00
@total_tax = 0.00
if @customer.orders
order_items = []
@customer.orders.each do |bo|
order = Order.find(bo.order_id)
#if (order.status == "new")
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
json.price item.price
json.qty item.qty
json.options item.options
json.remark item.remark
json.item_status item.order_item_status
@total_amount = @total_amount + (item.price * item.qty)
end
end
json.sub_total @total_amount
json.commerical_tax @total_amount * 0.05
json.total @total_amount + (@total_amount * 0.05)
end