Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYST-1880 Add recipients address to 1099R #5663

Merged
merged 7 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 9 additions & 0 deletions app/lib/submission_builder/state1099_r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ def document
xml.PayerEIN form1099r.payer_identification_number
xml.RecipientSSN sanitize_for_xml(form1099r.recipient_ssn) if form1099r.recipient_ssn.present?
xml.RecipientNm sanitize_for_xml(form1099r.recipient_name) if form1099r.recipient_name.present?
if form1099r.recipient_address_line1.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder about this check -- is it possible that line 1 will be empty but rest of the address present?

Do we only want to pass on the info if the line 1 is present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i did realize this felt like a shortcut when i did it. i feel like you can't have an address without line 1? because then it's just a city and a zip code. but we could ask to be safe!

xml.RecipientUSAddress do
xml.AddressLine1Txt sanitize_for_xml(form1099r.recipient_address_line1) if form1099r.recipient_address_line1.present?
Copy link
Contributor

Choose a reason for hiding this comment

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

this .present? check seems redundant b/c it's already on line 26

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ohh i didn't think of that! i added line 26 after

xml.AddressLine2Txt sanitize_for_xml(form1099r.recipient_address_line2) if form1099r.recipient_address_line2.present?
xml.CityNm sanitize_for_xml(form1099r.recipient_city_name) if form1099r.recipient_city_name.present?
xml.StateAbbreviationCd sanitize_for_xml(form1099r.recipient_state_code) if form1099r.recipient_state_code.present?
xml.ZIPCd sanitize_for_xml(form1099r.recipient_zip) if form1099r.recipient_zip.present?
end
end
xml.GrossDistributionAmt form1099r.gross_distribution_amount&.round
xml.TaxableAmt form1099r.taxable_amount&.round
if form1099r.taxable_amount_not_determined?
Expand Down
5 changes: 5 additions & 0 deletions app/models/df_1099r_accessor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class Df1099rAccessor < DfXmlAccessor
total_distribution: "TotalDistributionInd",
capital_gain_amount: "CapitalGainAmt",
designated_roth_account_first_year: "DesignatedROTHAcctFirstYr",
recipient_address_line1: "RecipientUSAddress AddressLine1Txt",
recipient_address_line2: "RecipientUSAddress AddressLine2Txt",
recipient_city_name: "RecipientUSAddress CityNm",
recipient_state_code: "RecipientUSAddress StateAbbreviationCd",
recipient_zip: "RecipientUSAddress ZIPCd",
}

def self.selectors
Expand Down
5 changes: 5 additions & 0 deletions app/models/state_file1099_r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
# payer_state_identification_number :string
# payer_zip :string
# phone_number :string
# recipient_address_line1 :string
# recipient_address_line2 :string
# recipient_city_name :string
# recipient_name :string
# recipient_ssn :string
# recipient_state_code :string
# recipient_zip :string
# standard :boolean
# state_code :string
# state_distribution_amount :decimal(12, 2)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddRecipientAddressColumnsToStateFile1099Rs < ActiveRecord::Migration[7.1]
def change
add_column :state_file1099_rs, :recipient_address_line1, :string
add_column :state_file1099_rs, :recipient_address_line2, :string
add_column :state_file1099_rs, :recipient_city_name, :string
add_column :state_file1099_rs, :recipient_state_code, :string
add_column :state_file1099_rs, :recipient_zip, :string
end
end
7 changes: 6 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2025_02_27_182343) do
ActiveRecord::Schema[7.1].define(version: 2025_02_27_234021) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "plpgsql"
Expand Down Expand Up @@ -1735,8 +1735,13 @@
t.string "payer_state_identification_number"
t.string "payer_zip"
t.string "phone_number"
t.string "recipient_address_line1"
t.string "recipient_address_line2"
t.string "recipient_city_name"
t.string "recipient_name"
t.string "recipient_ssn"
t.string "recipient_state_code"
t.string "recipient_zip"
t.boolean "standard"
t.string "state_code"
t.decimal "state_distribution_amount", precision: 12, scale: 2
Expand Down
10 changes: 10 additions & 0 deletions spec/factories/state_file1099_rs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
# payer_state_identification_number :string
# payer_zip :string
# phone_number :string
# recipient_address_line1 :string
# recipient_address_line2 :string
# recipient_city_name :string
# recipient_name :string
# recipient_ssn :string
# recipient_state_code :string
# recipient_zip :string
# standard :boolean
# state_code :string
# state_distribution_amount :decimal(12, 2)
Expand Down Expand Up @@ -51,6 +56,11 @@
payer_identification_number { "22345" }
recipient_ssn { "123456789" }
recipient_name { "Dorothy Jane Red" }
recipient_address_line1 { "123 Sesame St" }
recipient_address_line2 { "Apt 202" }
recipient_city_name { "Long Island" }
recipient_state_code { "AZ" }
recipient_zip { "12345-1234" }
gross_distribution_amount { 100.25 }
taxable_amount { 50.5 }
taxable_amount_not_determined { true }
Expand Down
5 changes: 5 additions & 0 deletions spec/lib/submission_builder/state1099_r_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
expect(doc.at("PayerEIN").text).to eq "22345"
expect(doc.at("RecipientSSN").text).to eq "123456789"
expect(doc.at("RecipientNm").text).to eq "Dorothy Jane Red"
expect(doc.at("RecipientUSAddress AddressLine1Txt").text).to eq "123 Sesame St"
expect(doc.at("RecipientUSAddress AddressLine2Txt").text).to eq "Apt 202"
expect(doc.at("RecipientUSAddress CityNm").text).to eq "Long Island"
expect(doc.at("RecipientUSAddress StateAbbreviationCd").text).to eq "AZ"
expect(doc.at("RecipientUSAddress ZIPCd").text).to eq "12345-1234"
expect(doc.at("GrossDistributionAmt").text).to eq "100"
expect(doc.at("TaxableAmt").text).to eq "51"
expect(doc.at("TxblAmountNotDeterminedInd").text).to eq "X"
Expand Down
5 changes: 5 additions & 0 deletions spec/models/state_file1099_r_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
# payer_state_identification_number :string
# payer_zip :string
# phone_number :string
# recipient_address_line1 :string
# recipient_address_line2 :string
# recipient_city_name :string
# recipient_name :string
# recipient_ssn :string
# recipient_state_code :string
# recipient_zip :string
# standard :boolean
# state_code :string
# state_distribution_amount :decimal(12, 2)
Expand Down
5 changes: 4 additions & 1 deletion spec/models/state_file_base_intake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@
intake.synchronize_df_1099_rs_to_database

expect(intake.state_file1099_rs.first.state_tax_withheld_amount).to eq 50
expect(intake.state_file1099_rs.count).to eq 1
expect(intake.state_file1099_rs.first.recipient_address_line1).to eq "200 Neptune Street"
expect(intake.state_file1099_rs.first.recipient_city_name).to eq "Flagstaff"
expect(intake.state_file1099_rs.first.recipient_state_code).to eq "AZ"
expect(intake.state_file1099_rs.first.recipient_zip).to eq "86001"
end
end

Expand Down
Loading