Спільнота Inzhur
Пупкін отримав доходи від продажу сертифікатів ПІФ 4000 грн за рік, від ОВДП 6000 грн за рік. Чи треба Пупкіну подати декларацію? В: НІ
const ovdpValues = [];
const units = Array.from(document.querySelectorAll('.investment-unit.available'));
units.forEach(unit => {
const values = unit.querySelectorAll('.unit-values strong');
const isin = values[0].textContent.trim();
const yieldValue = values[1].textContent.trim();
const date = values[2].textContent.trim();
const buyPrice = parseFloat(values[3].textContent.replace(/\s/g, ""));
const sellPrice = parseFloat(values[4].textContent.replace(/\s/g, ""));
const spread = buyPrice - sellPrice;
const obj = {
isin,
yieldValue: yieldValue,
date,
buyPrice,
sellPrice,
spread: spread.toFixed(2)
};
ovdpValues.push(obj);
});
ovdpValues.sort((a, b) => a.spread - b.spread);
ovdpValues.forEach((ovdp, index) => {
console.log(`[${index + 1}] Isin: ${ovdp.isin}. Погашення ${ovdp.date} Спред: ${ovdp.spread}, ціна покупки ${ovdp.buyPrice}, дохідність ${ovdp.yieldValue}`);
});