diff --git a/components/new/details.vue b/components/new/details.vue index 753178f..68a43c3 100644 --- a/components/new/details.vue +++ b/components/new/details.vue @@ -260,8 +260,6 @@ function generate() { this.errors = errors return } - - window.location.hash = 'new/summary' } export default { diff --git a/components/new/new.vue b/components/new/new.vue index e0b9ad8..1c0c160 100644 --- a/components/new/new.vue +++ b/components/new/new.vue @@ -93,7 +93,7 @@ const loans = [ Object.assign({}, example,), Object.assign( Object.assign({}, example), - {title: "Another One", mi: {}} + {title: "Another One", mi: {rate: 0}} ), ] @@ -146,27 +146,25 @@ function setPrice(value) { // Changes loan.ltv's and data() values, then syncs with data.amount function setLtv(e) { let ltv = strip(e) - let loan = this.loans[this.sel] if (!this.estimate.price) return if (ltv > 100) ltv = 100 if (ltv < 0) ltv = 0 - loan.ltv = ltv - loan.amount = (ltv / 100 * this.estimate.price).toFixed(2) + this.loan.ltv = ltv + this.loan.amount = (ltv / 100 * this.estimate.price).toFixed(2) } // Changes loan.amount\'s and data() values, then syncs with data.ltv function setAmount(e) { let amount = strip(e) - let loan = this.loans[this.sel] if (!this.estimate.price) return - if (amount > loan.price) amount = loan.price + if (amount > this.loan.price) amount = this.loan.price if (amount < 0) amount = 0 - loan.amount = amount - loan.ltv = (amount / this.estimate.price * 100).toFixed(2) + this.loan.amount = amount + this.loan.ltv = (amount / this.estimate.price * 100).toFixed(2) } function setDti(e) { @@ -197,7 +195,7 @@ function generate() { window.location.hash = 'new/summary' } -// Percentage values of fees always takek precedent over amounts. The conversion +// Percentage values of fees always take precedent over amounts. The conversion // happens in setPrice() export default { components: { LoanSummary, LoanDetails }, diff --git a/components/new/summary.vue b/components/new/summary.vue index 2b54f5b..adbdb3a 100644 --- a/components/new/summary.vue +++ b/components/new/summary.vue @@ -1,11 +1,11 @@ - + Monthly Payment - ${{totalMonthly}} Loan payment: ${{loanPayment.toFixed(2)}} - Mortgage insurance: ${{(loanPayment*loan.mi.rate/100).toFixed(2)}} + Mortgage insurance: ${{(loan.amount*loan.mi.rate/100/12).toFixed(2)}} Property taxes: ${{loan.tax}} @@ -13,10 +13,10 @@ Cash to Close - ${{totalMonthly}} Closing costs: ${{fees}} -Credits: ${{credits}} -Downpayment: ${{downpayment.toFixed(2)}} +Credits: ${{credits}} +Down payment: ${{downpayment.toFixed(2)}} - Mortgage insurance: ${{(loanPayment*loan.mi.rate).toFixed(2)}} + Mortgage insurance: ${{(loanPayment*loan.mi.rate/100).toFixed(2)}} @@ -30,16 +30,20 @@