-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (74 loc) · 4.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
document.addEventListener('DOMContentLoaded', function() {
const form = document.getElementById('calculator-form');
const resultsContainer = document.getElementById('results');
const rappicuentaMsg = document.getElementById('rappicuenta-msg');
const generateRappicuentaBtn = document.getElementById('generate-rappicuenta-btn');
const calculateBtn = document.getElementById('calculate-btn');
form.addEventListener('submit', function(event) {
event.preventDefault();
});
calculateBtn.addEventListener('click', function() {
const product = form.product.value;
const balance = parseFloat(form.balance.value);
const term = parseInt(form.term.value);
const averageBalance = document.getElementById('average-balance');
const profitability = document.getElementById('profitability');
const profitabilityCOP = document.getElementById('profitability-cop');
const monthlyProfitabilityCOP = document.getElementById('monthly-profitability-cop');
let interestRate = 0;
let profitabilityPercentage = 0;
let profitabilityCOPValue = 0;
let monthlyProfitabilityCOPValue = 0;
let retentionValue = 0;
if (product === 'ahorros') {
interestRate = balance < 2000000 ? 0.07 : 0.10;
} else if (product === 'deposito') {
interestRate = balance < 9900000 ? 0.07 : NaN;
}
if (!isNaN(interestRate)) {
profitabilityPercentage = parseInt(interestRate * 100);
profitabilityCOPValue = (balance * (profitabilityPercentage / 100)).toFixed(2);
monthlyProfitabilityCOPValue = ((profitabilityPercentage / 12) * balance).toFixed(2);
// Verificar si profitabilityCOPValue es mayor a 2588 para aplicar la retención
if (parseFloat(profitabilityCOPValue) > 2588) {
retentionValue = (monthlyProfitabilityCOPValue * 0.07).toFixed(2); // Retención del 7% sobre la rentabilidad mensual
monthlyProfitabilityCOPValue -= retentionValue; // Restar la retención mensual
}
averageBalance.textContent = `Saldo Promedio: $${balance.toLocaleString('es-CO')}`;
profitability.textContent = `Rentabilidad en %: ${profitabilityPercentage}%`;
profitabilityCOP.textContent = `Rentabilidad en COP: $${parseFloat(profitabilityCOPValue).toLocaleString('es-CO')}`;
monthlyProfitabilityCOP.textContent = `Rentabilidad mensual en COP: $${parseFloat(monthlyProfitabilityCOPValue).toLocaleString('es-CO')}`;
resultsContainer.classList.remove('hidden');
rappicuentaMsg.classList.add('hidden');
calculateBtn.textContent = 'Recalcular';
} else {
resultsContainer.classList.add('hidden');
rappicuentaMsg.classList.remove('hidden');
}
});
generateRappicuentaBtn.addEventListener('click', function() {
window.location.href = "https://rappi.onelink.me/2373836517/esm0oofo";
});
});
if (!isNaN(interestRate)) {
profitabilityPercentage = parseInt(interestRate * 100);
profitabilityCOPValue = ((balance * ((profitabilityPercentage / 100)/12))).toFixed(2);
monthlyProfitabilityCOPValue = ((profitabilityCOPValue * term)).toFixed(2);
// Verificar si profitabilityCOPValue es mayor a 2588 para aplicar la retención
if (parseFloat(profitabilityCOPValue) > 2588) {
retentionValue = (profitabilityCOPValue * 0.07).toFixed(2); // Retención del 7% sobre la rentabilidad mensual
profitabilityCOPValue -= retentionValue; // Restar la retención mensual
}
</script>
</body>
</html>
<span class="elementor-button-content-wrapper"><span class="elementor-button-icon elementor-align-icon-right"><svg aria-hidden="true" class="e-font-icon-svg e-fas-angle-right" viewBox="0 0 256 512" xmlns="http://www.w3.org/2000/svg"><path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path></svg></span><span class="elementor-button-text">Solicitar asistencia</span></span>