Экономия = Бюджет - Сумма поставки (расчёт)

This commit is contained in:
Rollan_Tuleuov 2026-08-18 10:35:57 +00:00
parent 60200f01ed
commit 3a071920ed
2 changed files with 241 additions and 238 deletions

468
data.json

File diff suppressed because it is too large Load Diff

View File

@ -32,9 +32,8 @@ function parseExcelData() {
};
const serviceNameIdx = findColumn(['Краткий текст материала']);
const budgetSumIdx = findColumn(['Бюджет закупок,тг']);
const budgetSumIdx = findColumn(['Сумма с уч.корр']);
const executedSumIdx = findColumn(['Сумма поставки,тг']);
const economyIdx = findColumn(['Экономия от проведенного закупа']);
const sppElementIdx = findColumn(['СПП-элемент']);
const departmentIdx = findColumn(['Завод', 'МВЗ', 'Текст МВЗ']);
const execPercentIdx = findColumn(['% исполнения']);
@ -46,9 +45,11 @@ function parseExcelData() {
const budgetSum = parseFloat(String(row[budgetSumIdx] || 0).replace(/\s/g, '')) || 0;
const executedSum = parseFloat(String(row[executedSumIdx] || 0).replace(/\s/g, '')) || 0;
const economy = parseFloat(String(row[economyIdx] || 0).replace(/\s/g, '')) || 0;
const sppElement = String(row[sppElementIdx] || '').trim();
// Экономия = Бюджет - Сумма поставки
const economy = budgetSum - executedSum;
let budgetType = '';
if (sppElement.startsWith('I')) {
budgetType = 'БКВ';
@ -59,8 +60,10 @@ function parseExcelData() {
let execPercent = 0;
if (execPercentIdx !== -1 && row[execPercentIdx]) {
execPercent = parseFloat(String(row[execPercentIdx]).replace('%', '').replace(/\s/g, '')) || 0;
} else if (budgetSum > 0) {
} else if (budgetSum > 0 && executedSum > 0) {
execPercent = (executedSum / budgetSum) * 100;
} else {
execPercent = 0;
}
const item = {