Pull from master

This commit is contained in:
San Wai Lwin
2018-08-20 11:26:07 +06:30
parent 3c2faf5970
commit d1852d24c3
28 changed files with 464 additions and 216 deletions

View File

@@ -36,10 +36,10 @@ class StockCheckItem < ApplicationRecord
def self.get_transaction(from, to, item_code)
transaction = all
if !from.nil? && !to.nil?
transaction = transaction.where('created_at between ? and ?', from, to)
transaction = transaction.where('created_at between ? and ?', from, to).order("item_code asc, different desc")
end
if item_code.present?
transaction = transaction.where(item_code: item_code)
transaction = transaction.where(item_code: item_code).order("item_code asc, different desc")
end
transaction
end