Weighted Average Discount Rate Calculation Asc 842

Weighted Average Discount Rate (WADR) Calculator ASC 842 :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; padding-bottom: 50px; } .container { width: 100%; max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); display: flex; flex-direction: column; align-items: center; } h1, h2, h3 { color: var(–primary-color); text-align: center; } h1 { font-size: 2.2em; margin-bottom: 15px; } h2 { font-size: 1.8em; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { font-size: 1.4em; margin-top: 20px; margin-bottom: 10px; } .calculator-section { width: 100%; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); padding: 30px; margin-bottom: 30px; } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; } .input-group { display: flex; flex-direction: column; gap: 5px; } .input-group label { font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; width: 100%; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; } .error-message { color: red; font-size: 0.8em; margin-top: 5px; min-height: 1.2em; /* Prevent layout shift */ } .button-group { display: flex; gap: 15px; margin-top: 25px; justify-content: center; flex-wrap: wrap; } button { padding: 12px 25px; border: none; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; } button.primary { background-color: var(–primary-color); color: white; } button.primary:hover { background-color: #003366; transform: translateY(-1px); } button.secondary { background-color: #6c757d; color: white; } button.secondary:hover { background-color: #5a6268; transform: translateY(-1px); } button.reset { background-color: #ffc107; color: #212529; } button.reset:hover { background-color: #e0a800; transform: translateY(-1px); } .results-container { margin-top: 30px; padding: 25px; background-color: var(–primary-color); color: white; border-radius: 8px; text-align: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); } .results-container h3 { color: white; margin-bottom: 15px; } .primary-result { font-size: 2.5em; font-weight: bold; margin: 10px 0; display: block; padding: 10px; background-color: var(–success-color); border-radius: 5px; } .intermediate-results { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; } .intermediate-result-item { background-color: rgba(255, 255, 255, 0.15); padding: 10px 15px; border-radius: 5px; text-align: center; } .intermediate-result-item strong { display: block; font-size: 1.4em; } .intermediate-result-item span { font-size: 0.9em; opacity: 0.9; } .formula-explanation { margin-top: 20px; font-size: 0.95em; opacity: 0.9; text-align: left; border-top: 1px solid rgba(255, 255, 255, 0.3); padding-top: 15px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: var(–shadow); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #e9ecef; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } canvas { margin-top: 20px; border: 1px solid var(–border-color); border-radius: 4px; background-color: var(–card-background); } .chart-container { width: 100%; margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } .chart-container h3 { margin-bottom: 20px; } .article-content { width: 100%; margin-top: 30px; padding: 30px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); text-align: left; } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; font-size: 1.05em; } .article-content ul, .article-content ol { padding-left: 25px; } .article-content li { margin-bottom: 8px; } .article-content a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .article-content a:hover { text-decoration: underline; } .faq-item { margin-bottom: 15px; padding: 10px; border-left: 3px solid var(–primary-color); background-color: #f0f0f0; border-radius: 4px; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links li a { font-weight: bold; } .related-links li span { font-size: 0.9em; color: #555; display: block; margin-top: 3px; } .highlight { background-color: var(–success-color); color: white; padding: 2px 5px; border-radius: 3px; font-weight: bold; } .variable-table { margin-top: 20px; width: 100%; } .variable-table th, .variable-table td { padding: 8px 12px; text-align: left; border: 1px solid #ddd; } .variable-table th { background-color: #f2f2f2; font-weight: bold; } .variable-table td:nth-child(2), .variable-table td:nth-child(3), .variable-table td:nth-child(4) { text-align: center; } @media (min-width: 768px) { .container { padding: 30px; } .calculator-section, .article-content, .chart-container { padding: 40px; } h1 { font-size: 2.5em; } h2 { font-size: 2em; } }

Weighted Average Discount Rate (WADR) Calculator ASC 842

Accurately determine your WADR for lease accounting compliance.

WADR Calculator

The present value of all future lease payments.
The expected value of the asset at the end of the lease term.
Costs incurred by the lessor to originate a lease.
The total duration of the lease agreement in months.
The rate at which the lessee could obtain financing for a similar asset.
The original cost of the asset being leased.

Calculation Results

–.–%
Present Value of Lease Payments
Present Value of Residual Value
Present Value of Initial Direct Costs
Formula Used: The Weighted Average Discount Rate (WADR) is typically derived by finding the rate that equates the present value of the lease payments and the present value of the residual value to the net cost of the asset (asset cost minus initial direct costs). This is often an iterative process or solved using financial functions. For simplicity in this calculator, we approximate it by solving for 'r' in:

Net Asset Cost = PV(Lease Payments, r, n) + PV(Residual Value, r, n)

Where: Net Asset Cost = Asset Cost – Initial Direct Costs PV(Payments, r, n) = Present Value of an ordinary annuity PV(Residual, r, n) = Present Value of a single sum 'r' is the discount rate (WADR), and 'n' is the number of periods (lease term).

What is Weighted Average Discount Rate (WADR) ASC 842?

The Weighted Average Discount Rate (WADR), in the context of ASC 842 lease accounting standards, is a critical metric used by lessors to determine the appropriate discount rate for calculating the present value of future lease payments and residual values. This rate significantly impacts the net investment in the lease, which is the lessor's primary asset recognized on the balance sheet. Understanding and correctly calculating the WADR is essential for accurate financial reporting under the new lease accounting regime.

Who should use it? Primarily, lessors (companies that lease assets to others) are concerned with the WADR. This includes financial institutions, equipment leasing companies, and any entity that enters into lease agreements where they are the owner of the asset. Lessees (companies that lease assets) use their incremental borrowing rate or the rate implicit in the lease, but the WADR is a lessor-specific calculation.

Common misconceptions about the WADR include assuming it's the same as the lessee's incremental borrowing rate or simply using a company's overall cost of capital. While related, the WADR is specific to the individual lease transaction, considering the cash flows, asset characteristics, and the lessor's own financing costs or opportunities related to that specific lease.

WADR Formula and Mathematical Explanation

The core principle behind the WADR is to find the single rate that accurately reflects the time value of money and the risk associated with the lease cash flows. Under ASC 842, for a sales-type or direct financing lease, the lessor recognizes a net investment in the lease. This net investment is the present value of the lease payments receivable plus the present value of any expected residual amount, minus any initial direct costs incurred by the lessor.

The WADR is the rate that equates the initial net investment in the lease to the sum of the present values of the expected cash flows. Mathematically, the lessor seeks to find the rate 'r' (the WADR) that satisfies the following equation:

Net Investment = PV(Lease Payments) + PV(Residual Value)

Where:

  • Net Investment = Cost of the underlying asset – Initial direct costs incurred by the lessor.
  • PV(Lease Payments) = Present Value of all future lease payments, discounted at the WADR. This is typically calculated as the present value of an ordinary annuity if payments are made at the end of each period.
  • PV(Residual Value) = Present Value of the estimated residual value of the asset at the end of the lease term, discounted at the WADR. This is the present value of a single sum.

The formula for the present value of an ordinary annuity is:
PV = P * [1 – (1 + r)^-n] / r
Where P = periodic lease payment, r = discount rate (WADR), n = number of periods.

The formula for the present value of a single sum is:
PV = FV / (1 + r)^n
Where FV = future value (residual value), r = discount rate (WADR), n = number of periods.

Since the WADR is the unknown variable that makes the equation balance, it often requires an iterative calculation (like using Excel's RATE function or a financial calculator's IRR function) or a numerical method to solve precisely. The calculator above uses a numerical approximation method to find this rate.

Key Variables in WADR Calculation
Variable Meaning Unit Typical Range
Lease Payments (PV) Total present value of all payments the lessee is obligated to make over the lease term. Currency ($) Varies widely based on lease value
Estimated Residual Value The expected fair value of the leased asset at the end of the lease term. Currency ($) Typically 10-70% of asset cost
Initial Direct Costs Costs incurred by the lessor directly related to negotiating and finalizing a lease agreement. Currency ($) Usually a small percentage of asset cost
Lease Term (Months) The duration of the lease agreement. Months 12 to 60+ months
Incremental Borrowing Rate (%) The rate at which the lessee could obtain a loan for a similar asset. Used as a proxy if the implicit rate is unknown. Percentage (%) 2% to 15%+
Cost of Underlying Asset The original acquisition cost of the asset being leased by the lessor. Currency ($) Varies widely
Weighted Average Discount Rate (WADR) The calculated rate that equates the net investment to the present value of cash flows. Percentage (%) Often similar to IBR or implicit rate

Practical Examples (Real-World Use Cases)

Example 1: Equipment Lease

A company leases manufacturing equipment with the following terms:

  • Cost of Underlying Asset: $200,000
  • Initial Direct Costs: $8,000
  • Lease Term: 48 months
  • Total Lease Payments (PV): $180,000 (This is the sum of all future payments, already stated as PV for simplicity in this example, though typically calculated from periodic payments)
  • Estimated Residual Value: $25,000
  • Lessee's Incremental Borrowing Rate: 6.0%

Calculation:

Net Investment = $200,000 (Asset Cost) – $8,000 (IDC) = $192,000

The calculator would solve for 'r' where: $192,000 = PV(\$180,000, r, 48) + PV(\$25,000, r, 48)$.

Using the calculator, inputting these values yields a WADR of approximately 5.25%.

Financial Interpretation: The WADR of 5.25% represents the effective rate of return the lessor expects on their net investment in this lease. This rate is used for subsequent accounting measurements and disclosures.

Example 2: Vehicle Fleet Lease

A leasing company provides a fleet of vehicles:

  • Cost of Underlying Asset: $500,000
  • Initial Direct Costs: $15,000
  • Lease Term: 36 months
  • Total Lease Payments (PV): $450,000
  • Estimated Residual Value: $60,000
  • Lessee's Incremental Borrowing Rate: 7.5%

Calculation:

Net Investment = $500,000 (Asset Cost) – $15,000 (IDC) = $485,000

The calculator solves for 'r' in: $485,000 = PV(\$450,000, r, 36) + PV(\$60,000, r, 36)$.

Using the calculator, inputting these values results in a WADR of approximately 6.80%.

Financial Interpretation: The 6.80% WADR indicates the lessor's required rate of return for this fleet lease. If the implicit rate in the lease contract is significantly different, it might signal a need for review or adjustment.

How to Use This WADR Calculator ASC 842

Using this Weighted Average Discount Rate calculator is straightforward:

  1. Input Lease Details: Enter the known values for your lease agreement into the respective fields: Total Lease Payments (PV), Estimated Residual Value, Initial Direct Costs, Lease Term (in months), Lessee's Incremental Borrowing Rate, and Cost of Underlying Asset. Ensure you use accurate figures from your lease contracts and financial records.
  2. Review Helper Text: Each input field has accompanying helper text to clarify what information is required.
  3. Validate Inputs: The calculator performs inline validation. If you enter non-numeric data, negative values where inappropriate, or leave fields blank, an error message will appear below the relevant input. Correct these errors before proceeding.
  4. Calculate WADR: Click the "Calculate WADR" button.
  5. Interpret Results: The primary result, the Weighted Average Discount Rate (WADR), will be displayed prominently in percentage format. You will also see the intermediate values for the Present Value of Lease Payments, Present Value of Residual Value, and Present Value of Initial Direct Costs used in the calculation.
  6. Understand the Formula: A brief explanation of the underlying formula is provided to help you understand how the WADR is derived.
  7. Reset or Copy: Use the "Reset" button to clear the fields and start over with default values. Use the "Copy Results" button to copy the calculated WADR, intermediate values, and key assumptions to your clipboard for use in reports or other documents.

Decision-Making Guidance: The calculated WADR is crucial for lessors to ensure their net investment in the lease is accurately stated. It should align with the lessor's expectations of return and the risk profile of the lessee and the asset. Significant deviations from the lessee's incremental borrowing rate or market rates may warrant further investigation into the lease terms or the calculation inputs.

Key Factors That Affect WADR Results

Several factors influence the calculated Weighted Average Discount Rate (WADR) and the overall lease accounting:

  1. Lease Term: Longer lease terms generally introduce more uncertainty and risk, potentially leading to a higher WADR as the lessor demands greater compensation for the extended commitment.
  2. Creditworthiness of the Lessee: A lessee with a lower credit rating poses a higher risk of default. This increased risk typically necessitates a higher WADR to compensate the lessor.
  3. Asset Volatility and Residual Value Risk: Assets that are expected to depreciate rapidly or have uncertain residual values (e.g., rapidly evolving technology) increase the risk for the lessor. This uncertainty often translates into a higher WADR to account for potential losses on disposal.
  4. Market Interest Rates: The prevailing economic conditions and market interest rates significantly influence the WADR. If general borrowing costs rise, the WADR for new leases will likely increase as well.
  5. Lessor's Funding Costs: The lessor's own cost of capital or the rates at which they can borrow funds to acquire the leased asset serve as a baseline. The WADR must be sufficient to cover these costs and provide an adequate profit margin.
  6. Initial Direct Costs (IDCs): While IDCs are subtracted from the asset's cost to determine the net investment, the timing and magnitude of these costs can indirectly influence the effective yield, and thus the WADR calculation, especially in iterative solutions.
  7. Lease Structure and Payment Terms: The timing and amount of lease payments affect the present value calculations. Leases with back-loaded payments or significant balloon payments at the end might require different discount rate considerations.
  8. Inflation Expectations: Anticipated inflation can influence market interest rates, which in turn affect the WADR. Lessors may seek higher rates to ensure the real return on their investment is maintained.

Frequently Asked Questions (FAQ)

Q1: What is the difference between the WADR and the lessee's incremental borrowing rate (IBR)?

A1: The WADR is calculated by the lessor and reflects the rate used to determine the net investment in the lease. The lessee's IBR is the rate at which the lessee could obtain financing for a similar asset on a collateralized basis. While the lessee's IBR is often used by the lessee if the implicit rate is unknown, the WADR is specific to the lessor's perspective and the lease cash flows.

Q2: Can the WADR be the same as the rate implicit in the lease?

A2: Yes, if the lessor knows the rate implicit in the lease (the rate that equates the fair value of the asset to the present value of lease payments and residual value), that rate is generally used. The WADR calculation often aims to *find* this implicit rate or a close approximation, especially when dealing with direct financing or sales-type leases.

Q3: What happens if the lessor cannot determine the residual value reliably?

A3: If the residual value cannot be reliably estimated, the lessor may have to treat the entire lease as if it were a lease with no residual value, or potentially classify it differently. This significantly impacts the net investment calculation and the resulting WADR.

Q4: How often should the WADR be reassessed?

A4: The WADR is typically determined at the commencement of the lease and used for initial measurement. It is generally not reassessed unless there is a lease modification that requires remeasurement under ASC 842.

Q5: Does the WADR include the lessor's profit margin?

A5: The WADR reflects the time value of money and the risk associated with the lease cash flows. The lessor's profit is embedded within the lease payments and residual value assumptions, which, when discounted at the WADR, result in a net investment that yields the lessor's desired return.

Q6: Can I use this calculator for lessee accounting?

A6: No, this calculator is specifically designed for lessor accounting under ASC 842 to determine the Weighted Average Discount Rate. Lessees use different methodologies, primarily their incremental borrowing rate or the rate implicit in the lease if known and readily determinable.

Q7: What if the initial direct costs are very high?

A7: High initial direct costs reduce the lessor's net investment in the lease. This can potentially lead to a lower WADR if the lease payments and residual value remain constant, as the required return is spread over a smaller initial investment base.

Q8: How does ASC 842 change WADR calculations compared to previous standards?

A8: ASC 842 generally aligns lessor accounting more closely with revenue recognition principles. While the core concept of discounting cash flows remains, the classification of leases (sales-type, direct financing, operating) and the specific recognition and measurement guidance under ASC 842 necessitate careful application of discount rates like the WADR.

Lease Cash Flow vs. Net Investment

This chart illustrates the present value of expected lease cash flows (payments and residual value) compared to the lessor's net investment at the calculated WADR.

© 2023 Your Company Name. All rights reserved.

var leasePaymentsInput = document.getElementById('leasePayments'); var residualValueInput = document.getElementById('residualValue'); var initialDirectCostsInput = document.getElementById('initialDirectCosts'); var leaseTermMonthsInput = document.getElementById('leaseTermMonths'); var incrementalBorrowingRateInput = document.getElementById('incrementalBorrowingRate'); var assetCostInput = document.getElementById('assetCost'); var leasePaymentsError = document.getElementById('leasePaymentsError'); var residualValueError = document.getElementById('residualValueError'); var initialDirectCostsError = document.getElementById('initialDirectCostsError'); var leaseTermMonthsError = document.getElementById('leaseTermMonthsError'); var incrementalBorrowingRateError = document.getElementById('incrementalBorrowingRateError'); var assetCostError = document.getElementById('assetCostError'); var resultsContainer = document.getElementById('resultsContainer'); var primaryResult = document.getElementById('primaryResult'); var intermediatePV = document.getElementById('intermediatePV'); var intermediateFV = document.getElementById('intermediateFV'); var intermediateIDC = document.getElementById('intermediateIDC'); var chart = null; var ctx = document.getElementById('wadrChart').getContext('2d'); function validateInput(inputElement, errorElement, minValue, maxValue) { var value = parseFloat(inputElement.value); var isValid = true; errorElement.textContent = "; if (isNaN(value)) { errorElement.textContent = 'Please enter a valid number.'; isValid = false; } else if (inputElement.id === 'leaseTermMonths' && value <= 0) { errorElement.textContent = 'Lease term must be positive.'; isValid = false; } else if (value < 0 && inputElement.id !== 'residualValue') { // Allow residual value to be 0, but not negative payments or costs errorElement.textContent = 'Value cannot be negative.'; isValid = false; } else if (minValue !== undefined && value maxValue) { errorElement.textContent = 'Value cannot exceed ' + maxValue + '.'; isValid = false; } return isValid; } function calculateWADR() { var isValid = true; isValid &= validateInput(leasePaymentsInput, leasePaymentsError, 0); isValid &= validateInput(residualValueInput, residualValueError, 0); isValid &= validateInput(initialDirectCostsInput, initialDirectCostsError, 0); isValid &= validateInput(leaseTermMonthsInput, leaseTermMonthsError, 1); // Lease term must be at least 1 month isValid &= validateInput(incrementalBorrowingRateInput, incrementalBorrowingRateError, 0, 100); isValid &= validateInput(assetCostInput, assetCostError, 0); if (!isValid) { resultsContainer.style.display = 'none'; return; } var totalLeasePaymentsPV = parseFloat(leasePaymentsInput.value); var residualValue = parseFloat(residualValueInput.value); var initialDirectCosts = parseFloat(initialDirectCostsInput.value); var leaseTermMonths = parseInt(leaseTermMonthsInput.value); var incrementalBorrowingRatePercent = parseFloat(incrementalBorrowingRateInput.value); var assetCost = parseFloat(assetCostInput.value); var incrementalBorrowingRate = incrementalBorrowingRatePercent / 100.0; var netAssetCost = assetCost – initialDirectCosts; // — WADR Calculation (Iterative Approximation) — // We need to find 'r' such that: // netAssetCost = PV(totalLeasePaymentsPV, r, leaseTermMonths) + PV(residualValue, r, leaseTermMonths) // PV(Annuity) = P * [1 – (1 + r)^-n] / r // PV(Single Sum) = FV / (1 + r)^n var wadr = incrementalBorrowingRate; // Start with IBR as an initial guess var maxIterations = 100; var tolerance = 0.00001; var pvPayments = 0; var pvResidual = 0; var calculatedNetInvestment = 0; for (var i = 0; i < maxIterations; i++) { var rate = wadr; if (rate === 0) { // Avoid division by zero if rate is exactly 0 pvPayments = totalLeasePaymentsPV * leaseTermMonths; // Approximation for rate=0 } else { pvPayments = totalLeasePaymentsPV * (1 – Math.pow(1 + rate, -leaseTermMonths)) / rate; } pvResidual = residualValue / Math.pow(1 + rate, leaseTermMonths); calculatedNetInvestment = pvPayments + pvResidual; var difference = netAssetCost – calculatedNetInvestment; if (Math.abs(difference) < tolerance) { break; // Found a close enough rate } // Adjust the rate using a simple numerical method (e.g., secant method or similar logic) // This is a simplified adjustment; more robust methods exist. // If calculated investment is too high, we need a higher rate to decrease PV. // If calculated investment is too low, we need a lower rate to increase PV. wadr += difference / (netAssetCost / 10.0); // Simple adjustment factor, may need tuning if (wadr 1.0) wadr = 1.0; // Cap at 100% var finalWADRPercent = (wadr * 100.0).toFixed(2); // Update results display primaryResult.textContent = finalWADRPercent + '%'; intermediatePV.textContent = '$' + totalLeasePaymentsPV.toFixed(2); intermediateFV.textContent = '$' + residualValue.toFixed(2); intermediateIDC.textContent = '$' + initialDirectCosts.toFixed(2); resultsContainer.style.display = 'block'; updateChart(netAssetCost, totalLeasePaymentsPV, residualValue, wadr, leaseTermMonths); } function resetCalculator() { leasePaymentsInput.value = "100000"; residualValueInput.value = "10000"; initialDirectCostsInput.value = "5000"; leaseTermMonthsInput.value = "60"; incrementalBorrowingRateInput.value = "5.0"; assetCostInput.value = "110000"; leasePaymentsError.textContent = "; residualValueError.textContent = "; initialDirectCostsError.textContent = "; leaseTermMonthsError.textContent = "; incrementalBorrowingRateError.textContent = "; assetCostError.textContent = "; resultsContainer.style.display = 'none'; if (chart) { chart.destroy(); chart = null; } } function copyResults() { var resultText = "Weighted Average Discount Rate (WADR): " + primaryResult.textContent + "\n\n"; resultText += "Key Assumptions:\n"; resultText += "- Total Lease Payments (PV): $" + parseFloat(leasePaymentsInput.value).toFixed(2) + "\n"; resultText += "- Estimated Residual Value: $" + parseFloat(residualValueInput.value).toFixed(2) + "\n"; resultText += "- Initial Direct Costs: $" + parseFloat(initialDirectCostsInput.value).toFixed(2) + "\n"; resultText += "- Lease Term: " + leaseTermMonthsInput.value + " months\n"; resultText += "- Incremental Borrowing Rate: " + parseFloat(incrementalBorrowingRateInput.value).toFixed(2) + "%\n"; resultText += "- Cost of Underlying Asset: $" + parseFloat(assetCostInput.value).toFixed(2) + "\n\n"; resultText += "Intermediate Values:\n"; resultText += "- Present Value of Lease Payments: " + intermediatePV.textContent + "\n"; resultText += "- Present Value of Residual Value: " + intermediateFV.textContent + "\n"; resultText += "- Initial Direct Costs: " + intermediateIDC.textContent + "\n"; navigator.clipboard.writeText(resultText).then(function() { alert('Results copied to clipboard!'); }).catch(function(err) { console.error('Failed to copy results: ', err); alert('Failed to copy results. Please copy manually.'); }); } function updateChart(netInvestment, pvPayments, pvResidual, wadr, term) { if (chart) { chart.destroy(); } var labels = []; var pvPaymentsSeries = []; var pvResidualSeries = []; var netInvestmentSeries = []; // Representing the target value // Generate points for the chart // We'll show the PV of payments and residual value at different rates around the calculated WADR var rateStep = wadr / 5.0; // Smaller steps for smoother curve var startRate = Math.max(0, wadr – rateStep * 3); var endRate = wadr + rateStep * 3; for (var r = startRate; r <= endRate; r += rateStep) { if (r = startRate && wadr parseFloat(label); }); if (insertIndex === -1) insertIndex = labels.length; labels.splice(insertIndex, 0, label); pvPaymentsSeries.splice(insertIndex, 0, currentPvPayments); pvResidualSeries.splice(insertIndex, 0, currentPvResidual); netInvestmentSeries.splice(insertIndex, 0, netInvestment); } ctx.canvas.height = 300; // Set canvas height chart = new Chart(ctx, { type: 'line', data: { labels: labels, datasets: [{ label: 'PV of Lease Payments', data: pvPaymentsSeries, borderColor: 'rgba(0, 74, 153, 1)', backgroundColor: 'rgba(0, 74, 153, 0.2)', fill: false, tension: 0.1 }, { label: 'PV of Residual Value', data: pvResidualSeries, borderColor: 'rgba(40, 167, 69, 1)', backgroundColor: 'rgba(40, 167, 69, 0.2)', fill: false, tension: 0.1 }, { label: 'Net Investment (Target)', data: netInvestmentSeries, borderColor: 'rgba(255, 193, 7, 1)', backgroundColor: 'rgba(255, 193, 7, 0.2)', fill: false, borderDash: [5, 5], // Dashed line for target tension: 0.1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Present Value ($)' }, ticks: { callback: function(value, index, values) { return '$' + value.toLocaleString(); } } }, x: { title: { display: true, text: 'Discount Rate (%)' } } }, plugins: { tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += '$' + context.parsed.y.toLocaleString(); } return label; } } } } } }); } // Initial calculation on load if values are present document.addEventListener('DOMContentLoaded', function() { // Check if default values are set and calculate if (leasePaymentsInput.value && residualValueInput.value && initialDirectCostsInput.value && leaseTermMonthsInput.value && incrementalBorrowingRateInput.value && assetCostInput.value) { calculateWADR(); } });

Leave a Comment