fixed inventory

This commit is contained in:
NyanLinHtut
2019-09-27 20:43:48 +06:30
parent ba7e929dc4
commit 62c03bf5fe
6 changed files with 59 additions and 59 deletions

View File

@@ -72,10 +72,13 @@ class StockJournal < ApplicationRecord
end
end
def self.update_stock_journal(item_code,remark)
stock = self.where("item_code=?", item_code).order("id DESC").first
stock.remark = remark
stock.save
def self.update_stock_journal(item_instance_code,remark)
product = InventoryDefinition.find_by_item_code(item_instance_code)
if !product.nil?
stock = self.where("item_code=?", item_instance_code).order("id DESC").first
stock.remark = remark
stock.save
end
end
def self.delete_stock_journal(item_code)