Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuiantw1212 committed May 10, 2024
1 parent e127011 commit e3d82d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/calculator/career/government.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ function calculatePension() {
career.value.pension.monthlyContribution = monthlyContributionEmployee + monthlyContributionGovernment
} else {
career.value.pension.monthlyContribution = 0
career.value.insurance.salary = 0
}
}
function calculateHealthInsurance() {
Expand Down
12 changes: 11 additions & 1 deletion components/calculator/retirement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const isFormDisabled = computed(() => {
return !lifeExpectancy || !monthlyBasicSalary
})
const unableToDraw = computed(() => {
const { monthlyBasicSalary } = props.career
const {
irrOverDecade
} = retirement.value.pension
Expand All @@ -315,9 +316,10 @@ const unableToDraw = computed(() => {
lifeExpectancy,
annualExpense,
} = retirement.value
const noIncome = !monthlyBasicSalary
const noBefore = !irrOverDecade || !yearToRetirement
const noAfter = !lifeExpectancy || !annualExpense
return noBefore || noAfter
return noIncome || noBefore || noAfter
})
// methods
function calculateRetirement(options: any = { propagate: true }) {
Expand Down Expand Up @@ -355,8 +357,16 @@ function calculateCivilServantRetirement() {
const { futureSeniority, } = retirement.value.insurance
const { type, } = retirement.value.pension
const { salary } = props.career.insurance
console.log({
name: 'why?',
futureSeniority,
type,
salary,
test: retirement.value.pension.monthlyAnnuity
})
if (!futureSeniority || !salary || !type) {
retirement.value.pension.monthlyAnnuity = 0
// career.value.insurance.salary = 0
return
}
/**
Expand Down

0 comments on commit e3d82d3

Please sign in to comment.