Skip to content

Commit

Permalink
Followup report: don't calculate cost after the day before citizenshi…
Browse files Browse the repository at this point in the history
…p_at
  • Loading branch information
martent committed Apr 15, 2019
1 parent 37a0721 commit 33918a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/reports/helpers/economy_followup_report_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ module EconomyFollowupReportHelper
def economy_per_month(refugee, age_group, po_rates)
(1..12).map do |month|
interval_for_costs = age_cutoff(month, refugee, age_group, cost: true)

# For this report only: don't calculate cost after citizenship_at - 1 day
if refugee.citizenship_at?
interval_for_costs[:to] = earliest_date(interval_for_costs[:to], refugee.citizenship_at - 1.day)
end

interval_for_income = age_cutoff(month, refugee, age_group)
[
days_with_placements(refugee, interval_for_costs),
Expand Down

0 comments on commit 33918a5

Please sign in to comment.