Update
This commit is contained in:
@@ -39,8 +39,8 @@ class SaleItem < ApplicationRecord
|
|||||||
# Check for actual sale items
|
# Check for actual sale items
|
||||||
sale_items.each do |si|
|
sale_items.each do |si|
|
||||||
if si.account_id == a.id
|
if si.account_id == a.id
|
||||||
account_price[:price] = account_price[:price] + si.price
|
account_price[:price] = account_price[:price] + si.price
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
price_accounts.push(account_price)
|
price_accounts.push(account_price)
|
||||||
end
|
end
|
||||||
@@ -55,10 +55,10 @@ class SaleItem < ApplicationRecord
|
|||||||
discount_account = {:name => a.title, :price => 0}
|
discount_account = {:name => a.title, :price => 0}
|
||||||
|
|
||||||
# Check for actual sale items
|
# Check for actual sale items
|
||||||
sale_items.where("is_taxable = 0 AND remark = 'Discount'").find_each do |si|
|
sale_items.where("is_taxable = false AND remark = 'Discount'").find_each do |si|
|
||||||
if si.account_id == a.id
|
if si.account_id == a.id
|
||||||
discount_account[:price] = (discount_account[:price] + si.price) * -1
|
discount_account[:price] = (discount_account[:price] + si.price) * -1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
discount_accounts.push(discount_account)
|
discount_accounts.push(discount_account)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user