stock check report

This commit is contained in:
Zin Lin Phyo
2017-09-07 10:30:20 +06:30
parent 2e53b72574
commit 43cc308d89
6 changed files with 218 additions and 206 deletions

View File

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