Skip to content

Commit 3f974b9

Browse files
committed
Merge branch 'main' into copy-ui-updates
2 parents 0aae486 + 49a9dba commit 3f974b9

File tree

62 files changed

+1469
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1469
-406
lines changed

app/controllers/state_file/questions/base_review_controller.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ class BaseReviewController < QuestionsController
44
def edit
55
@refund_or_owed_amount = current_intake.calculated_refund_or_owed_amount
66
@refund_or_owed_label = @refund_or_owed_amount.positive? ? I18n.t("state_file.questions.shared.review_header.your_refund") : I18n.t("state_file.questions.shared.review_header.your_tax_owed")
7+
@income_documents_present = income_documents_present?
78
end
89

910
private
1011

12+
def income_documents_present?
13+
current_intake.state_file1099_rs.present? ||
14+
current_intake.state_file_w2s.present? ||
15+
current_intake.direct_file_json_data.interest_reports.count.positive? ||
16+
current_intake.direct_file_data.fed_unemployment.positive? ||
17+
current_intake.direct_file_data.fed_ssb.positive? ||
18+
current_intake.direct_file_data.fed_taxable_ssb.positive?
19+
end
20+
1121
def form_class
1222
NullForm
1323
end

app/controllers/state_file/questions/nc_eligibility_residence_controller.rb renamed to app/controllers/state_file/questions/nc_eligibility_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module StateFile
22
module Questions
3-
class NcEligibilityResidenceController < QuestionsController
3+
class NcEligibilityController < QuestionsController
44
include EligibilityOffboardingConcern
55
end
66
end
7-
end
7+
end

app/controllers/state_file/questions/nc_eligibility_out_of_state_income_controller.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
module StateFile
22
module Questions
33
class ReturnStatusController < QuestionsController
4-
before_action :redirect_if_from_efile
54
before_action :redirect_if_no_submission
65
skip_before_action :redirect_if_in_progress_intakes_ended
76

87
def edit
9-
@submission_to_show = submission_to_show
10-
@error = submission_error
8+
@submission_to_show = current_intake.latest_submission
119
@return_status = return_status
10+
@error = submission_error
1211
@tax_refund_url = StateFile::StateInformationService.tax_refund_url(current_state_code)
1312
@tax_payment_url = StateFile::StateInformationService.tax_payment_url(current_state_code)
1413
@voucher_form_name = StateFile::StateInformationService.voucher_form_name(current_state_code)
@@ -23,28 +22,16 @@ def prev_path
2322

2423
private
2524

26-
def submission_to_show
27-
is_az_intake = current_intake.is_a?(StateFileAzIntake)
28-
latest_submission_has_901_error = current_intake.latest_submission&.efile_submission_transitions&.where(to_state: "rejected")&.last&.efile_errors&.pluck(:code)&.include?("901")
29-
accepted_submissions = current_intake.efile_submissions.filter { |submission| submission.in_state?(:accepted) }
30-
31-
if is_az_intake && latest_submission_has_901_error && accepted_submissions.present?
32-
accepted_submissions.last
33-
else
34-
current_intake.latest_submission
35-
end
36-
end
37-
3825
def submission_error
3926
return nil unless return_status == 'rejected'
4027
# in the case that its in the notified_of_rejection or waiting state
4128
# we can't just grab the efile errors from the last transition
42-
submission_to_show&.efile_submission_transitions&.where(to_state: 'rejected')&.last&.efile_errors&.last
29+
@submission_to_show&.efile_submission_transitions&.where(to_state: 'rejected')&.last&.efile_errors&.last
4330
end
4431

