stock check report
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class StockCheckItem < ApplicationRecord
|
||||
|
||||
belongs_to :stock_check
|
||||
|
||||
def create(stock_id, item)
|
||||
@@ -33,4 +32,15 @@ class StockCheckItem < ApplicationRecord
|
||||
return 'missing stock', stock_check_qty.to_i - journal_balance.to_i
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_transaction(from, to, item_code)
|
||||
transaction = all
|
||||
if !from.nil? && !to.nil?
|
||||
transaction = transaction.where('created_at between ? and ?', from, to)
|
||||
end
|
||||
if item_code.present?
|
||||
transaction = transaction.where(item_code: item_code)
|
||||
end
|
||||
transaction
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user