فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(Q01): label stocktake count and excess-cost inputs
davoodmehraban89 committed
Nov 1, 2026 at 11:36 UTC
2b088d3c1e809d0c1ef7bc199825877fd2141050
2 files changed
+19
-4
src/views/AccountingView.js
+6
-4
@@ -662,8 +662,8 @@ class AccountingViewImpl {
662
const extraOptions=extras.map(p=>`<option value="${html(p.id)}">${html(p.name)}</option>`).join('');
663
const existing=lines.map(l=>`<tr data-product="${html(l.productId)}">
664
<td>${html(names[l.productId]||l.productId)}</td><td>${l.expectedUnits/1000}</td>
665
- <td><input class="form-control ac-count" value="${l.countedUnits===null?'':l.countedUnits/1000}" ${take.status!=='draft'?'disabled':''}></td>
666
- <td><input class="form-control ac-cost" placeholder="ریال" value="${l.unitCost??''}" ${take.status!=='draft'?'disabled':''}></td></tr>`).join('');
665
+ <td><input class="form-control ac-count" aria-label="${html('شمارش واقعی برای '+(names[l.productId]||l.productId))}" value="${l.countedUnits===null?'':l.countedUnits/1000}" ${take.status!=='draft'?'disabled':''}></td>
666
+ <td><input class="form-control ac-cost" aria-label="${html('بهای واحد مازاد برای '+(names[l.productId]||l.productId))}" placeholder="ریال" value="${l.unitCost??''}" ${take.status!=='draft'?'disabled':''}></td></tr>`).join('');
667
Modal.open({title:'برگه انبارگردانی',size:'lg',closeOnBackdrop:false,
668
body:`<input type="hidden" id="acStocktakeId" value="${html(id)}">
669
<p style="margin-bottom:10px">مقدار شمارش واقعی و در صورت مازاد کالای بدون مانده، قیمت تمامشده واحد را وارد کنید.</p>
@@ -682,12 +682,14 @@ class AccountingViewImpl {
682
if(!selector?.value)return;
683
const id=selector.value;
684
const label=selector.selectedOptions[0]?.textContent||id;
685
+ const countLabel=html('شمارش واقعی برای '+label);
686
+ const costLabel=html('بهای واحد مازاد برای '+label);
687
const body=document.getElementById('acTakeRows');
688
if(!body||body.querySelector('[data-product="'+id+'"]'))return;
689
body.insertAdjacentHTML('beforeend',`<tr data-product="${html(id)}">
690
<td>${html(label)}</td><td>۰</td>
689
- <td><input class="form-control ac-count" value="0"></td>
690
- <td><input class="form-control ac-cost" placeholder="ریال"></td></tr>`);
691
+ <td><input class="form-control ac-count" aria-label="${countLabel}" value="0"></td>
692
+ <td><input class="form-control ac-cost" aria-label="${costLabel}" placeholder="ریال"></td></tr>`);
693
selector.selectedOptions[0]?.remove();
694
}
695
async persistStocktakeCounts(id) {
tests/q01-accounting-stocktake-a11y.test.mjs
new
+13
@@ -0,0 +1,13 @@
1
+import test from 'node:test';
2
+import assert from 'node:assert/strict';
3
+import { readFileSync } from 'node:fs';
4
+
5
+test('Q01: stocktake count and excess-cost inputs have per-product accessible names',()=>{
6
+ const source=readFileSync(new URL('../src/views/AccountingView.js',import.meta.url),'utf8');
7
+ assert.match(source,/ac-count" aria-label="\$\{html\('شمارش واقعی برای '/);
8
+ assert.match(source,/ac-cost" aria-label="\$\{html\('بهای واحد مازاد برای '/);
9
+ assert.match(source,/const countLabel=html\('شمارش واقعی برای '\+label\)/);
10
+ assert.match(source,/const costLabel=html\('بهای واحد مازاد برای '\+label\)/);
11
+ assert.match(source,/ac-count" aria-label="\$\{countLabel\}"/);
12
+ assert.match(source,/ac-cost" aria-label="\$\{costLabel\}"/);
13
+});