Promotion Tax bug fix

This commit is contained in:
Phyo
2017-08-24 18:31:53 +06:30
parent 9327cb7169
commit 8b33a94d93
2 changed files with 11 additions and 3 deletions

View File

@@ -183,6 +183,7 @@ class Sale < ApplicationRecord
sale_item.sale_id = self.id
sale_item.price = diningprice
sale_item.save
self.compute
end
def update_item (item)
@@ -214,10 +215,11 @@ class Sale < ApplicationRecord
sales_items.each do |item|
#compute each item and added to total
puts "item.sales_item_id ddd"
puts item.sale_item_id
subtotal_price = subtotal_price + item.price
total_taxable = total_taxable + (item.taxable_price * item.qty)
end
apply_tax (total_taxable)
self.total_amount = subtotal_price
self.total_discount = total_discount