request bill error on promotion. fix for compute sale's totals on promotion.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user