4532
def return_status
4633
# return status for display
47-
case submission_to_show.current_state
34+
case @submission_to_show.current_state
4835
when 'accepted'
4936
'accepted'
5037
when 'notified_of_rejection', 'waiting'
@@ -61,15 +48,6 @@ def redirect_if_no_submission
6148
redirect_to StateFile::Questions::InitiateDataTransferController.to_path_helper
6249
end
6350
end
64-
65-
def redirect_if_from_efile
66-
# We had a situation where we gave the wrong URL to direct file, and they were redirecting
67-
# here when the federal return was not yet approved.
68-
# We have alerted them, and once they have updated their URL we can probably remove this
69-
if params[:ref_location] == "df_authorize_state"
70-
redirect_to StateFile::Questions::PendingFederalReturnController.to_path_helper
71-
end
72-
end
7351
end
7452
end
7553
end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module StateFile
2+
class NcEligibilityForm < QuestionsForm
3+
set_attributes_for :intake, :eligibility_ed_loan_cancelled, :eligibility_ed_loan_emp_payment, :nc_eligiblity_none
4+
5+
validate :at_most_one_option_selected
6+
validate :at_least_one_option_selected
7+
8+
def save
9+
@intake.update(attributes_for(:intake))
10+
end
11+
12+
private
13+
14+
def at_least_one_option_selected
15+
values = attributes_for(:intake).values_at(:eligibility_ed_loan_emp_payment, :eligibility_ed_loan_cancelled, :nc_eligiblity_none)
16+
selected = values.select { |value| value == "yes" }
17+
if selected.count < 1
18+
errors.add(:nc_eligiblity_none, I18n.t("forms.errors.nc_eligibility_form.at_most_one_option_selected"))
19+
end
20+
end
21+
22+
def at_most_one_option_selected
23+
if attributes_for(:intake)[:nc_eligiblity_none] == "yes"
24+
if attributes_for(:intake).values_at(:eligibility_ed_loan_emp_payment, :eligibility_ed_loan_cancelled).any? { |value| value == "yes" }
25+
errors.add(:nc_eligiblity_none, I18n.t("forms.errors.nc_eligibility_form.at_most_one_option_selected"))
26+
end
27+
end
28+
end
29+
end
30+
end

app/forms/state_file/nc_eligibility_out_of_state_income_form.rb

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/forms/state_file/nc_eligibility_residence_form.rb

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/lib/efile/az/az140_calculator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ def calculate_line_56
283283
max_credit = 100
284284
max_credit -= @intake.household_excise_credit_claimed_amount&.round if @intake.household_excise_credit_claimed_yes?
285285

286-
[wrksht_line_4, max_credit].min
286+
result = [wrksht_line_4, max_credit].min
287+
result = 0 if result < 0
288+
result
287289
end
288290
end
289291

app/lib/efile/id/id40_calculator.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def calculate
2424
set_line(:ID40_LINE_9, :calculate_line_9)
2525
set_line(:ID40_LINE_10, :calculate_line_10)
2626
set_line(:ID40_LINE_11, :calculate_line_11)
27+
set_line(:ID40_LINE_16, :calculate_line_16)
2728
set_line(:ID40_LINE_19, :calculate_line_19)
2829
set_line(:ID40_LINE_20, :calculate_line_20)
2930
set_line(:ID40_LINE_21, :calculate_line_20)
@@ -103,10 +104,14 @@ def calculate_line_11
103104
[line_or_zero(:ID40_LINE_9) - line_or_zero(:ID40_LINE_10), 0].max
104105
end
105106

107+
def calculate_line_16
108+
@direct_file_data.total_itemized_or_standard_deduction_amount
109+
end
110+
106111
# Subtract the larger of L15 or L16 from L11 but L15 is always 0
107112
# L16 is pulled from df data
108113
def calculate_line_19
109-
[line_or_zero(:ID40_LINE_11) - @direct_file_data.total_itemized_or_standard_deduction_amount, 0].max
114+
[line_or_zero(:ID40_LINE_11) - line_or_zero(:ID40_LINE_16), 0].max
110115
end
111116

112117
WK_LINE_2_AMTS = {

app/lib/efile/line_data.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ ID40_LINE_10:
200200
label: '10. Subtractions from Form 39R, Part B, line 24'
201201
ID40_LINE_11:
202202
label: '11. Total Adjusted Income. Subtract line 10 from line 9'
203+
ID40_LINE_16:
204+
label: '16. Standard deduction'
203205
ID40_LINE_19:
204206
label: '19. Taxable state income'
205207
ID40_LINE_20:
@@ -836,6 +838,8 @@ NJ1040_LINE_51:
836838
label: '51 Use Tax Due on Internet, Mail-Order, or Other Out-of-State Purchases (See instructions) If no Use Tax, enter 0.00'
837839
NJ1040_LINE_54:
838840
label: '54 Total Tax Due (Add lines 50 through 53c)'
841+
NJ1040_LINE_55:
842+
label: '55 Total NJ Income Tax Withheld (Enclose Forms W-2 and 1099) (Part-year residents, see instr.)'
839843
NJ1040_LINE_56:
840844
label: '56 Property Tax Credit (See instructions page 25)'
841845
NJ1040_LINE_57:

0 commit comments

Comments
 (0)