-
Notifications
You must be signed in to change notification settings - Fork 13
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-526 Update refund taxes owed UI and add financial information to MD pdf/xml #5007
Merged
arinchoi03
merged 53 commits into
main
from
FYST-526-update-refund-taxes-owed-ui-and-add-financial-information-to-md-pdf-xml
Nov 27, 2024
Merged
Changes from 51 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
9ce7a6e
Add joint account holder name & bank_authorization_confirmation, remo…
arinchoi03 32d75ff
Ensure joint_account_holder_name is set to nil if payment method changes
arinchoi03 3166c36
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 f27a562
Remove bank_name from taxes owed/tax_refund
arinchoi03 8e19444
Reorganize db migration to separate name columns from the one new column
arinchoi03 c047de8
Ignore bank_name for all models
arinchoi03 4dcf802
Conditionally show joint account holder name if client indicates they…
arinchoi03 ad00864
Update migrations to fit data model better and add validations for ac…
arinchoi03 82e10b0
Address spec failures that reference bank_name
arinchoi03 75f7eec
Make sure to annotate AZ
arinchoi03 9f2d157
More spec failures oy
arinchoi03 5e37860
Address more spec failures
arinchoi03 6ed6f77
Remove references to bank_name from persona factories
arinchoi03 8d67efc
Move persona factories out of 2023 folder
arinchoi03 2c0239a
Add schema-specific validations for first and last name
arinchoi03 09d242f
Add suffix and middle initial validation/specs
arinchoi03 233092f
Remove unnecessary blank suffix option
arinchoi03 fa21585
Use i18n translations for labels
arinchoi03 526e07f
Style updates to be more in line with designs
arinchoi03 59268d4
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 d307903
Make sure all name fields and bank_authorization_confirmed get set to…
arinchoi03 836500d
follow rubocop suggestion
arinchoi03 f9c95ce
Add specs for md tax return page
arinchoi03 1548841
AuthToDirectDepositInd set on XML & checkbox filled in for 502 PDF
arinchoi03 3952c13
Add NameOnBankAccount information to 502 xml and pdf
arinchoi03 bd4d521
Add rest of bank details on MD502 pdf
arinchoi03 a394bcc
Add line data
arinchoi03 62e0f95
Fix broken spec
arinchoi03 1b5ba18
Ignore account_holder_name in MD intakes, ignore df_data_import_faile…
arinchoi03 a59c336
Do not refer to no longer used account_holder_name
arinchoi03 34c7c01
Refactor full_name method to be more readable
arinchoi03 9b3e7ed
Allow values to change their suffix from filled to an empty value
arinchoi03 f61bdea
Address XML errors due to improper setting of XML node values, move m…
arinchoi03 d3608b4
Read account holder names values from XML, not directly from intake
arinchoi03 f14a5e4
Make sure to sanitize has_joint_account_holder when sanitizing bank_d…
arinchoi03 e9dc7c9
Little cleanup
arinchoi03 52575f1
Fix typo for df_data_import_failed_at
arinchoi03 56cccd1
Add label and translation
arinchoi03 f7479e1
Only include joint account holder information if payment_or_deposit_t…
arinchoi03 1380324
Rename classname to be more descriptive and make it more isolated to …
arinchoi03 6ba181f
Reference intake attribute directly from set_line
arinchoi03 b2219bd
Refactor ignored_columns to inherit and add to and not overwrite
arinchoi03 8c565ba
Add more specs on account holder names on md502
arinchoi03 32a3033
Test bank_authorization_confirmed param
arinchoi03 66c08cb
Set default to 0 for has_joint_account_holder column
arinchoi03 7fef8f3
Add specs, address xml/pdf failure due to change in AuthToDirectDepos…
arinchoi03 0d68106
Default null for has_joint_account_holder
arinchoi03 4d82db6
Rename expectations
arinchoi03 1778dde
Refactor specs
arinchoi03 a8d228c
Cover the "no" scenario which shouldnt really occur
arinchoi03 8461769
Update md502 validations for first and last names of account holders …
arinchoi03 fd6e3a1
Drop account_holder_name from StateFileMdIntakes
arinchoi03 0f98c19
Merge remote-tracking branch 'origin' into FYST-526-update-refund-tax…
arinchoi03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ def initialize(submission) | |
end | ||
|
||
def hash_for_pdf | ||
{ | ||
answers = { | ||
'Enter 1': @xml_document.at("Form502 Income FederalAdjustedGrossIncome")&.text, | ||
'Enter 1a': @xml_document.at("Form502 Income WagesSalariesAndTips")&.text, | ||
'Enter 1b': @xml_document.at("Form502 Income EarnedIncome")&.text, | ||
|
@@ -86,13 +86,24 @@ def hash_for_pdf | |
'Enter 3': @xml_document.at('Form502 Additions StateRetirementPickup')&.text, | ||
'Enter 6': @xml_document.at('Form502 Additions Total')&.text, | ||
'Enter 7': @xml_document.at('Form502 Additions FedAGIAndStateAdditions')&.text, | ||
"Enter 15": @xml_document.at('Form502 Subtractions Total')&.text, | ||
"Enter 16": @xml_document.at('Form502 Subtractions StateAdjustedGrossIncome')&.text, | ||
'Enter 15': @xml_document.at('Form502 Subtractions Total')&.text, | ||
'Enter 16': @xml_document.at('Form502 Subtractions StateAdjustedGrossIncome')&.text, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rubocop told me to make it single quotes 👮♂️ |
||
'Text Box 30': @xml_document.at('Form502 StateTaxComputation StateIncomeTax')&.text, | ||
'Text Box 36': @xml_document.at('Form502 StateTaxComputation PovertyLevelCredit')&.text, | ||
'Text Box 40': @xml_document.at('Form502 StateTaxComputation TotalCredits')&.text, | ||
'Text Box 42': @xml_document.at('Form502 StateTaxComputation StateTaxAfterCredits')&.text, | ||
'Check Box 39': @xml_document.at('Form502 AuthToDirectDepositInd')&.text == 'X' ? 'Yes' : 'Off', | ||
'Text Box 95': full_names_of_bank_account_holders || "" | ||
} | ||
if @xml_document.at('RefundDirectDeposit').present? | ||
answers.merge!({ | ||
'Check Box 41': @xml_document.at('Checking')&.text == "X" ? 'Yes' : 'Off', | ||
'Check Box 42': @xml_document.at('Savings')&.text == "X" ? 'Yes' : 'Off', | ||
'Text Box 93': @xml_document.at('RoutingTransitNumber')&.text, | ||
'Text Box 94': @xml_document.at('BankAccountNumber')&.text, | ||
}) | ||
end | ||
answers | ||
end | ||
|
||
def spouse_ssn_if_mfs | ||
|
@@ -131,6 +142,24 @@ def generate_codes_for_502_su | |
applicable_codes | ||
end | ||
|
||
def full_names_of_bank_account_holders | ||
intake = @submission.data_source | ||
return nil unless intake.payment_or_deposit_type.to_sym == :direct_deposit | ||
|
||
if intake.has_joint_account_holder_yes? | ||
account_holder_full_name + " and " + account_holder_full_name(for_joint: true) | ||
else | ||
account_holder_full_name | ||
end | ||
end | ||
|
||
def account_holder_full_name(for_joint: false) | ||
attributes = %w[FirstName MiddleInitial LastName NameSuffix] | ||
account_holder_xmls = @xml_document.css('Form502 NameOnBankAccount') | ||
account_holder_xml = for_joint ? account_holder_xmls[1] : account_holder_xmls[0] | ||
attributes.map { |attr| account_holder_xml.at(attr)&.text }.filter_map(&:presence).join(" ") | ||
end | ||
|
||
def calculated_fields | ||
@calculated_fields ||= @submission.data_source.tax_calculator.calculate | ||
end | ||
|
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see anything in the form spec about this field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed 32a3033