Skip to content

Add $0 bill output for PINs with an EAV less than $150#91

Merged
kyrasturgill merged 8 commits into2024-data-updatefrom
kyrasturgill/fix-eav-under-150-bug
May 5, 2026
Merged

Add $0 bill output for PINs with an EAV less than $150#91
kyrasturgill merged 8 commits into2024-data-updatefrom
kyrasturgill/fix-eav-under-150-bug

Conversation

@kyrasturgill
Copy link
Copy Markdown
Member

This PR adds an exception to the tax_bill() function, defaulting the tax bill amount to zero when a PIN's final EAV is less than $150, mirroring the Treasurer which does not send tax bills to PINs with an EAV that is less than $150 and ultimately records the bill as $0. This ensures alignment between the final_tax output of the tax_bill() function and the tax_bill_total field which mirrors the final bill amount from the Treasurer's data.

@kyrasturgill kyrasturgill requested a review from jeancochrane as a code owner May 4, 2026 21:12
Copy link
Copy Markdown
Member

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the quick turnaround! A couple nits and questions below, but nothing serious.

Comment thread NEWS.md
Comment thread R/tax_bill.R Outdated
dt[, tax_amt_pre_exe := round(eav * agency_tax_rate, 2)]
dt[, tax_amt_post_exe := round(tax_amt_pre_exe - tax_amt_exe, 2)]
dt[tax_amt_post_exe < 0, tax_amt_post_exe := 0]
dt[eav < 150, tax_amt_post_exe := 0]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question, non-blocking] Something I should have thought about earlier: Do you know if the Treasurer's $150 limit applies to the pre- or post-exemption EAV? This code will apply it to the pre-exemption EAV, which may lead tax_bill() to miss some $0 bills if the Treasurer's logic actually depends on post-exemption EAV.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH I can't believe I didn't think of that! I believe it is post-exemption EAV. I did a test and found that there are PINs with pre-exemption EAV over $150 but a post-exemption under that have tax_bill_total equal to $0.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is updated with commit 895fb0f

Comment thread tests/testthat/test-tax_bill.R Outdated
kyrasturgill and others added 4 commits May 4, 2026 18:42
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
…data/ptaxsim into kyrasturgill/fix-eav-under-150-bug
Copy link
Copy Markdown
Member

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go!

@kyrasturgill
Copy link
Copy Markdown
Member Author

kyrasturgill commented May 5, 2026

Documenting for posterity - I did some QC to ensure the PINs impacted by the change to the function were those we'd expect (taxable EAV < 150). In doing a quick calc of taxable EAV of av_clerk * eq_factor_final - exe_total, I found that farmland (class 239) can return "taxable EAV" > 150 (from the calc, that's not actually the farmland's taxable EAV as farmland is not equalized) but have a zero bill. This is because in the tax_bill() function we have:

dt[class == "239", eav := av] # farmland is taxed on AV, not EAV

So, this update for handling taxable eav < 150 will return $0 bill for farmland with av < 150. Turns out this rule aligns with what shows up in tax_bill_total - for all years, any 239 PIN with an AV < 150 has tax_bill_total equal to 0. So we're good, but wanted to just document in case anyone happens to inquire about how farmland is handled in this situation.

@kyrasturgill kyrasturgill merged commit 6603905 into 2024-data-update May 5, 2026
7 checks passed
@kyrasturgill kyrasturgill deleted the kyrasturgill/fix-eav-under-150-bug branch May 5, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants