update sale item xls

This commit is contained in:
Aung Myo
2017-12-05 16:28:21 +06:30
parent 7d701edaab
commit 97bb6ae211
5 changed files with 9 additions and 20 deletions

View File

@@ -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")
query = query.group("i.product_name").order("mi.account_id asc","mi.menu_category_id asc")
end
def self.get_other_charges()

View File

@@ -97,7 +97,7 @@ class SaleItem < ApplicationRecord
# Check for actual sale items
sale_items.where("remark = 'Discount'").find_each do |si|
if si.account_id == a.id
discount_account[:price] = (discount_account[:price].abs + si.price.abs) * (-1)
discount_account[:price] = (discount_account[:price].abs + si.price.abs) * (1)
end
end
discount_accounts.push(discount_account)