From 37f80a8ac69542e6193dfab892df0da81a4c1614 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 23 Mar 2018 17:59:28 +0630 Subject: [PATCH] update sale --- app/models/sale.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 5fc0c06f..b459f16c 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -799,10 +799,13 @@ def self.get_by_shift_sale(from,to,status) end def self.get_item_query() - query = Sale.select("acc.title as account_name,mi.account_id, i.item_instance_code as item_code,i.account_id as account_id, " + - "SUM(i.qty * i.unit_price) as grand_total,SUM(i.qty) as total_item,i.qty as qty," + + query = Sale.select("acc.title as account_name,mi.account_id, + i.item_instance_code as item_code,i.account_id as account_id, " + + "SUM(i.qty * i.unit_price) as grand_total, + SUM(i.qty) as total_item,i.qty as qty," + "i.status as status_type,"+ - " i.unit_price,i.price as price,i.product_name as product_name, mc.name as" + + " i.unit_price,i.price as price,i.product_name as product_name, + mc.name as" + " menu_category_name,mc.id as menu_category_id ") query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id" +