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