From d64f547ae9fd3602f93e874f1be597ecdd968564 Mon Sep 17 00:00:00 2001 From: aliya_kairzhanova Date: Thu, 4 Jun 2026 11:02:19 +0000 Subject: [PATCH] =?UTF-8?q?v10:=20=D0=9E=D1=82=D1=87=D0=B5=D1=82=D1=8B=20?= =?UTF-8?q?=E2=80=94=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D1=8B=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=A4=D0=98=D0=9E,=20=D1=84=D0=B8=D0=BB=D0=B8=D0=B0?= =?UTF-8?q?=D0=BB=D1=83,=20=D0=BC=D0=B5=D1=81=D1=82=D1=83=20=D0=B4=D0=B8?= =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=BA=D0=B0=D1=86=D0=B8=D0=B8,=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D1=81=D1=82=D0=B8=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D1=81=D1=87=D0=B8=D1=82=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index e0d87dc..39453f0 100644 --- a/index.html +++ b/index.html @@ -660,6 +660,19 @@ tr:hover td { background: var(--cyan-50); }
+
+ + + + +
Работников
@@ -687,7 +700,7 @@ tr:hover td { background: var(--cyan-50); }
- +
РаботникДолжностьВыдано позицийИз них просрочено
РаботникФилиалДислокацияДолжностьВыдано позицийИз них просрочено
@@ -1723,26 +1736,35 @@ function renderControl() { // ===================== REPORTS ===================== function renderReports() { - const employees = DB.employees; + let employees = DB.employees; const sizList = DB.siz; const warehouse = DB.warehouse; const issuances = DB.issuances; + const q = (document.getElementById('repFilterName').value || '').toLowerCase(); + const fb = document.getElementById('repFilterBranch').value; + const fl = document.getElementById('repFilterLocation').value; + + if (q) employees = employees.filter(e => (e.fullName || '').toLowerCase().includes(q)); + if (fb) employees = employees.filter(e => e.branch === fb); + if (fl) employees = employees.filter(e => e.location === fl); + + const empIds = new Set(employees.map(e => e.id)); + document.getElementById('repEmployees').textContent = employees.length; document.getElementById('repSiz').textContent = sizList.length; - let totalStock = 0, totalIssued = 0, totalExpired = 0; - sizList.forEach(s => { - totalStock += getStockBalance(s.id); - }); + let totalStock = 0; + sizList.forEach(s => { totalStock += getStockBalance(s.id); }); + + let totalIssued = 0, totalExpired = 0; issuances.forEach(i => { - if (i.status !== 'returned') { - totalIssued += i.quantity; - if (getIssStatus(i) === 'expired') totalExpired += i.quantity; - } else { - totalIssued += i.quantity; - } + if (!empIds.has(i.employeeId)) return; + const qty = i.quantity; + totalIssued += qty; + if (getIssStatus(i) === 'expired') totalExpired += qty; }); + document.getElementById('repStock').textContent = totalStock; document.getElementById('repIssued').textContent = totalIssued; document.getElementById('repExpired').textContent = totalExpired; @@ -1753,6 +1775,8 @@ function renderReports() { const expiredCount = empIss.filter(i => getIssStatus(i) === 'expired').length; return ` ${e.fullName} + ${e.branch || '—'} + ${e.location || '—'} ${e.position} ${issuedCount} ${expiredCount ? '' + expiredCount + '' : '0'}