Inventory Issue

This commit is contained in:
Myat Zin Wai Maw
2019-06-21 15:33:34 +06:30
parent c10dd611d7
commit ae2144cca9
2 changed files with 9 additions and 6 deletions

View File

@@ -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