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-509 Add Federal Taxable Income interest information to NC400 Schedule S xml and pdf #4955

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions app/lib/efile/line_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ NCD400_LINE_26A:
label: '26A Owe Money: if Line 25 is less than Line 19, subtract Line 25 from Line 19.'
NCD400_LINE_27:
label: 'Total amount due: Sum of Lines 26a, 26d, and 26e (line 26d & 26e out of scope)'
NCD400_S_LINE_18:
label: "Interest Income From obligations of the United States' Possessions (DF IRS1040 TaxableInterestAmt)"
NCD400_S_LINE_27:
label: '27 Exempt Income Earned or Received by a Member of a Federally Recognized Indian Tribe'
NCD400_LINE_28:
Expand Down
2 changes: 2 additions & 0 deletions app/lib/efile/nc/d400_schedule_s_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ def initialize(value_access_tracker:, lines:, intake:)
@value_access_tracker = value_access_tracker
@lines = lines
@intake = intake
@direct_file_data = intake.direct_file_data
end

def calculate
set_line(:NCD400_S_LINE_18, @direct_file_data, :fed_taxable_income)
set_line(:NCD400_S_LINE_27, :calculate_line_27)
set_line(:NCD400_S_LINE_41, :calculate_line_41)
end
Expand Down
1 change: 1 addition & 0 deletions app/lib/pdf_filler/nc_d400_schedule_s_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def hash_for_pdf
{
y_d400schswf_ssn: @xml_document.at('Primary TaxpayerSSN')&.text,
y_d400wf_lname2_PG2: @xml_document.at('Primary TaxpayerName LastName')&.text,
y_d400schswf_li18_good: @xml_document.at('DedFedAGI USInterestInc')&.text,
y_d400schswf_li27_good: @xml_document.at('DedFedAGI ExmptIncFedRecInd')&.text,
y_d400schswf_li41_good: @xml_document.at('DedFedAGI TotDedFromFAGI')&.text,
}
Expand Down
Binary file modified app/lib/pdfs/ncD400-Schedule-S-TY2024.pdf
Binary file not shown.
Binary file modified app/lib/pdfs/ncD400-TY2024.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class D400ScheduleS < SubmissionBuilder::Document
def document
build_xml_doc("FormNCD400ScheduleS") do |xml|
xml.DedFedAGI do
xml.USInterestInc calculated_fields.fetch(:NCD400_S_LINE_18)
add_non_zero_value(xml, :ExmptIncFedRecInd, :NCD400_S_LINE_27)
add_non_zero_value(xml, :TotDedFromFAGI, :NCD400_S_LINE_41)
end
Expand Down
17 changes: 17 additions & 0 deletions spec/lib/efile/nc/d400_schedule_s_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@
end
let(:instance) { d400_calculator.instance_variable_get(:@d400_schedule_s) }

describe "Line 18: Interest Income From obligations of the United States' Possessions" do
context "if there are no interest incomes" do
it "returns 0" do
d400_calculator.calculate
expect(instance.lines[:NCD400_S_LINE_18]&.value).to eq(0)
end
end

context "if there are interest incomes with interest income from obligations of US possessions" do
it "returns fed_taxable_income from federal IRS Taxable Interest Amount" do
intake.direct_file_data.fed_taxable_income = 100
d400_calculator.calculate
expect(instance.lines[:NCD400_S_LINE_18]&.value).to eq(100)
end
end
end

describe 'Line 27: Exempt Income Earned or Received by a Member of a Federally Recognized Indian Tribe' do
context "if there are not tribal wages from intake" do
it "returns 0 for line 27 and line 41" do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/pdf_filler/nc_d400_schedule_s_pdf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
it 'sets fields to the correct values' do
expect(pdf_fields['y_d400schswf_ssn']).to eq '400000030'
expect(pdf_fields['y_d400wf_lname2_PG2']).to eq 'Carolinian'
expect(pdf_fields['y_d400schswf_li18_good']).to eq '0'
expect(pdf_fields['y_d400schswf_li27_good']).to eq '500'
expect(pdf_fields['y_d400schswf_li41_good']).to eq '500'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
let(:build_response) { described_class.build(submission, validate: false) }
let(:xml) { Nokogiri::XML::Document.parse(build_response.document.to_xml) }

context "return contain tribal wages amounts " do
context "USInterestInc" do
before do
intake.direct_file_data.fed_taxable_income = 323
end

it "correctly fills answers" do
expect(xml.document.at('DedFedAGI USInterestInc').text).to eq "323"
end
end

context "return contain tribal wages amounts " do
before do
intake.tribal_member = "yes"
intake.tribal_wages_amount = 100.00
Expand Down
Loading