Skip to content

Commit 144946e

Browse files
Merge branch 'main' into FYST-1973-send-marketing-email-to-az-ty-23-filers-who-have-not-yet-filed-for-ty-24
Co-authored-by: Anisha Ramnani <[email protected]>
2 parents c91b6b3 + 8fd639a commit 144946e

37 files changed

+403
-82
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module StateFile
2+
module Questions
3+
class NcOutOfCountryController < QuestionsController
4+
include ReturnToReviewConcern
5+
6+
def self.show?(_intake)
7+
Flipper.enabled?(:extension_period)
8+
end
9+
end
10+
end
11+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module StateFile
2+
class NcOutOfCountryForm < QuestionsForm
3+
set_attributes_for :intake, :out_of_country
4+
5+
validates :out_of_country, inclusion: { in: %w[yes no], message: :blank }
6+
7+
def save
8+
@intake.update!(attributes_for(:intake))
9+
end
10+
end
11+
end

app/forms/state_file/nj_medical_expenses_form.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ class NjMedicalExpensesForm < QuestionsForm
44
:medical_expenses
55

66
validates_numericality_of :medical_expenses, message: I18n.t("validators.not_a_number"), if: -> { medical_expenses.present? }
7-
validates :medical_expenses, presence: true, allow_blank: false, numericality: { greater_than_or_equal_to: 0 }
7+
validates :medical_expenses, allow_blank: true, numericality: { greater_than_or_equal_to: 0 }
88

99
def save
10-
unless medical_expenses.nil?
11-
@intake.update(attributes_for(:intake))
12-
end
10+
@intake.update(attributes_for(:intake))
1311
end
1412
end
1513
end

app/lib/efile/nj/nj1040_calculator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ def calculate_line_29
365365

366366
def calculate_line_31
367367
two_percent_gross = line_or_zero(:NJ1040_LINE_29) * 0.02
368-
difference_with_med_expenses = @intake.medical_expenses - two_percent_gross
368+
medical_expenses = @intake.medical_expenses || 0
369+
difference_with_med_expenses = medical_expenses - two_percent_gross
369370
rounded_difference = difference_with_med_expenses.round
370371
return rounded_difference if rounded_difference.positive?
371372
nil

app/lib/navigation/state_file_nc_question_navigation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class StateFileNcQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio
3838
Navigation::NavigationStep.new(StateFile::Questions::NcRetirementIncomeSubtractionController),
3939
Navigation::NavigationStep.new(StateFile::Questions::NcSubtractionsController),
4040
Navigation::NavigationStep.new(StateFile::Questions::NcSalesUseTaxController),
41+
Navigation::NavigationStep.new(StateFile::Questions::NcOutOfCountryController),
4142
Navigation::NavigationStep.new(StateFile::Questions::PrimaryStateIdController),
4243
Navigation::NavigationStep.new(StateFile::Questions::SpouseStateIdController),
4344
Navigation::NavigationStep.new(StateFile::Questions::NcReviewController),

app/lib/pdf_filler/nc_d400_pdf.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def hash_for_pdf
2121
mfs_spouse_last_name = @xml_document.at("MFSSpouseName LastName")&.text || ""
2222
mfs_spouse_name = [mfs_spouse_first_name, mfs_spouse_middle_initial, mfs_spouse_last_name].reject(&:empty?).join(" ")
2323

24-
{
24+
answers = {
2525
y_d400wf_ssn1: @submission.data_source.primary.ssn,
2626
y_d400wf_ssn2: @submission.data_source.spouse.ssn,
2727
y_d400wf_fname1: @submission.data_source.primary.first_name,
@@ -80,6 +80,10 @@ def hash_for_pdf
8080
y_d400wf_sigdate: @submission.data_source.primary_esigned_yes? ? date_type_for_timezone(@submission.data_source.primary_esigned_at)&.to_date : "",
8181
y_d400wf_sigdate2: @submission.data_source.spouse_esigned_yes? ? date_type_for_timezone(@submission.data_source.spouse_esigned_at)&.to_date : ""
8282
}
83+
if Flipper.enabled?(:extension_period)
84+
answers["y_d400wf_Out of Country"] = checkbox_value(@xml_document.at('OutOfCountry')&.text.present?)
85+
end
86+
answers
8387
end
8488

8589
def checkbox_value(condition)

app/lib/submission_builder/financial_transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def document
2727
xml.BankAccountNumber sanitize_for_xml(@submission.data_source.account_number) if @submission.data_source.account_number.present?
2828
xml.PaymentAmount @submission.data_source.withdraw_amount if @submission.data_source.withdraw_amount.present?
2929
xml.AccountHolderType "2" if @submission.data_source.requires_additional_withdrawal_information?
30-
xml.RequestedPaymentDate date_type(@submission.data_source.date_electronic_withdrawal) if @submission.data_source.date_electronic_withdrawal.present?
30+
xml.RequestedPaymentDate date_type(@submission.data_source.calculate_date_electronic_withdrawal(current_time: @submission.created_at)) if @submission.data_source.date_electronic_withdrawal.present?
3131
if @submission.data_source.requires_additional_withdrawal_information?
3232
xml.AddendaRecord do
3333
xml.TaxTypeCode do

app/lib/submission_builder/ty2024/states/nc/documents/d400.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def document
1919

2020
build_xml_doc("FormNCD400") do |xml|
2121
xml.NCCountyCode @submission.data_source.residence_county
22+
xml.OutOfCountry "X" if Flipper.enabled?(:extension_period) && @submission.data_source.out_of_country_yes?
2223
xml.ResidencyStatusPrimary true
2324
xml.ResidencyStatusSpouse true if @submission.data_source.filing_status_mfj?
2425
xml.VeteranInfoPrimary @submission.data_source.primary_veteran_yes? ? 1 : 0

app/models/state_file/automated_message/pre_deadline_reminder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.after_transition_notification?
1010
end
1111

1212
def self.send_only_once?
13-
true
13+
false
1414
end
1515

1616
def sms_body(**args)

app/models/state_file_base_intake.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,4 +493,14 @@ def eligible_1099rs
493493
form1099r.taxable_amount&.to_f&.positive?
494494
end
495495
end
496-
end
496+
497+
def calculate_date_electronic_withdrawal(current_time:)
498+
submitted_before_deadline = StateFile::StateInformationService.before_payment_deadline?(current_time, self.state_code)
499+
if submitted_before_deadline
500+
date_electronic_withdrawal&.to_date
501+
else
502+
timezone = StateFile::StateInformationService.timezone(self.state_code)
503+
current_time.in_time_zone(timezone).to_date
504+
end
505+
end
506+
end

0 commit comments

Comments
 (0)