-
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-996 add two income sub md #4963
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
3d66baf
Re-add missing md trnaslations
squanto 71d0c52
add columns to state file md intake
squanto 92b34bf
Add two income form
squanto e3374e4
Remove extra comments
squanto 6f57b36
Rerun annotate after main
squanto 6b2df3f
Fix schema.rb after main sync
squanto b4d13cc
Fix failing efile error spec
squanto 0d28970
Correct form navigation placement
squanto 66e196c
Rename fields and move amounts to decimals
squanto f94cad2
Add two income sub md feature spec
squanto a0b09ef
Remove extra enum
squanto b19b509
Update annotations
squanto ddb0934
Fix feature spec after main merge
squanto a281e87
Add two income sub form specs, fix validation converstion
squanto f9b626c
Combine md example feature specs
squanto 0e2f2d2
Add back form fill out address spec
squanto 74c158f
Annotate
squanto 16fe2ce
Update copy for option 2
squanto d4c28fb
fix copy typo
squanto 88d6d73
Compare floats instead of integers
squanto 034f999
Round both comparisons for two income sub validation
squanto ffbea22
Add missing translations
squanto 13bdb62
Fix rounding
squanto 5e10c0e
Merge branch 'main' into FYST-996-add-two-income-sub-md
squanto 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
16 changes: 16 additions & 0 deletions
16
app/controllers/state_file/questions/md_two_income_subtractions_controller.rb
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 @@ | ||
module StateFile | ||
module Questions | ||
class MdTwoIncomeSubtractionsController < QuestionsController | ||
|
||
def self.show?(intake) | ||
intake.filing_status_mfj? && intake.direct_file_data.fed_student_loan_interest.present? | ||
end | ||
|
||
def edit | ||
super | ||
@total_deduction = current_intake.direct_file_data.fed_student_loan_interest || 0 | ||
end | ||
private | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module StateFile | ||
class MdTwoIncomeSubtractionsForm < QuestionsForm | ||
set_attributes_for :intake, :primary_student_loan_interest_ded_amount, :spouse_student_loan_interest_ded_amount | ||
|
||
validate :valid_amounts | ||
|
||
def save | ||
@intake.update(attributes_for(:intake)) | ||
end | ||
|
||
private | ||
|
||
def valid_amounts | ||
if @intake.direct_file_data.fed_student_loan_interest.present? | ||
if (primary_student_loan_interest_ded_amount.to_f + spouse_student_loan_interest_ded_amount.to_f).to_round != @intake.direct_file_data.fed_student_loan_interest.to_f.to_round | ||
errors.add( | ||
:primary_student_loan_interest_ded_amount, | ||
I18n.t("state_file.questions.md_two_income_subtractions.edit.sum_form_error", total_deduction: @intake.direct_file_data.fed_student_loan_interest) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
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
34 changes: 34 additions & 0 deletions
34
app/views/state_file/questions/md_two_income_subtractions/edit.html.erb
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,34 @@ | ||
<% content_for :title, t(".title") %> | ||
|
||
<% content_for :card do %> | ||
<h1 class="h2"><%= t(".title") %></h1> | ||
<p class="spacing-below-5"><%= t(".description") %></p> | ||
|
||
<%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> | ||
<div class="white-group"> | ||
<p class="spacing-below-5"><%= t(".subtitle") %></p> | ||
<p class="text--small spacing-below-5"><%= t(".total", total_deduction: number_to_currency(@total_deduction)) %></p> | ||
<div class="form-question spacing-below-25"> | ||
<%= f.vita_min_money_field(:primary_student_loan_interest_ded_amount, "Your portion of the student loan interest deduction", classes: ["form-width--long"]) %> | ||
</div> | ||
|
||
<div class="form-question spacing-below-25"> | ||
<%= f.vita_min_money_field(:spouse_student_loan_interest_ded_amount, "Your spouse's portion of the student loan interest deduction", classes: ["form-width--long"]) %> | ||
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. and translations here as well! 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. good points, added 👍 |
||
</div> | ||
</div> | ||
|
||
<div class="reveal"> | ||
<p><a href="#" class="reveal__button"><%= t('.student_loan_deduction_heading') %></a></p> | ||
<div class="reveal__content"> | ||
<p><%= t('.student_loan_deduction_copy') %></p> | ||
<p><%= t('.student_loan_deduction_copy2') %></p> | ||
</div> | ||
</div> | ||
|
||
<%= f.button :submit, class: "button button--wide button--primary" do %> | ||
<%= t("general.continue") %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% 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
6 changes: 6 additions & 0 deletions
6
db/migrate/20241104170456_add_student_loan_interest_ded_amount_to_state_file_md_intakes.rb
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,6 @@ | ||
class AddStudentLoanInterestDedAmountToStateFileMdIntakes < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :state_file_md_intakes, :primary_student_loan_interest_ded_amount, :decimal, precision: 12, scale: 2, null: false, default: 0 | ||
add_column :state_file_md_intakes, :spouse_student_loan_interest_ded_amount, :decimal, precision: 12, scale: 2, null: false, default: 0 | ||
end | ||
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
Oops, something went wrong.
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.
Does the label text have to be translated?