fix: (agenda) descricao melhorada para titulo das colunas da listagem dos eventos

This commit is contained in:
NANDO9322 2026-01-16 18:37:00 -03:00
parent 1b55707f90
commit 5b0783f36b
2 changed files with 74 additions and 46 deletions

View file

@ -408,40 +408,40 @@ export const EventTable: React.FC<EventTableProps> = ({
{/* Novas colunas de gestão de equipe */} {/* Novas colunas de gestão de equipe */}
{(userRole === UserRole.BUSINESS_OWNER || userRole === UserRole.SUPERADMIN) && ( {(userRole === UserRole.BUSINESS_OWNER || userRole === UserRole.SUPERADMIN) && (
<> <>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Quantidade de Formandos">
QTD Form. QTD Form.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Quantidade de Fotógrafos">
Fotóg. Fotóg.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Quantidade de Recepcionistas">
Recep. Recep.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Quantidade de Cinegrafistas">
Cine. Cine.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Quantidade de Estúdios">
Estúd. Estúd.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Pontos de Foto">
Pts. Foto Pts. Foto
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Pontos Decorados">
Pts. Dec. Pts. Dec.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Pontos de LED">
Pts. LED Pts. LED
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Profissionais Confirmados?">
Prof. OK? Prof. OK?
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Fotógrafos Faltantes/Pendentes">
Fot. Falt. Fot. Falt.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Recepcionistas Faltantes/Pendentes">
Rec. Falt. Rec. Falt.
</th> </th>
<th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> <th className="px-3 py-3 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider" title="Cinegrafistas Faltantes/Pendentes">
Cin. Falt. Cin. Falt.
</th> </th>
</> </>

View file

@ -440,11 +440,16 @@ const Finance: React.FC = () => {
anoFormatura: data.ano_formatura_label || "", anoFormatura: data.ano_formatura_label || "",
fot: data.fot, fot: data.fot,
})); }));
// Update the search query state too
setFotQuery(String(data.fot));
setFotFound(true); setFotFound(true);
} }
} catch (err) { } catch (err) {
console.error("Error fetching FOT details for edit:", err); console.error("Error fetching FOT details for edit:", err);
} }
} else if (t.fot) {
// Fallback if no ID but we have the number
setFotQuery(String(t.fot));
} }
// Fetch professional functions if professional name is present // Fetch professional functions if professional name is present
@ -608,8 +613,15 @@ const Finance: React.FC = () => {
<tbody className="divide-y relative"> <tbody className="divide-y relative">
{sortedTransactions.map((t, index) => { {sortedTransactions.map((t, index) => {
const isNewFot = index > 0 && t.fot !== sortedTransactions[index - 1].fot; const isNewFot = index > 0 && t.fot !== sortedTransactions[index - 1].fot;
// Check if this is the last item of the group (or list) to show summary
const isLastOfGroup = index === sortedTransactions.length - 1 || t.fot !== sortedTransactions[index + 1].fot;
// Only show summary if sorted by default (which groups by FOT) or explicitly sorted by FOT
const showSummary = isLastOfGroup && (!sortConfig || sortConfig.key === 'fot');
return ( return (
<tr key={t.id} <React.Fragment key={t.id}>
<tr
className={`hover:bg-gray-50 cursor-pointer ${isNewFot ? "border-t-[3px] border-gray-400" : ""}`} className={`hover:bg-gray-50 cursor-pointer ${isNewFot ? "border-t-[3px] border-gray-400" : ""}`}
onClick={() => handleEdit(t)} onClick={() => handleEdit(t)}
> >
@ -643,6 +655,22 @@ const Finance: React.FC = () => {
: <span className="bg-red-100 text-red-800 px-2 py-0.5 rounded-full text-[10px]">Não</span>} : <span className="bg-red-100 text-red-800 px-2 py-0.5 rounded-full text-[10px]">Não</span>}
</td> </td>
</tr> </tr>
{showSummary && (
<tr className="bg-gray-100 font-bold text-gray-800 border-b-2 border-gray-300">
<td colSpan={11} className="px-3 py-2 text-right uppercase text-[10px] tracking-wide text-gray-500">
Total FOT {t.fot}:
</td>
<td className="px-3 py-2 text-right text-brand-gold">
{/* Calculate sum for this group */}
{sortedTransactions
.filter(tr => tr.fot === t.fot)
.reduce((sum, curr) => sum + (curr.totalPagar || 0), 0)
.toFixed(2)}
</td>
<td colSpan={2}></td>
</tr>
)}
</React.Fragment>
); );
})} })}
</tbody> </tbody>