This commit is contained in:
yarzar_code
2020-01-12 20:07:28 +06:30
parent 314cc507a3
commit dff2c69627
89 changed files with 492 additions and 469 deletions

View File

@@ -36,7 +36,7 @@ class StockJournal < ApplicationRecord
end
def self.from_stock_check(item,shop)
stock_journal = StockJournal.where("shop_code='#{shop.shop_code}' and item_code=?", item.item_code).order("id DESC").first
stock_journal = StockJournal.where("item_code=?", item.item_code).order("id DESC").first
if stock_journal.nil?
old_blance = 0
inventory_definition_id = InventoryDefinition.find_by_item_code_and_shop_code(item.item_code,shop.shop_code).id
@@ -79,7 +79,7 @@ class StockJournal < ApplicationRecord
end
def self.delete_stock_journal(item_code,shop)
self.where("item_code=? and shop_code='#{shop.shop_code}'", item_code).delete_all
self.where("item_code=?", item_code).delete_all
end
end