<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://www.pandoraburo.ru/" xml:lang="ru">
  <id>https://www.pandoraburo.ru/raschet-odnogo-rezervuara</id>
  <link href="https://www.pandoraburo.ru/raschet-odnogo-rezervuara.xml" rel="self"/>
  <title>Расчет одного резервуара</title>
  <subtitle type="html">
&lt;html lang="ru"&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
&lt;title&gt;Калькулятор резервуара 2024 — Арсенал-Деталь&lt;/title&gt;
&lt;style&gt;
  :root {
    --bg: #0a0a0a; --bg2: #111111; --line: #d4af37; --gold: #d4af37;
    --goldB: #f0d060; --red: #e74c3c; --green: #2ecc71;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg); color: var(--gold); line-height: 1.5; padding: 20px 14px;
  }
  .wrap { max-width: 1400px; margin: 0 auto; }

  .ticker-block {
    display: flex; align-items: stretch; background: var(--bg);
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
    margin-bottom: 14px; height: 44px;
  }
  .ticker-label {
    background: var(--gold); color: #0a0a0a; font-weight: 800; font-size: 12px;
    letter-spacing: 1.5px; padding: 0 16px; display: flex; align-items: center; white-space: nowrap;
  }
  .ticker-viewport { flex: 1; overflow: hidden; position: relative; }
  .ticker-track {
    display: inline-flex; align-items: center; height: 100%; white-space: nowrap;
    animation: tickerScroll 40s linear infinite; padding-left: 20px;
  }
  .ticker-item { color: var(--gold); font-size: 13px; padding: 0 10px; letter-spacing: .3px; }
  .ticker-item b { color: var(--goldB); font-weight: 700; }
  .ticker-dot { color: var(--gold); font-size: 10px; }
  @keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

  header {
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
    padding: 30px 25px; text-align: center; margin-bottom: 14px;
  }
  .banner-line {
    display: inline-block; background: var(--red); color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: 2px; padding: 4px 14px;
    border-radius: 999px; margin-bottom: 14px;
  }
  header h1 {
    margin: 0 0 12px 0; font-size: 28px; color: var(--gold);
    text-transform: uppercase; letter-spacing: 3px; font-weight: 800;
  }
  header p { margin: 0; color: var(--gold); font-size: 15px; opacity: .9; }

  .calc-block {
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
    padding: 20px; margin-bottom: 14px;
  }
  .calc-title {
    color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 2px;
    text-transform: uppercase; padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid var(--line); text-align: center;
  }

  .warning-block {
    background: rgba(231, 76, 60, 0.1); border: 1px solid var(--red); border-radius: 12px;
    padding: 16px; margin-bottom: 16px; text-align: center;
  }
  .warning-text { color: var(--red); font-size: 13px; font-weight: 700; }
  .warning-text b { color: #fff; }

  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .field label {
    font-size: 11px; font-weight: 700; color: var(--gold);
    text-transform: uppercase; letter-spacing: 1px; opacity: .8;
  }
  .field input, .field select {
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
    font-size: 14px; background: var(--bg); color: var(--gold);
    outline: none; transition: .15s; font-family: inherit; font-variant-numeric: tabular-nums;
  }
  .field input:focus, .field select:focus {
    border-color: var(--goldB); box-shadow: 0 0 0 3px rgba(212,175,55,.2);
  }
  .field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  @media (max-width: 800px) { .field-row { grid-template-columns: 1fr; } }

  .auto-calc {
    background: rgba(212,175,55,.08); border: 1px dashed var(--gold);
    border-radius: 9px; padding: 12px 14px; margin-bottom: 14px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  }
  @media (max-width: 900px) { .auto-calc { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 500px) { .auto-calc { grid-template-columns: 1fr; } }
  .auto-item { text-align: center; }
  .auto-label { font-size: 10px; color: var(--gold); opacity: .7; text-transform: uppercase; font-weight: 700; }
  .auto-value { font-size: 18px; font-weight: 800; color: var(--goldB); font-variant-numeric: tabular-nums; }

  .result-block {
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 14px;
  }
  .result-main {
    text-align: center; padding: 16px 0 20px; border-bottom: 1px solid rgba(212,175,55,.3); margin-bottom: 16px;
  }
  .result-main-label {
    font-size: 11px; font-weight: 800; letter-spacing: 2px;
    text-transform: uppercase; color: var(--gold); opacity: .8; margin-bottom: 8px;
  }
  .result-main-value {
    font-size: 48px; font-weight: 800; color: var(--goldB);
    line-height: 1; font-variant-numeric: tabular-nums; margin-bottom: 6px;
  }
  .result-main-unit { font-size: 16px; color: var(--gold); opacity: .8; }
  .result-main-note { font-size: 12px; color: var(--gold); opacity: .7; margin-top: 8px; }

  .result-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px;
  }
  @media (max-width: 900px) { .result-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 500px) { .result-grid { grid-template-columns: 1fr; } }
  .result-item {
    background: #0a0a0a; border: 1px solid rgba(212,175,55,.3); border-radius: 9px; padding: 12px; text-align: center;
  }
  .result-label {
    font-size: 10px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--gold); opacity: .7; margin-bottom: 6px;
  }
  .result-value { font-size: 18px; font-weight: 800; color: var(--goldB); line-height: 1.1; font-variant-numeric: tabular-nums; }
  .result-value.small { font-size: 15px; }
  .result-value.profit { color: var(--green); }

  .actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .promo-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 16px; border-radius: 9px; border: 1px solid var(--gold);
    background: transparent; color: var(--gold); font-size: 13px; font-weight: 700;
    cursor: pointer; transition: .15s; font-family: inherit; letter-spacing: .3px; flex: 1; min-width: 140px;
  }
  .promo-btn:hover { background: var(--gold); color: #0a0a0a; }
  .promo-btn.primary { background: var(--gold); color: #0a0a0a; }
  .promo-btn.primary:hover { background: var(--goldB); }

  .pricing-info {
    background: rgba(46, 204, 113, 0.08); border: 1px solid var(--green);
    border-radius: 10px; padding: 14px 18px; margin-top: 14px; text-align: center;
  }
  .pricing-info-title {
    font-size: 12px; font-weight: 800; color: var(--green);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
  }
  .pricing-info-text { font-size: 13px; color: var(--gold); opacity: .85; line-height: 1.6; }
  .pricing-info-text b { color: var(--goldB); }

  ::-webkit-scrollbar { width: 14px; height: 14px; }
  ::-webkit-scrollbar-track { background: #050505; border: 1px solid #2a2210; border-radius: 9px; }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    border: 1px solid #ffd700; border-radius: 9px; box-shadow: 0 0 10px rgba(255,215,0,.6);
  }

  @media print {
    body { background: #fff; color: #000; padding: 0; }
    .ticker-block, .promo-btn, .warning-block { display: none !important; }
    .calc-block, .result-block { background: #fff !important; border: 1px solid #999 !important; }
    .field input, .field select { background: #fff !important; color: #000 !important; border-color: #999 !important; }
    .result-main-value, .result-value { color: #000 !important; }
  }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="wrap"&gt;

  &lt;div class="ticker-block"&gt;
    &lt;div class="ticker-label"&gt;АКТУАЛЬНО 2024&lt;/div&gt;
    &lt;div class="ticker-viewport"&gt;
      &lt;div class="ticker-track"&gt;
        &lt;span class="ticker-item"&gt;Нержавейка 12Х18Н10Т: &lt;b&gt;от 480 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Лист 09Г2С: &lt;b&gt;от 125 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Индекс удорожания работ: &lt;b&gt;×1.35&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Целевая рентабельность: &lt;b&gt;55%&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;header&gt;
    &lt;div class="banner-line"&gt;⚠️ ЗАЩИТА ОТ ИНФЛЯЦИИ&lt;/div&gt;
    &lt;h1&gt;Калькулятор резервуара 2024&lt;/h1&gt;
    &lt;p&gt;Расчёт одного резервуара: вес, материал, работа, себестоимость, прибыль и цена с НДС&lt;/p&gt;
  &lt;/header&gt;

  &lt;div class="calc-block"&gt;
    &lt;div class="warning-block"&gt;
      &lt;div class="warning-text"&gt;
        ⚠️ Внимание: Цены материалов и ставки работ указаны на &lt;b&gt;2022 год&lt;/b&gt;.&lt;br /&gt;
        Калькулятор автоматически применяет индекс удорожания, чтобы вы не работали в минус.
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="calc-title"&gt;Параметры резервуара&lt;/div&gt;

    &lt;div class="field-row"&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Тип резервуара&lt;/label&gt;
        &lt;select id="tankType"&gt;
          &lt;option value="vertical"&gt;Вертикальный (РВС)&lt;/option&gt;
          &lt;option value="horizontal"&gt;Горизонтальный (РГС)&lt;/option&gt;
          &lt;option value="square"&gt;Прямоугольный&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Материал стенки&lt;/label&gt;
        &lt;select id="material"&gt;
          &lt;option value="st20"&gt;Сталь 20 · ~110 ₽/кг&lt;/option&gt;
          &lt;option value="09g2s" selected="selected"&gt;Сталь 09Г2С · ~125 ₽/кг&lt;/option&gt;
          &lt;option value="12x18"&gt;Нержавейка 12Х18Н10Т · ~480 ₽/кг&lt;/option&gt;
          &lt;option value="08x18"&gt;Нержавейка 08Х18Н10 · ~460 ₽/кг&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Толщина стенки (S), мм&lt;/label&gt;
        &lt;input type="number" id="wallS" value="6" min="1" max="40" step="0.5" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="field-row"&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Диаметр (D), мм&lt;/label&gt;
        &lt;input type="number" id="tankD" value="2000" min="100" max="50000" step="10" /&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Высота / длина (H), мм&lt;/label&gt;
        &lt;input type="number" id="tankH" value="3000" min="100" max="50000" step="10" /&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Количество, шт&lt;/label&gt;
        &lt;input type="number" id="qty" value="1" min="1" max="1000" step="1" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="field-row"&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Толщина днища / крышки (S2), мм&lt;/label&gt;
        &lt;input type="number" id="bottomS" value="6" min="1" max="40" step="0.5" /&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Индекс удорожания (к ценам 2022 г.)&lt;/label&gt;
        &lt;input type="number" id="inflationIdx" value="1.35" min="1.0" max="2.0" step="0.05" /&gt;
        &lt;div style="font-size:10px; color:var(--gold); opacity:0.6; margin-top:4px;"&gt;1.35 = +35% к стоимости работ и накладных&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;label&gt;Целевая рентабельность, %&lt;/label&gt;
        &lt;input type="number" id="margin" value="55" min="0" max="200" step="1" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="auto-calc"&gt;
      &lt;div class="auto-item"&gt;
        &lt;div class="auto-label"&gt;Вес одного резервуара&lt;/div&gt;
        &lt;div class="auto-value" id="autoWeight"&gt;0 кг&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="auto-item"&gt;
        &lt;div class="auto-label"&gt;Площадь стенки&lt;/div&gt;
        &lt;div class="auto-value" id="autoArea"&gt;0 м²&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="auto-item"&gt;
        &lt;div class="auto-label"&gt;Стоимость материала&lt;/div&gt;
        &lt;div class="auto-value" id="autoMatCost"&gt;0 ₽&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="auto-item"&gt;
        &lt;div class="auto-label"&gt;Стоимость работы (с индексом)&lt;/div&gt;
        &lt;div class="auto-value" id="autoWorkCost"&gt;0 ₽&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="result-block"&gt;
    &lt;div class="calc-title"&gt;Результат расчёта (Актуальный)&lt;/div&gt;

    &lt;div class="result-main"&gt;
      &lt;div class="result-main-label"&gt;Цена продажи за 1 шт (с НДС 20%)&lt;/div&gt;
      &lt;div class="result-main-value" id="rPrice"&gt;0&lt;/div&gt;
      &lt;div class="result-main-unit"&gt;рублей&lt;/div&gt;
      &lt;div class="result-main-note" id="rNote"&gt;—&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="result-grid"&gt;
      &lt;div class="result-item"&gt;&lt;div class="result-label"&gt;Материал&lt;/div&gt;&lt;div class="result-value small" id="rMatCost"&gt;0 ₽&lt;/div&gt;&lt;/div&gt;
      &lt;div class="result-item"&gt;&lt;div class="result-label"&gt;Работа + Накладные&lt;/div&gt;&lt;div class="result-value small" id="rWorkCost"&gt;0 ₽&lt;/div&gt;&lt;/div&gt;
      &lt;div class="result-item"&gt;&lt;div class="result-label"&gt;Полная себест. (без НДС)&lt;/div&gt;&lt;div class="result-value small" id="rCost"&gt;0 ₽&lt;/div&gt;&lt;/div&gt;
      &lt;div class="result-item"&gt;&lt;div class="result-label"&gt;Чистая прибыль (без НДС)&lt;/div&gt;&lt;div class="result-value small profit" id="rProfit"&gt;0 ₽&lt;/div&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="pricing-info"&gt;
      &lt;div class="pricing-info-title"&gt;? Почему цена выше, чем 2 года назад?&lt;/div&gt;
      &lt;div class="pricing-info-text"&gt;
        1. &lt;b&gt;Материал:&lt;/b&gt; 09Г2С заложен по 125 ₽/кг (вместо 95 ₽), нержавейка — по 480 ₽/кг.&lt;br /&gt;
        2. &lt;b&gt;Работа:&lt;/b&gt; Базовая формула умножена на индекс &lt;b id="idxDisplay"&gt;1.35&lt;/b&gt; (рост зарплат сварщиков, аргон, проволока, гибка).&lt;br /&gt;
        3. &lt;b&gt;Рентабельность:&lt;/b&gt; Поднята до &lt;b id="marginDisplay"&gt;55&lt;/b&gt;%, чтобы покрыть реальные налоги, брак и кассовые разрывы.&lt;br /&gt;
        &lt;i&gt;Если вы дадите клиенту цену по старому калькулятору, вы потеряете ~25-30% потенциальной прибыли.&lt;/i&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="actions"&gt;
      &lt;button class="promo-btn primary" onclick="downloadCSV()"&gt;⬇ CSV&lt;/button&gt;
      &lt;button class="promo-btn primary" onclick="downloadExcel()"&gt;⬇ Excel&lt;/button&gt;
      &lt;button class="promo-btn" onclick="window.print()"&gt;? Печать&lt;/button&gt;
      &lt;button class="promo-btn" onclick="resetAll()"&gt;✕ Сброс&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;script&gt;
/* ==================== ДАННЫЕ ==================== */
const MATERIALS = [
  {key:'st20',   name:'Сталь 20',               price:110, density:7850},
  {key:'09g2s',  name:'Сталь 09Г2С',            price:125, density:7850},
  {key:'12x18',  name:'Нержавейка 12Х18Н10Т',   price:480, density:7900},
  {key:'08x18',  name:'Нержавейка 08Х18Н10',    price:460, density:7900}
];

/* ==================== УТИЛИТЫ ==================== */
const fmt = n =&gt; (n === null || n === undefined || isNaN(n)) ? '0' : n.toLocaleString('ru-RU', {maximumFractionDigits: 0});
const fmt2 = n =&gt; (n === null || n === undefined || isNaN(n)) ? '0' : n.toLocaleString('ru-RU', {maximumFractionDigits: 2});
const num = id =&gt; { const el = document.getElementById(id); if (!el) return 0; const v = parseFloat(el.value); return isNaN(v) ? 0 : v; };
const getMaterial = key =&gt; MATERIALS.find(m =&gt; m.key === key) || MATERIALS[0];

/* ==================== РАСЧЁТ ==================== */
function calculate() {
  const mat = getMaterial(document.getElementById('material').value);
  const type = document.getElementById('tankType').value;
  const D = num('tankD');
  const H = num('tankH');
  const S = num('wallS');
  const S2 = num('bottomS');
  const qty = Math.max(1, num('qty'));
  const inflationIdx = num('inflationIdx');
  const marginPct = num('margin');

  if (D &lt;= 0 || H &lt;= 0 || S &lt;= 0) {
    document.getElementById('rPrice').textContent = '0';
    return;
  }

  const Dm = D / 1000;
  const Hm = H / 1000;
  const Sm = S / 1000;
  const S2m = S2 / 1000;

  // 1. Площадь стенки и вес
  let areaWall, areaBottom, areaTop;
  if (type === 'vertical') {
    areaWall = Math.PI * Dm * Hm;
    areaBottom = Math.PI * Math.pow(Dm / 2, 2);
    areaTop = areaBottom;
  } else if (type === 'horizontal') {
    areaWall = Math.PI * Dm * Hm;
    areaBottom = Math.PI * Math.pow(Dm / 2, 2);
    areaTop = areaBottom;
  } else { // square
    areaWall = 4 * Dm * Hm;
    areaBottom = Dm * Dm;
    areaTop = areaBottom;
  }

  const weightWall = areaWall * Sm * mat.density;
  const weightBottom = areaBottom * S2m * mat.density;
  const weightTop = areaTop * S2m * mat.density;
  const totalWeight = weightWall + weightBottom + weightTop;

  // 2. Стоимость материала
  const matCost = totalWeight * mat.price;

  // 3. Стоимость работы (базовая формула 2022 года * Индекс удорожания)
  // Базовая ставка: сварка + гибка + сборка + накладные
  const baseWorkRatePerM2 = 3200 + (450 * S) + (280 * Dm * 1000 / 1000);
  const currentWorkRatePerM2 = baseWorkRatePerM2 * inflationIdx;
  const workCost = (areaWall + areaBottom + areaTop) * currentWorkRatePerM2;

  // 4. Полная себестоимость (без НДС)
  const totalCost = matCost + workCost;

  // 5. Цена продажи
  const profit = totalCost * (marginPct / 100);
  const priceNoVat = totalCost + profit;
  const priceVat = priceNoVat * 1.20;

  // 6. Вывод
  document.getElementById('autoWeight').textContent = fmt2(totalWeight) + ' кг';
  document.getElementById('autoArea').textContent = fmt2(areaWall + areaBottom + areaTop) + ' м²';
  document.getElementById('autoMatCost').textContent = fmt(matCost) + ' ₽';
  document.getElementById('autoWorkCost').textContent = fmt(workCost) + ' ₽';

  document.getElementById('rPrice').textContent = fmt(priceVat);
  document.getElementById('rMatCost').textContent = fmt(matCost) + ' ₽';
  document.getElementById('rWorkCost').textContent = fmt(workCost) + ' ₽';
  document.getElementById('rCost').textContent = fmt(totalCost) + ' ₽';
  document.getElementById('rProfit').textContent = fmt(profit) + ' ₽';

  document.getElementById('idxDisplay').textContent = inflationIdx;
  document.getElementById('marginDisplay').textContent = marginPct;

  document.getElementById('rNote').textContent =
    `Ставка работы: ${fmt(currentWorkRatePerM2)} ₽/м² · Материал: ${fmt(mat.price)} ₽/кг · Площадь: ${fmt2(areaWall + areaBottom + areaTop)} м²`;

  state.result = {
    type: type,
    material: mat.name, tankD: D, tankH: H, wallS: S, bottomS: S2,
    weight: totalWeight, area: areaWall + areaBottom + areaTop,
    matCost: matCost, workCost: workCost,
    cost: totalCost, profit: profit, price: priceVat, margin: marginPct, idx: inflationIdx
  };
}

/* ==================== СОБЫТИЯ ==================== */
document.getElementById('material').addEventListener('change', calculate);
document.getElementById('tankType').addEventListener('change', calculate);
['tankD', 'tankH', 'wallS', 'bottomS', 'qty', 'inflationIdx', 'margin'].forEach(id =&gt; {
  document.getElementById(id).addEventListener('input', calculate);
});

/* ==================== СБРОС ==================== */
function resetAll() {
  document.getElementById('tankType').value = 'vertical';
  document.getElementById('material').value = '09g2s';
  document.getElementById('tankD').value = 2000;
  document.getElementById('tankH').value = 3000;
  document.getElementById('wallS').value = 6;
  document.getElementById('bottomS').value = 6;
  document.getElementById('qty').value = 1;
  document.getElementById('inflationIdx').value = 1.35;
  document.getElementById('margin').value = 55;
  calculate();
}

/* ==================== ЭКСПОРТ ==================== */
function downloadBlob(blob, filename) {
  const url = URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url; a.download = filename;
  document.body.appendChild(a); a.click(); a.remove();
  setTimeout(() =&gt; URL.revokeObjectURL(url), 500);
}
function today() { const d = new Date(), p = n =&gt; String(n).padStart(2,'0'); return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())}`; }

function downloadCSV() {
  if (!state.result) return;
  const r = state.result;
  const header = ['Параметр','Значение'];
  const body = [
    ['Тип резервуара', r.type],
    ['Материал', r.material],
    ['Диаметр', r.tankD + ' мм'],
    ['Высота / длина', r.tankH + ' мм'],
    ['Толщина стенки', r.wallS + ' мм'],
    ['Толщина днища/крышки', r.bottomS + ' мм'],
    ['Площадь поверхности', r.area.toFixed(2) + ' м²'],
    ['Вес', r.weight.toFixed(2) + ' кг'],
    ['Индекс удорожания', r.idx],
    ['Полная себестоимость (без НДС)', Math.round(r.cost) + ' ₽'],
    ['Рентабельность', r.margin + '%'],
    ['Чистая прибыль (без НДС)', Math.round(r.profit) + ' ₽'],
    ['Цена продажи (с НДС 20%)', Math.round(r.price) + ' ₽']
  ];
  const esc = v =&gt; `"${String(v).replace(/"/g,'""')}"`;
  const csv = [header, ...body].map(row =&gt; row.map(esc).join(';')).join('\r\n');
  downloadBlob(new Blob(['\uFEFF' + csv], {type:'text/csv;charset=utf-8;'}), 'rezervuar_2024_' + today() + '.csv');
}

function downloadExcel() {
  if (!state.result) return;
  const r = state.result;
  const header = ['Параметр','Значение'];
  const body = [
    ['Тип резервуара', r.type],
    ['Материал', r.material],
    ['Диаметр', r.tankD + ' мм'],
    ['Высота / длина', r.tankH + ' мм'],
    ['Толщина стенки', r.wallS + ' мм'],
    ['Толщина днища/крышки', r.bottomS + ' мм'],
    ['Площадь поверхности', r.area.toFixed(2) + ' м²'],
    ['Вес', r.weight.toFixed(2) + ' кг'],
    ['Индекс удорожания', r.idx],
    ['Полная себестоимость (без НДС)', Math.round(r.cost) + ' ₽'],
    ['Рентабельность', r.margin + '%'],
    ['Чистая прибыль (без НДС)', Math.round(r.profit) + ' ₽'],
    ['Цена продажи (с НДС 20%)', Math.round(r.price) + ' ₽']
  ];
  const esc = v =&gt; String(v ?? '').replace(/&amp;/g,'&amp;amp;').replace(/&lt;/g,'&amp;lt;').replace(/&gt;/g,'&amp;gt;');
  const table = `&lt;table border="1" cellspacing="0" cellpadding="4"&gt;
    &lt;thead style="background:#000;color:#ffd700;"&gt;&lt;tr&gt;${header.map(h=&gt;`&lt;th&gt;${esc(h)}&lt;/th&gt;`).join('')}&lt;/tr&gt;&lt;/thead&gt;
    &lt;tbody&gt;${body.map(row=&gt;`&lt;tr&gt;${row.map(c=&gt;`&lt;td&gt;${esc(c)}&lt;/td&gt;`).join('')}&lt;/tr&gt;`).join('')}&lt;/tbody&gt;&lt;/table&gt;`;
  const html = `&lt;html xmlns:x="urn:schemas-microsoft-com:office:excel"&gt;&lt;head&gt;&lt;meta charset="UTF-8"&gt;
    &lt;style&gt;td,th{font-family:Arial;font-size:12px;}&lt;/style&gt;&lt;/head&gt;
    &lt;body&gt;&lt;h2&gt;Расчёт резервуара (Актуальный 2024) — ${today()}&lt;/h2&gt;
    &lt;p&gt;ООО «Арсенал-Деталь» · 8 (992) 017-49-73&lt;/p&gt;
    &lt;p&gt;&lt;b&gt;Внимание:&lt;/b&gt; Расчёт включает индекс удорожания материалов и ФОТ (+${Math.round((r.idx-1)*100)}% к базовым ставкам 2022 г.)&lt;/p&gt;
    ${table}
    &lt;/body&gt;&lt;/html&gt;`;
  downloadBlob(new Blob(['\uFEFF' + html], {type:'application/vnd.ms-excel;charset=utf-8;'}), 'rezervuar_2024_' + today() + '.xls');
}

/* ==================== СТАРТ ==================== */
let state = { result: null };
calculate();
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</subtitle>
  <updated>2026-10-12T10:12:03Z</updated>
  <logo>https://pandoraburo.ru/ssl/u/pic/07/26436cc3c611f19d9efcd8c4a10874/-/0c723f71762611f1b3964aaba1665535.jpg</logo>
  <author>
    <name>1592962</name>
    <uri>https://www.pandoraburo.ru/</uri>
  </author>
</feed>
