Skip to content

Commit

Permalink
fix annotate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Proebstel committed Oct 21, 2024
1 parent 909e447 commit 305a6f2
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/controllers/state_file/questions/md_tax_refund_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module StateFile
module Questions
class MdTaxRefundController < QuestionsController
def self.show?(intake)
# intake.calculated_refund_or_owed_amount.positive?
true
end

def refund_amount
current_intake.calculated_refund_or_owed_amount
end
helper_method :refund_amount


private

def card_postscript; end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module StateFile
module Questions
class TaxesOwedController < QuestionsController
def self.show?(intake)
intake.calculated_refund_or_owed_amount.negative? # what happens if zero?
true
# intake.calculated_refund_or_owed_amount.negative? # what happens if zero?
end

def taxes_owed
Expand Down
2 changes: 1 addition & 1 deletion app/lib/navigation/state_file_md_question_navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StateFileMdQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio
Navigation::NavigationStep.new(StateFile::Questions::UnemploymentController),
Navigation::NavigationStep.new(StateFile::Questions::MdReviewController),
Navigation::NavigationStep.new(StateFile::Questions::TaxesOwedController),
Navigation::NavigationStep.new(StateFile::Questions::TaxRefundController),
Navigation::NavigationStep.new(StateFile::Questions::MdTaxRefundController),
Navigation::NavigationStep.new(StateFile::Questions::EsignDeclarationController), # creates EfileSubmission and transitions to preparing
]),
Navigation::NavigationSection.new("state_file.navigation.section_6", [
Expand Down
8 changes: 8 additions & 0 deletions app/models/state_file_id_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# email_address_verified_at :datetime
# failed_attempts :integer default(0), not null
# federal_return_status :string
# has_unpaid_sales_use_tax :integer default("unfilled"), not null
# hashed_ssn :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
Expand Down Expand Up @@ -49,12 +50,19 @@
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_suffix :string
# total_purchase_amount :decimal(12, 2)
# unsubscribed_from_email :boolean default(FALSE), not null
# withdraw_amount :integer
# created_at :datetime not null
# updated_at :datetime not null
# federal_submission_id :string
# visitor_id :string
#
# Indexes
#
# index_state_file_id_intakes_on_email_address (email_address)
# index_state_file_id_intakes_on_hashed_ssn (hashed_ssn)
#

# Indexes
#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<div class="white-group">
<p class="spacing-below-0"><%= t(".bank_title") %></p>
<p class="text--small"><%= t(".foreign_accounts") %></p>
<div class="form-group-tight">
<% if owe_taxes %>
<%= form.hidden_field :app_time, value: app_time %>
<%= form.vita_min_money_field(:withdraw_amount, t('.withdraw_amount', owed_amount: taxes_owed), classes: ["form-width--long"]) %>
<% if before_withdrawal_date_deadline?(current_state_code) %>
<div class="date-select">
<% year = MultiTenantService.new(:statefile).current_tax_year + 1 %>
<%= form.cfa_date_select(
:date_electronic_withdrawal,
t(".date_withdraw_text",
withdrawal_deadline_date: I18n.l(withdrawal_date_deadline(current_state_code).to_date, format: :medium, locale: locale),
with_drawal_deadline_year: withdrawal_date_deadline(current_state_code).year),
options: {
start_year: year,
end_year: year,
}
) %>
</div>
<% else %>
<%= form.hidden_field :post_deadline_withdrawal_date, value: post_deadline_withdrawal_date(current_state_code) %>
<% end %>
<% end %>

<%= form.cfa_input_field(:bank_name, t("views.questions.bank_details.bank_name"), classes: ["form-width--long"]) %>
<%= form.cfa_radio_set(
:account_type,
label_text: t("views.questions.bank_details.account_type.label"),
collection: [
{ value: :checking, label: t("views.questions.bank_details.account_type.checking") },
{ value: :savings, label: t("views.questions.bank_details.account_type.savings") },
]
)
%>
<%= form.cfa_input_field(:routing_number, t(".routing_number"), classes: ["form-width--long", "disablecopy"]) %>
<%= form.cfa_input_field(:routing_number_confirmation, t(".confirm_routing_number"), classes: ["form-width--long", "disablepaste", "disablecopy"]) %>
<%= form.cfa_input_field(:account_number, t(".account_number"), classes: ["form-width--long", "disablecopy"]) %>
<%= form.cfa_input_field(:account_number_confirmation, t(".confirm_account_number"), classes: ["form-width--long", "disablepaste", "disablecopy"]) %>
</div>
<p><strong><%= t(".disclaimer") %></strong></p>
<% if owe_taxes && !before_withdrawal_date_deadline?(current_state_code) %>
<p>
<%= t(".after_deadline_default_withdrawal_info",
withdrawal_deadline_date: I18n.l(withdrawal_date_deadline(current_state_code).to_date, format: :medium, locale: locale),
with_drawal_deadline_year: withdrawal_date_deadline(current_state_code).year) %>
</p>
<% end %>
</div>
36 changes: 36 additions & 0 deletions app/views/state_file/questions/md_tax_refund/edit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<% content_for :page_title, t(".page_title") %>

<% content_for :card do %>
<h1 class="h2">
<%= t(".title_html", refund_amount: refund_amount, state_name: current_state_name) %>
</h1>

<%= form_with model: @form, url: { action: :update }, method: :put, local: true, builder: VitaMinFormBuilder, html: { class: 'form-card form-card--long' } do |f| %>
<div class="question-with-follow-up">
<div class="question-with-follow-up__question">
<div class="white-group">
<%= f.cfa_radio_set(
:payment_or_deposit_type,
collection: [
{ value: :direct_deposit, label: t(".direct_deposit"), input_html: { "data-follow-up": "#deposit-to-bank" } },
{ value: :mail, label: t(".mail"), input_html: { "data-follow-up": "#mail-check" } },
]
) %>
</div>
</div>

<div class="question-with-follow-up__follow-up" id="deposit-to-bank">
<div class="question-with-follow-up">
<div class="question-with-follow-up__question">
<%= render 'state_file/questions/md_tax_refund/md_bank_details', form: f, owe_taxes: false %>
</div>
</div>
</div>
<%= f.continue %>
</div>
<% end %>
<% end %>

<% content_for :script do %>
<%= render 'shared/disable_copy_paste' %>
<% end %>
3 changes: 3 additions & 0 deletions spec/factories/state_file_id_intakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# email_address_verified_at :datetime
# failed_attempts :integer default(0), not null
# federal_return_status :string
# has_unpaid_sales_use_tax :integer default("unfilled"), not null
# hashed_ssn :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
Expand Down Expand Up @@ -49,12 +50,14 @@
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_suffix :string
# total_purchase_amount :decimal(12, 2)
# unsubscribed_from_email :boolean default(FALSE), not null
# withdraw_amount :integer
# created_at :datetime not null
# updated_at :datetime not null
# federal_submission_id :string
# visitor_id :string
#
# Indexes
#
# index_state_file_id_intakes_on_email_address (email_address)
Expand Down
3 changes: 3 additions & 0 deletions spec/models/state_file_id_intake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# email_address_verified_at :datetime
# failed_attempts :integer default(0), not null
# federal_return_status :string
# has_unpaid_sales_use_tax :integer default("unfilled"), not null
# hashed_ssn :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
Expand Down Expand Up @@ -49,12 +50,14 @@
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_suffix :string
# total_purchase_amount :decimal(12, 2)
# unsubscribed_from_email :boolean default(FALSE), not null
# withdraw_amount :integer
# created_at :datetime not null
# updated_at :datetime not null
# federal_submission_id :string
# visitor_id :string
#
# Indexes
#
# index_state_file_id_intakes_on_email_address (email_address)
Expand Down

0 comments on commit 305a6f2

Please sign in to comment.