@burdenoff/microfe-timecampus 2026.1205.1 → 2026.1206.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/timecampus/components/DateFields.d.ts +53 -0
- package/dist/timecampus/components/DateFields.js +87 -0
- package/dist/timecampus/components/DateFields.js.map +1 -0
- package/dist/timecampus/components/ErrorBoundary.js +1 -1
- package/dist/timecampus/components/ErrorBoundary.js.map +1 -1
- package/dist/timecampus/components/StatusBadge.js +4 -4
- package/dist/timecampus/components/StatusBadge.js.map +1 -1
- package/dist/timecampus/components/Toast.js +4 -4
- package/dist/timecampus/components/Toast.js.map +1 -1
- package/dist/timecampus/components/dateFieldValues.d.ts +39 -0
- package/dist/timecampus/components/dateFieldValues.js +49 -0
- package/dist/timecampus/components/dateFieldValues.js.map +1 -0
- package/dist/timecampus/components/maps/LocationGeofenceMap.js +2 -2
- package/dist/timecampus/components/maps/LocationGeofenceMap.js.map +1 -1
- package/dist/timecampus/pages/HomePage.js +1 -1
- package/dist/timecampus/pages/HomePage.js.map +1 -1
- package/dist/timecampus/pages/admin/AdminPage.js +6 -6
- package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +5 -5
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js +4 -4
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/AnalyticsPage.js +3 -3
- package/dist/timecampus/pages/dashboard/AnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ReportsPage.js +4 -4
- package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.js +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -1
- package/dist/timecampus/pages/email-tracking/EmailTrackingPage.js +121 -120
- package/dist/timecampus/pages/email-tracking/EmailTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +71 -71
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +1 -1
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +250 -253
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/focus-score/FocusScorePage.js +1 -1
- package/dist/timecampus/pages/focus-score/FocusScorePage.js.map +1 -1
- package/dist/timecampus/pages/geofencing/GeofencingPage.js +5 -5
- package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
- package/dist/timecampus/pages/invoicing/InvoicingPage.js +264 -263
- package/dist/timecampus/pages/invoicing/InvoicingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/DeadTimeRadarPage.js +1 -1
- package/dist/timecampus/pages/lifetime/DeadTimeRadarPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/FiniteLifePage.js +103 -103
- package/dist/timecampus/pages/lifetime/FiniteLifePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js +1 -1
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +43 -43
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/PersonalCorporatePage.js +3 -3
- package/dist/timecampus/pages/lifetime/PersonalCorporatePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/TimeWellSpentPage.js +2 -2
- package/dist/timecampus/pages/lifetime/TimeWellSpentPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js +5 -5
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js.map +1 -1
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js +223 -221
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js +65 -64
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingAnalyticsPage.js +1 -1
- package/dist/timecampus/pages/meetings/MeetingAnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js +55 -55
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js +8 -8
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +99 -97
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js +3 -3
- package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js +1 -1
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileLifeBalancePage.js +1 -1
- package/dist/timecampus/pages/mobile/MobileLifeBalancePage.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js +4 -4
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileTimerPage.js +1 -1
- package/dist/timecampus/pages/mobile/MobileTimerPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js +2 -2
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +155 -154
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectCreatePage.js +1 -1
- package/dist/timecampus/pages/projects/ProjectCreatePage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectDetailPage.js +5 -5
- package/dist/timecampus/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.js +6 -6
- package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/TasksPage.js +189 -188
- package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +356 -361
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/team/TeamAnalyticsPage.js +2 -2
- package/dist/timecampus/pages/team/TeamAnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/team/TeamMembersPage.js +3 -3
- package/dist/timecampus/pages/team/TeamMembersPage.js.map +1 -1
- package/dist/timecampus/pages/team/TeamPage.js +2 -2
- package/dist/timecampus/pages/team/TeamPage.js.map +1 -1
- package/dist/timecampus/pages/team-activity/TeamActivityPage.js +2 -2
- package/dist/timecampus/pages/team-activity/TeamActivityPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +133 -131
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +1 -1
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js +47 -48
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js.map +1 -1
- package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +8 -8
- package/dist/timecampus/pages/time-approval/TimeApprovalPage.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +237 -237
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/pages/work-patterns/SustainedLoadCard.js +3 -3
- package/dist/timecampus/pages/work-patterns/SustainedLoadCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,205 +8,206 @@ import { useTimeCampusAnalytics as o } from "../../analytics/useTimeCampusAnalyt
|
|
|
8
8
|
import { ToastContainer as ee, useToast as te } from "../../components/Toast.js";
|
|
9
9
|
import { formatCurrency as s, formatDate as c } from "../../utils/helpers.js";
|
|
10
10
|
import { useTimeCampus as ne } from "../../providers/TimeCampusProvider.js";
|
|
11
|
-
import { useDeleteInvoiceDraftMutation as re, useGenerateInvoiceDraftMutation as ie, useGetInvoiceStatsQuery as ae, useListInvoicesQuery as oe, useUpdateInvoiceStatusMutation as
|
|
11
|
+
import { useDeleteInvoiceDraftMutation as re, useGenerateInvoiceDraftMutation as ie, useGetInvoiceStatsQuery as ae, useListInvoicesQuery as oe, useUpdateInvoiceStatusMutation as se } from "../../../generated/wspace-operations.js";
|
|
12
12
|
import "../../analytics/index.js";
|
|
13
|
-
import { TimeCampusInvoiceStatus as
|
|
13
|
+
import { TimeCampusInvoiceStatus as l } from "../../../generated/wspace-types.js";
|
|
14
|
+
import { DateField as u } from "../../components/DateFields.js";
|
|
14
15
|
import { useState as d } from "react";
|
|
15
|
-
import { AlertTriangle as
|
|
16
|
-
import { gql as
|
|
17
|
-
import { useApolloClient as
|
|
18
|
-
import { Fragment as
|
|
16
|
+
import { AlertTriangle as ce, CheckCircle2 as le, DollarSign as ue, Download as f, Eye as de, FileText as p, Plus as fe, Send as pe, Trash2 as me } from "lucide-react";
|
|
17
|
+
import { gql as m } from "@apollo/client";
|
|
18
|
+
import { useApolloClient as he } from "@apollo/client/react";
|
|
19
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
19
20
|
// src/timecampus/pages/invoicing/InvoicingPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var v = 25, y = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", ge = m`
|
|
21
22
|
query TimeCampusInvoicing_GetInvoiceHtml($id: ID!, $workspaceId: ID!) {
|
|
22
23
|
timeCampusInvoiceHtml(id: $id, workspaceId: $workspaceId)
|
|
23
24
|
}
|
|
24
|
-
`,
|
|
25
|
+
`, _e = m`
|
|
25
26
|
query TimeCampusInvoicing_GetInvoicePdf($id: ID!, $workspaceId: ID!) {
|
|
26
27
|
timeCampusInvoicePdf(id: $id, workspaceId: $workspaceId)
|
|
27
28
|
}
|
|
28
29
|
`;
|
|
29
|
-
function
|
|
30
|
+
function b() {
|
|
30
31
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function x() {
|
|
33
34
|
let e = /* @__PURE__ */ new Date();
|
|
34
35
|
return new Date(e.getFullYear(), e.getMonth(), 1).toISOString().slice(0, 10);
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
+
var S = {
|
|
37
38
|
clientName: "",
|
|
38
39
|
clientEmail: "",
|
|
39
40
|
clientAddress: "",
|
|
40
|
-
periodStart:
|
|
41
|
-
periodEnd:
|
|
41
|
+
periodStart: x(),
|
|
42
|
+
periodEnd: b(),
|
|
42
43
|
taxRatePercent: "0",
|
|
43
44
|
currency: "USD",
|
|
44
45
|
dueDate: "",
|
|
45
46
|
notes: "",
|
|
46
47
|
projectIds: ""
|
|
47
48
|
};
|
|
48
|
-
function
|
|
49
|
+
function ve(e, t) {
|
|
49
50
|
let n = atob(e), r = new Uint8Array(n.length);
|
|
50
51
|
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
51
52
|
let i = new Blob([r], { type: "application/pdf" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
52
53
|
o.href = a, o.download = t, document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(a);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
-
let { workspaceId:
|
|
55
|
+
function C() {
|
|
56
|
+
let { workspaceId: m = "" } = ne(), { toasts: C, addToast: w, dismissToast: ye } = te(), T = he(), { data: E, loading: D, error: be, refetch: xe, fetchMore: Se } = oe({
|
|
56
57
|
variables: {
|
|
57
|
-
workspaceId:
|
|
58
|
+
workspaceId: m,
|
|
58
59
|
pagination: {
|
|
59
|
-
limit:
|
|
60
|
+
limit: v,
|
|
60
61
|
offset: 0
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
notifyOnNetworkStatusChange: !0
|
|
64
|
-
}), { data:
|
|
65
|
-
await Promise.all([
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
...
|
|
69
|
-
periodStart:
|
|
70
|
-
periodEnd:
|
|
71
|
-
}),
|
|
72
|
-
}, Z = () =>
|
|
73
|
-
if (!
|
|
74
|
-
let e = Number(
|
|
75
|
-
if (Number.isNaN(e) || e < 0 || e > 1)
|
|
65
|
+
}), { data: Ce, loading: we, refetch: Te } = ae({ variables: { workspaceId: m } }), [O, { loading: k }] = ie(), Ee = o(), [A] = se(), [De, { loading: j }] = re(), M = E?.timeCampusInvoices?.items ?? [], Oe = E?.timeCampusInvoices?.total ?? 0, N = Ce?.timeCampusInvoiceStats, [P, F] = d(!1), [ke, Ae] = d(!0), [je, I] = d(!1), [L, R] = d(S), [z, B] = d(null), [V, H] = d(null), [Me, U] = d(!1), [W, G] = d(null), [K, q] = d(null), [Ne, J] = d(null), Y = async () => {
|
|
66
|
+
await Promise.all([xe(), Te()]);
|
|
67
|
+
}, X = () => {
|
|
68
|
+
R({
|
|
69
|
+
...S,
|
|
70
|
+
periodStart: x(),
|
|
71
|
+
periodEnd: b()
|
|
72
|
+
}), I(!0);
|
|
73
|
+
}, Z = () => I(!1), Pe = async () => {
|
|
74
|
+
if (!L.clientName.trim() || !L.periodStart || !L.periodEnd) return;
|
|
75
|
+
let e = Number(L.taxRatePercent || "0") / 100;
|
|
76
|
+
if (Number.isNaN(e) || e < 0 || e > 1) w({
|
|
76
77
|
title: "Tax rate must be between 0 and 100%",
|
|
77
78
|
variant: "error"
|
|
78
79
|
});
|
|
79
80
|
else try {
|
|
80
|
-
let t = (await
|
|
81
|
-
workspaceId:
|
|
82
|
-
clientName:
|
|
83
|
-
clientEmail:
|
|
84
|
-
clientAddress:
|
|
85
|
-
periodStart: new Date(
|
|
86
|
-
periodEnd: (/* @__PURE__ */ new Date(new Date(
|
|
81
|
+
let t = (await O({ variables: { input: {
|
|
82
|
+
workspaceId: m,
|
|
83
|
+
clientName: L.clientName.trim(),
|
|
84
|
+
clientEmail: L.clientEmail.trim() || void 0,
|
|
85
|
+
clientAddress: L.clientAddress.trim() || void 0,
|
|
86
|
+
periodStart: new Date(L.periodStart).toISOString(),
|
|
87
|
+
periodEnd: (/* @__PURE__ */ new Date(new Date(L.periodEnd).getTime() + 864e5 - 1)).toISOString(),
|
|
87
88
|
taxRate: e,
|
|
88
|
-
currency:
|
|
89
|
-
dueDate:
|
|
90
|
-
notes:
|
|
91
|
-
projectIds:
|
|
89
|
+
currency: L.currency.trim() || "USD",
|
|
90
|
+
dueDate: L.dueDate ? new Date(L.dueDate).toISOString() : void 0,
|
|
91
|
+
notes: L.notes.trim() || void 0,
|
|
92
|
+
projectIds: L.projectIds.trim() ? L.projectIds.split(",").map((e) => e.trim()).filter(Boolean) : void 0
|
|
92
93
|
} } })).data?.generateTimeCampusInvoiceDraft;
|
|
93
94
|
if (!t) throw Error("Failed to generate invoice — check the billing period has un-invoiced billable time");
|
|
94
|
-
|
|
95
|
+
Ee.invoiceCreated({
|
|
95
96
|
invoiceId: t.id,
|
|
96
97
|
lineItemCount: t.lineItems?.length ?? 0
|
|
97
|
-
}),
|
|
98
|
+
}), w({
|
|
98
99
|
title: "Draft invoice generated",
|
|
99
100
|
variant: "success"
|
|
100
|
-
}), Z(), await
|
|
101
|
+
}), Z(), await Y();
|
|
101
102
|
} catch (e) {
|
|
102
|
-
|
|
103
|
+
w({
|
|
103
104
|
title: e instanceof Error ? e.message : "Failed to generate invoice — check the billing period has un-invoiced billable time",
|
|
104
105
|
variant: "error"
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
},
|
|
108
|
-
|
|
108
|
+
}, Fe = async (e) => {
|
|
109
|
+
J(e.id);
|
|
109
110
|
try {
|
|
110
|
-
await
|
|
111
|
+
await A({ variables: { input: {
|
|
111
112
|
id: e.id,
|
|
112
|
-
workspaceId:
|
|
113
|
-
status:
|
|
114
|
-
} } }),
|
|
113
|
+
workspaceId: m,
|
|
114
|
+
status: l.Sent
|
|
115
|
+
} } }), w({
|
|
115
116
|
title: "Invoice marked as sent",
|
|
116
117
|
variant: "success"
|
|
117
|
-
}), await
|
|
118
|
+
}), await Y();
|
|
118
119
|
} catch {
|
|
119
|
-
|
|
120
|
+
w({
|
|
120
121
|
title: "Failed to update invoice status",
|
|
121
122
|
variant: "error"
|
|
122
123
|
});
|
|
123
124
|
} finally {
|
|
124
|
-
|
|
125
|
+
J(null);
|
|
125
126
|
}
|
|
126
|
-
},
|
|
127
|
-
|
|
127
|
+
}, Ie = async (e) => {
|
|
128
|
+
J(e.id);
|
|
128
129
|
try {
|
|
129
|
-
await
|
|
130
|
+
await A({ variables: { input: {
|
|
130
131
|
id: e.id,
|
|
131
|
-
workspaceId:
|
|
132
|
-
status:
|
|
133
|
-
} } }),
|
|
132
|
+
workspaceId: m,
|
|
133
|
+
status: l.Paid
|
|
134
|
+
} } }), w({
|
|
134
135
|
title: "Invoice marked as paid",
|
|
135
136
|
variant: "success"
|
|
136
|
-
}), await
|
|
137
|
+
}), await Y();
|
|
137
138
|
} catch {
|
|
138
|
-
|
|
139
|
+
w({
|
|
139
140
|
title: "Failed to update invoice status",
|
|
140
141
|
variant: "error"
|
|
141
142
|
});
|
|
142
143
|
} finally {
|
|
143
|
-
|
|
144
|
+
J(null);
|
|
144
145
|
}
|
|
145
|
-
},
|
|
146
|
-
if (
|
|
147
|
-
await
|
|
148
|
-
id:
|
|
149
|
-
workspaceId:
|
|
150
|
-
} }),
|
|
146
|
+
}, Le = async () => {
|
|
147
|
+
if (K) try {
|
|
148
|
+
await De({ variables: {
|
|
149
|
+
id: K.id,
|
|
150
|
+
workspaceId: m
|
|
151
|
+
} }), w({
|
|
151
152
|
title: "Draft invoice deleted",
|
|
152
153
|
variant: "success"
|
|
153
|
-
}),
|
|
154
|
+
}), q(null), await Y();
|
|
154
155
|
} catch {
|
|
155
|
-
|
|
156
|
+
w({
|
|
156
157
|
title: "Failed to delete invoice",
|
|
157
158
|
variant: "error"
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
|
-
},
|
|
161
|
-
|
|
161
|
+
}, Re = async (e) => {
|
|
162
|
+
B(e), H(null), U(!0);
|
|
162
163
|
try {
|
|
163
|
-
let { data: t } = await
|
|
164
|
-
query:
|
|
164
|
+
let { data: t } = await T.query({
|
|
165
|
+
query: ge,
|
|
165
166
|
variables: {
|
|
166
167
|
id: e.id,
|
|
167
|
-
workspaceId:
|
|
168
|
+
workspaceId: m
|
|
168
169
|
},
|
|
169
170
|
fetchPolicy: "no-cache"
|
|
170
171
|
}), n = t?.timeCampusInvoiceHtml;
|
|
171
|
-
|
|
172
|
+
H(n ?? null);
|
|
172
173
|
} catch {
|
|
173
|
-
|
|
174
|
+
w({
|
|
174
175
|
title: "Failed to load invoice preview",
|
|
175
176
|
variant: "error"
|
|
176
177
|
});
|
|
177
178
|
} finally {
|
|
178
|
-
|
|
179
|
+
U(!1);
|
|
179
180
|
}
|
|
180
181
|
}, Q = async (e) => {
|
|
181
|
-
|
|
182
|
+
G(e.id);
|
|
182
183
|
try {
|
|
183
|
-
let { data: t } = await
|
|
184
|
-
query:
|
|
184
|
+
let { data: t } = await T.query({
|
|
185
|
+
query: _e,
|
|
185
186
|
variables: {
|
|
186
187
|
id: e.id,
|
|
187
|
-
workspaceId:
|
|
188
|
+
workspaceId: m
|
|
188
189
|
},
|
|
189
190
|
fetchPolicy: "no-cache"
|
|
190
191
|
}), n = t?.timeCampusInvoicePdf;
|
|
191
192
|
if (!n) throw Error("Empty PDF payload");
|
|
192
|
-
|
|
193
|
+
ve(n, `${e.invoiceNumber}.pdf`);
|
|
193
194
|
} catch {
|
|
194
|
-
|
|
195
|
+
w({
|
|
195
196
|
title: "Failed to download PDF",
|
|
196
197
|
variant: "error"
|
|
197
198
|
});
|
|
198
199
|
} finally {
|
|
199
|
-
|
|
200
|
+
G(null);
|
|
200
201
|
}
|
|
201
|
-
},
|
|
202
|
-
|
|
202
|
+
}, ze = async () => {
|
|
203
|
+
F(!0);
|
|
203
204
|
try {
|
|
204
|
-
((await
|
|
205
|
+
((await Se({
|
|
205
206
|
variables: {
|
|
206
|
-
workspaceId:
|
|
207
|
+
workspaceId: m,
|
|
207
208
|
pagination: {
|
|
208
|
-
limit:
|
|
209
|
-
offset:
|
|
209
|
+
limit: v,
|
|
210
|
+
offset: M.length
|
|
210
211
|
}
|
|
211
212
|
},
|
|
212
213
|
updateQuery: (e, { fetchMoreResult: t }) => t ? {
|
|
@@ -216,153 +217,153 @@ function w() {
|
|
|
216
217
|
items: [...e.timeCampusInvoices.items, ...t.timeCampusInvoices.items]
|
|
217
218
|
}
|
|
218
219
|
} : e
|
|
219
|
-
})).data?.timeCampusInvoices?.items?.length ?? 0) <
|
|
220
|
+
})).data?.timeCampusInvoices?.items?.length ?? 0) < v && Ae(!1);
|
|
220
221
|
} finally {
|
|
221
|
-
|
|
222
|
+
F(!1);
|
|
222
223
|
}
|
|
223
224
|
};
|
|
224
|
-
if (
|
|
225
|
+
if (D && we && M.length === 0) return /* @__PURE__ */ g(e, {
|
|
225
226
|
title: "Invoicing",
|
|
226
227
|
description: "Bill clients for billable time",
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
+
children: /* @__PURE__ */ g(r, {
|
|
228
229
|
variant: "list",
|
|
229
230
|
count: 4
|
|
230
231
|
})
|
|
231
232
|
});
|
|
232
|
-
if (
|
|
233
|
+
if (be) return /* @__PURE__ */ g(e, {
|
|
233
234
|
title: "Invoicing",
|
|
234
235
|
description: "Bill clients for billable time",
|
|
235
|
-
children: /* @__PURE__ */
|
|
236
|
-
className: "rounded-lg border border-status-error-
|
|
236
|
+
children: /* @__PURE__ */ g("div", {
|
|
237
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bgSubtle p-4 text-sm text-status-error-text",
|
|
237
238
|
children: "Failed to load invoices. Please try again later."
|
|
238
239
|
})
|
|
239
240
|
});
|
|
240
|
-
let $ = /* @__PURE__ */
|
|
241
|
-
onClick:
|
|
241
|
+
let $ = /* @__PURE__ */ _("button", {
|
|
242
|
+
onClick: X,
|
|
242
243
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ g(fe, { className: "h-4 w-4" }), "Generate Invoice"]
|
|
244
245
|
});
|
|
245
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ _(e, {
|
|
246
247
|
title: "Invoicing",
|
|
247
248
|
description: "Bill clients for billable time",
|
|
248
249
|
purpose: "Turn logged, billable hours into a real invoice — pick a client and a billing period, and TimeCampus aggregates every un-invoiced billable time entry by project and task, applying each entry's own rate, into a draft you can review, send, and mark paid.",
|
|
249
250
|
actions: $,
|
|
250
251
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ _("div", {
|
|
252
253
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
253
254
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ g(t, {
|
|
255
256
|
featured: !0,
|
|
256
257
|
title: "Total Invoiced",
|
|
257
|
-
value: s(
|
|
258
|
-
icon: /* @__PURE__ */
|
|
258
|
+
value: s(N?.totalInvoiced ?? 0),
|
|
259
|
+
icon: /* @__PURE__ */ g(ue, { className: "h-5 w-5" })
|
|
259
260
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ g(t, {
|
|
261
262
|
title: "Outstanding",
|
|
262
|
-
value: s(
|
|
263
|
-
description: `${
|
|
263
|
+
value: s(N?.totalOutstanding ?? 0),
|
|
264
|
+
description: `${N?.sentCount ?? 0} sent, awaiting payment`
|
|
264
265
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ g(t, {
|
|
266
267
|
title: "Paid",
|
|
267
|
-
value: s(
|
|
268
|
-
description: `${
|
|
268
|
+
value: s(N?.totalPaid ?? 0),
|
|
269
|
+
description: `${N?.paidCount ?? 0} invoices paid`
|
|
269
270
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ g(t, {
|
|
271
272
|
title: "Drafts",
|
|
272
|
-
value: String(
|
|
273
|
-
icon: /* @__PURE__ */
|
|
273
|
+
value: String(N?.draftCount ?? 0),
|
|
274
|
+
icon: /* @__PURE__ */ g(p, { className: "h-5 w-5" }),
|
|
274
275
|
description: "not yet sent"
|
|
275
276
|
})
|
|
276
277
|
]
|
|
277
278
|
}),
|
|
278
|
-
|
|
279
|
+
M.length === 0 && !D ? /* @__PURE__ */ g(n, {
|
|
279
280
|
illustration: "empty-data",
|
|
280
281
|
title: "No invoices yet",
|
|
281
282
|
description: "Generate a draft invoice from real billable time entries to bill a client.",
|
|
282
283
|
action: $
|
|
283
|
-
}) : /* @__PURE__ */
|
|
284
|
+
}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
284
285
|
className: "mt-4 rounded-xl border border-border-seam bg-gloss-card shadow-pop",
|
|
285
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ g("div", {
|
|
286
287
|
className: "divide-y divide-border",
|
|
287
|
-
children:
|
|
288
|
-
let t =
|
|
289
|
-
return /* @__PURE__ */
|
|
288
|
+
children: M.map((e) => {
|
|
289
|
+
let t = Ne === e.id, n = e.status === l.Draft, r = e.status === l.Sent;
|
|
290
|
+
return /* @__PURE__ */ _("div", {
|
|
290
291
|
className: "flex flex-col gap-3 p-4 hover:bg-bg-sunken/50 transition-colors sm:flex-row sm:items-center sm:justify-between",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ _("div", {
|
|
292
293
|
className: "flex items-center gap-3",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ g(p, { className: "h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("p", {
|
|
294
295
|
className: "text-sm font-medium text-text-primary",
|
|
295
296
|
children: [
|
|
296
297
|
e.invoiceNumber,
|
|
297
298
|
" · ",
|
|
298
299
|
e.clientName
|
|
299
300
|
]
|
|
300
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ _("p", {
|
|
301
302
|
className: "text-xs text-text-secondary",
|
|
302
303
|
children: [
|
|
303
304
|
c(e.periodStart),
|
|
304
305
|
" –",
|
|
305
306
|
" ",
|
|
306
307
|
c(e.periodEnd),
|
|
307
|
-
e.dueDate && /* @__PURE__ */
|
|
308
|
+
e.dueDate && /* @__PURE__ */ _(h, { children: [" · Due ", c(e.dueDate)] })
|
|
308
309
|
]
|
|
309
310
|
})] })]
|
|
310
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ _("div", {
|
|
311
312
|
className: "flex items-center gap-3",
|
|
312
313
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ g("p", {
|
|
314
315
|
className: "text-sm font-medium text-text-primary",
|
|
315
316
|
children: s(e.total, e.currency)
|
|
316
317
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ g(i, {
|
|
318
319
|
label: e.status.toLowerCase(),
|
|
319
320
|
status: e.status.toLowerCase()
|
|
320
321
|
}),
|
|
321
|
-
e.isOverdue && /* @__PURE__ */
|
|
322
|
+
e.isOverdue && /* @__PURE__ */ _("span", {
|
|
322
323
|
title: "Past due date",
|
|
323
324
|
className: "inline-flex items-center gap-1 text-xs font-medium text-status-error-text",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ g(ce, { className: "h-3.5 w-3.5" }), "Overdue"]
|
|
325
326
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ _("div", {
|
|
327
328
|
className: "flex items-center gap-1",
|
|
328
329
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ g("button", {
|
|
330
331
|
type: "button",
|
|
331
|
-
onClick: () => void
|
|
332
|
+
onClick: () => void Re(e),
|
|
332
333
|
title: "View invoice",
|
|
333
334
|
className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken",
|
|
334
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ g(de, { className: "h-4 w-4" })
|
|
335
336
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ g("button", {
|
|
337
338
|
type: "button",
|
|
338
|
-
disabled:
|
|
339
|
+
disabled: W === e.id,
|
|
339
340
|
onClick: () => void Q(e),
|
|
340
341
|
title: "Download PDF",
|
|
341
342
|
className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken disabled:opacity-50",
|
|
342
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ g(f, { className: "h-4 w-4" })
|
|
343
344
|
}),
|
|
344
|
-
n && /* @__PURE__ */
|
|
345
|
+
n && /* @__PURE__ */ g("button", {
|
|
345
346
|
type: "button",
|
|
346
347
|
disabled: t,
|
|
347
|
-
onClick: () =>
|
|
348
|
+
onClick: () => Fe(e),
|
|
348
349
|
title: "Mark as sent",
|
|
349
|
-
className: "rounded-md p-1.5 text-status-info-text hover:bg-status-info-
|
|
350
|
-
children: /* @__PURE__ */
|
|
350
|
+
className: "rounded-md p-1.5 text-status-info-text hover:bg-status-info-bgSubtle disabled:opacity-50",
|
|
351
|
+
children: /* @__PURE__ */ g(pe, { className: "h-4 w-4" })
|
|
351
352
|
}),
|
|
352
|
-
r && /* @__PURE__ */
|
|
353
|
+
r && /* @__PURE__ */ g("button", {
|
|
353
354
|
type: "button",
|
|
354
355
|
disabled: t,
|
|
355
|
-
onClick: () =>
|
|
356
|
+
onClick: () => Ie(e),
|
|
356
357
|
title: "Mark as paid",
|
|
357
|
-
className: "rounded-md p-1.5 text-status-success-text hover:bg-status-success-
|
|
358
|
-
children: /* @__PURE__ */
|
|
358
|
+
className: "rounded-md p-1.5 text-status-success-text hover:bg-status-success-bgSubtle disabled:opacity-50",
|
|
359
|
+
children: /* @__PURE__ */ g(le, { className: "h-4 w-4" })
|
|
359
360
|
}),
|
|
360
|
-
n && /* @__PURE__ */
|
|
361
|
+
n && /* @__PURE__ */ g("button", {
|
|
361
362
|
type: "button",
|
|
362
|
-
onClick: () =>
|
|
363
|
+
onClick: () => q(e),
|
|
363
364
|
title: "Delete draft",
|
|
364
|
-
className: "rounded-md p-1.5 text-status-error-text hover:bg-status-error-
|
|
365
|
-
children: /* @__PURE__ */
|
|
365
|
+
className: "rounded-md p-1.5 text-status-error-text hover:bg-status-error-bgSubtle",
|
|
366
|
+
children: /* @__PURE__ */ g(me, { className: "h-4 w-4" })
|
|
366
367
|
})
|
|
367
368
|
]
|
|
368
369
|
})
|
|
@@ -371,228 +372,228 @@ function w() {
|
|
|
371
372
|
}, e.id);
|
|
372
373
|
})
|
|
373
374
|
})
|
|
374
|
-
}),
|
|
375
|
+
}), ke && M.length < Oe && /* @__PURE__ */ g("div", {
|
|
375
376
|
className: "mt-4 flex justify-center",
|
|
376
|
-
children: /* @__PURE__ */
|
|
377
|
-
onClick:
|
|
378
|
-
disabled:
|
|
377
|
+
children: /* @__PURE__ */ g("button", {
|
|
378
|
+
onClick: ze,
|
|
379
|
+
disabled: P,
|
|
379
380
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
|
|
380
|
-
children:
|
|
381
|
+
children: P ? "Loading..." : "Load more"
|
|
381
382
|
})
|
|
382
383
|
})] }),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
open:
|
|
384
|
+
/* @__PURE__ */ g(a, {
|
|
385
|
+
open: je,
|
|
385
386
|
onClose: Z,
|
|
386
387
|
title: "Generate Invoice",
|
|
387
388
|
description: "Aggregates every billable, un-invoiced time entry in the selected period into a draft invoice.",
|
|
388
|
-
footer: /* @__PURE__ */
|
|
389
|
+
footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
|
|
389
390
|
onClick: Z,
|
|
390
391
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
391
392
|
children: "Cancel"
|
|
392
|
-
}), /* @__PURE__ */
|
|
393
|
-
onClick:
|
|
394
|
-
disabled:
|
|
393
|
+
}), /* @__PURE__ */ g("button", {
|
|
394
|
+
onClick: Pe,
|
|
395
|
+
disabled: k || !L.clientName.trim() || !L.periodStart || !L.periodEnd,
|
|
395
396
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
396
|
-
children:
|
|
397
|
+
children: k ? "Generating..." : "Generate Draft"
|
|
397
398
|
})] }),
|
|
398
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ _("div", {
|
|
399
400
|
className: "space-y-4",
|
|
400
401
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
402
403
|
className: "block text-sm font-medium text-text-primary",
|
|
403
404
|
children: "Client name"
|
|
404
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ g("input", {
|
|
405
406
|
type: "text",
|
|
406
407
|
placeholder: "Acme Corp",
|
|
407
|
-
value:
|
|
408
|
-
onChange: (e) =>
|
|
409
|
-
...
|
|
408
|
+
value: L.clientName,
|
|
409
|
+
onChange: (e) => R({
|
|
410
|
+
...L,
|
|
410
411
|
clientName: e.target.value
|
|
411
412
|
}),
|
|
412
|
-
className:
|
|
413
|
+
className: y
|
|
413
414
|
})] }),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ _("div", {
|
|
415
416
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
417
418
|
className: "block text-sm font-medium text-text-primary",
|
|
418
419
|
children: "Client email"
|
|
419
|
-
}), /* @__PURE__ */
|
|
420
|
+
}), /* @__PURE__ */ g("input", {
|
|
420
421
|
type: "email",
|
|
421
422
|
placeholder: "billing@acme.com",
|
|
422
|
-
value:
|
|
423
|
-
onChange: (e) =>
|
|
424
|
-
...
|
|
423
|
+
value: L.clientEmail,
|
|
424
|
+
onChange: (e) => R({
|
|
425
|
+
...L,
|
|
425
426
|
clientEmail: e.target.value
|
|
426
427
|
}),
|
|
427
|
-
className:
|
|
428
|
-
})] }), /* @__PURE__ */
|
|
428
|
+
className: y
|
|
429
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
429
430
|
className: "block text-sm font-medium text-text-primary",
|
|
430
431
|
children: "Currency"
|
|
431
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ g("input", {
|
|
432
433
|
type: "text",
|
|
433
434
|
placeholder: "USD",
|
|
434
|
-
value:
|
|
435
|
-
onChange: (e) =>
|
|
436
|
-
...
|
|
435
|
+
value: L.currency,
|
|
436
|
+
onChange: (e) => R({
|
|
437
|
+
...L,
|
|
437
438
|
currency: e.target.value
|
|
438
439
|
}),
|
|
439
|
-
className:
|
|
440
|
+
className: y
|
|
440
441
|
})] })]
|
|
441
442
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
443
444
|
className: "block text-sm font-medium text-text-primary",
|
|
444
445
|
children: "Client address"
|
|
445
|
-
}), /* @__PURE__ */
|
|
446
|
+
}), /* @__PURE__ */ g("input", {
|
|
446
447
|
type: "text",
|
|
447
448
|
placeholder: "Optional billing address",
|
|
448
|
-
value:
|
|
449
|
-
onChange: (e) =>
|
|
450
|
-
...
|
|
449
|
+
value: L.clientAddress,
|
|
450
|
+
onChange: (e) => R({
|
|
451
|
+
...L,
|
|
451
452
|
clientAddress: e.target.value
|
|
452
453
|
}),
|
|
453
|
-
className:
|
|
454
|
+
className: y
|
|
454
455
|
})] }),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ _("div", {
|
|
456
457
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
458
459
|
className: "block text-sm font-medium text-text-primary",
|
|
459
460
|
children: "Billing period start"
|
|
460
|
-
}), /* @__PURE__ */
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
periodStart: e.target.value
|
|
461
|
+
}), /* @__PURE__ */ g(u, {
|
|
462
|
+
value: L.periodStart,
|
|
463
|
+
onChange: (e) => R({
|
|
464
|
+
...L,
|
|
465
|
+
periodStart: e
|
|
466
466
|
}),
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
label: "Billing period start",
|
|
468
|
+
clearable: !0
|
|
469
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
469
470
|
className: "block text-sm font-medium text-text-primary",
|
|
470
471
|
children: "Billing period end"
|
|
471
|
-
}), /* @__PURE__ */
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
periodEnd: e.target.value
|
|
472
|
+
}), /* @__PURE__ */ g(u, {
|
|
473
|
+
value: L.periodEnd,
|
|
474
|
+
onChange: (e) => R({
|
|
475
|
+
...L,
|
|
476
|
+
periodEnd: e
|
|
477
477
|
}),
|
|
478
|
-
|
|
478
|
+
label: "Billing period end",
|
|
479
|
+
clearable: !0
|
|
479
480
|
})] })]
|
|
480
481
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ _("div", {
|
|
482
483
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
484
485
|
className: "block text-sm font-medium text-text-primary",
|
|
485
486
|
children: "Tax rate (%)"
|
|
486
|
-
}), /* @__PURE__ */
|
|
487
|
+
}), /* @__PURE__ */ g("input", {
|
|
487
488
|
type: "number",
|
|
488
489
|
min: 0,
|
|
489
490
|
max: 100,
|
|
490
491
|
step: "0.1",
|
|
491
|
-
value:
|
|
492
|
-
onChange: (e) =>
|
|
493
|
-
...
|
|
492
|
+
value: L.taxRatePercent,
|
|
493
|
+
onChange: (e) => R({
|
|
494
|
+
...L,
|
|
494
495
|
taxRatePercent: e.target.value
|
|
495
496
|
}),
|
|
496
|
-
className:
|
|
497
|
-
})] }), /* @__PURE__ */
|
|
497
|
+
className: y
|
|
498
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
498
499
|
className: "block text-sm font-medium text-text-primary",
|
|
499
500
|
children: "Due date"
|
|
500
|
-
}), /* @__PURE__ */
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
dueDate: e.target.value
|
|
501
|
+
}), /* @__PURE__ */ g(u, {
|
|
502
|
+
value: L.dueDate,
|
|
503
|
+
onChange: (e) => R({
|
|
504
|
+
...L,
|
|
505
|
+
dueDate: e
|
|
506
506
|
}),
|
|
507
|
-
|
|
507
|
+
label: "Due date",
|
|
508
|
+
clearable: !0
|
|
508
509
|
})] })]
|
|
509
510
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
511
512
|
className: "block text-sm font-medium text-text-primary",
|
|
512
513
|
children: "Project IDs"
|
|
513
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ g("input", {
|
|
514
515
|
type: "text",
|
|
515
516
|
placeholder: "Optional, comma-separated. Leave blank for all projects.",
|
|
516
|
-
value:
|
|
517
|
-
onChange: (e) =>
|
|
518
|
-
...
|
|
517
|
+
value: L.projectIds,
|
|
518
|
+
onChange: (e) => R({
|
|
519
|
+
...L,
|
|
519
520
|
projectIds: e.target.value
|
|
520
521
|
}),
|
|
521
|
-
className:
|
|
522
|
+
className: y
|
|
522
523
|
})] }),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
524
525
|
className: "block text-sm font-medium text-text-primary",
|
|
525
526
|
children: "Notes"
|
|
526
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ g("textarea", {
|
|
527
528
|
rows: 2,
|
|
528
529
|
placeholder: "Optional notes printed on the invoice",
|
|
529
|
-
value:
|
|
530
|
-
onChange: (e) =>
|
|
531
|
-
...
|
|
530
|
+
value: L.notes,
|
|
531
|
+
onChange: (e) => R({
|
|
532
|
+
...L,
|
|
532
533
|
notes: e.target.value
|
|
533
534
|
}),
|
|
534
|
-
className:
|
|
535
|
+
className: y
|
|
535
536
|
})] })
|
|
536
537
|
]
|
|
537
538
|
})
|
|
538
539
|
}),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
open:
|
|
541
|
-
onClose: () =>
|
|
542
|
-
title:
|
|
543
|
-
description:
|
|
540
|
+
/* @__PURE__ */ g(a, {
|
|
541
|
+
open: z !== null,
|
|
542
|
+
onClose: () => B(null),
|
|
543
|
+
title: z ? `Invoice ${z.invoiceNumber}` : "Invoice",
|
|
544
|
+
description: z?.clientName,
|
|
544
545
|
size: "xl",
|
|
545
|
-
footer:
|
|
546
|
-
onClick: () =>
|
|
546
|
+
footer: z && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
|
|
547
|
+
onClick: () => B(null),
|
|
547
548
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
548
549
|
children: "Close"
|
|
549
|
-
}), /* @__PURE__ */
|
|
550
|
-
onClick: () => void Q(
|
|
551
|
-
disabled:
|
|
550
|
+
}), /* @__PURE__ */ _("button", {
|
|
551
|
+
onClick: () => void Q(z),
|
|
552
|
+
disabled: W === z.id,
|
|
552
553
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ g(f, { className: "h-4 w-4" }), W === z.id ? "Downloading..." : "Download PDF"]
|
|
554
555
|
})] }),
|
|
555
|
-
children:
|
|
556
|
+
children: Me ? /* @__PURE__ */ g(r, {
|
|
556
557
|
variant: "detail",
|
|
557
558
|
count: 1
|
|
558
|
-
}) :
|
|
559
|
+
}) : V ? /* @__PURE__ */ g("iframe", {
|
|
559
560
|
title: "Invoice preview",
|
|
560
|
-
srcDoc:
|
|
561
|
+
srcDoc: V,
|
|
561
562
|
sandbox: "",
|
|
562
563
|
className: "h-[60vh] w-full rounded-md border border-border-subtle bg-white"
|
|
563
|
-
}) : /* @__PURE__ */
|
|
564
|
+
}) : /* @__PURE__ */ g("p", {
|
|
564
565
|
className: "text-sm text-text-secondary",
|
|
565
566
|
children: "Failed to load invoice preview."
|
|
566
567
|
})
|
|
567
568
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
open:
|
|
570
|
-
onClose: () =>
|
|
569
|
+
/* @__PURE__ */ g(a, {
|
|
570
|
+
open: K !== null,
|
|
571
|
+
onClose: () => q(null),
|
|
571
572
|
title: "Delete draft invoice?",
|
|
572
|
-
description:
|
|
573
|
+
description: K ? `${K.invoiceNumber} · ${s(K.total, K.currency)} will be removed and its time entries released back to the un-invoiced pool.` : void 0,
|
|
573
574
|
size: "sm",
|
|
574
|
-
footer: /* @__PURE__ */
|
|
575
|
-
onClick: () =>
|
|
575
|
+
footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
|
|
576
|
+
onClick: () => q(null),
|
|
576
577
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
577
578
|
children: "Cancel"
|
|
578
|
-
}), /* @__PURE__ */
|
|
579
|
-
onClick:
|
|
580
|
-
disabled:
|
|
581
|
-
className: "rounded-md bg-status-error-
|
|
582
|
-
children:
|
|
579
|
+
}), /* @__PURE__ */ g("button", {
|
|
580
|
+
onClick: Le,
|
|
581
|
+
disabled: j,
|
|
582
|
+
className: "rounded-md bg-status-error-bgSubtle px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bgSubtle/70 disabled:opacity-50",
|
|
583
|
+
children: j ? "Deleting..." : "Delete"
|
|
583
584
|
})] }),
|
|
584
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ g("p", {
|
|
585
586
|
className: "text-sm text-text-secondary",
|
|
586
587
|
children: "This permanently removes the draft. This action cannot be undone."
|
|
587
588
|
})
|
|
588
589
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
toasts:
|
|
591
|
-
onDismiss:
|
|
590
|
+
/* @__PURE__ */ g(ee, {
|
|
591
|
+
toasts: C,
|
|
592
|
+
onDismiss: ye
|
|
592
593
|
})
|
|
593
594
|
]
|
|
594
595
|
});
|
|
595
596
|
}
|
|
596
|
-
export {
|
|
597
|
+
export { C as InvoicingPage };
|
|
597
598
|
|
|
598
599
|
//# sourceMappingURL=InvoicingPage.js.map
|