From fe6e4d668250435cabf58ca0b6cee848cb09901a Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Wed, 3 Dec 2025 20:05:11 +0300 Subject: [PATCH] =?UTF-8?q?Fix:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BE=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D1=83=D1=89=D0=B5=D0=BC=20=D1=81=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B5=20=D0=B2=20JavaScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлена ошибка 'currentWarehouse is not defined' при проведении продажи. Добавлен JSON блок currentWarehouseData в template и инициализация переменной currentWarehouse в terminal.js. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- myproject/pos/static/pos/js/terminal.js | 5 ++++- myproject/pos/templates/pos/terminal.html | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/myproject/pos/static/pos/js/terminal.js b/myproject/pos/static/pos/js/terminal.js index b7248d4..37583e0 100644 --- a/myproject/pos/static/pos/js/terminal.js +++ b/myproject/pos/static/pos/js/terminal.js @@ -64,13 +64,16 @@ function saveCartToRedis() { }, 500); // Debounce 500ms } -// ===== УПРАВЛЕНИЕ КЛИЕНТОМ ===== +// ===== УПРАВЛЕНИЕ КЛИЕНТОМ И СКЛАДОМ ===== // Загружаем данные системного клиента const SYSTEM_CUSTOMER = JSON.parse(document.getElementById('systemCustomerData').textContent); // Текущий выбранный клиент (загружается из Redis или системный) let selectedCustomer = JSON.parse(document.getElementById('selectedCustomerData').textContent); +// Текущий склад +const currentWarehouse = JSON.parse(document.getElementById('currentWarehouseData').textContent); + function formatMoney(v) { return (Number(v)).toFixed(2); } diff --git a/myproject/pos/templates/pos/terminal.html b/myproject/pos/templates/pos/terminal.html index 6a66598..325b8dc 100644 --- a/myproject/pos/templates/pos/terminal.html +++ b/myproject/pos/templates/pos/terminal.html @@ -497,6 +497,12 @@ } + {% endblock %}