Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
6becc98850
commit
62c9b79d0b
@@ -46,6 +46,9 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) {
|
||||
billable: true,
|
||||
});
|
||||
|
||||
const [fees, setFees] = useState<FeeItem[]>([]);
|
||||
const [selectedFeeId, setSelectedFeeId] = useState<string>("");
|
||||
|
||||
const load = async () => {
|
||||
const { data, error } = await supabase
|
||||
.from("time_entries")
|
||||
@@ -64,6 +67,20 @@ export function CaseTimeTab({ caseRecord, onInvoice }: CaseTimeTabProps) {
|
||||
|
||||
useEffect(() => { load(); }, [caseRecord.id]);
|
||||
|
||||
// Load fee schedule (time category)
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const { data } = await supabase
|
||||
.from("fee_schedule_items")
|
||||
.select("id, name, description, amount, billable")
|
||||
.eq("category", "time")
|
||||
.eq("active", true)
|
||||
.order("sort_order")
|
||||
.order("name");
|
||||
setFees((data ?? []) as FeeItem[]);
|
||||
})();
|
||||
}, []);
|
||||
|
||||
// Pull this user's default hourly rate; use it to prefill when case has no override.
|
||||
useEffect(() => {
|
||||
if (!user?.id) return;
|
||||
|
||||
Reference in New Issue
Block a user