@tesouro/embedded-components-react 0.5.252 → 0.5.255
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/index.d.ts +95 -79
- package/dist/lib/ReceivablesWidget.d.ts +25 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +214 -209
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +162 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +32 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillPayWidgetNative.js +48 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +32 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +38 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +12 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +11 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +9 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +78 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -78
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +29 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +26 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +16 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +54 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +2 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +15 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +89 -88
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +55 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +71 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +123 -164
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +40 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +91 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -78
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +15 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +206 -89
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +38 -38
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +8 -7
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +0 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +0 -2
|
@@ -1,2 +1,54 @@
|
|
|
1
|
-
import "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import "
|
|
1
|
+
import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuGroup as r, DropdownMenuItem as i, DropdownMenuLabel as a, DropdownMenuSeparator as o, DropdownMenuTrigger as s } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { groupBySectionHeading as c } from "./index6.js";
|
|
3
|
+
import { Fragment as l, useId as u } from "react";
|
|
4
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { MoreHorizontalIcon as p, MoreVerticalIcon as m } from "lucide-react";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js
|
|
7
|
+
function h({ actions: h, triggerLabel: g, placement: _ = "row", testId: v }) {
|
|
8
|
+
let y = u();
|
|
9
|
+
if (!h.length) return null;
|
|
10
|
+
let b = _ === "header", x = _ === "header" || _ === "table", S = b ? p : m, C = c(h);
|
|
11
|
+
return /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(s, {
|
|
12
|
+
asChild: !0,
|
|
13
|
+
children: /* @__PURE__ */ d(e, {
|
|
14
|
+
type: "button",
|
|
15
|
+
variant: x ? "ghost" : "outline",
|
|
16
|
+
size: "icon",
|
|
17
|
+
"aria-label": g,
|
|
18
|
+
"data-testid": v,
|
|
19
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
20
|
+
onClick: (e) => e.stopPropagation(),
|
|
21
|
+
children: /* @__PURE__ */ d(S, { className: "ttw:size-4" })
|
|
22
|
+
})
|
|
23
|
+
}), /* @__PURE__ */ d(n, {
|
|
24
|
+
align: "end",
|
|
25
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
26
|
+
onClick: (e) => e.stopPropagation(),
|
|
27
|
+
children: C.map((e, t) => {
|
|
28
|
+
let n = e.items.map((e) => {
|
|
29
|
+
let t = e.icon;
|
|
30
|
+
return /* @__PURE__ */ f(i, {
|
|
31
|
+
disabled: e.disabled,
|
|
32
|
+
onClick: e.onSelect,
|
|
33
|
+
children: [t ? /* @__PURE__ */ d(t, { className: "ttw:size-4" }) : null, e.label]
|
|
34
|
+
}, e.id);
|
|
35
|
+
});
|
|
36
|
+
if (!e.heading) return /* @__PURE__ */ d(l, { children: n }, e.items[0]?.id);
|
|
37
|
+
let s = `${y}-${t}`;
|
|
38
|
+
return /* @__PURE__ */ f(l, { children: [
|
|
39
|
+
t > 0 ? /* @__PURE__ */ d(o, {}) : null,
|
|
40
|
+
/* @__PURE__ */ d(a, {
|
|
41
|
+
id: s,
|
|
42
|
+
className: "ttw:py-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
|
|
43
|
+
children: e.heading
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ d(r, {
|
|
46
|
+
"aria-labelledby": s,
|
|
47
|
+
children: n
|
|
48
|
+
})
|
|
49
|
+
] }, e.items[0]?.id);
|
|
50
|
+
})
|
|
51
|
+
})] });
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { h as BillOverflowMenu, h as default };
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js
|
|
2
|
-
|
|
3
|
-
let t = [];
|
|
4
|
-
for (let n of e) {
|
|
5
|
-
let e = t.at(-1);
|
|
6
|
-
if (e && e.heading === n.sectionHeading) {
|
|
7
|
-
e.items = [...e.items, n];
|
|
8
|
-
continue;
|
|
9
|
-
}
|
|
10
|
-
t.push({
|
|
11
|
-
heading: n.sectionHeading,
|
|
12
|
-
items: [n]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
}
|
|
2
|
+
var e = {};
|
|
17
3
|
//#endregion
|
|
18
|
-
export { e as
|
|
4
|
+
export { e as DEFAULT_LABELS };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { useDeleteReceivableAttachmentMutation as i, useUploadReceivableAttachme
|
|
|
7
7
|
import { useSendReceivableEmailMutation as o } from "./index7.js";
|
|
8
8
|
import { useAcceptReceivableMutation as s, useCancelReceivableMutation as c, useCloneReceivableMutation as l, useCreateReceivableMutation as u, useDeclineReceivableMutation as d, useDeleteReceivableMutation as f, useIssueReceivableMutation as p, useUpdateReceivableMutation as m } from "./index8.js";
|
|
9
9
|
import { useReceivablePaymentRecordsQuery as h } from "./index9.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useCreateReceivablePaymentRecordMutation as g, useMarkReceivablePaidMutation as _, useMarkReceivableUncollectibleMutation as v } from "./index10.js";
|
|
11
11
|
import { useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivableRequiredFieldsQuery as x, useReceivablesByIdQueries as S, useReceivablesQuery as C } from "./index11.js";
|
|
12
12
|
import { useCancelRecurrenceMutation as w, useCreateOverdueReminderMutation as T, useCreatePaymentReminderMutation as E, useCreateRecurrenceMutation as D, useOverdueRemindersQuery as O, usePauseRecurrenceMutation as k, usePaymentRemindersQuery as A, useRecurrenceQuery as j, useResumeRecurrenceMutation as M, useUpdateRecurrenceMutation as N } from "./index12.js";
|
|
13
13
|
import { useReceivablesAnalyticsQuery as P } from "./index13.js";
|
|
14
|
-
export { s as useAcceptReceivableMutation, t as useAllReceivableHistoryQuery, c as useCancelReceivableMutation, w as useCancelRecurrenceMutation, l as useCloneReceivableMutation, n as useCreateEntityBankAccountMutation, T as useCreateOverdueReminderMutation, E as useCreatePaymentReminderMutation, u as useCreateReceivableMutation, D as useCreateRecurrenceMutation, d as useDeclineReceivableMutation, i as useDeleteReceivableAttachmentMutation, f as useDeleteReceivableMutation, p as useIssueReceivableMutation,
|
|
14
|
+
export { s as useAcceptReceivableMutation, t as useAllReceivableHistoryQuery, c as useCancelReceivableMutation, w as useCancelRecurrenceMutation, l as useCloneReceivableMutation, n as useCreateEntityBankAccountMutation, T as useCreateOverdueReminderMutation, E as useCreatePaymentReminderMutation, u as useCreateReceivableMutation, g as useCreateReceivablePaymentRecordMutation, D as useCreateRecurrenceMutation, d as useDeclineReceivableMutation, i as useDeleteReceivableAttachmentMutation, f as useDeleteReceivableMutation, p as useIssueReceivableMutation, _ as useMarkReceivablePaidMutation, v as useMarkReceivableUncollectibleMutation, O as useOverdueRemindersQuery, k as usePauseRecurrenceMutation, r as usePaymentAccountsQuery, A as usePaymentRemindersQuery, e as usePaymentTermsQuery, h as useReceivablePaymentRecordsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, x as useReceivableRequiredFieldsQuery, P as useReceivablesAnalyticsQuery, S as useReceivablesByIdQueries, C as useReceivablesQuery, j as useRecurrenceQuery, M as useResumeRecurrenceMutation, o as useSendReceivableEmailMutation, m as useUpdateReceivableMutation, N as useUpdateRecurrenceMutation, a as useUploadReceivableAttachmentMutation };
|
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { postPaymentRecords as e, postReceivablesIdMarkAsPaid as t, postReceivablesIdMarkAsUncollectible as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
6
|
import { invalidateAllClients as r } from "../../../shared/data-access/dist/lib/clientRegistry.js";
|
|
7
7
|
import { useEmbedApi as i } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
8
|
import { organizationHeaders as a } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
@@ -37,11 +37,11 @@ async function f({ client: e, organizationId: t, receivableId: n }) {
|
|
|
37
37
|
]);
|
|
38
38
|
}
|
|
39
39
|
function p() {
|
|
40
|
-
let { client:
|
|
40
|
+
let { client: e, organizationId: n } = i();
|
|
41
41
|
return d({
|
|
42
42
|
mutationFn: async ({ path: r, body: i }) => {
|
|
43
|
-
let { data: o } = await
|
|
44
|
-
client:
|
|
43
|
+
let { data: o } = await t({
|
|
44
|
+
client: e,
|
|
45
45
|
headers: a(n),
|
|
46
46
|
path: r,
|
|
47
47
|
body: i,
|
|
@@ -49,9 +49,9 @@ function p() {
|
|
|
49
49
|
});
|
|
50
50
|
return o;
|
|
51
51
|
},
|
|
52
|
-
onSuccess: async (
|
|
52
|
+
onSuccess: async (t, r) => {
|
|
53
53
|
await f({
|
|
54
|
-
client:
|
|
54
|
+
client: e,
|
|
55
55
|
organizationId: n,
|
|
56
56
|
receivableId: r.path.receivable_id
|
|
57
57
|
});
|
|
@@ -59,23 +59,22 @@ function p() {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function m() {
|
|
62
|
-
let { client:
|
|
62
|
+
let { client: t, organizationId: n } = i();
|
|
63
63
|
return d({
|
|
64
|
-
mutationFn: async ({
|
|
65
|
-
let { data:
|
|
66
|
-
client:
|
|
64
|
+
mutationFn: async ({ body: r }) => {
|
|
65
|
+
let { data: i } = await e({
|
|
66
|
+
client: t,
|
|
67
67
|
headers: a(n),
|
|
68
|
-
|
|
69
|
-
body: i,
|
|
68
|
+
body: r,
|
|
70
69
|
throwOnError: !0
|
|
71
70
|
});
|
|
72
|
-
return
|
|
71
|
+
return i;
|
|
73
72
|
},
|
|
74
|
-
onSuccess: async (
|
|
73
|
+
onSuccess: async (e, r) => {
|
|
75
74
|
await f({
|
|
76
|
-
client:
|
|
75
|
+
client: t,
|
|
77
76
|
organizationId: n,
|
|
78
|
-
receivableId: r.
|
|
77
|
+
receivableId: r.body.object.id
|
|
79
78
|
});
|
|
80
79
|
}
|
|
81
80
|
});
|
|
@@ -103,4 +102,4 @@ function h() {
|
|
|
103
102
|
});
|
|
104
103
|
}
|
|
105
104
|
//#endregion
|
|
106
|
-
export {
|
|
105
|
+
export { m as useCreateReceivablePaymentRecordMutation, p as useMarkReceivablePaidMutation, h as useMarkReceivableUncollectibleMutation };
|
|
@@ -254,19 +254,23 @@ function k({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
254
254
|
labels: J
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ D(_, {
|
|
257
|
-
open: Q.actions.
|
|
257
|
+
open: Q.actions.payment.isOpen,
|
|
258
258
|
onOpenChange: (e) => {
|
|
259
|
-
e || Q.actions.
|
|
259
|
+
e || Q.actions.payment.close();
|
|
260
260
|
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
261
|
+
step: Q.actions.payment.step,
|
|
262
|
+
values: Q.actions.payment.values,
|
|
263
|
+
errors: Q.actions.payment.errors,
|
|
264
|
+
currencySymbol: Q.actions.payment.currencySymbol,
|
|
265
|
+
amountDueLabel: Q.actions.payment.amountDueLabel,
|
|
266
|
+
review: Q.actions.payment.review,
|
|
267
|
+
inProgress: Q.actions.payment.inProgress || Q.actionsSuspended,
|
|
268
|
+
onChange: Q.actions.payment.change,
|
|
269
|
+
onFillAmountDue: Q.actions.payment.fillAmountDue,
|
|
270
|
+
onSave: Q.actions.payment.save,
|
|
271
|
+
onEdit: Q.actions.payment.edit,
|
|
272
|
+
onConfirm: Q.actions.payment.confirm,
|
|
273
|
+
onCancel: Q.actions.payment.close,
|
|
270
274
|
labels: G
|
|
271
275
|
}),
|
|
272
276
|
Q.actions.actionDialog && /* @__PURE__ */ D(f, {
|
|
@@ -116,12 +116,12 @@ var b = {
|
|
|
116
116
|
paused: "warning",
|
|
117
117
|
canceled: "danger",
|
|
118
118
|
completed: "success"
|
|
119
|
-
},
|
|
119
|
+
}, ee = {
|
|
120
120
|
active: "forward",
|
|
121
121
|
paused: "pause",
|
|
122
122
|
canceled: "ban",
|
|
123
123
|
completed: "check"
|
|
124
|
-
},
|
|
124
|
+
}, x = {
|
|
125
125
|
pending: "neutral",
|
|
126
126
|
skipped: "warning",
|
|
127
127
|
canceled: "danger",
|
|
@@ -129,7 +129,7 @@ var b = {
|
|
|
129
129
|
send_failed: "danger",
|
|
130
130
|
completed: "success"
|
|
131
131
|
};
|
|
132
|
-
function
|
|
132
|
+
function S(e, t) {
|
|
133
133
|
return {
|
|
134
134
|
pending: t.detailsIterationStatusPending,
|
|
135
135
|
skipped: t.detailsIterationStatusSkipped,
|
|
@@ -139,13 +139,13 @@ function C(e, t) {
|
|
|
139
139
|
completed: t.detailsIterationStatusCompleted
|
|
140
140
|
}[e] ?? "";
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function C(e, t, n) {
|
|
143
143
|
return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", _(t.frequency, n));
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function w(e, t) {
|
|
146
146
|
return t[e] ?? t.unknown;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function T({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: c }) {
|
|
149
149
|
return (t.iterations ?? []).map((t, l) => {
|
|
150
150
|
let u = t.issued_invoice_id, d = u ? n.get(u) : void 0, f = d ?? e;
|
|
151
151
|
return {
|
|
@@ -158,12 +158,12 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
158
158
|
}),
|
|
159
159
|
chip: d ? {
|
|
160
160
|
kind: "invoice",
|
|
161
|
-
label:
|
|
161
|
+
label: w(d.status, i),
|
|
162
162
|
tone: s(d.status)
|
|
163
163
|
} : {
|
|
164
164
|
kind: "iteration",
|
|
165
|
-
label:
|
|
166
|
-
tone:
|
|
165
|
+
label: S(t.status, a),
|
|
166
|
+
tone: x[t.status] ?? "neutral"
|
|
167
167
|
},
|
|
168
168
|
numberLabel: u ? d?.document_id ?? "" : a.detailsPending,
|
|
169
169
|
onOpen: d ? () => c(d.id) : void 0,
|
|
@@ -171,7 +171,7 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
171
171
|
};
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function E(e) {
|
|
175
175
|
if (!e?.line1) return;
|
|
176
176
|
let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
177
177
|
return [
|
|
@@ -180,7 +180,7 @@ function ee(e) {
|
|
|
180
180
|
e.country ? l(e.country) : void 0
|
|
181
181
|
].filter(Boolean).join(", ");
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function D(e, t, n) {
|
|
184
184
|
let r = {
|
|
185
185
|
label: n.detailsAmountReceived,
|
|
186
186
|
value: t(e.amount_paid)
|
|
@@ -242,7 +242,7 @@ function te(e, t, n) {
|
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function te(t, i, a) {
|
|
246
246
|
let o = t.line_items.reduce((t, n) => {
|
|
247
247
|
let r = n.total_before_tax ?? 0;
|
|
248
248
|
return e(n.tax_status) ? {
|
|
@@ -287,20 +287,20 @@ function ne(t, i, a) {
|
|
|
287
287
|
emphasis: !0
|
|
288
288
|
}), m;
|
|
289
289
|
}
|
|
290
|
-
var
|
|
290
|
+
var ne = {
|
|
291
291
|
primary: [],
|
|
292
292
|
overflow: []
|
|
293
293
|
};
|
|
294
|
-
function O({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: s, depositAccount: l, isAccountListIncomplete: u, recurrence: h, paymentRecords:
|
|
294
|
+
function O({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: s, depositAccount: l, isAccountListIncomplete: u, recurrence: h, paymentRecords: x = [], isLoadingPaymentRecords: S = !1, iterationInvoices: w = /* @__PURE__ */ new Map(), auditHistory: O, statusLabels: k, messages: A, canRecordPayment: j, canWrite: M = !0, onOpenReceivable: N, now: P }) {
|
|
295
295
|
if (!e || e.type !== "invoice") return;
|
|
296
|
-
let
|
|
296
|
+
let F = e, I = (e) => o({
|
|
297
297
|
amount: e ?? 0,
|
|
298
|
-
currency:
|
|
298
|
+
currency: F.currency,
|
|
299
299
|
fallback: ""
|
|
300
|
-
}),
|
|
301
|
-
...
|
|
300
|
+
}), L = (e) => a(e, "-"), R = (e) => e ? L(e) : A.detailsPending, { status: z } = F, B = z === "canceled", V = z === "recurring" ? h : void 0, H = F.recurrence_id && z !== "recurring" ? h : void 0, U = z === "overdue" ? m(F.due_date, P) : 0, { amountTone: W, amountRows: re } = D(F, I, A), G = F.counterpart_contact, K = E(F.counterpart_billing_address), ie = [
|
|
301
|
+
...F.counterpart_name ? [{
|
|
302
302
|
label: A.detailsCustomerName,
|
|
303
|
-
value:
|
|
303
|
+
value: F.counterpart_name
|
|
304
304
|
}] : [],
|
|
305
305
|
...G?.email ? [{
|
|
306
306
|
label: A.detailsCustomerEmail,
|
|
@@ -319,133 +319,134 @@ function O({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: s, d
|
|
|
319
319
|
value: g({
|
|
320
320
|
paymentReminder: r,
|
|
321
321
|
overdueReminder: s,
|
|
322
|
-
remindersConfigured: !!(
|
|
322
|
+
remindersConfigured: !!(F.payment_reminder_id || F.overdue_reminder_id),
|
|
323
323
|
messages: A
|
|
324
324
|
})
|
|
325
325
|
}, J = {
|
|
326
326
|
label: A.detailsDepositAccount,
|
|
327
|
-
value: l ? c(l, A) : u &&
|
|
327
|
+
value: l ? c(l, A) : u && F.bank_account_id ? "-" : A.detailsNotProvided
|
|
328
328
|
}, Y = {
|
|
329
329
|
label: A.detailsPaymentTerms,
|
|
330
|
-
value:
|
|
331
|
-
},
|
|
330
|
+
value: F.payment_terms?.name ?? A.detailsPending
|
|
331
|
+
}, ae = V ? [
|
|
332
332
|
{
|
|
333
333
|
label: A.detailsFrequency,
|
|
334
|
-
value: _(
|
|
334
|
+
value: _(V.frequency, A)
|
|
335
335
|
},
|
|
336
336
|
{
|
|
337
337
|
label: A.detailsInvoiceAmount,
|
|
338
|
-
value: F
|
|
338
|
+
value: I(F.total_amount)
|
|
339
339
|
},
|
|
340
340
|
Y,
|
|
341
341
|
q,
|
|
342
342
|
{
|
|
343
343
|
label: A.detailsPoNumber,
|
|
344
|
-
value:
|
|
344
|
+
value: F.purchase_order || A.detailsNotProvided
|
|
345
345
|
},
|
|
346
346
|
J
|
|
347
347
|
] : [
|
|
348
|
-
...
|
|
348
|
+
...F.document_id ? [{
|
|
349
349
|
label: A.detailsInvoiceNumber,
|
|
350
|
-
value:
|
|
350
|
+
value: F.document_id
|
|
351
351
|
}] : [],
|
|
352
352
|
{
|
|
353
353
|
label: A.detailsInvoiceAmount,
|
|
354
|
-
value: F
|
|
354
|
+
value: I(F.total_amount)
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
label: A.detailsInvoiceDate,
|
|
358
|
-
value:
|
|
358
|
+
value: R(F.issue_date)
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
361
|
label: A.detailsDueDate,
|
|
362
|
-
value:
|
|
362
|
+
value: R(F.due_date)
|
|
363
363
|
},
|
|
364
364
|
Y,
|
|
365
365
|
q,
|
|
366
|
-
...
|
|
366
|
+
...F.purchase_order ? [{
|
|
367
367
|
label: A.detailsPoNumber,
|
|
368
|
-
value:
|
|
368
|
+
value: F.purchase_order
|
|
369
369
|
}] : [],
|
|
370
370
|
J
|
|
371
|
-
], X =
|
|
371
|
+
], X = V ? void 0 : i(F), { primary: Z, overflow: Q } = M ? d[z] ?? {
|
|
372
372
|
primary: [],
|
|
373
373
|
overflow: ["clone"]
|
|
374
|
-
} :
|
|
375
|
-
if (
|
|
376
|
-
let e =
|
|
377
|
-
Q =
|
|
374
|
+
} : ne;
|
|
375
|
+
if (V && M) {
|
|
376
|
+
let e = V.status === "active" || V.status === "paused";
|
|
377
|
+
Q = V.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : V.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
|
|
378
378
|
}
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
j || (Z = Z.filter((e) => e !== "recordPayment"));
|
|
380
|
+
let oe = f.has(z) ? {
|
|
381
|
+
rows: x.map((e) => ({
|
|
381
382
|
id: e.id,
|
|
382
|
-
dateLabel:
|
|
383
|
-
amountLabel:
|
|
383
|
+
dateLabel: L(e.paid_at),
|
|
384
|
+
amountLabel: I(e.amount)
|
|
384
385
|
})),
|
|
385
|
-
totalLabel: F
|
|
386
|
-
emptyTone:
|
|
387
|
-
isLoading:
|
|
388
|
-
} : void 0,
|
|
389
|
-
statusLabel: y(
|
|
390
|
-
statusTone: b[
|
|
391
|
-
statusIcon:
|
|
392
|
-
amountLabel: F
|
|
393
|
-
amountPeriodLabel: v(
|
|
394
|
-
startsOnLabel:
|
|
395
|
-
endsOnLabel:
|
|
396
|
-
scheduleTitle: A.detailsScheduleTitle.replace("{frequency}", _(
|
|
397
|
-
schedule:
|
|
398
|
-
invoice:
|
|
399
|
-
recurrence:
|
|
400
|
-
iterationInvoices:
|
|
401
|
-
date:
|
|
386
|
+
totalLabel: I(F.amount_paid),
|
|
387
|
+
emptyTone: z === "overdue" ? "danger" : "default",
|
|
388
|
+
isLoading: S
|
|
389
|
+
} : void 0, se = V ? {
|
|
390
|
+
statusLabel: y(V.status, A),
|
|
391
|
+
statusTone: b[V.status] ?? "neutral",
|
|
392
|
+
statusIcon: ee[V.status],
|
|
393
|
+
amountLabel: I(F.total_amount),
|
|
394
|
+
amountPeriodLabel: v(V.frequency, A),
|
|
395
|
+
startsOnLabel: R(V.start_date),
|
|
396
|
+
endsOnLabel: L(V.end_date),
|
|
397
|
+
scheduleTitle: A.detailsScheduleTitle.replace("{frequency}", _(V.frequency, A)),
|
|
398
|
+
schedule: T({
|
|
399
|
+
invoice: F,
|
|
400
|
+
recurrence: V,
|
|
401
|
+
iterationInvoices: w,
|
|
402
|
+
date: L,
|
|
402
403
|
statusLabels: k,
|
|
403
404
|
messages: A,
|
|
404
|
-
onOpenReceivable:
|
|
405
|
+
onOpenReceivable: N
|
|
405
406
|
})
|
|
406
|
-
} : void 0, $ =
|
|
407
|
+
} : void 0, $ = H ? C(F, H, A) : void 0, ce = H && $ ? {
|
|
407
408
|
title: $,
|
|
408
409
|
backLabel: A.detailsSeriesBack.replace("{title}", $),
|
|
409
|
-
onOpen: () =>
|
|
410
|
+
onOpen: () => N(H.invoice_id)
|
|
410
411
|
} : void 0;
|
|
411
412
|
return {
|
|
412
|
-
id:
|
|
413
|
-
type:
|
|
414
|
-
title:
|
|
415
|
-
status:
|
|
416
|
-
statusTone: p[
|
|
413
|
+
id: F.id,
|
|
414
|
+
type: F.type,
|
|
415
|
+
title: V ? C(F, V, A) : F.counterpart_name ?? A.invoiceType,
|
|
416
|
+
status: z,
|
|
417
|
+
statusTone: p[z] ?? "neutral",
|
|
417
418
|
pdfUrl: n,
|
|
418
|
-
lineItems:
|
|
419
|
+
lineItems: F.line_items.map((e, t) => ({
|
|
419
420
|
id: `${e.product.id ?? "item"}-${t}`,
|
|
420
421
|
name: e.product.name,
|
|
421
422
|
quantityLabel: String(e.quantity),
|
|
422
|
-
unitPriceLabel:
|
|
423
|
-
totalLabel:
|
|
423
|
+
unitPriceLabel: I(e.product.price?.value),
|
|
424
|
+
totalLabel: I(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
|
|
424
425
|
})),
|
|
425
426
|
panel: {
|
|
426
|
-
subtitle:
|
|
427
|
-
statusLabel:
|
|
428
|
-
recurring: !!
|
|
429
|
-
overdueLabel:
|
|
430
|
-
amountTone:
|
|
431
|
-
amountRows:
|
|
432
|
-
issueDateLabel:
|
|
433
|
-
dueDateLabel:
|
|
434
|
-
dueDateCaption:
|
|
435
|
-
paymentHistory:
|
|
436
|
-
customerContact:
|
|
437
|
-
recurringSeries:
|
|
438
|
-
seriesLink:
|
|
439
|
-
billingItems:
|
|
440
|
-
lineItemsSection:
|
|
441
|
-
countLabel: String(
|
|
442
|
-
totals:
|
|
427
|
+
subtitle: V ? A.detailsSeriesSubtitle : F.document_id ? A.detailsInvoiceSubtitle.replace("{number}", F.document_id) : void 0,
|
|
428
|
+
statusLabel: z === "partially_paid" ? k.issued : k[z] ?? k.unknown,
|
|
429
|
+
recurring: !!F.recurrence_id || z === "recurring",
|
|
430
|
+
overdueLabel: U > 0 ? A.detailsDaysOverdue.replace("{days}", String(U)) : void 0,
|
|
431
|
+
amountTone: W,
|
|
432
|
+
amountRows: re,
|
|
433
|
+
issueDateLabel: R(F.issue_date),
|
|
434
|
+
dueDateLabel: B ? L(F.updated_at) : R(F.due_date),
|
|
435
|
+
dueDateCaption: B ? A.detailsCancelledOnCaption : A.detailsDueDate,
|
|
436
|
+
paymentHistory: oe,
|
|
437
|
+
customerContact: ie,
|
|
438
|
+
recurringSeries: se,
|
|
439
|
+
seriesLink: ce,
|
|
440
|
+
billingItems: ae,
|
|
441
|
+
lineItemsSection: V ? void 0 : {
|
|
442
|
+
countLabel: String(F.line_items.length),
|
|
443
|
+
totals: te(F, I, A)
|
|
443
444
|
},
|
|
444
445
|
notes: X && {
|
|
445
446
|
...X,
|
|
446
447
|
countLabel: String([X.opening, X.closing].filter(Boolean).length)
|
|
447
448
|
},
|
|
448
|
-
attachments: t(
|
|
449
|
+
attachments: t(F, A),
|
|
449
450
|
auditHistory: O,
|
|
450
451
|
primaryActions: Z,
|
|
451
452
|
overflowActions: Q
|