Update CondoFinancials.tsx

This commit is contained in:
2026-01-10 00:15:11 +01:00
committed by GitHub
parent ffdfcddf4a
commit dcadc6ea66

View File

@@ -2,7 +2,7 @@
import React, { useEffect, useState, useMemo } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { CondoService } from '../services/mockDb'; import { CondoService } from '../services/mockDb';
import { CondoExpense, Condo } from '../types'; import { CondoExpense, Condo } from '../types';
import { Plus, Search, Filter, Paperclip, X, Save, FileText, Download, Euro, Trash2, Pencil, Briefcase } from 'lucide-react'; import { Plus, Search, Filter, Paperclip, X, Save, FileText, Download, Euro, Trash2, Pencil, Briefcase, Calendar, CreditCard, Hash, StickyNote, Truck } from 'lucide-react';
export const CondoFinancialsPage: React.FC = () => { export const CondoFinancialsPage: React.FC = () => {
const user = CondoService.getCurrentUser(); const user = CondoService.getCurrentUser();
@@ -293,14 +293,19 @@ export const CondoFinancialsPage: React.FC = () => {
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Descrizione</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Descrizione</label>
<input className="w-full border p-2 rounded-lg text-slate-700" value={formData.description} onChange={e => setFormData({...formData, description: e.target.value})} required placeholder="Es. Pulizia scale Gennaio" /> <div className="relative">
<FileText className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input className="w-full border p-2 pl-10 rounded-lg text-slate-700" value={formData.description} onChange={e => setFormData({...formData, description: e.target.value})} required placeholder="Es. Pulizia scale Gennaio" />
</div>
</div> </div>
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Fornitore</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Fornitore</label>
<div className="relative">
<Truck className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input <input
list="suppliers-list" list="suppliers-list"
className="w-full border p-2 rounded-lg text-slate-700" className="w-full border p-2 pl-10 rounded-lg text-slate-700"
value={formData.supplierName} value={formData.supplierName}
onChange={e => setFormData({...formData, supplierName: e.target.value})} onChange={e => setFormData({...formData, supplierName: e.target.value})}
placeholder="Seleziona o scrivi nuovo..." placeholder="Seleziona o scrivi nuovo..."
@@ -310,15 +315,22 @@ export const CondoFinancialsPage: React.FC = () => {
{suppliers.map((s, i) => <option key={i} value={s} />)} {suppliers.map((s, i) => <option key={i} value={s} />)}
</datalist> </datalist>
</div> </div>
</div>
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Importo ()</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Importo ()</label>
<input type="number" step="0.01" className="w-full border p-2 rounded-lg text-slate-700" value={formData.amount} onChange={e => setFormData({...formData, amount: e.target.value})} required /> <div className="relative">
<Euro className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input type="number" step="0.01" className="w-full border p-2 pl-10 rounded-lg text-slate-700" value={formData.amount} onChange={e => setFormData({...formData, amount: e.target.value})} required />
</div>
</div> </div>
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Rif. Fattura</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Rif. Fattura</label>
<input className="w-full border p-2 rounded-lg text-slate-700" value={formData.invoiceNumber} onChange={e => setFormData({...formData, invoiceNumber: e.target.value})} /> <div className="relative">
<Hash className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input className="w-full border p-2 pl-10 rounded-lg text-slate-700" value={formData.invoiceNumber} onChange={e => setFormData({...formData, invoiceNumber: e.target.value})} />
</div>
</div> </div>
</div> </div>
@@ -333,13 +345,19 @@ export const CondoFinancialsPage: React.FC = () => {
</div> </div>
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Data Pagamento</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Data Pagamento</label>
<input type="date" className="w-full border p-2 rounded-lg text-slate-700" value={formData.paymentDate} onChange={e => setFormData({...formData, paymentDate: e.target.value})} /> <div className="relative">
<Calendar className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input type="date" className="w-full border p-2 pl-10 rounded-lg text-slate-700" value={formData.paymentDate} onChange={e => setFormData({...formData, paymentDate: e.target.value})} />
</div>
</div> </div>
</div> </div>
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Metodo Pagamento</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Metodo Pagamento</label>
<input className="w-full border p-2 rounded-lg text-slate-700" value={formData.paymentMethod} onChange={e => setFormData({...formData, paymentMethod: e.target.value})} placeholder="Es. Bonifico, RID..." /> <div className="relative">
<CreditCard className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<input className="w-full border p-2 pl-10 rounded-lg text-slate-700" value={formData.paymentMethod} onChange={e => setFormData({...formData, paymentMethod: e.target.value})} placeholder="Es. Bonifico, RID..." />
</div>
</div> </div>
<div> <div>
@@ -350,7 +368,10 @@ export const CondoFinancialsPage: React.FC = () => {
<div> <div>
<label className="block text-xs font-bold text-slate-500 uppercase mb-1">Note</label> <label className="block text-xs font-bold text-slate-500 uppercase mb-1">Note</label>
<textarea className="w-full border p-2 rounded-lg text-slate-700 h-20" value={formData.notes} onChange={e => setFormData({...formData, notes: e.target.value})} /> <div className="relative">
<StickyNote className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<textarea className="w-full border p-2 pl-10 rounded-lg text-slate-700 h-20" value={formData.notes} onChange={e => setFormData({...formData, notes: e.target.value})} />
</div>
</div> </div>
<div className="pt-2 flex gap-2"> <div className="pt-2 flex gap-2">