From d1efd5043900bb88bd66e850b6169084a8517ec0 Mon Sep 17 00:00:00 2001 From: Fernando Blat Date: Sat, 16 Nov 2024 21:25:03 +0100 Subject: [PATCH] Fix parent category --- operations/gobierto_budgets/transform-planned/run.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/operations/gobierto_budgets/transform-planned/run.rb b/operations/gobierto_budgets/transform-planned/run.rb index d2f4454..6752391 100644 --- a/operations/gobierto_budgets/transform-planned/run.rb +++ b/operations/gobierto_budgets/transform-planned/run.rb @@ -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 @@ -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 => {} } @@ -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]