diff --git a/app/routes/areas.tsx b/app/routes/areas.tsx index d0798a4..02958ba 100644 --- a/app/routes/areas.tsx +++ b/app/routes/areas.tsx @@ -8,7 +8,7 @@ import Toast from "~/components/Toast"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Areas Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Areas Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/dashboard.tsx b/app/routes/dashboard.tsx index 8434c9c..82b9ad7 100644 --- a/app/routes/dashboard.tsx +++ b/app/routes/dashboard.tsx @@ -5,7 +5,7 @@ import { requireAuthLevel } from "~/utils/auth.server"; import DashboardLayout from "~/components/DashboardLayout"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Dashboard - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Dashboard - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 1); @@ -51,7 +51,7 @@ export default function Dashboard() { Welcome back, {user.name}!
- Here's what's happening with your phosphat operations today. + Here's what's happening with your allhaffer operations today.
diff --git a/app/routes/dredger-locations.tsx b/app/routes/dredger-locations.tsx index cf2413b..ffff8ef 100644 --- a/app/routes/dredger-locations.tsx +++ b/app/routes/dredger-locations.tsx @@ -8,7 +8,7 @@ import Toast from "~/components/Toast"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Dredger Locations Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Dredger Locations Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/employees.tsx b/app/routes/employees.tsx index 13e18f8..396e123 100644 --- a/app/routes/employees.tsx +++ b/app/routes/employees.tsx @@ -9,7 +9,7 @@ import { useState, useEffect } from "react"; import bcrypt from "bcryptjs"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Employee Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Employee Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/equipment.tsx b/app/routes/equipment.tsx index 6993fe6..60b62ab 100644 --- a/app/routes/equipment.tsx +++ b/app/routes/equipment.tsx @@ -8,7 +8,7 @@ import Toast from "~/components/Toast"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Equipment Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Equipment Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/foreman.tsx b/app/routes/foreman.tsx index b3ea82f..1007b40 100644 --- a/app/routes/foreman.tsx +++ b/app/routes/foreman.tsx @@ -8,7 +8,7 @@ import Toast from "~/components/Toast"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Foreman Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Foreman Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/reclamation-locations.tsx b/app/routes/reclamation-locations.tsx index af53497..74dff82 100644 --- a/app/routes/reclamation-locations.tsx +++ b/app/routes/reclamation-locations.tsx @@ -8,7 +8,7 @@ import Toast from "~/components/Toast"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Reclamation Locations Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Reclamation Locations Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 2); diff --git a/app/routes/report-sheet.tsx b/app/routes/report-sheet.tsx index 235ca0c..02e9fd2 100644 --- a/app/routes/report-sheet.tsx +++ b/app/routes/report-sheet.tsx @@ -7,7 +7,7 @@ import ReportSheetViewModal from "~/components/ReportSheetViewModal"; import { useState } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Report Sheets - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Report Sheets - Alhaffer Report System" }]; interface ReportSheet { id: string; diff --git a/app/routes/reports.tsx b/app/routes/reports.tsx index 793e15c..2fae2f7 100644 --- a/app/routes/reports.tsx +++ b/app/routes/reports.tsx @@ -10,7 +10,7 @@ import { useState, useEffect } from "react"; import { manageSheet, removeFromSheet } from "~/utils/sheet.server"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Reports Management - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Reports Management - Alhaffer Report System" }]; export const loader = async ({ request }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 1); // All employees can access reports diff --git a/app/routes/reports_.$id.edit.tsx b/app/routes/reports_.$id.edit.tsx index c0fc41c..94bc750 100644 --- a/app/routes/reports_.$id.edit.tsx +++ b/app/routes/reports_.$id.edit.tsx @@ -6,7 +6,7 @@ import DashboardLayout from "~/components/DashboardLayout"; import { useState, useEffect } from "react"; import { prisma } from "~/utils/db.server"; -export const meta: MetaFunction = () => [{ title: "Edit Report - Phosphat Report" }]; +export const meta: MetaFunction = () => [{ title: "Edit Report - Alhaffer Report System" }]; export const loader = async ({ request, params }: LoaderFunctionArgs) => { const user = await requireAuthLevel(request, 1); @@ -112,6 +112,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => { const statsExc = formData.get("statsExc"); const statsLoaders = formData.get("statsLoaders"); const statsForeman = formData.get("statsForeman"); + const statsLaborer = formData.get("statsLaborer"); const workersListData = formData.get("workersList"); const timeSheetData = formData.get("timeSheetData"); const stoppagesData = formData.get("stoppagesData"); @@ -149,7 +150,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => { let finalNotes = typeof notes === "string" ? notes : ''; if (automaticNotes.length > 0) { const automaticNotesText = automaticNotes.join(', '); - finalNotes = finalNotes.trim() ? `${automaticNotesText}. ${finalNotes}` : automaticNotesText; + finalNotes = finalNotes.trim() ? `${automaticNotesText}.\n${finalNotes}` : automaticNotesText; } await prisma.report.update({ @@ -172,7 +173,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => { Exc: parseInt(statsExc as string) || 0, Loaders: parseInt(statsLoaders as string) || 0, Foreman: statsForeman as string || "", - Laborer: workersList.length + Laborer: parseInt(statsLaborer as string) || 0 }, timeSheet, stoppages, @@ -222,6 +223,7 @@ export default function EditReport() { report.shiftWorkers?.map((sw: any) => sw.worker.id) || [] ); const [workerSearchTerm, setWorkerSearchTerm] = useState(''); + const [isLaborerManuallyEdited, setIsLaborerManuallyEdited] = useState(false); const [timeSheetEntries, setTimeSheetEntries] = useState