Correctif

This commit is contained in:
ocroguennec committed 2026-08-16 11:43:21 +02:00
1 parent 5273f11e05
commit f4c590b3a3
3 files changed
+32 -22

No files matched your search

+16 -10
View File
@@ -35,7 +35,7 @@ export function signedMontant(r) {
export const MOUV_TYPE_LABELS = { export const MOUV_TYPE_LABELS = {
depot: 'Dépôt', retrait: 'Retrait', correction: 'Correction de solde', depot: 'Dépôt', retrait: 'Retrait', correction: 'Correction de solde',
remboursement: 'Remboursement', bonus: 'Bonus / Cashback', souscription: 'Souscription', remboursement: 'Remboursement', bonus: 'Bonus', cashback: 'Cashback', souscription: 'Souscription',
prelevement_ir: 'Prélèvement IR', prelevement_csg: 'Prélèvement CSG', prelevement_ir: 'Prélèvement IR', prelevement_csg: 'Prélèvement CSG',
prelevement_local: "Prélèvement impôts à l'étranger", prelevement_local: "Prélèvement impôts à l'étranger",
}; };
@@ -145,14 +145,16 @@ export function DetailPanel({ row, onEdit, onDeleteCorrection, onViewRemb, onVie
); );
const isCorrection = row.type === 'correction'; const isCorrection = row.type === 'correction';
const isRemb = row.type === 'remboursement' || row.type === 'bonus';
const isBonus = row.type === 'bonus'; const isBonus = row.type === 'bonus';
const isCashback = row.type === 'cashback';
const isRemb = row.type === 'remboursement' || isBonus || isCashback;
const isSouscription = row.type === 'souscription'; const isSouscription = row.type === 'souscription';
const isPrelevement = row.type === 'prelevement_ir' || row.type === 'prelevement_csg' || row.type === 'prelevement_local'; const isPrelevement = row.type === 'prelevement_ir' || row.type === 'prelevement_csg' || row.type === 'prelevement_local';
const isAuto = row.source === 'auto_remboursement'; const isAuto = row.source === 'auto_remboursement';
const typeLabel = isCorrection ? 'Correction de solde' const typeLabel = isCorrection ? 'Correction de solde'
: isBonus ? 'Bonus / Cashback' : isBonus ? 'Bonus'
: isCashback ? 'Cashback'
: row.type === 'remboursement' ? 'Remboursement (porte-monnaie, brut)' : row.type === 'remboursement' ? 'Remboursement (porte-monnaie, brut)'
: row.type === 'prelevement_ir' ? 'Prélèvement impôt sur le revenu' : row.type === 'prelevement_ir' ? 'Prélèvement impôt sur le revenu'
: row.type === 'prelevement_csg' ? 'Prélèvement CSG' : row.type === 'prelevement_csg' ? 'Prélèvement CSG'
@@ -163,7 +165,7 @@ export function DetailPanel({ row, onEdit, onDeleteCorrection, onViewRemb, onVie
const editLabel = isCorrection ? 'Modifier la correction de solde' const editLabel = isCorrection ? 'Modifier la correction de solde'
: row.type === 'depot' ? 'Modifier le dépôt' : 'Modifier le retrait'; : row.type === 'depot' ? 'Modifier le dépôt' : 'Modifier le retrait';
// Débit (−) pour retrait/souscription/prélèvements, crédit (+) pour dépôt/remboursement/bonus ; // Débit (−) pour retrait/souscription/prélèvements, crédit (+) pour dépôt/remboursement/bonus/cashback ;
// la correction est déjà signée en base. // la correction est déjà signée en base.
const isDebitType = row.type === 'retrait' || isSouscription || isPrelevement; const isDebitType = row.type === 'retrait' || isSouscription || isPrelevement;
const isPos = isCorrection ? row.montant >= 0 : !isDebitType; const isPos = isCorrection ? row.montant >= 0 : !isDebitType;
@@ -171,17 +173,19 @@ export function DetailPanel({ row, onEdit, onDeleteCorrection, onViewRemb, onVie
const montantFmt = `${sign} ${fmtEUR(Math.abs(row.montant))}`; const montantFmt = `${sign} ${fmtEUR(Math.abs(row.montant))}`;
const montantColor = undefined; const montantColor = undefined;
const isRembOnly = row.type === 'remboursement';
const fields = [ const fields = [
{ label: 'Plateforme', value: row.plateforme_nom }, { label: 'Plateforme', value: row.plateforme_nom },
{ label: 'Type de mouvement', value: typeLabel }, { label: 'Type de mouvement', value: typeLabel },
{ label: 'Montant', value: montantFmt, color: montantColor }, { label: 'Montant', value: montantFmt, color: montantColor },
{ label: 'Date', value: fmtDate(row.date_operation) }, { label: 'Date', value: fmtDate(row.date_operation) },
isRemb && !isBonus && row.libelle && { label: 'Projet', value: row.libelle }, isRembOnly && row.libelle && { label: 'Projet', value: row.libelle },
isBonus && row.libelle && { label: 'Projet', value: row.libelle }, (isBonus || isCashback) && row.libelle && { label: 'Projet', value: row.libelle },
isRemb && !isBonus && { label: 'Capital', value: fmtEUR(row._capital) }, isRembOnly && { label: 'Capital', value: fmtEUR(row._capital) },
isRemb && !isBonus && row._cashback > 0 && { label: 'Cashback', value: fmtEUR(row._cashback) }, isRembOnly && row._cashback > 0 && { label: 'Cashback', value: fmtEUR(row._cashback) },
isRemb && !isBonus && { label: 'Intérêts bruts', value: fmtEUR(row._interets_bruts) }, isRembOnly && { label: 'Intérêts bruts', value: fmtEUR(row._interets_bruts) },
isRemb && !isBonus && { label: 'Traitement fiscal', value: row._isFlatTax isRembOnly && { label: 'Traitement fiscal', value: row._isFlatTax
? 'Flat tax France (PFU prélevé à la source — voir prélèvements associés)' ? 'Flat tax France (PFU prélevé à la source — voir prélèvements associés)'
: row._taxeLocale > 0 : row._taxeLocale > 0
? "Étranger avec retenue fiscale locale — voir prélèvement associé" ? "Étranger avec retenue fiscale locale — voir prélèvement associé"
@@ -237,6 +241,8 @@ export function DetailPanel({ row, onEdit, onDeleteCorrection, onViewRemb, onVie
<span> <span>
{isBonus {isBonus
? 'Bonus crédité directement au porte-monnaie de la plateforme.' ? 'Bonus crédité directement au porte-monnaie de la plateforme.'
: isCashback
? "Cashback crédité au porte-monnaie de la plateforme, saisi sur un remboursement classique plutôt qu'en tant que bonus. Modifiable depuis la page Remboursements."
: row._isAutoSweep : row._isAutoSweep
? "Remboursement (montant brut) crédité sur le porte-monnaie puis reversé aussitôt sur le compte courant (retrait automatique associé). Les prélèvements éventuels apparaissent en lignes séparées. Modifiable depuis la page Remboursements." ? "Remboursement (montant brut) crédité sur le porte-monnaie puis reversé aussitôt sur le compte courant (retrait automatique associé). Les prélèvements éventuels apparaissent en lignes séparées. Modifiable depuis la page Remboursements."
: "Montant brut du remboursement versé sur le porte-monnaie de la plateforme (méthode « portefeuille ») — les prélèvements éventuels apparaissent en lignes séparées. Modifiable depuis la page Remboursements."} : "Montant brut du remboursement versé sur le porte-monnaie de la plateforme (méthode « portefeuille ») — les prélèvements éventuels apparaissent en lignes séparées. Modifiable depuis la page Remboursements."}
+8 -6
View File
@@ -319,7 +319,7 @@ export default function DepotsRetraits() {
} }
if (cashback > 0) { if (cashback > 0) {
out.push({ ...base, id: `remb_${r.id}_cashback`, type: 'bonus', montant: cashback }); out.push({ ...base, id: `remb_${r.id}_cashback`, type: 'cashback', montant: cashback });
} }
if (taxeLocale > 0) { if (taxeLocale > 0) {
@@ -1138,7 +1138,8 @@ export default function DepotsRetraits() {
<option value="retrait">Retraits</option> <option value="retrait">Retraits</option>
<option value="correction">Corrections de solde</option> <option value="correction">Corrections de solde</option>
<option value="remboursement">Remboursements</option> <option value="remboursement">Remboursements</option>
<option value="bonus">Bonus / Cashback</option> <option value="bonus">Bonus</option>
<option value="cashback">Cashback</option>
<option value="souscription">Souscriptions</option> <option value="souscription">Souscriptions</option>
<option value="prelevement_ir">Prélèvements IR</option> <option value="prelevement_ir">Prélèvements IR</option>
<option value="prelevement_csg">Prélèvements CSG</option> <option value="prelevement_csg">Prélèvements CSG</option>
@@ -1250,8 +1251,9 @@ export default function DepotsRetraits() {
</tr> </tr>
); );
} }
if (r.type === 'remboursement' || r.type === 'bonus') { if (r.type === 'remboursement' || r.type === 'bonus' || r.type === 'cashback') {
const isBonus = r.type === 'bonus'; const isBonus = r.type === 'bonus';
const isCashback = r.type === 'cashback';
return ( return (
<tr key={r.id} <tr key={r.id}
className={`dr-row${selectedRow?.id === r.id ? ' dr-row-selected' : ''}`} className={`dr-row${selectedRow?.id === r.id ? ' dr-row-selected' : ''}`}
@@ -1265,11 +1267,11 @@ export default function DepotsRetraits() {
display: 'inline-block', display: 'inline-block',
fontSize: 11, fontWeight: 600, letterSpacing: '0.03em', fontSize: 11, fontWeight: 600, letterSpacing: '0.03em',
padding: '2px 7px', borderRadius: 4, padding: '2px 7px', borderRadius: 4,
background: isBonus background: (isBonus || isCashback)
? 'color-mix(in srgb, var(--warning) 18%, transparent)' ? 'color-mix(in srgb, var(--warning) 18%, transparent)'
: 'color-mix(in srgb, var(--success) 15%, transparent)', : 'color-mix(in srgb, var(--success) 15%, transparent)',
color: isBonus ? 'var(--warning)' : 'var(--success)', color: (isBonus || isCashback) ? 'var(--warning)' : 'var(--success)',
}}>{isBonus ? 'bonus' : 'remboursement'}</span> }}>{isBonus ? 'bonus' : isCashback ? 'cashback' : 'remboursement'}</span>
</td> </td>
<td className="text-muted">{r._projet || '—'}</td> <td className="text-muted">{r._projet || '—'}</td>
<td className="num success"> <td className="num success">
+8 -6
View File
@@ -1013,7 +1013,7 @@ export default function Plateformes() {
} }
if (cashback > 0) { if (cashback > 0) {
out.push({ ...base, id: `remb_${r.id}_cashback`, type: 'bonus', montant: cashback }); out.push({ ...base, id: `remb_${r.id}_cashback`, type: 'cashback', montant: cashback });
} }
if (taxeLocale > 0) { if (taxeLocale > 0) {
@@ -2404,7 +2404,8 @@ export default function Plateformes() {
<option value="retrait">Retraits</option> <option value="retrait">Retraits</option>
<option value="correction">Corrections de solde</option> <option value="correction">Corrections de solde</option>
<option value="remboursement">Remboursements</option> <option value="remboursement">Remboursements</option>
<option value="bonus">Bonus / Cashback</option> <option value="bonus">Bonus</option>
<option value="cashback">Cashback</option>
<option value="souscription">Souscriptions</option> <option value="souscription">Souscriptions</option>
<option value="prelevement_ir">Prélèvements IR</option> <option value="prelevement_ir">Prélèvements IR</option>
<option value="prelevement_csg">Prélèvements CSG</option> <option value="prelevement_csg">Prélèvements CSG</option>
@@ -2492,8 +2493,9 @@ export default function Plateformes() {
</tr> </tr>
); );
} }
if (r.type === 'remboursement' || r.type === 'bonus') { if (r.type === 'remboursement' || r.type === 'bonus' || r.type === 'cashback') {
const isBonus = r.type === 'bonus'; const isBonus = r.type === 'bonus';
const isCashback = r.type === 'cashback';
return ( return (
<tr key={r.id} <tr key={r.id}
className={`dr-row${mvSelectedRow?.id === r.id ? ' dr-row-selected' : ''}`} className={`dr-row${mvSelectedRow?.id === r.id ? ' dr-row-selected' : ''}`}
@@ -2507,11 +2509,11 @@ export default function Plateformes() {
display: 'inline-block', display: 'inline-block',
fontSize: 11, fontWeight: 600, letterSpacing: '0.03em', fontSize: 11, fontWeight: 600, letterSpacing: '0.03em',
padding: '2px 7px', borderRadius: 4, padding: '2px 7px', borderRadius: 4,
background: isBonus background: (isBonus || isCashback)
? 'color-mix(in srgb, var(--warning) 18%, transparent)' ? 'color-mix(in srgb, var(--warning) 18%, transparent)'
: 'color-mix(in srgb, var(--success) 15%, transparent)', : 'color-mix(in srgb, var(--success) 15%, transparent)',
color: isBonus ? 'var(--warning)' : 'var(--success)', color: (isBonus || isCashback) ? 'var(--warning)' : 'var(--success)',
}}>{isBonus ? 'bonus' : 'remboursement'}</span> }}>{isBonus ? 'bonus' : isCashback ? 'cashback' : 'remboursement'}</span>
</td> </td>
<td className="text-muted">{r._projet || '—'}</td> <td className="text-muted">{r._projet || '—'}</td>
<td className="num success"> <td className="num success">