request bill error on promotion. fix for compute sale's totals on promotion.

This commit is contained in:
Thein Lin Kyaw
2019-11-08 20:35:26 +06:30
parent 1e2ff8b1be
commit 8046b7210b
13 changed files with 117 additions and 127 deletions

View File

@@ -109,7 +109,7 @@ class Promotion < ApplicationRecord
item = saleObj.order_items.where(item_instance_code: promo_product).first
if !item.nil?
update_existing_item(foc_qty, item, sale_id, "promotion", item[:price], source)
update_existing_item(foc_qty, item, saleObj, "promotion", item[:price], source)
end
end
# AA - 10 # 3 # BB # orderList, #S34345
@@ -128,7 +128,7 @@ class Promotion < ApplicationRecord
item = saleObj.order_items.where(item_instance_code: promo_product).first
if !item.nil?
update_existing_item(promotion_qty, item, sale_id, "promotion", item[:price],source)
update_existing_item(promotion_qty, item, saleObj, "promotion", item[:price],source)
end
end
@@ -157,8 +157,9 @@ class Promotion < ApplicationRecord
sale_item.is_taxable = 1
sale_item.sale = saleObj
sale_item.save
saleObj.compute_by_sale_items(saleObj.id, saleObj.sale_items, saleObj.total_discount,nil,source)
saleObj.sale_items << sale_item
saleObj.compute_by_sale_items(saleObj.total_discount, nil, source)
end
end
@@ -180,7 +181,7 @@ class Promotion < ApplicationRecord
item = saleObj.order_items.where(item_instance_code: promo_product.item_code).first
if !item.nil?
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off,source)
update_existing_item(foc_qty, item, saleObj, "promotion nett off", promo_product.net_off,source)
end
end