diff --git a/src/components/cases/time-tab.tsx b/src/components/cases/time-tab.tsx index b4cd1a1..5e48439 100644 --- a/src/components/cases/time-tab.tsx +++ b/src/components/cases/time-tab.tsx @@ -10,7 +10,7 @@ import { useAuth } from "@/lib/auth"; import { Plus, Trash2, Loader2, FilePlus, PlusCircle, CheckCircle2, Undo2, Download } from "lucide-react"; import { formatCurrency, formatDate } from "@/lib/format"; import { ensureMarkedInvoicedPlaceholder } from "@/lib/invoice-generation"; -import { roundToSixth } from "@/lib/timer"; +import { roundToTenth } from "@/lib/timer"; import { toast } from "sonner"; import { ImportUnbilledDialog } from "@/components/cases/import-unbilled-dialog"; import { @@ -51,9 +51,9 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) { billable: true, }); - // Compute total raw hours from hours + minutes inputs, then round UP to 1/6. + // Compute total raw hours from hours + minutes inputs, then round UP to 1/10 hr (6 min). const rawHours = (parseFloat(form.hours || "0") || 0) + (parseFloat(form.minutes || "0") || 0) / 60; - const roundedHours = roundToSixth(rawHours); + const roundedHours = roundToTenth(rawHours); const [fees, setFees] = useState([]); const [selectedFeeId, setSelectedFeeId] = useState(""); @@ -125,7 +125,7 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) { setSubmitting(false); if (error) toast.error(error.message); else { - toast.success(`Time entry added (${hours.toFixed(2)} hrs)`); + toast.success(`Time entry added (${hours.toFixed(1)} hrs)`); setShowForm(false); setForm({ ...form, hours: "", minutes: "", description: "" }); load(); @@ -173,7 +173,7 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) {
- +
@@ -251,7 +251,7 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) { setForm({ ...form, minutes: e.target.value })} /> {rawHours > 0 && (

- Billed as {roundedHours.toFixed(2)} hrs (1/6 hr) + Billed as {roundedHours.toFixed(1)} hrs (1/10 hr)

)}
@@ -302,7 +302,7 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) { {formatDate(e.work_date)} {e.user?.full_name || e.user?.email} {e.description} - {Number(e.hours).toFixed(2)} + {Number(e.hours).toFixed(1)} {formatCurrency(e.hourly_rate)} {e.billable ? formatCurrency(Number(e.hours) * Number(e.hourly_rate)) : "—"} {!e.billable ? "Non-billable" : e.invoice_id ? "Invoiced" : "Unbilled"}