Update Reports.tsx
This commit is contained in:
@@ -92,6 +92,12 @@ export const ReportsPage: React.FC = () => {
|
||||
return { totalAmount, paypalAmount, manualAmount, count };
|
||||
}, [filteredData]);
|
||||
|
||||
const getMonthLabel = (month: number) => {
|
||||
if (month === 13) return "Extra";
|
||||
if (month >= 1 && month <= 12) return MONTH_NAMES[month - 1];
|
||||
return "-";
|
||||
};
|
||||
|
||||
const handleExportCSV = () => {
|
||||
if (!activeCondo) return;
|
||||
|
||||
@@ -100,7 +106,7 @@ export const ReportsPage: React.FC = () => {
|
||||
new Date(p.datePaid).toLocaleDateString(),
|
||||
p.familyName,
|
||||
p.familyUnit,
|
||||
MONTH_NAMES[p.forMonth - 1],
|
||||
getMonthLabel(p.forMonth),
|
||||
p.forYear,
|
||||
p.amount.toFixed(2),
|
||||
p.method,
|
||||
@@ -161,6 +167,7 @@ export const ReportsPage: React.FC = () => {
|
||||
>
|
||||
<option value="ALL">Tutti</option>
|
||||
{MONTH_NAMES.map((m, i) => <option key={i} value={i+1}>{m}</option>)}
|
||||
<option value={13}>Spese Extra</option>
|
||||
</select>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
@@ -246,7 +253,7 @@ export const ReportsPage: React.FC = () => {
|
||||
</td>
|
||||
<td className="px-6 py-4">
|
||||
<span className="bg-slate-100 text-slate-600 px-2 py-1 rounded text-xs font-bold uppercase">
|
||||
{MONTH_NAMES[t.forMonth - 1].substring(0, 3)} {t.forYear}
|
||||
{getMonthLabel(t.forMonth).substring(0, 5)} {t.forYear}
|
||||
</span>
|
||||
</td>
|
||||
<td className="px-6 py-4">
|
||||
|
||||
Reference in New Issue
Block a user