Skip to content
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

MD502 validations #5291

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/lib/efile/md/md502_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ def calculate_line_21
percent = ranges[range_index][2]
in_excess_of = ranges[range_index][0].begin
(base + ((taxable_net_income - in_excess_of) * percent)).round
else
0
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/lib/efile/md/md502_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,8 @@

context "deduction method is 'N'" do
let(:deduction_method) { "N" }
it "returns nil" do
expect(instance.lines[:MD502_LINE_21].value).to eq nil
it "returns 0" do
expect(instance.lines[:MD502_LINE_21].value).to eq 0
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@

it "leaves amounts blank if method is not standard" do
allow_any_instance_of(Efile::Md::Md502Calculator).to receive(:calculate_deduction_method).and_return "N"
allow_any_instance_of(Efile::Md::Md502Calculator).to receive(:calculate_line_21).and_return nil
allow_any_instance_of(Efile::Md::Md502Calculator).to receive(:calculate_line_21).and_return 0
expect(xml.at("Form502 NetIncome")).to be_nil
expect(xml.at("Form502 StateTaxComputation TaxableNetIncome")).to be_nil
expect(xml.at("Form502 StateTaxComputation StateIncomeTax")).to be_nil
expect(xml.at("Form502 StateTaxComputation StateIncomeTax").text).to eq "0"
expect(xml.at("Form502 StateTaxComputation PovertyLevelCredit")).to be_nil
expect(xml.at("Form502 StateTaxComputation IndividualTaxCredits")).to be_nil
expect(xml.at("Form502 StateTaxComputation StateTaxAfterCredits")).to be_nil
Expand Down
Loading