Skip to content

Commit

Permalink
FYST-1270 Tax period not included in return header for NC (#5083)
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinaislam authored Dec 4, 2024
1 parent dbb027f commit 00042fc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/lib/pdf_filler/nc_d400_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def hash_for_pdf
mfs_spouse_name = [mfs_spouse_first_name, mfs_spouse_middle_initial, mfs_spouse_last_name].reject(&:empty?).join(" ")

{
y_d400wf_datebeg: formatted_date(@xml_document.at('ReturnHeaderState TaxPeriodBeginDt')&.text, "%m-%d"),
y_d400wf_dateend: formatted_date(@xml_document.at('ReturnHeaderState TaxPeriodEndDt')&.text, "%m-%d-%y"),
y_d400wf_datebeg: '01-01',
y_d400wf_dateend: "12-31-#{@submission.data_source.tax_return_year.to_s[-2..]}",
y_d400wf_ssn1: @xml_document.at('Primary TaxpayerSSN')&.text,
y_d400wf_ssn2: @xml_document.at('Secondary TaxpayerSSN')&.text,
y_d400wf_fname1: @xml_document.at('Primary TaxpayerName FirstName')&.text,
Expand Down
6 changes: 4 additions & 2 deletions app/lib/submission_builder/return_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ def document
build_xml_doc("ReturnHeaderState") do |xml|
xml.Jurisdiction "#{@submission.data_source.state_code.upcase}ST"
xml.ReturnTs datetime_type(@submission.created_at) if @submission.created_at.present?
xml.TaxPeriodBeginDt date_type(Date.new(@submission.data_source.tax_return_year, 1, 1))
xml.TaxPeriodEndDt date_type(Date.new(@submission.data_source.tax_return_year, 12, 31))
if @submission.data_source.show_tax_period_in_return_header?
xml.TaxPeriodBeginDt date_type(Date.new(@submission.data_source.tax_return_year, 1, 1))
xml.TaxPeriodEndDt date_type(Date.new(@submission.data_source.tax_return_year, 12, 31))
end
xml.TaxYr @submission.data_source.tax_return_year
xml.OriginatorGrp do
xml.EFIN EnvironmentCredentials.irs(:efin)
Expand Down
4 changes: 4 additions & 0 deletions app/models/state_file_base_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ def ask_for_signature_pin?
false
end

def show_tax_period_in_return_header?
true
end

def ask_spouse_esign?
filing_status_mfj? && !spouse_deceased?
end
Expand Down
4 changes: 4 additions & 0 deletions app/models/state_file_nc_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,8 @@ def disqualifying_eligibility_rules
eligibility_ed_loan_emp_payment: "yes"
}
end

def show_tax_period_in_return_header?
false
end
end
30 changes: 28 additions & 2 deletions spec/lib/submission_builder/ty2022/states/return_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
it "generates xml with the right values" do
expect(doc.at("Jurisdiction").text).to eq "#{state_code.upcase}ST"
expect(doc.at("ReturnTs").text).to eq submission.created_at.strftime("%FT%T%:z")
expect(doc.at("TaxPeriodBeginDt").text).to eq Date.new(tax_return_year, 1, 1).strftime("%F")
expect(doc.at("TaxPeriodEndDt").text).to eq Date.new(tax_return_year, 12, 31).strftime("%F")
expect(doc.at("TaxYr").text).to eq tax_return_year.to_s
expect(doc.at("OriginatorGrp EFIN").text).to eq efin
expect(doc.at("OriginatorGrp OriginatorTypeCd").text).to eq "OnlineFiler"
Expand Down Expand Up @@ -159,6 +157,34 @@
end
end

context "tax period information" do
let(:tax_return_year) { 2024 }
before do
intake.direct_file_data.tax_return_year = tax_return_year
end

StateFile::StateInformationService.active_state_codes.without("nc").each do |state_code|
context "if state is not NC" do
let(:intake) { create "state_file_#{state_code}_intake".to_sym }
let(:submission) { create(:efile_submission, data_source: intake) }
let(:doc) { SubmissionBuilder::ReturnHeader.new(submission).document }
it "shows tax period information" do
expect(doc.at("TaxPeriodBeginDt").text).to eq Date.new(tax_return_year, 1, 1).strftime("%F")
expect(doc.at("TaxPeriodEndDt").text).to eq Date.new(tax_return_year, 12, 31).strftime("%F")
end
end
end
context "if state is NC" do
let(:intake) { create :state_file_nc_intake }
let(:submission) { create(:efile_submission, data_source: intake) }
let(:doc) { SubmissionBuilder::ReturnHeader.new(submission).document }
it "does not show tax period information" do
expect(doc.at("TaxPeriodBeginDt")).to be_nil
expect(doc.at("TaxPeriodEndDt")).to be_nil
end
end
end

context "MD filer personal info includes signature PINs" do
let(:intake) {
create(
Expand Down

0 comments on commit 00042fc

Please sign in to comment.