clean shop code
This commit is contained in:
@@ -26,8 +26,7 @@ class StockJournal < ApplicationRecord
|
||||
inventory_definition_id: inventory_definition.id,
|
||||
remark: stock_message,
|
||||
trans_ref: trans_ref,
|
||||
trans_type: trans_type,
|
||||
shop_code: inventory_definition.shop_code
|
||||
trans_type: trans_type
|
||||
)
|
||||
end
|
||||
|
||||
@@ -39,7 +38,7 @@ class StockJournal < ApplicationRecord
|
||||
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
|
||||
inventory_definition_id = InventoryDefinition.find_by_item_code(item.item_code).id
|
||||
else
|
||||
old_blance = stock_journal.balance
|
||||
inventory_definition_id = stock_journal.inventory_definition_id
|
||||
@@ -54,7 +53,6 @@ class StockJournal < ApplicationRecord
|
||||
journal.remark = StockJournal::STOCK_CHECK_TRANS
|
||||
journal.trans_ref = item.id
|
||||
journal.trans_type = StockJournal::STOCK_CHECK_TRANS
|
||||
journal.shop_code = shop.shop_code
|
||||
journal.save
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user