|
|
@@ -31,12 +31,12 @@ class="bi bi-plus" viewBox="0 0 16 16"> <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 |
|
|
|
@del="del" |
|
|
|
@update:borrowerNum="(b) => estimate.borrower.num = b" |
|
|
|
@update:borrowerCredit="(c) => estimate.borrower.credit = c" |
|
|
|
@update:borrowerIncome="(m) => estimate.borrower.income = m" |
|
|
|
@update:borrowerIncome="(m) => estimate.borrower.income = m*100" |
|
|
|
@update:transaction="(t) => estimate.transaction = t" |
|
|
|
@update:price="setPrice" |
|
|
|
@update:property="(p) => estimate.property = p" |
|
|
|
|
|
|
|
@update:loanType="(lt) => loan.type.id = lt" |
|
|
|
@update:loanType="changeLoanType" |
|
|
|
@update:term="(lt) => loan.term = lt" |
|
|
|
@update:program="(p) => loans[sel].program = p" |
|
|
|
@update:ltv="setLtv" |
|
|
@@ -135,7 +135,7 @@ function del() { |
|
|
|
function setPrice(value) { |
|
|
|
this.estimate.price = Math.round(value*100) |
|
|
|
this.estimate.loans[this.sel].fees.forEach(fee => { |
|
|
|
if (fee.perc) fee.amount = (fee.perc / 100 * value).toFixed(2) |
|
|
|
if (fee.perc) fee.amount = Math.round(fee.perc * value) |
|
|
|
}) |
|
|
|
this.estimate.loans.forEach(l => {l.ltv = 0; l.amount = 0}) |
|
|
|
} |
|
|
@@ -192,6 +192,29 @@ function setHousingDti(e) { |
|
|
|
loan.housingDti = housingDti |
|
|
|
} |
|
|
|
|
|
|
|
function changeLoanType(id) { |
|
|
|
if (id == this.loan.type.id) return |
|
|
|
|
|
|
|
// Set mandatory upfront MIP in fees if type is FHA |
|
|
|
let i = this.loan.fees.findIndex( |
|
|
|
l => l.required && l.name == "FHA Upfront MIP" |
|
|
|
) |
|
|
|
if (id == 2) { |
|
|
|
this.loan.fees.push({ |
|
|
|
amount: Math.round(this.estimate.price*1.75/100), |
|
|
|
perc: 1.75, |
|
|
|
name: "FHA Upfront MIP", |
|
|
|
type: "Required", |
|
|
|
id: 0, |
|
|
|
required: true |
|
|
|
}) |
|
|
|
} else if (i >= 0) { |
|
|
|
this.loan.fees.splice(i, 1) |
|
|
|
} |
|
|
|
|
|
|
|
this.loan.type.id = id |
|
|
|
} |
|
|
|
|
|
|
|
function generate() { |
|
|
|
window.location.hash = 'new/summary' |
|
|
|
} |
|
|
@@ -202,7 +225,7 @@ export default { |
|
|
|
components: { LoanSummary, LoanDetails }, |
|
|
|
methods: { |
|
|
|
generate, createFees, del, create, setPrice, setLtv, setAmount, |
|
|
|
setDti, setHousingDti |
|
|
|
setDti, setHousingDti, changeLoanType |
|
|
|
}, |
|
|
|
computed: { loan }, |
|
|
|
props: ['user', 'fees', 'token'], |
|
|
|