Экономия = Бюджет - Сумма поставки (расчёт)
This commit is contained in:
parent
60200f01ed
commit
3a071920ed
11
server.js
11
server.js
@ -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 = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user