fix dis and payment foc and sale item report

This commit is contained in:
Yan
2017-11-22 20:47:53 +06:30
parent 06582d755e
commit 3261fef3cf
5 changed files with 37 additions and 19 deletions

View File

@@ -171,9 +171,10 @@ class SalePayment < ApplicationRecord
payment_status = false
# add to sale item with foc
sale_items = SaleItem.find_by_sale_id(self.sale)
sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'")
sale_items.each do|item|
SaleItem.update_existing_item(item.qty, item, self.sale, "foc", item.unit_price)
SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "foc", item.unit_price, item.price)
end
self.payment_method = "foc"