Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions backend/app/serializers/tax_documents/form_1042s_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Copy link
Member Author

@nyomanjyotisa nyomanjyotisa Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the new template LeftCol changed to LeftColumn and RightCol changed to RightColumn. And f1_31 moved from LeftColumn to RightColumn

"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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member Author

@nyomanjyotisa nyomanjyotisa Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we still use the 2023 serializer which the template already has 20 prefix and the label was changed since 2024 template (this still the latest template)

2023:
Image

2025, Before:

Image

2025, After fix:

Image

# 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,
Expand Down
29 changes: 9 additions & 20 deletions backend/app/serializers/tax_documents/form_1099nec_serializer.rb
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy C no longer exist


def attributes
TAX_FORM_COPIES.each_with_object({}) do |tax_form_copy, result|
Expand All @@ -10,32 +10,21 @@ def attributes
end

private
def header_for(tax_form_copy)
case tax_form_copy
Copy link
Member Author

@nyomanjyotisa nyomanjyotisa Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header_for method no longer needed, all copies now use PgHeader

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,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2023:

Image

2025, before:

Image

2025, after:

Image

# 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),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LeftColumn changed to LeftCol and RightColumn changed to RightCol

}
end

Expand Down
Binary file modified backend/config/data/tax_forms/1042-S.pdf
Binary file not shown.
Binary file modified backend/config/data/tax_forms/1099-NEC.pdf
Binary file not shown.
Loading