Inventory Issue
This commit is contained in:
@@ -4,8 +4,6 @@ class InventoryDefinition < ApplicationRecord
|
||||
|
||||
def self.calculate_product_count(saleObj=nil,saleobj_after_req_bill=nil)
|
||||
if !saleObj.nil?
|
||||
Rails.logger.debug "Hello count"
|
||||
Rails.logger.debug saleObj.sale_items.count
|
||||
saleObj.sale_items.each do |item|
|
||||
found, inventory_definition = find_product_in_inventory(item)
|
||||
if found
|
||||
@@ -37,7 +35,7 @@ class InventoryDefinition < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.check_balance(item,inventory_definition) # item => saleItemOBj
|
||||
stock = StockJournal.where('item_code=?', item.item_instance_code).last
|
||||
stock = StockJournal.where('item_code=?', item.item_instance_code).order("id DESC").first
|
||||
unless stock.nil?
|
||||
modify_balance(item, stock, inventory_definition)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user