Last active
June 3, 2017 10:21
-
-
Save mh-github/f1df3b017f8397eb37ab943813b5ace7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From date is start of financial year if not input | |
| if params[:from_date] == '' | |
| from_date = DateTime.now.beginning_of_day.beginning_of_financial_year.to_date | |
| else | |
| from_date = params[:from_date] | |
| end | |
| # To date is today if not input | |
| if params[:to_date] == '' | |
| to_date = Date.today.to_date | |
| else | |
| to_date = params[:to_date] | |
| end | |
| @te_records = TravelExpense.where(:expense_code => @expense_codes, created_at: from_date..to_date) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment