Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
mpidcock committed Apr 16, 2024
2 parents 3025868 + 535dd71 commit c3755d9
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 34 deletions.
Expand Up @@ -4,6 +4,7 @@ class TaxesOwedController < AuthenticatedQuestionsController
def self.show?(intake)
intake.calculated_refund_or_owed_amount.negative? # what happens if zero?
end

def taxes_owed
current_intake.calculated_refund_or_owed_amount.abs
end
Expand Down
8 changes: 4 additions & 4 deletions app/forms/state_file/taxes_owed_form.rb
Expand Up @@ -13,8 +13,8 @@ class TaxesOwedForm < TaxRefundForm
set_attributes_for :date, :date_electronic_withdrawal_month, :date_electronic_withdrawal_year, :date_electronic_withdrawal_day

with_options unless: -> { payment_or_deposit_type == "mail" } do
validate :date_electronic_withdrawal_is_valid_date
validate :withdrawal_date_before_deadline, if: -> { date_electronic_withdrawal.present? }
# validate :date_electronic_withdrawal_is_valid_date
# validate :withdrawal_date_before_deadline, if: -> { date_electronic_withdrawal.present? }
validates :withdraw_amount, presence: true, numericality: { greater_than: 0 }
validate :withdraw_amount_higher_than_owed?
end
Expand All @@ -37,11 +37,11 @@ def self.existing_attributes(intake)
private

def date_electronic_withdrawal
parse_date_params(date_electronic_withdrawal_year, date_electronic_withdrawal_month, date_electronic_withdrawal_day)
Time.now.in_time_zone('Eastern Time (US & Canada)').to_date
end

def date_electronic_withdrawal_is_valid_date
valid_text_date(date_electronic_withdrawal_year, date_electronic_withdrawal_month, date_electronic_withdrawal_day, :date_electronic_withdrawal)
valid_text_date(Time.now.year.to_s, Time.now.month.to_s, Time.now.day.to_s, :date_electronic_withdrawal)
end

def withdraw_amount_higher_than_owed?
Expand Down
2 changes: 0 additions & 2 deletions app/models/intake.rb
Expand Up @@ -306,8 +306,6 @@
#
# fk_rails_... (client_id => clients.id)
# fk_rails_... (matching_previous_year_intake_id => intakes.id)
# fk_rails_... (primary_drivers_license_id => drivers_licenses.id)
# fk_rails_... (spouse_drivers_license_id => drivers_licenses.id)
# fk_rails_... (vita_partner_id => vita_partners.id)
#

Expand Down
2 changes: 0 additions & 2 deletions app/models/intake/ctc_intake.rb
Expand Up @@ -306,8 +306,6 @@
#
# fk_rails_... (client_id => clients.id)
# fk_rails_... (matching_previous_year_intake_id => intakes.id)
# fk_rails_... (primary_drivers_license_id => drivers_licenses.id)
# fk_rails_... (spouse_drivers_license_id => drivers_licenses.id)
# fk_rails_... (vita_partner_id => vita_partners.id)
#
class Intake::CtcIntake < Intake
Expand Down
2 changes: 0 additions & 2 deletions app/models/intake/gyr_intake.rb
Expand Up @@ -306,8 +306,6 @@
#
# fk_rails_... (client_id => clients.id)
# fk_rails_... (matching_previous_year_intake_id => intakes.id)
# fk_rails_... (primary_drivers_license_id => drivers_licenses.id)
# fk_rails_... (spouse_drivers_license_id => drivers_licenses.id)
# fk_rails_... (vita_partner_id => vita_partners.id)
#
class Intake::GyrIntake < Intake
Expand Down
13 changes: 2 additions & 11 deletions app/views/state_file/questions/tax_refund/_bank_details.html.erb
Expand Up @@ -4,17 +4,7 @@
<div class="form-group-tight">
<% if owe_taxes %>
<%= form.cfa_input_field(:withdraw_amount, t('.withdraw_amount', owed_amount: taxes_owed), classes: ["form-width--long"]) %>
<div class="date-select">
<% year = MultiTenantService.new(:statefile).current_tax_year + 1 %>
<%= form.cfa_date_select(
:date_electronic_withdrawal,
t(".date_withdraw_text"),
options: {
start_year: year,
end_year: year,
}
) %>
</div>
<% end %>
<%= form.cfa_input_field(:bank_name, t("views.questions.bank_details.bank_name"), classes: ["form-width--long"]) %>
Expand All @@ -33,4 +23,5 @@
<%= form.cfa_input_field(:account_number_confirmation, t(".confirm_account_number"), classes: ["form-width--long", "disablepaste", "disablecopy"]) %>
</div>
<p><strong><%= t(".disclaimer") %></strong></p>
<p><strong><%= t(".after-deadline-default-withdrawl-info") %></strong></p>
</div>
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -2657,10 +2657,10 @@ en:
tax_refund:
bank_details:
account_number: Account Number
after-deadline-default-withdrawl-info: Because you are submitting your return on or after April 15, 2024, the state will withdraw your payment as soon as they process your return.
bank_title: 'Please provide your bank details:'
confirm_account_number: Confirm Account Number
confirm_routing_number: Confirm Routing Number
date_withdraw_text: 'When would you like the funds withdrawn from your account? (Must be on or before April 15, 2024):'
disclaimer: Check to make sure your bank information is correct. You won’t be able to correct this after you submit your return.
foreign_accounts: "(Foreign accounts are not accepted)"
routing_number: Routing Number
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Expand Up @@ -2637,10 +2637,10 @@ es:
tax_refund:
bank_details:
account_number: Número de cuenta
after-deadline-default-withdrawl-info: Debido al hecho de que estás enviando tu declaración el 15 de abril o después, el estado retirará tu pago tan pronto como se procese tu declaración.
bank_title: 'Comparte los detalles de tu cuenta bancaria:'
confirm_account_number: Confirma el número de cuenta
confirm_routing_number: Confirma el número de ruta bancaria (routing number)
date_withdraw_text: "¿Cuándo te gustaría que se retiren los fondos de tu cuenta? (debe ser antes o en el dia del 15 de abril de 2024):"
disclaimer: Verifica que la información de tu banco sea correcta. No podrás corregirla después de enviar tu declaración.
foreign_accounts: "(Las cuentas extranjeras no son aceptadas)"
routing_number: Número de ruta bancaria (routing number)
Expand Down
4 changes: 0 additions & 4 deletions db/schema.rb
Expand Up @@ -11,8 +11,6 @@
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_04_03_214006) do
create_schema "analytics"

# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "plpgsql"
Expand Down Expand Up @@ -2270,8 +2268,6 @@
add_foreign_key "incoming_text_messages", "clients"
add_foreign_key "intake_archives", "intakes", column: "id"
add_foreign_key "intakes", "clients"
add_foreign_key "intakes", "drivers_licenses", column: "primary_drivers_license_id"
add_foreign_key "intakes", "drivers_licenses", column: "spouse_drivers_license_id"
add_foreign_key "intakes", "intakes", column: "matching_previous_year_intake_id"
add_foreign_key "intakes", "vita_partners"
add_foreign_key "notes", "clients"
Expand Down
4 changes: 2 additions & 2 deletions spec/forms/state_file/taxes_owed_form_spec.rb
Expand Up @@ -149,7 +149,7 @@
let(:day) { "31" }
let(:year) { current_year }

it "is valid" do
xit "is valid" do
form = described_class.new(intake, params)
expect(form).not_to be_valid
expect(form.errors).to include :date_electronic_withdrawal
Expand All @@ -161,7 +161,7 @@
let(:day) { "15" }
let(:year) { current_year }

it "is not valid" do
xit "is not valid" do
form = described_class.new(intake, params)
expect(form).not_to be_valid
expect(form.errors).to include :date_electronic_withdrawal
Expand Down
Expand Up @@ -15,7 +15,8 @@
expect(xml.at("StatePayment BankAccountNumber").text).to eq "222222222"
expect(xml.at("StatePayment PaymentAmount").text).to eq "5"
expect(xml.at("StatePayment NotIATTransaction").text).to eq "X"
expect(xml.at("StatePayment RequestedPaymentDate").text).to eq "2024-04-15"
# Removing after April 15th
# expect(xml.at("StatePayment RequestedPaymentDate").text).to eq "2024-04-15"
end
end

Expand Down
2 changes: 0 additions & 2 deletions spec/models/intake/gyr_intake_spec.rb
Expand Up @@ -306,8 +306,6 @@
#
# fk_rails_... (client_id => clients.id)
# fk_rails_... (matching_previous_year_intake_id => intakes.id)
# fk_rails_... (primary_drivers_license_id => drivers_licenses.id)
# fk_rails_... (spouse_drivers_license_id => drivers_licenses.id)
# fk_rails_... (vita_partner_id => vita_partners.id)
#
require "rails_helper"
Expand Down
2 changes: 0 additions & 2 deletions spec/models/intake_spec.rb
Expand Up @@ -306,8 +306,6 @@
#
# fk_rails_... (client_id => clients.id)
# fk_rails_... (matching_previous_year_intake_id => intakes.id)
# fk_rails_... (primary_drivers_license_id => drivers_licenses.id)
# fk_rails_... (spouse_drivers_license_id => drivers_licenses.id)
# fk_rails_... (vita_partner_id => vita_partners.id)
#

Expand Down

0 comments on commit c3755d9

Please sign in to comment.