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

Adding field priloha3_r14_zdravotne #927

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions __tests__/testCases/baseInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { E2eTestUserInput } from '../../src/types/E2eTestUserInput'
export const baseInput: E2eTestUserInput = {
priloha3_r11_socialne: '1000',
priloha3_r13_zdravotne: '1000',
priloha3_r14_zdravotne: '1000',
r005_meno: 'Fake',
r004_priezvisko: 'Name',
r001_dic: '233123123',
Expand Down
1 change: 1 addition & 0 deletions __tests__/testCases/bugReport10Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const bugReport10Input: E2eTestUserInput = {
t1r10_prijmy: '9678.43',
priloha3_r11_socialne: '193.57',
priloha3_r13_zdravotne: '1742.12',
priloha3_r14_zdravotne: '1000000000',
zaplatenePreddavky: '36750.48',
employed: false,
hasChildren: true,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/calculation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export function calculate(input: TaxFormUserInput): TaxForm {
priloha3_r13_zdravotne: round(
new Decimal(parseInputNumber(input.priloha3_r13_zdravotne)),
),
priloha3_r14_zdravotne: round(
new Decimal(parseInputNumber(input.priloha3_r14_zdravotne)),
),

/** SECTION Dochodok */
platil_prispevky_na_dochodok: input?.platil_prispevky_na_dochodok ?? false,
Expand Down Expand Up @@ -835,6 +838,7 @@ export function calculate(input: TaxFormUserInput): TaxForm {
this.priloha3_r10_zdravotne,
this.priloha3_r11_socialne,
this.priloha3_r13_zdravotne,
this.priloha3_r14_zdravotne,
].every((x) => x.eq(0))
return priloha3Prazdna ? '' : this.datum
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/initialValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const incomeAndExpenseInitialValues: IncomeAndExpenseUserInput = {
t1r10_prijmy: '',
priloha3_r11_socialne: '',
priloha3_r13_zdravotne: '',
priloha3_r14_zdravotne: '',
zaplatenePreddavky: '',
}

Expand Down
3 changes: 3 additions & 0 deletions src/lib/xml/xmlConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ export function convertToJson(taxForm: TaxForm): OutputJson {
form.dokument.telo.socZdravPoistenie.pr13 = decimalToString(
taxForm.priloha3_r13_zdravotne,
)
form.dokument.telo.socZdravPoistenie.pr14 = decimalToString(
taxForm.priloha3_r14_zdravotne,
)

form.dokument.telo.socZdravPoistenie.datum = taxForm.socZdravPoistenieDatum

Expand Down
1 change: 1 addition & 0 deletions src/types/PageUserInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type IncomeAndExpenseUserInput = Pick<
| 't1r10_prijmy'
| 'priloha3_r11_socialne'
| 'priloha3_r13_zdravotne'
| 'priloha3_r14_zdravotne'
| 'zaplatenePreddavky'
>

Expand Down
2 changes: 2 additions & 0 deletions src/types/TaxForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export interface TaxForm {
priloha3_r11_socialne: Decimal
/** Preukázaeľne zaplatené poistné na zdravotné poistenie z príjmov*/
priloha3_r13_zdravotne: Decimal
/** TODO */
priloha3_r14_zdravotne: Decimal

/** Deti*/
r033?: Child[]
Expand Down
1 change: 1 addition & 0 deletions src/types/TaxFormUserInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface TaxFormUserInput {
t1r10_prijmy: string
priloha3_r11_socialne: string
priloha3_r13_zdravotne: string
priloha3_r14_zdravotne: string
zaplatenePreddavky?: string

/** SECTION Zamestnanie */
Expand Down
Loading