diff --git a/app/views/report_workbooks/_economy_followup_headings.xlsx.axlsx b/app/views/report_workbooks/_economy_followup_headings.xlsx.axlsx index d0f8d0d..55853f8 100644 --- a/app/views/report_workbooks/_economy_followup_headings.xlsx.axlsx +++ b/app/views/report_workbooks/_economy_followup_headings.xlsx.axlsx @@ -2,11 +2,11 @@ months = %i[Januari Februari Mars April Maj Juni Juli Augusti September Oktober sheet.add_row( [ - (0..10).map { nil }, + (0..11).map { nil }, months.map { |month| [month, nil, nil] }, nil ].flatten, - style: [(0..10).map { nil }, (11..50).map { @style.heading }].flatten + style: [(0..11).map { nil }, (12..51).map { @style.heading }].flatten ) month_cols = ['Dygn', 'Kostnad', 'Förväntad intäkt'] @@ -23,6 +23,7 @@ sheet.add_row( 'Inskriven', 'Anvisningsdatum', 'Avslutad', + 'Medborgarskap erhölls', 'Prel avslut pga 21 år', (0..12).map { month_cols }, 'Avvikelse' @@ -30,8 +31,8 @@ sheet.add_row( style: @style.heading ) -sheet.merge_cells sheet.rows.first.cells[(0..10)] -(11..44).step(3).each { |i| sheet.merge_cells(sheet.rows.first.cells[i..(i + 2)]) } -sheet.merge_cells sheet.rows.first.cells[(47..50)] +sheet.merge_cells sheet.rows.first.cells[(0..11)] +(12..45).step(3).each { |i| sheet.merge_cells(sheet.rows.first.cells[i..(i + 2)]) } +sheet.merge_cells sheet.rows.first.cells[(48..51)] heading_comment(sheet, 'F', 'Kundnummer för barnets ärende i Procapita', 2) diff --git a/app/views/report_workbooks/_economy_followup_last_row.xlsx.axlsx b/app/views/report_workbooks/_economy_followup_last_row.xlsx.axlsx index 69dbeeb..cb23f97 100644 --- a/app/views/report_workbooks/_economy_followup_last_row.xlsx.axlsx +++ b/app/views/report_workbooks/_economy_followup_last_row.xlsx.axlsx @@ -3,11 +3,11 @@ last_row = sheet.rows.size sheet.add_row( [ 'SUMMA:', - (1..10).map { nil }, - (11..50).map { |i| "=SUM(#{Axlsx.col_ref(i)}3:#{Axlsx.col_ref(i)}#{last_row})" } + (1..11).map { nil }, + (12..51).map { |i| "=SUM(#{Axlsx.col_ref(i)}3:#{Axlsx.col_ref(i)}#{last_row})" } ].flatten ) -(0..50).each do |col| +(0..51).each do |col| sheet.rows.last.cells[col].style = @style.sum end diff --git a/app/views/report_workbooks/_economy_followup_rows.xlsx.axlsx b/app/views/report_workbooks/_economy_followup_rows.xlsx.axlsx index d357d29..26c09f8 100644 --- a/app/views/report_workbooks/_economy_followup_rows.xlsx.axlsx +++ b/app/views/report_workbooks/_economy_followup_rows.xlsx.axlsx @@ -13,21 +13,22 @@ refugees.each do |refugee| refugee.registered, refugee.municipality_placement_migrationsverket_at, refugee.deregistered, + refugee.citizenship_at, (refugee.date_at_21st_birthday if refugee.will_turn_21_in_year(@year)), economy_per_month(refugee, age_group, @po_rates), - "=(#{step_sum(row_ref, 11..44, 3)})", "=(#{step_sum(row_ref, 12..45, 3)})", "=(#{step_sum(row_ref, 13..46, 3)})", - "=(#{Axlsx.col_ref(49)}#{row_ref}-#{Axlsx.col_ref(48)}#{row_ref})" + "=(#{step_sum(row_ref, 14..47, 3)})", + "=(#{Axlsx.col_ref(50)}#{row_ref}-#{Axlsx.col_ref(49)}#{row_ref})" ].flatten, style: @style.normal ) - [7, 8, 9, 10].each do |col| + [7, 8, 9, 10, 11].each do |col| sheet.rows.last.cells[col].style = @style.date end - [(12..48).step(3).to_a, (13..49).step(3).to_a, 50].flatten.each do |col| + [(13..49).step(3).to_a, (14..50).step(3).to_a, 51].flatten.each do |col| sheet.rows.last.cells[col].style = @style.currency end end