class Tran

Public Class Methods

month_transactions(date) click to toggle source

def self.month_transactions(date)

month = Vfwcash.yyyymm(date)
trans = Tran.where('transactions.post_date BETWEEN ? and ?',month+"00",month+"32").order(:post_date,:num)

end

# File lib/models/tran.rb, line 20
def self.month_transactions(date)
  bom = date.beginning_of_month.to_datetime.beginning_of_day.to_s(:db)
  eom = date.end_of_month.to_s(:db).to_datetime.end_of_day.to_s(:db)
  trans = Tran.where(post_date: bom..eom ).order(:post_date,:num)
end