Fix: prb de date sur les prêts différés

This commit is contained in:
2026-06-17 22:16:29 +02:00
parent f09d5e4143
commit a8781a9f62
3 changed files with 35 additions and 16 deletions
+14 -10
View File
@@ -131,6 +131,10 @@ export default function DrillCellPanel({
const totalProjetes = projetes.reduce((s, p) => s + projRowValue(p), 0);
const grandTotal = (showRecus ? totalRecus : 0) + (showProjetes ? totalProjetes : 0);
/* Lignes visibles : masquer les lignes à 0 selon les critères actifs */
const recusVisible = recus.filter(r => recuRowValue(r) !== 0);
const projetesVisible = projetes.filter(p => projRowValue(p) !== 0);
/* ── Colonnes dynamiques ── */
const cols = [
inclureInterets && { key: 'interets', label: netMode ? 'Intérêts nets' : 'Intérêts bruts', color: chartInterets },
@@ -327,14 +331,14 @@ export default function DrillCellPanel({
background: hexToRgba(chartInterets, 0.07),
color: 'var(--text-muted)', letterSpacing: '.04em', textTransform: 'uppercase',
}}>
Reçus ({recus.length})
Reçus ({recusVisible.length}{recusVisible.length !== recus.length ? `/${recus.length}` : ''})
</td>
</tr>
{recus.length === 0 ? (
{recusVisible.length === 0 ? (
<tr><td colSpan={colCount} style={{ padding: '10px 16px', color: 'var(--text-muted)', fontStyle: 'italic' }}>
Aucun remboursement reçu ce mois
{recus.length === 0 ? 'Aucun remboursement reçu ce mois' : 'Aucun montant à afficher avec les critères sélectionnés'}
</td></tr>
) : recus.map(r => (
) : recusVisible.map(r => (
<tr key={r.id}
style={{ borderBottom: '1px solid var(--border)', cursor: onEditRecu ? 'pointer' : 'default' }}
title={onEditRecu ? 'Modifier ce remboursement' : undefined}
@@ -354,7 +358,7 @@ export default function DrillCellPanel({
<td style={{ ...tdStyle, ...numStyle, fontWeight: 600 }}>{fmtEUR(recuRowValue(r))}</td>
</tr>
))}
{recus.length > 0 && (
{recusVisible.length > 0 && (
<tr className="drill-row-fixed" style={{ background: 'var(--surface-2)', fontWeight: 700 }}>
<td colSpan={3 + (showPlatCol ? 1 : 0)} style={{ ...tdStyle, color: 'var(--text-muted)', fontSize: '0.8em' }}>
Sous-total reçus
@@ -383,7 +387,7 @@ export default function DrillCellPanel({
color: 'var(--text-muted)', letterSpacing: '.04em', textTransform: 'uppercase',
}}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<span>Projetés ({projetes.length})</span>
<span>Projetés ({projetesVisible.length}{projetesVisible.length !== projetes.length ? `/${projetes.length}` : ''})</span>
{projetes.length > 0 && (
<button
onClick={() => openBulkModal()}
@@ -408,11 +412,11 @@ export default function DrillCellPanel({
</div>
</td>
</tr>
{projetes.length === 0 ? (
{projetesVisible.length === 0 ? (
<tr><td colSpan={colCount} style={{ padding: '10px 16px', color: 'var(--text-muted)', fontStyle: 'italic' }}>
Aucune projection ce mois
{projetes.length === 0 ? 'Aucune projection ce mois' : 'Aucun montant à afficher avec les critères sélectionnés'}
</td></tr>
) : projetes.map(p => (
) : projetesVisible.map(p => (
<tr key={p.id}
style={{ borderBottom: '1px solid var(--border)', opacity: 0.85, cursor: onEditProjet ? 'pointer' : 'default' }}
title={onEditProjet ? 'Saisir ce remboursement' : undefined}
@@ -432,7 +436,7 @@ export default function DrillCellPanel({
<td style={{ ...tdStyle, ...numStyle, fontStyle: 'italic', color: 'var(--text-muted)' }}>{fmtEUR(projRowValue(p))}</td>
</tr>
))}
{projetes.length > 0 && (
{projetesVisible.length > 0 && (
<tr className="drill-row-fixed" style={{ background: 'var(--surface-2)', fontWeight: 700 }}>
<td colSpan={3 + (showPlatCol ? 1 : 0)} style={{ ...tdStyle, color: 'var(--text-muted)', fontSize: '0.8em' }}>
Sous-total projetés