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

Worked on issue #1215 #1456

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
8 changes: 7 additions & 1 deletion src/components/TaxPayer/PersonFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import ListItemText from '@material-ui/core/ListItemText'
import PersonIcon from '@material-ui/icons/Person'

export const labels = {
fname: 'First Name and Initial',
fname: 'First Name',
initial: 'Initial',

Choose a reason for hiding this comment

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

Would this be more clear if it was called 'Middle Initial'?

Copy link

Choose a reason for hiding this comment

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

Agreed, midInitial: 'Middle Initial' would likely be better naming for the key and the label.

lname: 'Last Name',
dateOfBirth: 'Date of Birth',
ssn: 'SSN / TIN'
Expand All @@ -40,6 +41,11 @@ export const PersonFields = ({
name="firstName"
required={true}
/>
<LabeledInput
autofocus={autofocus}
label={labels.initial}
name="initial"
/>
<LabeledInput label={labels.lname} name="lastName" required={true} />
<LabeledInput
label={labels.ssn}
Expand Down
2 changes: 2 additions & 0 deletions src/components/TaxPayer/SpouseAndDependent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { intentionallyFloat } from 'ustaxes/core/util'

interface UserPersonForm {
firstName: string
initial: string
lastName: string
ssid: string
isBlind: boolean
Expand All @@ -44,6 +45,7 @@ interface UserPersonForm {

const blankUserPersonForm: UserPersonForm = {
firstName: '',
initial: '',
lastName: '',
ssid: '',
isBlind: false,
Expand Down
3 changes: 3 additions & 0 deletions src/components/TaxPayer/TaxPayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { intentionallyFloat } from 'ustaxes/core/util'

interface TaxPayerUserForm {
firstName: string
initial: string
lastName: string
ssid: string
contactPhoneNumber?: string
Expand All @@ -47,6 +48,7 @@ interface TaxPayerUserForm {

const defaultTaxpayerUserForm: TaxPayerUserForm = {
firstName: '',
initial: '',
lastName: '',
ssid: '',
contactPhoneNumber: '',
Expand All @@ -72,6 +74,7 @@ const asPrimaryPerson = (formData: TaxPayerUserForm): PrimaryPerson<string> => {
return {
address: formData.address,
firstName: formData.firstName,
initial: formData.initial,
lastName: formData.lastName,
ssid: formData.ssid.replace(/-/g, ''),
isTaxpayerDependent: formData.isTaxpayerDependent,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Y2021/AdvanceChildTaxCredit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const AdvanceChildTaxCredit = (): ReactElement => {
}
name="recipient"
keyMapping={(p: Person, i: number) => i}
textMapping={(p) => `${p.firstName} ${p.lastName}`}
textMapping={(p) => `${p.firstName} ${p.initial} ${p.lastName}`}
/>
</Grid>
</FormListContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/components/income/F1099Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export default function F1099Info(): ReactElement {
name="personRole"
keyMapping={(p: Person, i: number) => i}
textMapping={(p: Person) =>
`${p.firstName} ${p.lastName} (${formatSSID(p.ssid)})`
`${p.firstName} ${p.initial} ${p.lastName} (${formatSSID(p.ssid)})`
}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/income/PartnershipIncome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const PartnershipIncome = (): ReactElement => {
name="personRole"
keyMapping={(p: Person, i: number) => i}
textMapping={(p) =>
`${p.firstName} ${p.lastName} (${formatSSID(p.ssid)})`
`${p.firstName} ${p.initial} ${p.lastName} (${formatSSID(p.ssid)})`
}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/income/W2JobInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export default function W2JobInfo(): ReactElement {
name="personRole"
keyMapping={(p: Person, i: number) => i}
textMapping={(p) =>
`${p.firstName} ${p.lastName} (${formatSSID(p.ssid)})`
`${p.firstName} ${p.initial} ${p.lastName} (${formatSSID(p.ssid)})`
}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/savingsAccounts/IRA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function IRA(): ReactElement {
name="personRole"
keyMapping={(p: Person, i: number) => i}
textMapping={(p: Person) =>
`${p.firstName} ${p.lastName} (${formatSSID(p.ssid)})`
`${p.firstName} ${p.initial} ${p.lastName} (${formatSSID(p.ssid)})`
}
/>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/savingsAccounts/healthSavingsAccounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function HealthSavingsAccounts(): ReactElement {
name="personRole"
keyMapping={(p: Person, i: number) => i}
textMapping={(p: Person) =>
`${p.firstName} ${p.lastName} (${formatSSID(p.ssid)})`
`${p.firstName} ${p.initial} ${p.lastName} (${formatSSID(p.ssid)})`
}
/>
<DatePicker
Expand Down
1 change: 1 addition & 0 deletions src/core/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum PersonRole {
*/
export interface Person<D = Date> {
firstName: string
initial: string
lastName: string
ssid: string
role: PersonRole
Expand Down
4 changes: 3 additions & 1 deletion src/core/tests/arbitraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export const filingStatus: Arbitrary<types.FilingStatus> = fc.constantFrom(

export const person: Arbitrary<types.Person> = fc
.tuple(
word,
word,
word,
ein,
Expand All @@ -384,8 +385,9 @@ export const person: Arbitrary<types.Person> = fc
max: new Date()
})
)
.map(([firstName, lastName, ssid, isBlind, dateOfBirth]) => ({
.map(([firstName, initial, lastName, ssid, isBlind, dateOfBirth]) => ({
firstName,
initial,
lastName,
ssid,
isBlind,
Expand Down
6 changes: 4 additions & 2 deletions src/forms/F1040Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export default abstract class F1040Base extends Form {
.filter((p: Person | undefined) => p !== undefined)
.map((p: Person | undefined) => p as Person)

return ps.map((p: Person) => `${p.firstName} ${p.lastName}`).join(', ')
return ps
.map((p: Person) => `${p.firstName} ${p.initial} ${p.lastName}`)
.join(', ')
}

k1sWithInterest = (): ScheduleK1Form1065[] =>
Expand All @@ -116,7 +118,7 @@ export default abstract class F1040Base extends Form {
this.f1099sByType(Income1099Type.SSA) as Income1099SSA[]

fullName = (person: Person): string =>
`${person.firstName} ${person.lastName}`
`${person.firstName} ${person.initial} ${person.lastName}`

primaryFullName = (): string | undefined =>
this.fullName(this.info.taxPayer.primaryPerson)
Expand Down
4 changes: 4 additions & 0 deletions src/forms/Y2020/irsForms/F1040.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,15 @@ export default class F1040 extends F1040Base {
// TODO: implement non dependent child for HOH and QW
this.info.taxPayer.filingStatus === 'MFS' ? this.spouseFullName() : '',
this.info.taxPayer.primaryPerson.firstName,
this.info.taxPayer.primaryPerson.initial,
this.info.taxPayer.primaryPerson.lastName,
this.info.taxPayer.primaryPerson.ssid,
this.info.taxPayer.filingStatus === FilingStatus.MFJ
? this.info.taxPayer.spouse?.firstName
: '',
this.info.taxPayer.filingStatus === FilingStatus.MFJ
? this.info.taxPayer.spouse?.initial
: '',
this.info.taxPayer.filingStatus === FilingStatus.MFJ
? this.info.taxPayer.spouse?.lastName ?? ''
: '',
Expand Down
2 changes: 2 additions & 0 deletions src/forms/Y2020/irsForms/F1040v.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ export default class F1040V extends F1040Attachment {
Math.trunc(taxOwed), // dollars
Math.round((taxOwed - Math.trunc(taxOwed)) * 100), // cents
tp.primaryPerson.firstName,
tp.primaryPerson.initial,
tp.primaryPerson.lastName,
tp.spouse?.firstName,
tp.spouse?.initial,
tp.spouse?.lastName,
tp.primaryPerson.address.address,
tp.primaryPerson.address.aptNo,
Expand Down
2 changes: 1 addition & 1 deletion src/forms/Y2020/irsForms/F8889.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default class F8889 extends F1040Attachment {
l21 = (): number => Math.round(this.l20() * 0.1)

fields = (): Field[] => [
`${this.person.firstName} ${this.person.lastName}`,
`${this.person.firstName} ${this.person.initial} ${this.person.lastName}`,
this.person.ssid,
this.calculatedCoverageType === 'self-only', // line 1: self-only check box
this.calculatedCoverageType === 'family', // line 1: family checkbox
Expand Down
2 changes: 1 addition & 1 deletion src/forms/Y2020/irsForms/ScheduleEIC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export default class ScheduleEIC extends F1040Attachment {
// EIC line 1
nameFields = (): Array<string | undefined> =>
this.qualifyingDependentsFilled().map(
(d) => `${d?.firstName ?? ''} ${d?.lastName ?? ''}`
(d) => `${d?.firstName ?? ''} ${d?.initial ?? ''} ${d?.lastName ?? ''}`
)

// EIC line 2
Expand Down
17 changes: 16 additions & 1 deletion src/forms/Y2020/stateForms/IL/IL1040.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,19 @@ export class IL1040 extends Form {
}
payment = (): number | undefined => this.l39()

/**
* Index 81: initial1
*/
initial = (): string | undefined => this.info.taxPayer.primaryPerson.initial

f79 = (): string | undefined => this.initial()

/**
* Index 82: initial2
*/
initial2 = (): string | undefined => this.info.taxPayer.spouse?.initial

f80 = (): string | undefined => this.initial2()
// Signature block fields omitted

fields = (): Field[] => [
Expand Down Expand Up @@ -704,7 +717,9 @@ export class IL1040 extends Form {
this.f77(),
this.f78(),
this.l38(),
this.l39()
this.l39(),
this.f79(),
this.f80()
]
}

Expand Down
96 changes: 94 additions & 2 deletions src/forms/Y2020/stateForms/IL/IL1040ScheduleILEIC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export class IL1040scheduleileeic extends Form {
* Index 4: Your name
*/
Yourname = (): string | undefined =>
[this.primary?.firstName, this.primary?.lastName].flat().join(' ')
[this.primary?.firstName, this.primary?.initial, this.primary?.lastName]
.flat()
.join(' ')

f4 = (): string | undefined => this.Yourname()

Expand Down Expand Up @@ -1648,6 +1650,86 @@ export class IL1040scheduleileeic extends Form {

f185 = (): string | undefined => this.YourSSN4()

/**
* Index 5: Dependents initial - 1
*/
Dependentsinitial1 = (): string | undefined =>
this.info.taxPayer.dependents[0]?.initial

f186 = (): string | undefined => this.Dependentsinitial1()

/**
* Index 6: Dependent's initial - 2
*/
Dependentsinitial2 = (): string | undefined =>
this.info.taxPayer.dependents[1]?.initial

f187 = (): string | undefined => this.Dependentsinitial2()

/**
* Index 7: Dependent's initial - 3
*/
Dependentsinitial3 = (): string | undefined =>
this.info.taxPayer.dependents[2]?.initial

f188 = (): string | undefined => this.Dependentsinitial3()

/**
* Index 8: Dependent's initial - 4
*/
Dependentsinitial4 = (): string | undefined =>
this.info.taxPayer.dependents[3]?.initial

f189 = (): string | undefined => this.Dependentsinitial4()

/**
* Index 9: Dependent's initial - 5
*/
Dependentsinitial5 = (): string | undefined =>
this.info.taxPayer.dependents[4]?.initial

f190 = (): string | undefined => this.Dependentsinitial5()

/**
* Index 10: Dependent's initial - 6
*/
Dependentsinitial6 = (): string | undefined =>
this.info.taxPayer.dependents[5]?.initial

f191 = (): string | undefined => this.Dependentsinitial6()

/**
* Index 11: Dependent's initial - 7
*/
Dependentsinitial7 = (): string | undefined =>
this.info.taxPayer.dependents[6]?.initial

f192 = (): string | undefined => this.Dependentsinitial7()

/**
* Index 12: Dependent's initial - 8
*/
Dependentsinitial8 = (): string | undefined =>
this.info.taxPayer.dependents[7]?.initial

f193 = (): string | undefined => this.Dependentsinitial8()

/**
* Index 13: Dependent's initial - 9
*/
Dependentsinitial9 = (): string | undefined =>
this.info.taxPayer.dependents[8]?.initial

f194 = (): string | undefined => this.Dependentsinitial9()

/**
* Index 14: Dependent's initial - 10
*/
Dependentsinitial10 = (): string | undefined =>
this.info.taxPayer.dependents[9]?.initial

f195 = (): string | undefined => this.Dependentsinitial10()

fields = (): Field[] => [
this.f0(),
this.f1(),
Expand Down Expand Up @@ -1834,7 +1916,17 @@ export class IL1040scheduleileeic extends Form {
this.f182(),
this.f183(),
this.f184(),
this.f185()
this.f185(),
this.f186(),
this.f187(),
this.f188(),
this.f189(),
this.f190(),
this.f191(),
this.f192(),
this.f193(),
this.f194(),
this.f195()
]
}

Expand Down
18 changes: 17 additions & 1 deletion src/forms/Y2020/stateForms/IL/IL1040V.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ export default class IL1040V extends Form {

f18 = (): string | undefined => this.scanline()

/**
* Index 19: Initial
*/
Initial = (): string | undefined => this.info.taxPayer.primaryPerson.initial

f19 = (): string | undefined => this.Initial()

/**
* Index 20: SpouseInitial
*/
SpouseInitial = (): string | undefined => this.info.taxPayer.spouse?.initial

f20 = (): string | undefined => this.SpouseInitial()

fields = (): Field[] => [
this.f0(),
this.f1(),
Expand All @@ -203,6 +217,8 @@ export default class IL1040V extends Form {
this.f15(),
this.f16(),
this.f17(),
this.f18()
this.f18(),
this.f19(),
this.f20()
]
}
Loading