update sale search

This commit is contained in:
Aung Myo
2017-06-13 15:04:51 +06:30
parent 03b839fc07
commit 7194f0e971
3 changed files with 17 additions and 20 deletions

View File

@@ -258,6 +258,14 @@ class Sale < ApplicationRecord
end
end
def self.search(search)
if search
find(:all, :conditions => ['receipt_no LIKE ?', "%#{search}%"])
else
find(:all)
end
end
private
def generate_custom_id