-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Az 8879 e-file authorization form #186264976 (#3800)
- Loading branch information
Lou Moore
authored
Nov 21, 2023
1 parent
e746ab5
commit 81ca793
Showing
8 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
module PdfFiller | ||
class Az8879Pdf | ||
include PdfHelper | ||
|
||
def source_pdf_name | ||
"az8879-TY2023" | ||
end | ||
|
||
def initialize(submission) | ||
@submission = submission | ||
|
||
# Most PDF fields are grabbed right off the XML | ||
@xml_document = SubmissionBuilder::Ty2022::States::Az::IndividualReturn.new(submission).document | ||
end | ||
|
||
def hash_for_pdf | ||
answers = { | ||
"Your First Name and Initial" => @submission.data_source.primary.first_name_and_middle_initial, | ||
"Your Last Name" => @submission.data_source.primary.last_name, | ||
"Your SSN" => @submission.data_source.primary.ssn, | ||
"Spouse First Name and Initial" => @submission.data_source.spouse.first_name_and_middle_initial, | ||
"Spouse Last Name" => @submission.data_source.spouse.last_name, | ||
"Spouse SSN" => @submission.data_source.spouse.ssn, | ||
"1 AZ AGI" => @xml_document.at('AZAdjGrossIncome')&.text, | ||
"2 Balance of Tax" => @xml_document.at("BalanceOfTaxDue")&.text, | ||
"3 AZ Income Tax Withheld" => @xml_document.at("AzIncTaxWithheld")&.text, | ||
} | ||
|
||
if @xml_document.at('RefundAmt').present? | ||
answers["4 Refund Checkbox"] = 'Yes' | ||
answers["4 Refund Amount"] = @xml_document.at("RefundAmt")&.text | ||
elsif @xml_document.at('AmtOwed').present? | ||
answers["5 Owed Checkbox"] = 'Yes' | ||
answers["5 Owed Amount"] = @xml_document.at("AmtOwed")&.text | ||
end | ||
|
||
# TODO: double check assumption that "Foreign Account Checkbox" will always be unchecked | ||
case @submission.data_source.account_type | ||
when 'checking' | ||
answers['Account Type Checkbox - Checking'] = 'Yes' | ||
when 'savings' | ||
answers['Account Type Checkbox - Savings'] = 'Yes' | ||
end | ||
|
||
answers.merge!( | ||
"Routing Number" => @submission.data_source.routing_number, | ||
"Account Number" => @submission.data_source.account_number, | ||
"Direct Debit Date" => @submission.data_source.date_electronic_withdrawal&.strftime("%m%d%Y"), | ||
"Direct Debit Amount" => @submission.data_source.withdraw_amount, | ||
"Electronic Return Originator" => 'Code for America Labs, Inc' | ||
) | ||
|
||
if @submission.data_source.primary_esigned_yes? | ||
answers["Your Signature"] = @submission.data_source.primary.full_name | ||
answers["Your Date Signed"] = @submission.data_source.primary_esigned_at.to_date | ||
if @xml_document.at('RefundAmt').present? | ||
answers["6a Checkbox"] = 'Yes' | ||
elsif @xml_document.at('AmtOwed').present? | ||
answers["6b Checkbox"] = 'Yes' | ||
answers["6c Checkbox"] = 'Yes' | ||
end | ||
end | ||
if @submission.data_source.spouse_esigned_yes? | ||
answers["Spouse Signature"] = @submission.data_source.spouse.full_name | ||
answers["Spouse Date Signed"] = @submission.data_source.spouse_esigned_at.to_date | ||
end | ||
answers | ||
end | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe PdfFiller::Az8879Pdf do | ||
include PdfSpecHelper | ||
|
||
let(:submission) { create :efile_submission, tax_return: nil, data_source: create(:state_file_az_intake) } | ||
let(:pdf) { described_class.new(submission) } | ||
|
||
describe '#hash_for_pdf' do | ||
it 'uses field names that exist in the pdf' do | ||
pdf_fields = filled_in_values(submission.generate_filing_pdf.path) | ||
missing_fields = pdf.hash_for_pdf.keys.map(&:to_s) - pdf_fields.keys | ||
expect(missing_fields).to eq([]) | ||
end | ||
end | ||
end |