Added Money System

This commit is contained in:
2026-01-22 19:25:25 +01:00
parent d5d0d5aaf4
commit bb5c3058b1
12 changed files with 703 additions and 266 deletions

View File

@@ -13,6 +13,7 @@ interface Adherent {
situation?: string | null;
prescripteur?: string | null;
facturation?: string | null;
forfait?: string | null;
commentaire?: string | null;
telephoneSecondaire?: string | null;
instructions?: string | null;
@@ -29,10 +30,12 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
situation: Array<{ id: string; value: string }>;
prescripteur: Array<{ id: string; value: string }>;
facturation: Array<{ id: string; value: string }>;
forfait: Array<{ id: string; value: string }>;
}>({
situation: [],
prescripteur: [],
facturation: [],
forfait: [],
});
const [formData, setFormData] = useState({
nom: '',
@@ -44,6 +47,7 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
situation: '',
prescripteur: '',
facturation: '',
forfait: '',
commentaire: '',
telephoneSecondaire: '',
instructions: '',
@@ -62,6 +66,7 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
situation: data.situation || [],
prescripteur: data.prescripteur || [],
facturation: data.facturation || [],
forfait: data.forfait || [],
});
}
} catch (error) {
@@ -82,6 +87,7 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
situation: adherent.situation || '',
prescripteur: adherent.prescripteur || '',
facturation: adherent.facturation || '',
forfait: adherent.forfait || '',
commentaire: adherent.commentaire || '',
telephoneSecondaire: adherent.telephoneSecondaire || '',
instructions: adherent.instructions || '',
@@ -102,6 +108,7 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
situation: formData.situation || null,
prescripteur: formData.prescripteur || null,
facturation: formData.facturation || null,
forfait: formData.forfait || null,
commentaire: formData.commentaire || null,
telephoneSecondaire: formData.telephoneSecondaire || null,
instructions: formData.instructions || null,
@@ -386,6 +393,37 @@ export default function AdherentForm({ adherent, onClose }: AdherentFormProps) {
</div>
</div>
<div>
<label htmlFor="forfait" className="block text-sm font-medium text-gray-700 mb-1">
Forfait
</label>
<div className="relative">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg className="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<select
id="forfait"
value={formData.forfait}
onChange={(e) => setFormData({ ...formData, forfait: e.target.value })}
className="w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg text-gray-900 focus:outline-none focus:ring-2 focus:ring-lblue focus:border-transparent appearance-none bg-white"
>
<option value="">Sélectionner un forfait (prix par trajet)</option>
{options.forfait.map((option) => (
<option key={option.id} value={option.value}>
{option.value}
</option>
))}
</select>
<div className="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
<svg className="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
</svg>
</div>
</div>
</div>
<div>
<label htmlFor="telephoneSecondaire" className="block text-sm font-medium text-gray-700 mb-1">
Téléphone secondaire