НДС в DI2: KPI-карточки показывают текущий квартал (начислено/вычет/к уплате)
Все три карточки — состояние текущего квартала по состоянию на сегодня (квартал последнего месяца в данных). Полная история остаётся в графиках.
This commit is contained in:
@@ -645,7 +645,6 @@ function VatTab({ data, quarters, balance, sync, markers }: { data: any; quarter
|
|||||||
|
|
||||||
const salesByRate = (data.byRate ?? []).filter((r: any) => r.direction === "sales");
|
const salesByRate = (data.byRate ?? []).filter((r: any) => r.direction === "sales");
|
||||||
const purchasesByRate = (data.byRate ?? []).filter((r: any) => r.direction === "purchases");
|
const purchasesByRate = (data.byRate ?? []).filter((r: any) => r.direction === "purchases");
|
||||||
const totals = data.totals ?? { accrued: 0, deducted: 0 };
|
|
||||||
const quarter = data.currentQuarter ?? null;
|
const quarter = data.currentQuarter ?? null;
|
||||||
const redRows: any[] = markers?.rows ?? [];
|
const redRows: any[] = markers?.rows ?? [];
|
||||||
const markerCounts: any[] = markers?.byMarker ?? [];
|
const markerCounts: any[] = markers?.byMarker ?? [];
|
||||||
@@ -661,8 +660,8 @@ function VatTab({ data, quarters, balance, sync, markers }: { data: any; quarter
|
|||||||
</div>
|
</div>
|
||||||
<span className="text-sm text-muted-foreground">Начислено</span>
|
<span className="text-sm text-muted-foreground">Начислено</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xl font-bold text-foreground tabular-nums" data-testid="text-income-vat">{formatCurrency(totals.accrued)}</p>
|
<p className="text-xl font-bold text-foreground tabular-nums" data-testid="text-income-vat">{formatCurrency(quarter?.accrued ?? 0)}</p>
|
||||||
<p className="text-xs text-muted-foreground mt-0.5">за период{data.dateFrom && data.dateTo ? ` ${data.dateFrom} — ${data.dateTo}` : ""}</p>
|
<p className="text-xs text-muted-foreground mt-0.5">{quarter ? `квартал ${formatQuarterLabel(quarter.dateFrom)} · ${quarter.dateFrom} — ${quarter.dateTo}` : ""}</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<Card>
|
<Card>
|
||||||
@@ -673,8 +672,8 @@ function VatTab({ data, quarters, balance, sync, markers }: { data: any; quarter
|
|||||||
</div>
|
</div>
|
||||||
<span className="text-sm text-muted-foreground">Вычет</span>
|
<span className="text-sm text-muted-foreground">Вычет</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xl font-bold text-foreground tabular-nums" data-testid="text-expense-vat">{formatCurrency(totals.deducted)}</p>
|
<p className="text-xl font-bold text-foreground tabular-nums" data-testid="text-expense-vat">{formatCurrency(quarter?.deducted ?? 0)}</p>
|
||||||
<p className="text-xs text-muted-foreground mt-0.5">за период</p>
|
<p className="text-xs text-muted-foreground mt-0.5">{quarter ? `квартал ${formatQuarterLabel(quarter.dateFrom)}` : ""}</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<Card>
|
<Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user