Skip to content

Commit

Permalink
Fix parent category
Browse files Browse the repository at this point in the history
  • Loading branch information
ferblape committed Nov 16, 2024
1 parent 270242a commit d1efd50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions operations/gobierto_budgets/transform-planned/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def parse_cell(row, year, name)

if category_code.to_s.length == 4
parent_category_name = row['PARCLSFUN_GRP'].strip
@parent_categories[category_code] = FIRST_LEVEL_CUSTOM_CATEGORIES[parent_category_name]
@parent_categories[kind][category_code] = FIRST_LEVEL_CUSTOM_CATEGORIES[parent_category_name]
end

@categories[kind][category_code] ||= 0
Expand All @@ -104,7 +104,7 @@ def parse_cell(row, year, name)

type = GobiertoBudgetsData::GobiertoBudgets::CUSTOM_AREA_NAME

@parent_categories = {}
@parent_categories = { GobiertoBudgetsData::GobiertoBudgets::INCOME => {}, GobiertoBudgetsData::GobiertoBudgets::EXPENSE => {} }
@categories = { GobiertoBudgetsData::GobiertoBudgets::INCOME => {}, GobiertoBudgetsData::GobiertoBudgets::EXPENSE => {} }
@economic_categories = { GobiertoBudgetsData::GobiertoBudgets::INCOME => {}, GobiertoBudgetsData::GobiertoBudgets::EXPENSE => {} }

Expand All @@ -130,7 +130,7 @@ def parse_cell(row, year, name)
parent_code = nil
when 4
level = 2
parent_code = @parent_categories[code]
parent_code = @parent_categories[kind][code]
when 5
level = 3
parent_code = code[0..-2]
Expand Down

0 comments on commit d1efd50

Please sign in to comment.