fix(buchhaltung): remove budget utilization bars from accounts overview
This commit is contained in:
@@ -489,7 +489,6 @@ function KontoRow({ konto, depth = 0, onNavigate }: { konto: KontoTreeNode; dept
|
|||||||
const isEinfach = (konto.budget_typ || 'detailliert') === 'einfach';
|
const isEinfach = (konto.budget_typ || 'detailliert') === 'einfach';
|
||||||
const totalBudget = isEinfach ? Number(konto.budget_gesamt || 0) : Number(konto.budget_gwg || 0) + Number(konto.budget_anlagen || 0) + Number(konto.budget_instandhaltung || 0);
|
const totalBudget = isEinfach ? Number(konto.budget_gesamt || 0) : Number(konto.budget_gwg || 0) + Number(konto.budget_anlagen || 0) + Number(konto.budget_instandhaltung || 0);
|
||||||
const totalSpent = Number(konto.spent_gwg || 0) + Number(konto.spent_anlagen || 0) + Number(konto.spent_instandhaltung || 0);
|
const totalSpent = Number(konto.spent_gwg || 0) + Number(konto.spent_anlagen || 0) + Number(konto.spent_instandhaltung || 0);
|
||||||
const utilization = totalBudget > 0 ? (totalSpent / totalBudget) * 100 : 0;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -498,11 +497,6 @@ function KontoRow({ konto, depth = 0, onNavigate }: { konto: KontoTreeNode; dept
|
|||||||
<Typography variant="body2">
|
<Typography variant="body2">
|
||||||
{konto.kontonummer} — {konto.bezeichnung}
|
{konto.kontonummer} — {konto.bezeichnung}
|
||||||
</Typography>
|
</Typography>
|
||||||
{totalBudget > 0 && (
|
|
||||||
<LinearProgress variant="determinate" value={Math.min(utilization, 100)}
|
|
||||||
color={utilization > 100 ? 'error' : utilization > 80 ? 'warning' : 'primary'}
|
|
||||||
sx={{ mt: 0.5, height: 4, borderRadius: 2 }} />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="right" sx={dividerLeft}>{isEinfach ? '' : fmtEur(konto.budget_gwg)}</TableCell>
|
<TableCell align="right" sx={dividerLeft}>{isEinfach ? '' : fmtEur(konto.budget_gwg)}</TableCell>
|
||||||
<TableCell align="right">{isEinfach ? '' : fmtEur(konto.budget_anlagen)}</TableCell>
|
<TableCell align="right">{isEinfach ? '' : fmtEur(konto.budget_anlagen)}</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user