update sale item report

This commit is contained in:
Aung Myo
2017-11-24 18:57:01 +06:30
parent 479a6b5a61
commit b49f46a5c2
5 changed files with 53 additions and 23 deletions

View File

@@ -623,6 +623,7 @@ def self.get_item_query()
query = Sale.select("acc.title as account_name,mi.account_id, i.item_instance_code as item_code, " +
"SUM(i.qty * i.unit_price) as grand_total,SUM(i.qty) as total_item," +
"i.remark as status_type,"+
" i.unit_price as unit_price,i.product_name as product_name, mc.name as" +
" menu_category_name,mc.id as menu_category_id ")
@@ -635,7 +636,7 @@ def self.get_item_query()
query = query.joins(" JOIN accounts acc ON acc.id = mi.account_id")
query = query.where("i.item_instance_code IS NOT NULL")
query = query.group("i.item_instance_code").order("mi.account_id, mi.menu_category_id")
query = query.group("i.product_name").order("mi.account_id, mi.menu_category_id")
end
def self.get_by_shift_items(shift_sale_range, shift, from, to, status)