From 11c3be8f4a6b853a11b0e3f27e0fe60af75386d9 Mon Sep 17 00:00:00 2001 From: Nweni Date: Thu, 29 Jun 2017 14:05:03 +0630 Subject: [PATCH] Update --- app/models/sale_item.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 90222976..3cc0eb43 100644 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -39,8 +39,8 @@ class SaleItem < ApplicationRecord # Check for actual sale items sale_items.each do |si| if si.account_id == a.id - account_price[:price] = account_price[:price] + si.price - end + account_price[:price] = account_price[:price] + si.price + end end price_accounts.push(account_price) end @@ -55,10 +55,10 @@ class SaleItem < ApplicationRecord discount_account = {:name => a.title, :price => 0} # 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 - discount_account[:price] = (discount_account[:price] + si.price) * -1 - end + discount_account[:price] = (discount_account[:price] + si.price) * -1 + end end discount_accounts.push(discount_account) end