-
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-1041 ID form 40 add some lines #4985
Changes from 13 commits
a51e3cb
d04176f
4b061c9
ce3c0a6
d2f7c4d
a2ca738
c66471e
66b09ee
c90363c
bc1e047
2e388c5
74e79d9
2d36dfd
539f1f7
a192fd5
960daba
6b17b1d
d1e93af
dd570da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ def calculate | |
set_line(:ID40_LINE_9, :calculate_line_9) | ||
set_line(:ID40_LINE_10, :calculate_line_10) | ||
set_line(:ID40_LINE_11, :calculate_line_11) | ||
set_line(:ID40_LINE_19, :calculate_line_19) | ||
set_line(:ID40_LINE_20, :calculate_line_20) | ||
set_line(:ID40_LINE_23, :calculate_line_23) | ||
set_line(:ID40_LINE_29, :calculate_line_29) | ||
set_line(:ID40_LINE_32A, :calculate_line_32a) | ||
|
@@ -85,6 +87,24 @@ def calculate_line_11 | |
[line_or_zero(:ID40_LINE_9) - line_or_zero(:ID40_LINE_10), 0].max | ||
end | ||
|
||
# Subtract the larger of L15 or L16 from L11 but L15 is always 0 | ||
# L16 is pulled from df data | ||
def calculate_line_19 | ||
[line_or_zero(:ID40_LINE_11) - @direct_file_data.total_itemized_or_standard_deduction_amount, 0].max | ||
end | ||
|
||
WKSHT_LINE_2_AMTS = { | ||
single: 4673, | ||
married_filing_separately: 4673, | ||
married_filing_jointly: 9346, | ||
head_of_household: 9346, | ||
qualifying_widow: 9346, | ||
}.freeze | ||
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. this looks kind of stupid but it's much nicer to access? idk 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. seems ok to me, we do this elsewhere and I like that's close to where it is used |
||
def calculate_line_20 | ||
worksheet_line_2_amount = WKSHT_LINE_2_AMTS[@filing_status] | ||
[((worksheet_line_2_amount - line_or_zero(:ID40_LINE_19)) * 5.695).round(2), 0].max | ||
end | ||
|
||
def calculate_line_23 | ||
line_or_zero(:ID39R_D_LINE_4) | ||
end | ||
|
@@ -109,7 +129,7 @@ def calculate_line_32b | |
end | ||
|
||
def calculate_grocery_credit | ||
return 0 if @intake.direct_file_data.claimed_as_dependent? | ||
return 0 if @direct_file_data.claimed_as_dependent? | ||
|
||
credit = 0 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,17 @@ def hash_for_pdf | |
'IncomeL9' => @xml_document.at('Form40 FederalAGI')&.text, | ||
'IncomeL10' => @xml_document.at('Form39R TotalSubtractions')&.text, | ||
'IncomeL11' => @xml_document.at('Form40 StateTotalAdjustedIncome')&.text, | ||
'L12aYourself ' => @xml_document.at('PrimeOver65')&.text == "1" ? "Yes" : "Off", | ||
'L12aSpouse' => @xml_document.at('SpouseOver65')&.text == "1" ? "Yes" : "Off", | ||
'L12bYourself' => @xml_document.at('PrimeBlind')&.text == "1" ? "Yes" : "Off", | ||
'L12bSpouse' => @xml_document.at('SpouseBlind')&.text == "1" ? "Yes" : "Off", | ||
'L12cDependent' => @xml_document.at('ClaimedAsDependent')&.text == "1" ? "Yes" : "Off", | ||
'TxCompL15' => 0, | ||
'TxCompL16' => @xml_document.at('StandardDeduction')&.text, | ||
'TxCompL17' => @xml_document.at('TaxableIncomeState')&.text, | ||
'TxCompL19' => @xml_document.at('TaxableIncomeState')&.text, | ||
'TxCompL20' => round_amount_to_nearest_integer(@xml_document.at('StateIncomeTax')&.text), | ||
'L21' => round_amount_to_nearest_integer(@xml_document.at('StateIncomeTax')&.text), | ||
Comment on lines
+55
to
+56
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. [dust] instead of 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. ah, so re: rounding, the xml accepts cents for this field ( 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. that's the first I've heard of xml wanting/accepting cents but sometimes I guess I have to accept that things are just weird |
||
'CreditsL23' => @xml_document.at('Form39R TotalSupplementalCredits')&.text, | ||
'OtherTaxesL29' => @xml_document.at('StateUseTax')&.text, | ||
'OtherTaxesL32Check' => @xml_document.at('PublicAssistanceIndicator')&.text == "true" ? 'Yes' : 'Off', | ||
|
@@ -71,5 +82,9 @@ def formatted_date(date_str, format) | |
|
||
Date.parse(date_str)&.strftime(format) | ||
end | ||
|
||
def round_amount_to_nearest_integer(str_value) | ||
str_value.to_f.round | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,8 @@ class DirectFileData < DfXmlAccessor | |
spouse_date_of_death: 'IRS1040 SpouseDeathDt', | ||
spouse_name: 'IRS1040 SpouseNm', | ||
non_resident_alien: 'IRS1040 NRALiteralCd', | ||
primary_over_65: 'IRS1040 Primary65OrOlderInd', | ||
spouse_over_65: 'IRS1040 Spouse65OrOlderInd', | ||
primary_blind: 'IRS1040 PrimaryBlindInd', | ||
spouse_blind: 'IRS1040 SpouseBlindInd', | ||
qualifying_children_under_age_ssn_count: 'IRS1040Schedule8812 QlfyChildUnderAgeSSNCnt', | ||
|
@@ -121,6 +123,14 @@ def phone_number=(value) | |
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def cell_phone_number=(value) | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def tax_payer_email=(value) | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
Comment on lines
+127
to
+134
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. added these so i could test that the list of attrs in the test also have setters (see direct_file_data_spec) |
||
def spouse_ssn=(value) | ||
create_or_destroy_df_xml_node(__method__, value, after = "PrimarySSN") | ||
|
||
|
@@ -211,6 +221,10 @@ def fed_agi=(value) | |
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def total_itemized_or_standard_deduction_amount=(value) | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def fed_wages | ||
df_xml_value(__method__)&.to_i || 0 | ||
end | ||
|
@@ -532,14 +546,22 @@ def fed_w2_state=(value) | |
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def set_primary_blind | ||
create_or_destroy_df_xml_node(:primary_blind, true, 'VirtualCurAcquiredDurTYInd') | ||
write_df_xml_value(:primary_blind, 'X') | ||
def primary_over_65=(value) | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def spouse_over_65=(value) | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def primary_blind=(value) | ||
create_or_destroy_df_xml_node(__method__, true, 'VirtualCurAcquiredDurTYInd') | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def set_spouse_blind | ||
create_or_destroy_df_xml_node(:spouse_blind, true, 'VirtualCurAcquiredDurTYInd') | ||
write_df_xml_value(:spouse_blind, 'X') | ||
def spouse_blind=(value) | ||
create_or_destroy_df_xml_node(__method__, true, 'VirtualCurAcquiredDurTYInd') | ||
write_df_xml_value(__method__, value) | ||
end | ||
|
||
def is_primary_blind? | ||
|
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.
[dustiest dust] would you mind using WK as an abbreviation for worksheet? I doubt we're at all consistent about it, but it's what I saw somewhere else and am using it in the story I'm working on. also my brain is auto populating a different vowel sound in WKSHT.....