diff --git a/app/models/sale.rb b/app/models/sale.rb index 29607c11..b97c529e 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -659,7 +659,7 @@ def self.get_item_query() # "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_id ") 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.product_name").order("mi.account_id asc","mi.menu_category_id asc") + query = query.group("i.product_name").order("mi.account_id desc") end def self.get_other_charges() diff --git a/app/views/reports/saleitem/index.html.erb b/app/views/reports/saleitem/index.html.erb index 7fa72521..97ba9c3f 100644 --- a/app/views/reports/saleitem/index.html.erb +++ b/app/views/reports/saleitem/index.html.erb @@ -49,6 +49,7 @@ <% acc_arr = Array.new %> <% cate_arr = Array.new %> + <% sub_qty = 0 %> <% sub_total = 0 %> <% other_sub_total = 0 %> <% count = 0 %> @@ -108,18 +109,23 @@