Skip to content

Commit

Permalink
fix(inheritance-report): fixes EFS 7.06 (#15145)
Browse files Browse the repository at this point in the history
* fix(inheritance-report): fixes EFS 7.06

* tweaks

* dateofbirth in overview

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
albinagu and kodiakhq[bot] authored Jun 7, 2024
1 parent e0f4b99 commit bdc72a9
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ export const AdditionalHeir = ({
/>
</GridColumn>
) : customField.id === 'taxFreeInheritance' &&
((values.applicationFor === PREPAID_INHERITANCE &&
currentHeir?.relation !== RelationSpouse) ||
values.applicationFor === ESTATE_INHERITANCE) ? null : (
values.applicationFor === PREPAID_INHERITANCE &&
currentHeir?.relation !== RelationSpouse ? null : (
<GridColumn span={['1/2']} paddingBottom={2}>
<InputController
id={`${fieldIndex}.${customField.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
PREPAID_INHERITANCE,
RelationSpouse,
} from '../../lib/constants'
import format from 'date-fns/format'

export const HeirsOverview: FC<React.PropsWithChildren<FieldBaseProps>> = ({
application,
Expand All @@ -22,6 +23,7 @@ export const HeirsOverview: FC<React.PropsWithChildren<FieldBaseProps>> = ({
return (
<Box>
{heirs?.map((heir, index) => {
console.log(heir)
const showTaxFree =
answers.applicationFor === ESTATE_INHERITANCE ||
(answers.applicationFor === PREPAID_INHERITANCE &&
Expand All @@ -31,12 +33,22 @@ export const HeirsOverview: FC<React.PropsWithChildren<FieldBaseProps>> = ({
return (
<Box key={index} marginTop={index === 0 ? 3 : 6}>
<Text marginBottom={2} variant="h4">
{formatMessage(m.heir)}
{formatMessage(m.heir) + ' ' + (index + 1)}
</Text>
<Box display="flex" marginBottom={2}>
<Box width="half">
<Text variant="h4">{formatMessage(m.nationalId)}</Text>
<Text>{formatNationalId(heir.nationalId ?? '')}</Text>
<Text variant="h4">
{formatMessage(
heir.foreignCitizenship?.length
? m.dateOfBirth
: m.nationalId,
)}
</Text>
<Text>
{heir.foreignCitizenship?.length
? format(new Date(heir.dateOfBirth ?? ''), 'dd.MM.yyyy')
: formatNationalId(heir.nationalId ?? '')}
</Text>
</Box>
<Box width="half">
<Text variant="h4">{formatMessage(m.name)}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,24 +413,7 @@ export const ReportFieldsRepeater: FC<
value: type.value,
}))}
backgroundColor="blue"
/> /* Commenting out for testing purposes of this field
: field.id === 'exchangeRateOrInterest' ? (
<NumberInput
name={`${fieldIndex}.${field.id}`}
placeholder={field.placeholder}
onAfterChange={() => {
updateValue(fieldIndex)
calculateTotal()
setIndex(fieldIndex)
}}
label={
formatMessage(
parseLabel(field.title, application.answers),
) ?? ''
}
/>
)*/
) : (
<InputController
id={`${fieldIndex}.${field.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,22 @@ export const debtsAndFuneralCost = buildSection({
sumField: 'propertyValuation',
selections: [
{
label: m.debtOverDraft,
value: DebtTypes.Overdraft,
label: DebtTypes.Overdraft,
},
{
label: m.debtCreditCard,
value: DebtTypes.CreditCard,
label: DebtTypes.CreditCard,
},
{
label: m.debtLoan,
value: DebtTypes.Loan,
label: DebtTypes.Loan,
},
{
label: m.debtInsuranceCompany,
value: DebtTypes.InsuranceCompany,
label: DebtTypes.InsuranceCompany,
},
{
label: m.debtPropertyFees,
value: DebtTypes.PropertyFees,
label: DebtTypes.PropertyFees,
},
{
label: DebtTypes.PropertyFees,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export const heirs = buildSection({
buildDescriptionField({
id: 'heirsAdditionalInfoFilesPrivateTitle',
title: m.fileUploadPrivateTransfer,
description: m.uploadPrivateTransferUserGuidelines,
titleVariant: 'h5',
space: 'containerGutter',
marginBottom: 'smallGutter',
Expand All @@ -178,6 +179,7 @@ export const heirs = buildSection({
buildDescriptionField({
id: 'heirsAdditionalInfoFilesOtherDocumentsTitle',
title: m.fileUploadOtherDocuments,
description: m.uploadOtherDocumentsUserGuidelines,
titleVariant: 'h5',
space: 'containerGutter',
marginBottom: 'smallGutter',
Expand Down Expand Up @@ -210,23 +212,6 @@ export const heirs = buildSection({
space: 'gutter',
marginBottom: 'gutter',
}),
buildKeyValueField({
label: m.netProperty,
display: 'flex',
value: ({ answers }) =>
formatCurrency(
String(
roundedValueToNumber(
getValueViaPath<number>(answers, 'netTotal'),
),
),
),
}),
buildDescriptionField({
id: 'space',
title: '',
space: 'gutter',
}),
buildKeyValueField({
label: m.totalDeduction,
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ export const prePaidHeirs = buildSection({
buildDescriptionField({
id: 'heirsAdditionalInfoFilesOtherDocumentsTitle',
title: m.fileUploadOtherDocumentsPrePaid,
description: m.fileUploadOtherDocumentsPrePaidUserGuidelines,
titleVariant: 'h5',
space: 'containerGutter',
marginBottom: 'smallGutter',
}),
buildFileUploadField({
id: 'heirsAdditionalInfoFilesOtherDocuments',
uploadAccept: '.pdf, .doc, .docx, .jpg, .jpeg, .png, .xls, .xlsx',
uploadDescription: m.fileUploadOtherDocumentsPrePaid,
uploadDescription: m.fileUploadOtherDocumentsPrePaidDescription,
title: '',
uploadHeader: '',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export const inheritance = buildSection({
options: [
{
value: YES,
label: m.realEstate,
subLabel: m.realEstateDescription,
label: m.realEstateRepeaterHeader,
},
],
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const prepaidOverview = buildSubSection({
marginBottom: 'gutter',
}),
buildKeyValueField({
label: m.netProperty,
label: m.netPropertyForExchange,
display: 'flex',
value: ({ answers }) =>
formatCurrency(
Expand Down
54 changes: 29 additions & 25 deletions libs/application/templates/inheritance-report/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export const m = defineMessages({
defaultMessage: 'Nafn',
description: '',
},
dateOfBirth: {
id: 'ir.application:dateOfBirth',
defaultMessage: 'Fæðingardagur',
description: '',
},
nationalId: {
id: 'ir.application:nationalId',
defaultMessage: 'Kennitala',
Expand Down Expand Up @@ -970,31 +975,6 @@ export const m = defineMessages({
defaultMessage: 'Tegund skuldar',
description: '',
},
debtOverDraft: {
id: 'ir.application:debtOverDraft',
defaultMessage: 'Yfirdráttur',
description: 'Selection for debts: Overdraft',
},
debtCreditCard: {
id: 'ir.application:debtCreditCard',
defaultMessage: 'Kreditkort',
description: 'Selection for debts: Credit card',
},
debtLoan: {
id: 'ir.application:debtLoan',
defaultMessage: 'Lán',
description: 'Selection for debts: Loan',
},
debtInsuranceCompany: {
id: 'ir.application:debtInsuranceCompany',
defaultMessage: 'Tryggingastofnun',
description: 'Selection for debts: Insurance company',
},
debtPropertyFees: {
id: 'ir.application:debtPropertyFees',
defaultMessage: 'Fasteignagjöld',
description: 'Selection for debts: Property fees',
},
creditorsNationalId: {
id: 'ir.application:creditorsNationalId',
defaultMessage: 'Kennitala',
Expand Down Expand Up @@ -1549,18 +1529,42 @@ export const m = defineMessages({
defaultMessage: 'Fylgigögn',
description: '',
},
fileUploadOtherDocumentsPrePaidDescription: {
id: 'ir.application:fileUploadOtherDocumentsPrePaidDescription',
defaultMessage:
'Samþykktar skráargerðir eru .pdf, .doc, .docx, .jpg, .jpeg, .png, .xls og .xlsx',
description: '',
},
fileUploadOtherDocumentsPrePaidUserGuidelines: {
id: 'ir.application:fileUploadOtherDocumentsPrePaidUserGuidelines#markdown',
defaultMessage:
'Vinsamlegast hlaðið upp önnur fylgigögn. Hægt að hlaða inn fleiri en eitt skjal.',
description: '',
},
uploadPrivateTransferDescription: {
id: 'ir.application:uploadPrivateTransferDescription',
defaultMessage:
'Samþykktar skráargerðir eru .pdf, .doc, .docx, .jpg, .jpeg, .png, .xls og .xlsx',
description: '',
},
uploadPrivateTransferUserGuidelines: {
id: 'ir.application:uploadPrivateTransferUserGuidelines#markdown',
defaultMessage:
'Vinsamlegast hlaðið upp einkaskiptagerð. Aðeins er hægt að hlaða inn 1 skjal.',
description: '',
},
uploadOtherDocumentsDescription: {
id: 'ir.application:uploadOtherDocumentsDescription',
defaultMessage:
'Samþykktar skráargerðir eru .pdf, .doc, .docx, .jpg, .jpeg, .png, .xls og .xlsx',
description: '',
},
uploadOtherDocumentsUserGuidelines: {
id: 'ir.application:uploadOtherDocumentsUserGuidelines#markdown',
defaultMessage:
'Vinsamlegast hlaðið upp önnur fylgigögn. Hægt að hlaða inn fleiri 1 skjal.',
description: '',
},
heirShare: {
id: 'ir.application:heirShare',
defaultMessage: 'Arfur og erfðafjárskattur',
Expand Down
11 changes: 6 additions & 5 deletions libs/application/templates/inheritance-report/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,10 @@ export interface EstateMember {
export const heirAgeValidation = 'heirAgeValidation'

export enum DebtTypes {
Overdraft = 'overdraft',
CreditCard = 'creditCard',
Loan = 'loan',
InsuranceCompany = 'insuranceCompany',
PropertyFees = 'propertyFees',
Overdraft = 'Yfirdráttur',
CreditCard = 'Kreditkort',
Loan = 'Lán',
InsuranceCompany = 'Tryggingafélag',
PropertyFees = 'Fastagjöld',
OtherDebts = 'Aðrar skuldir',
}

0 comments on commit bdc72a9

Please sign in to comment.