Skip to content

Commit

Permalink
addedtwo functions: is_dfid_project and transaction_description back …
Browse files Browse the repository at this point in the history
…into the ruby class as they may be required
  • Loading branch information
Ross Clements committed Oct 20, 2015
1 parent 007f587 commit 1bc74fd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion helpers/project_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def dfid_global_projects_data

end

def is_dfid_project(projectCode)
projectCode[0, 4] == "GB-1"
end

def first_day_of_financial_year(date_value)
if date_value.month > 3 then
Date.new(date_value.year, 4, 1)
Expand All @@ -133,7 +137,18 @@ def last_day_of_financial_year(date_value)
end


# TODO Delete these functions if they're no longer required
# TODO Delete these methods if they're no longer required

def transaction_description(transaction, transactionType)
if(transactionType == "C")
transaction['title'] || ""
elsif(transactionType == "IF")
transaction_title(transactionType)
else
transaction['description']
end
end


def choose_better_date(actual, planned)
# determines project actual start/end date - use actual date, planned date as a fallback
Expand Down

0 comments on commit 1bc74fd

Please sign in to comment.