diff --git a/toptran-app/eas.json b/toptran-app/eas.json index bff975e..e188fd7 100644 --- a/toptran-app/eas.json +++ b/toptran-app/eas.json @@ -11,7 +11,7 @@ "buildType": "apk" }, "env": { - "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br" + "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br/api" } }, "preview": { @@ -20,7 +20,7 @@ "buildType": "apk" }, "env": { - "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br" + "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br/api" } }, "production": { @@ -29,7 +29,7 @@ "buildType": "app-bundle" }, "env": { - "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br" + "EXPO_PUBLIC_API_URL": "https://toptran.olymp.com.br/api" } } }, diff --git a/toptran-app/src/app/home.tsx b/toptran-app/src/app/home.tsx index 0b7a2d7..33ce7ee 100644 --- a/toptran-app/src/app/home.tsx +++ b/toptran-app/src/app/home.tsx @@ -346,7 +346,7 @@ const styles = StyleSheet.create({ borderColor: COLORS.borderLight, }, statValue: { - fontSize: 20, + fontSize: 18, fontWeight: "800", color: COLORS.text, marginBottom: 2, diff --git a/toptran-app/src/app/relatorio.tsx b/toptran-app/src/app/relatorio.tsx index a3991bc..27d89d2 100644 --- a/toptran-app/src/app/relatorio.tsx +++ b/toptran-app/src/app/relatorio.tsx @@ -31,7 +31,10 @@ function getMonthOptions() { return Array.from({ length: 12 }, (_, i) => { const d = new Date(now.getFullYear(), now.getMonth() - i, 1); const value = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}`; - const label = d.toLocaleDateString("pt-BR", { month: "long", year: "numeric" }); + const label = d.toLocaleDateString("pt-BR", { + month: "long", + year: "numeric", + }); return { value, label: label.charAt(0).toUpperCase() + label.slice(1) }; }); } @@ -60,7 +63,12 @@ type CompanyReport = { name: string; rides: number; km: number; total: number }; function buildCompanyReports(rides: RideDB[]): CompanyReport[] { const map = new Map(); for (const r of rides) { - const prev = map.get(r.company) ?? { name: r.company, rides: 0, km: 0, total: 0 }; + const prev = map.get(r.company) ?? { + name: r.company, + rides: 0, + km: 0, + total: 0, + }; map.set(r.company, { ...prev, rides: prev.rides + 1, @@ -109,8 +117,10 @@ function buildPdfHtml( ) .join(""); - const generated = new Date().toLocaleDateString("pt-BR") + - " às " + new Date().toLocaleTimeString("pt-BR"); + const generated = + new Date().toLocaleDateString("pt-BR") + + " às " + + new Date().toLocaleTimeString("pt-BR"); return ` @@ -145,9 +155,11 @@ function buildPdfHtml(
- ${logoSrc - ? `` - : `TopTran`} + ${ + logoSrc + ? `` + : `TopTran` + }

Relatório de Corridas

${monthLabel}

@@ -219,11 +231,16 @@ export default function RelatorioPage() { const companies = buildCompanyReports(rides); const totalKm = rides.reduce((s, r) => s + r.km, 0); const totalEarnings = rides.reduce((s, r) => s + r.total, 0); - const monthLabel = MONTH_OPTIONS.find((o) => o.value === selectedMonth)?.label ?? selectedMonth; + const monthLabel = + MONTH_OPTIONS.find((o) => o.value === selectedMonth)?.label ?? + selectedMonth; const handleExport = async () => { if (rides.length === 0) { - Alert.alert("Sem dados", "Não há corridas registradas em " + monthLabel + "."); + Alert.alert( + "Sem dados", + "Não há corridas registradas em " + monthLabel + ".", + ); return; } try { @@ -253,13 +270,20 @@ export default function RelatorioPage() { return ( - router.back()} style={styles.backButton} activeOpacity={0.7}> + router.back()} + style={styles.backButton} + activeOpacity={0.7} + > Voltar - + Relatório Análise de ganhos por período @@ -268,7 +292,11 @@ export default function RelatorioPage() { {/* Filtro de mês */} Período - {/* Cards de resumo */} @@ -294,7 +322,9 @@ export default function RelatorioPage() { {companies.length === 0 ? ( - Nenhuma corrida em {monthLabel}. + + Nenhuma corrida em {monthLabel}. + ) : ( <> @@ -308,7 +338,9 @@ export default function RelatorioPage() { {c.km.toFixed(1)} km - R$ {c.total.toFixed(2)} + + R$ {c.total.toFixed(2)} + ))} @@ -319,7 +351,9 @@ export default function RelatorioPage() { {totalKm.toFixed(1)} km - R$ {totalEarnings.toFixed(2)} + + R$ {totalEarnings.toFixed(2)} + @@ -327,7 +361,10 @@ export default function RelatorioPage() { {/* Botão exportar */}