Correctif
This commit is contained in:
1 parent
5273f11e05
commit
f4c590b3a3
3 files changed
+35
-25
No files matched your search
@@ -35,7 +35,7 @@ export function signedMontant(r) {
|
||||
|
||||
export const MOUV_TYPE_LABELS = {
|
||||
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_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 isRemb = row.type === 'remboursement' || 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 isPrelevement = row.type === 'prelevement_ir' || row.type === 'prelevement_csg' || row.type === 'prelevement_local';
|
||||
const isAuto = row.source === 'auto_remboursement';
|
||||
|
||||
const typeLabel = isCorrection ? 'Correction de solde'
|
||||
: isBonus ? 'Bonus / Cashback'
|
||||
: isBonus ? 'Bonus'
|
||||
: isCashback ? 'Cashback'
|
||||
: row.type === 'remboursement' ? 'Remboursement (porte-monnaie, brut)'
|
||||
: row.type === 'prelevement_ir' ? 'Prélèvement impôt sur le revenu'
|
||||
: 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'
|
||||
: 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.
|
||||
const isDebitType = row.type === 'retrait' || isSouscription || isPrelevement;
|
||||
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 montantColor = undefined;
|
||||
|
||||
const isRembOnly = row.type === 'remboursement';
|
||||
|
||||
const fields = [
|
||||
{ label: 'Plateforme', value: row.plateforme_nom },
|
||||
{ label: 'Type de mouvement', value: typeLabel },
|
||||
{ label: 'Montant', value: montantFmt, color: montantColor },
|
||||
{ label: 'Date', value: fmtDate(row.date_operation) },
|
||||
isRemb && !isBonus && row.libelle && { label: 'Projet', value: row.libelle },
|
||||
isBonus && row.libelle && { label: 'Projet', value: row.libelle },
|
||||
isRemb && !isBonus && { label: 'Capital', value: fmtEUR(row._capital) },
|
||||
isRemb && !isBonus && row._cashback > 0 && { label: 'Cashback', value: fmtEUR(row._cashback) },
|
||||
isRemb && !isBonus && { label: 'Intérêts bruts', value: fmtEUR(row._interets_bruts) },
|
||||
isRemb && !isBonus && { label: 'Traitement fiscal', value: row._isFlatTax
|
||||
isRembOnly && row.libelle && { label: 'Projet', value: row.libelle },
|
||||
(isBonus || isCashback) && row.libelle && { label: 'Projet', value: row.libelle },
|
||||
isRembOnly && { label: 'Capital', value: fmtEUR(row._capital) },
|
||||
isRembOnly && row._cashback > 0 && { label: 'Cashback', value: fmtEUR(row._cashback) },
|
||||
isRembOnly && { label: 'Intérêts bruts', value: fmtEUR(row._interets_bruts) },
|
||||
isRembOnly && { label: 'Traitement fiscal', value: row._isFlatTax
|
||||
? 'Flat tax France (PFU prélevé à la source — voir prélèvements associés)'
|
||||
: row._taxeLocale > 0
|
||||
? "Étranger avec retenue fiscale locale — voir prélèvement associé"
|
||||
@@ -237,9 +241,11 @@ export function DetailPanel({ row, onEdit, onDeleteCorrection, onViewRemb, onVie
|
||||
<span>
|
||||
{isBonus
|
||||
? 'Bonus crédité directement au porte-monnaie de la plateforme.'
|
||||
: 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."
|
||||
: "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."}
|
||||
: 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
|
||||
? "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."}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -319,7 +319,7 @@ export default function DepotsRetraits() {
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -1138,7 +1138,8 @@ export default function DepotsRetraits() {
|
||||
<option value="retrait">Retraits</option>
|
||||
<option value="correction">Corrections de solde</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="prelevement_ir">Prélèvements IR</option>
|
||||
<option value="prelevement_csg">Prélèvements CSG</option>
|
||||
@@ -1250,8 +1251,9 @@ export default function DepotsRetraits() {
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
if (r.type === 'remboursement' || r.type === 'bonus') {
|
||||
if (r.type === 'remboursement' || r.type === 'bonus' || r.type === 'cashback') {
|
||||
const isBonus = r.type === 'bonus';
|
||||
const isCashback = r.type === 'cashback';
|
||||
return (
|
||||
<tr key={r.id}
|
||||
className={`dr-row${selectedRow?.id === r.id ? ' dr-row-selected' : ''}`}
|
||||
@@ -1265,11 +1267,11 @@ export default function DepotsRetraits() {
|
||||
display: 'inline-block',
|
||||
fontSize: 11, fontWeight: 600, letterSpacing: '0.03em',
|
||||
padding: '2px 7px', borderRadius: 4,
|
||||
background: isBonus
|
||||
background: (isBonus || isCashback)
|
||||
? 'color-mix(in srgb, var(--warning) 18%, transparent)'
|
||||
: 'color-mix(in srgb, var(--success) 15%, transparent)',
|
||||
color: isBonus ? 'var(--warning)' : 'var(--success)',
|
||||
}}>{isBonus ? 'bonus' : 'remboursement'}</span>
|
||||
color: (isBonus || isCashback) ? 'var(--warning)' : 'var(--success)',
|
||||
}}>{isBonus ? 'bonus' : isCashback ? 'cashback' : 'remboursement'}</span>
|
||||
</td>
|
||||
<td className="text-muted">{r._projet || '—'}</td>
|
||||
<td className="num success">
|
||||
|
||||
@@ -1013,7 +1013,7 @@ export default function Plateformes() {
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -2404,7 +2404,8 @@ export default function Plateformes() {
|
||||
<option value="retrait">Retraits</option>
|
||||
<option value="correction">Corrections de solde</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="prelevement_ir">Prélèvements IR</option>
|
||||
<option value="prelevement_csg">Prélèvements CSG</option>
|
||||
@@ -2492,8 +2493,9 @@ export default function Plateformes() {
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
if (r.type === 'remboursement' || r.type === 'bonus') {
|
||||
if (r.type === 'remboursement' || r.type === 'bonus' || r.type === 'cashback') {
|
||||
const isBonus = r.type === 'bonus';
|
||||
const isCashback = r.type === 'cashback';
|
||||
return (
|
||||
<tr key={r.id}
|
||||
className={`dr-row${mvSelectedRow?.id === r.id ? ' dr-row-selected' : ''}`}
|
||||
@@ -2507,11 +2509,11 @@ export default function Plateformes() {
|
||||
display: 'inline-block',
|
||||
fontSize: 11, fontWeight: 600, letterSpacing: '0.03em',
|
||||
padding: '2px 7px', borderRadius: 4,
|
||||
background: isBonus
|
||||
background: (isBonus || isCashback)
|
||||
? 'color-mix(in srgb, var(--warning) 18%, transparent)'
|
||||
: 'color-mix(in srgb, var(--success) 15%, transparent)',
|
||||
color: isBonus ? 'var(--warning)' : 'var(--success)',
|
||||
}}>{isBonus ? 'bonus' : 'remboursement'}</span>
|
||||
color: (isBonus || isCashback) ? 'var(--warning)' : 'var(--success)',
|
||||
}}>{isBonus ? 'bonus' : isCashback ? 'cashback' : 'remboursement'}</span>
|
||||
</td>
|
||||
<td className="text-muted">{r._projet || '—'}</td>
|
||||
<td className="num success">
|
||||
|
||||
Reference in new issue
Block a user