diff --git a/budget-form.html b/budget-form.html
index 4e450a9..1aa507e 100644
--- a/budget-form.html
+++ b/budget-form.html
@@ -290,6 +290,34 @@ document.getElementById('budget-form').addEventListener('submit', async function
submitBtn.textContent = 'Отправка...';
submitBtn.disabled = true;
+ // Save to localStorage for dashboard
+ const branch = document.getElementById('branch').value;
+ const month = document.getElementById('month').value;
+ const year = document.getElementById('year').value;
+
+ let budgetData = JSON.parse(localStorage.getItem('budget-data')) || [];
+
+ document.querySelectorAll('#articles-body tr').forEach(row => {
+ const articleName = row.querySelector('[name="article_name[]"]').value;
+ const articleCode = articleName.split(' - ')[0];
+ const plan = parseInt(row.querySelector('[name="article_plan[]"]').value) || 0;
+ const fact = parseInt(row.querySelector('[name="article_fact[]"]').value) || 0;
+ const cumulative = parseInt(row.querySelector('[name="article_cumulative[]"]').value) || 0;
+
+ budgetData.push({
+ branch: branch,
+ month: month,
+ year: year,
+ article: articleName,
+ articleCode: articleCode,
+ plan: plan,
+ fact: fact,
+ cumulative: cumulative
+ });
+ });
+
+ localStorage.setItem('budget-data', JSON.stringify(budgetData));
+
try {
const response = await fetch(form.action, {
method: 'POST',