diff --git a/backend/app/serializers/tax_documents/form_1042s_serializer.rb b/backend/app/serializers/tax_documents/form_1042s_serializer.rb index bf16a64fa8..a570d11af2 100644 --- a/backend/app/serializers/tax_documents/form_1042s_serializer.rb +++ b/backend/app/serializers/tax_documents/form_1042s_serializer.rb @@ -12,32 +12,32 @@ def attributes private def form_fields_for(tax_form_copy) { - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_03[0]" => "06", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_04[0]" => dividends_amount_in_usd.to_s, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].Lines3_b[0].f1_05[0]" => "3", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].Lines3_b[0].f1_06[0]" => exemption_code, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].Lines3_b[0].f1_07[0]" => tax_withholding_percentage.to_s, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].Lines3_b[0].f1_08[0]" => "00", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_09[0]" => "15", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_10[0]" => "00", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_11[0]" => "00", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_13[0]" => dividends_net_amount_in_usd.to_s, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_14[0]" => dividends_tax_amount_withheld_in_usd.to_s, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_17[0]" => dividends_tax_amount_withheld_in_usd.to_s, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_19[0]" => payer_tin, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_20[0]" => "15", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_21[0]" => "02", - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_22[0]" => company.name, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_24[0]" => company.country_code, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_26[0]" => company.street_address, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_27[0]" => payer_details, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_28[0]" => normalized_tax_field(billing_entity_name), - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_29[0]" => country_code, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_30[0]" => normalized_street_address, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f1_31[0]" => normalized_tax_field(full_city_address), - "topmostSubform[0].Copy#{tax_form_copy}[0].RightCol[0].f1_33[0]" => "16", - "topmostSubform[0].Copy#{tax_form_copy}[0].RightCol[0].f1_34[0]" => "23", - "topmostSubform[0].Copy#{tax_form_copy}[0].RightCol[0].f1_36[0]" => tax_id, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_03[0]" => "06", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_04[0]" => dividends_amount_in_usd.to_s, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].Lines3_b[0].f1_05[0]" => "3", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].Lines3_b[0].f1_06[0]" => exemption_code, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].Lines3_b[0].f1_07[0]" => tax_withholding_percentage.to_s, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].Lines3_b[0].f1_08[0]" => "00", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_09[0]" => "15", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_10[0]" => "00", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_11[0]" => "00", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_13[0]" => dividends_net_amount_in_usd.to_s, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_14[0]" => dividends_tax_amount_withheld_in_usd.to_s, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_17[0]" => dividends_tax_amount_withheld_in_usd.to_s, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_19[0]" => payer_tin, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_20[0]" => "15", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_21[0]" => "02", + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_22[0]" => company.name, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_24[0]" => company.country_code, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_26[0]" => company.street_address, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_27[0]" => payer_details, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_28[0]" => normalized_tax_field(billing_entity_name), + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_29[0]" => country_code, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f1_30[0]" => normalized_street_address, + "topmostSubform[0].Copy#{tax_form_copy}[0].RightColumn[0].f1_31[0]" => normalized_tax_field(full_city_address), + "topmostSubform[0].Copy#{tax_form_copy}[0].RightColumn[0].f1_33[0]" => "16", + "topmostSubform[0].Copy#{tax_form_copy}[0].RightColumn[0].f1_34[0]" => "23", + "topmostSubform[0].Copy#{tax_form_copy}[0].RightColumn[0].f1_36[0]" => tax_id, } end diff --git a/backend/app/serializers/tax_documents/form_1099div_serializer.rb b/backend/app/serializers/tax_documents/form_1099div_serializer.rb index cab50dce76..8cea040944 100644 --- a/backend/app/serializers/tax_documents/form_1099div_serializer.rb +++ b/backend/app/serializers/tax_documents/form_1099div_serializer.rb @@ -14,7 +14,7 @@ def form_fields_for(tax_form_copy) page_number = tax_form_copy == "A" ? "1" : "2" result = { - "topmostSubform[0].Copy#{tax_form_copy}[0].Copy#{tax_form_copy}Header[0].CalendarYear[0].f#{page_number}_1[0]" => formatted_tax_year, + "topmostSubform[0].Copy#{tax_form_copy}[0].CopyHeader[0].CalendarYear[0].f#{page_number}_1[0]" => tax_year.to_s, # Payer information "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_2[0]" => payer_details, "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_3[0]" => payer_tin, diff --git a/backend/app/serializers/tax_documents/form_1099nec_serializer.rb b/backend/app/serializers/tax_documents/form_1099nec_serializer.rb index 1508d67667..61db1ace5b 100644 --- a/backend/app/serializers/tax_documents/form_1099nec_serializer.rb +++ b/backend/app/serializers/tax_documents/form_1099nec_serializer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class TaxDocuments::Form1099necSerializer < TaxDocuments::BaseSerializer - TAX_FORM_COPIES = %w[A 1 B 2 C].freeze + TAX_FORM_COPIES = %w[A 1 B 2].freeze def attributes TAX_FORM_COPIES.each_with_object({}) do |tax_form_copy, result| @@ -10,32 +10,21 @@ def attributes end private - def header_for(tax_form_copy) - case tax_form_copy - when "A" - "Pg" - when "2" - "CopyC" - else - "Copy#{tax_form_copy}" - end - end - def form_fields_for(tax_form_copy) page_number = tax_form_copy == "A" ? "1" : "2" { - "topmostSubform[0].Copy#{tax_form_copy}[0].#{header_for(tax_form_copy)}Header[0].CalendarYear[0].f#{page_number}_1[0]" => tax_year.to_s.last(2), + "topmostSubform[0].Copy#{tax_form_copy}[0].PgHeader[0].CalendarYear[0].f#{page_number}_1[0]" => tax_year.to_s, # Payer information - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_2[0]" => payer_details, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_3[0]" => payer_tin, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_2[0]" => payer_details, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_3[0]" => payer_tin, # Recipient information - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_4[0]" => formatted_recipient_tin, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_5[0]" => normalized_tax_field(billing_entity_name), - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_6[0]" => normalized_street_address, - "topmostSubform[0].Copy#{tax_form_copy}[0].LeftColumn[0].f#{page_number}_7[0]" => normalized_tax_field(full_city_address), + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_4[0]" => formatted_recipient_tin, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_5[0]" => normalized_tax_field(billing_entity_name), + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_6[0]" => normalized_street_address, + "topmostSubform[0].Copy#{tax_form_copy}[0].LeftCol[0].f#{page_number}_7[0]" => normalized_tax_field(full_city_address), # Nonemployee compensation - "topmostSubform[0].Copy#{tax_form_copy}[0].RightColumn[0].f#{page_number}_9[0]" => compensation_amount_for_tax_year(tax_year), + "topmostSubform[0].Copy#{tax_form_copy}[0].RightCol[0].f#{page_number}_9[0]" => compensation_amount_for_tax_year(tax_year), } end diff --git a/backend/config/data/tax_forms/1042-S.pdf b/backend/config/data/tax_forms/1042-S.pdf index 14f267e286..65ae2444b7 100644 Binary files a/backend/config/data/tax_forms/1042-S.pdf and b/backend/config/data/tax_forms/1042-S.pdf differ diff --git a/backend/config/data/tax_forms/1099-NEC.pdf b/backend/config/data/tax_forms/1099-NEC.pdf index 4e8bd00eb0..e812c8a791 100644 Binary files a/backend/config/data/tax_forms/1099-NEC.pdf and b/backend/config/data/tax_forms/1099-NEC.pdf differ