From 1bc74fd4c8485952f932106e2badeddbfd944f30 Mon Sep 17 00:00:00 2001 From: Ross Clements Date: Tue, 20 Oct 2015 16:45:48 +0100 Subject: [PATCH] addedtwo functions: is_dfid_project and transaction_description back into the ruby class as they may be required --- helpers/project_helpers.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/helpers/project_helpers.rb b/helpers/project_helpers.rb index 163d89aa..80ad06cb 100644 --- a/helpers/project_helpers.rb +++ b/helpers/project_helpers.rb @@ -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) @@ -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