update sale item xls
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user