Skip to content
Open
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
34 changes: 34 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,40 @@ <h2 data-hook="property-mailing-header" class="h4 alternate no-margin">Mailing A
<div data-hook="property-mailing" class="bold mailing"></div>
</div>
</div> <!-- End owners -->
<div class="row"> <!-- Begin taxes -->
<div class="hide-for-print columns">
<h2 class="alternate divide">Real Estate Tax Calculator</h2>
</div>
</div>
<div class="row columns" style="margin-bottom: 10px">
<p class="normal">
You can estimate the 2019 Real Estate Tax of this property based on the tax rate and
<a href="https://beta.phila.gov/services/property-lots-housing/get-the-homestead-exemption/">Homestead Exemption</a> amount.
The Homestead Exemption will typically save homeowners about $550 on their Real Estate Tax.
These estimates are for information only, and may not be the actual amount of Real Estate Tax for 2019.
</p>

<div class="row">
<div class="medium-7 columns">
<label for="rate">Tax rate</label>
<p>1.3998% (2019)</p>
</div>
<div class="medium-9 columns">
<input type="checkbox" id="homestead" data-hook="tax-estimate-homestead-checkbox">
<label for="homestead">Homestead Exemption</label>
<div data-hook="homestead-disabled-tip"
data-tooltip title="It looks like your property already has an exemption that makes it ineligible for the Homestead Exemption."
class="has-tip"
>
Why can't I check this?
</div>
</div>
<div class="medium-8 columns text-right" style="margin-top: 28px">
<a data-hook="tax-estimate-button" class="button no-margin">Estimate 2019 tax</a>
<strong data-hook="tax-estimate-result" class="stat" style="display: none"></strong>
</div>
</div>
</div> <!-- End taxes -->
<div class="row"> <!-- Begin taxes -->
<div class="hide-for-print columns">
<h2 class="alternate divide">Real Estate Tax Balance</h2>
Expand Down
66 changes: 66 additions & 0 deletions js/views/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,72 @@ app.views.property = function (accountNumber) {
var taxBalanceUrl = 'http://www.phila.gov/revenue/realestatetax/?txtBRTNo=' + opa.parcel_number;
app.hooks.taxBalanceLink.attr('href', taxBalanceUrl);

function updateTaxEstimate() {
// get assessment values
var marketValue = opa.market_value,
exemptValue = opa.exempt_building + opa.exempt_land;

var rate = 1.3998;

// get homestead checkbox value
var homesteadCheckbox = app.hooks.taxEstimateHomesteadCheckbox,
isHomesteadChecked = homesteadCheckbox.prop('checked');

// check if they already have a homestead exemption
var existingHomesteadValue = opa.homestead_exemption || 0,
alreadyHasHomestead = existingHomesteadValue > 0;

// handle homestead exemption if necessary
if (isHomesteadChecked) {
// if they already have an exemption
if (alreadyHasHomestead) {
// calculate their current homestead proportionate to 30k and
// apply to 40k
var proposedHomestead = existingHomesteadValue / 40000 * 40000;
// exemptValue += proposedHomestead;
exemptValue = proposedHomestead;
// if they don't already have a homestead, use 40k
} else {
exemptValue = 40000;
}
}

// calculate tax estimate
var taxableValue = marketValue - exemptValue,
taxEstimate = taxableValue * rate / 100,
taxEstimateOrZero = Math.max(taxEstimate, 0);

// leaving this in here because it's super useful for debugging.
// console.log('taxable value', taxableValue, '=', 'marketValue', marketValue, '- exemptValue', exemptValue);
// console.log('tax estimate', taxEstimate, '= max of', taxEstimate, 'and 0');

// format and update
var formattedTaxEstimate = accounting.formatMoney(taxEstimateOrZero);
app.hooks.taxEstimateResult.text(formattedTaxEstimate);
}

var alreadyHasHomestead = (opa.homestead_exemption > 0);
var hasExemptValue = opa.exempt_building + opa.exempt_land > 0;
var shouldDisableHomestead = alreadyHasHomestead || hasExemptValue;
app.hooks.taxEstimateHomesteadCheckbox
.prop('checked', alreadyHasHomestead)
.prop('disabled', shouldDisableHomestead);

app.hooks.homesteadDisabledTip.toggle(!alreadyHasHomestead && shouldDisableHomestead);
// call foundation again to activate the homestead disabled tooltip
$(app.hooks.homesteadDisabledTip).foundation();

updateTaxEstimate();

app.hooks.taxEstimateHomesteadCheckbox
.change(updateTaxEstimate);

app.hooks.taxEstimateButton.click(function () {
$(this).hide();
app.hooks.taxEstimateResult.show();
})


// Render zoning
// TODO Socrata is missing zoning description
// app.hooks.zoning.html(state.opa.characteristics.zoning + ': ' +
Expand Down