Added few functions

This commit is contained in:
2026-02-16 14:43:02 +01:00
parent 0c908a21ac
commit 1ec4c935c9
31 changed files with 352 additions and 35 deletions

View File

@@ -3,6 +3,8 @@
import React, { useState, useEffect } from 'react';
import { useNotification } from './NotificationProvider';
import Link from 'next/link';
import { getParticipationRef } from '@/lib/participation-ref';
import { useBodyScrollLock } from '@/lib/body-scroll-lock';
interface HistoriqueItem {
id: string;
@@ -41,6 +43,7 @@ export default function BudgetContent() {
const [rectifierBudget, setRectifierBudget] = useState('');
const [rectifierAjustement, setRectifierAjustement] = useState('');
const [expandedPrescripteur, setExpandedPrescripteur] = useState<string | null>(null);
useBodyScrollLock(!!addModalPrescripteur || !!rectifierModalPrescripteur);
useEffect(() => {
fetchBudgets();
@@ -332,6 +335,7 @@ export default function BudgetContent() {
<thead className="bg-gray-100">
<tr>
<th className="px-4 py-2 text-left text-xs font-medium text-gray-500">Date</th>
<th className="px-4 py-2 text-left text-xs font-medium text-gray-500">Référence</th>
<th className="px-4 py-2 text-left text-xs font-medium text-gray-500">Adhérent</th>
<th className="px-4 py-2 text-right text-xs font-medium text-gray-500">Montant</th>
<th className="px-4 py-2 text-right text-xs font-medium text-gray-500 w-24">Lien</th>
@@ -341,6 +345,11 @@ export default function BudgetContent() {
{item.historique.map((h) => (
<tr key={h.id}>
<td className="px-4 py-2 text-gray-700">{formatDate(h.date)}</td>
<td className="px-4 py-2">
<span className="font-mono text-xs font-medium text-lblue" title="Référence de prescription">
{getParticipationRef(h.id)}
</span>
</td>
<td className="px-4 py-2 text-gray-700">{h.adherentNom}</td>
<td className="px-4 py-2 text-right text-orange-600 font-medium">
{formatEuro(h.montant)}
@@ -455,6 +464,7 @@ export default function BudgetContent() {
<div className="min-w-0 flex-1">
<p className="font-medium text-gray-900 truncate">{h.adherentNom}</p>
<p className="text-xs text-gray-500">{formatDate(h.date)}</p>
<p className="text-xs font-mono text-lblue mt-0.5">{getParticipationRef(h.id)}</p>
</div>
<div className="flex items-center gap-2 flex-shrink-0">
<span className="text-orange-600 font-medium">{formatEuro(h.montant)}</span>