Skip to content

Commit

Permalink
Fix earnings record table for entries with earnings prior to 1966. #185
Browse files Browse the repository at this point in the history
Add text to one of the FAQ entries calling out the limitations with
respect to:

 - Special Extra Earnings for Military Service #186
 - Windfall Elimination Provision #94

This does not actually resolve #186 or #94, it just calls them out as
sources of error in the text.
  • Loading branch information
Gregable committed Mar 14, 2022
1 parent 5e8a689 commit 6c3c0fa
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 183 deletions.
30 changes: 28 additions & 2 deletions partials/frequent-questions.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,43 @@ <h2>Additional Questions</h2>
<ul>
<li>
Income tax withholding
[<a href="https://www.ssa.gov/planners/taxwithold.html">ssa.gov</a>]
[<a href="https://www.ssa.gov/planners/taxwithold.html"
target="_blank">ssa.gov</a>]
</li>
<li>
Medicare (health insurance) Part B premium
[<a
href="https://www.medicare.gov/your-medicare-costs/paying-parts-a-and-b/pay-parts-a-and-b-premiums.html">medicare.gov</a>].
href="https://www.medicare.gov/your-medicare-costs/paying-parts-a-and-b/pay-parts-a-and-b-premiums.html"
target="_blank">medicare.gov</a>].
</li>
<li>
Garnishments (ex: back taxes, student loans, alimony, child support).
</li>
</ul>
<p>
There are also some smaller factors which this calculator does not
currently take into account fully, but may be added in the future. These
include:
</p>
<ul>
<li>
Special Extra Earnings for Military Service from 1957 - 2001 [<a
href="https://www.ssa.gov/benefits/retirement/planner/military.html"
target="_blank">ssa.gov</a>]. This can add as much as an additional
$1,200 per year on your earnings record. For most, the effect
is only a few additional dollars per month in benefits, but in rare
cases this can be as high as hundreds of extra dollars.
</li>
<li>
Windfall Elimination Provision [<a
href="https://www.ssa.gov/pubs/EN-05-10045.pdf"
target="_blank">ssa.gov</a>]. This provision can reduce the monthly
benefit for those who earn a retirement or disability pension from an
employer who didn't withhold Social Security taxes (typically a
Government pension). The reduction can be up to half the value of the
pension. About 3% of Social Security beneficiaries are affected.
</li>
</ul>
</section>
<section class=frequent-questions>
<input type=checkbox id=q5>
Expand Down
14 changes: 13 additions & 1 deletion src/ssa-parse.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ var dollarStringToNumber = function(dollar_string) {
// yet been filed. Record this as a -1 sentinel for now.
if (dollar_string === 'NotYetRecorded')
return -1;
if (dollar_string === 'MedicareBeganIn1966')
return 0;
if (dollar_string === '')
return 0;
var number_string = dollar_string.replace(/[$,]/g, '');
return Number(number_string);
}
Expand All @@ -26,7 +30,11 @@ var parseSsaGovTable = function(lines) {
var record = new EarningRecord();
record.year = Number.parseInt(columns[0]);
record.taxedEarnings = dollarStringToNumber(columns[1]);
record.taxedMedicareEarnings = dollarStringToNumber(columns[2]);
if (columns.length > 2) {
record.taxedMedicareEarnings = dollarStringToNumber(columns[2]);
} else {
record.taxedMedicareEarnings = 0;
}
earningsRecords.push(record);
}
return earningsRecords;
Expand Down Expand Up @@ -96,6 +104,10 @@ var parsePaste = function(paste) {
// Some columns will include the string "Not yet recorded" which breaks
// columns on spaces in the string. We replace these with "NotYetRecorded".
replacedStr = replacedStr.replace(/not yet recorded+/gi, "NotYetRecorded");
// Similarly, for records in 1965, the Medicare column will include the
// string "Medicare Began in 1966". We replace this with:
// "MedicareBeganIn1966".
replacedStr = replacedStr.replace(/medicare began in 1966+/gi, "MedicareBeganIn1966");

// Split based on newlines.
let lines = replacedStr.split("\n");
Expand Down
Loading

0 comments on commit 6c3c0fa

Please sign in to comment.