@tesouro/embedded-components-react 0.5.268 → 0.5.271
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.css +4 -10
- package/dist/index.d.ts +13 -9
- package/dist/lib/ReceivablesWidget.d.ts +13 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +97 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +76 -150
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +63 -57
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/actionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +161 -152
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +30 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +18 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +208 -158
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +91 -85
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +197 -196
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +147 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +3 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +37 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +22 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +17 -15
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +17 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +37 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +29 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +38 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +26 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +20 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +8 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +34 -83
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +14 -404
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +28 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +79 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +490 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +2 -502
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +41 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +70 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +484 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +224 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +21 -263
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +261 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +2 -237
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +100 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +21 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +226 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +3 -59
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +233 -178
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +85 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +194 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +0 -100
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { isLineItemTaxable as e } from "./lineItems.js";
|
|
2
2
|
import { buildReceivableAttachmentDetailsView as t } from "./attachments.js";
|
|
3
3
|
import { allocateDiscount as n, resolveDiscountAmount as r } from "./totals.js";
|
|
4
|
-
import { buildReceivableNotesView as i, formatDate as a, formatMoney as o
|
|
5
|
-
import { getPaymentAccountLineLabel as
|
|
6
|
-
import { formatCountryName as
|
|
4
|
+
import { buildReceivableNotesView as i, formatDate as a, formatMoney as o } from "./helpers.js";
|
|
5
|
+
import { getPaymentAccountLineLabel as s } from "./bankAccounts.js";
|
|
6
|
+
import { formatCountryName as c, formatDeduction as l } from "./preview.js";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js
|
|
8
|
-
var
|
|
8
|
+
var u = {
|
|
9
9
|
draft: {
|
|
10
|
-
primary: [
|
|
10
|
+
primary: [
|
|
11
|
+
"edit",
|
|
12
|
+
"issue",
|
|
13
|
+
"issueAndSend"
|
|
14
|
+
],
|
|
11
15
|
overflow: ["clone", "delete"]
|
|
12
16
|
},
|
|
13
17
|
issued: {
|
|
@@ -42,13 +46,13 @@ var d = {
|
|
|
42
46
|
primary: [],
|
|
43
47
|
overflow: []
|
|
44
48
|
}
|
|
45
|
-
},
|
|
49
|
+
}, d = /* @__PURE__ */ new Set([
|
|
46
50
|
"issued",
|
|
47
51
|
"overdue",
|
|
48
52
|
"partially_paid",
|
|
49
53
|
"paid",
|
|
50
54
|
"uncollectible"
|
|
51
|
-
]),
|
|
55
|
+
]), f = {
|
|
52
56
|
draft: "neutral",
|
|
53
57
|
issuing: "info",
|
|
54
58
|
issued: "info",
|
|
@@ -64,28 +68,28 @@ var d = {
|
|
|
64
68
|
recurring: "neutral",
|
|
65
69
|
deleted: "neutral"
|
|
66
70
|
};
|
|
67
|
-
function
|
|
71
|
+
function p(e, t = /* @__PURE__ */ new Date()) {
|
|
68
72
|
if (!e) return 0;
|
|
69
73
|
let n = new Date(e);
|
|
70
74
|
if (Number.isNaN(n.getTime())) return 0;
|
|
71
75
|
let r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), i = Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), a = Math.floor((r - i) / 864e5);
|
|
72
76
|
return a > 0 ? a : 0;
|
|
73
77
|
}
|
|
74
|
-
function
|
|
78
|
+
function m(e, t) {
|
|
75
79
|
let n = e.map((e) => `${e} ${e === 1 ? t.reminderUnitDay : t.reminderUnitDays}`);
|
|
76
80
|
if (n.length <= 1) return n[0] ?? "";
|
|
77
81
|
let r = t.reminderNameAnd;
|
|
78
82
|
return n.length === 2 ? `${n[0]} ${r} ${n[1]}` : `${n.slice(0, -1).join(", ")}, ${r} ${n[n.length - 1]}`;
|
|
79
83
|
}
|
|
80
|
-
function
|
|
84
|
+
function h({ paymentReminder: e, overdueReminder: t, remindersConfigured: n, messages: r }) {
|
|
81
85
|
let i = [
|
|
82
86
|
e?.term_1_reminder?.days_before,
|
|
83
87
|
e?.term_2_reminder?.days_before,
|
|
84
88
|
e?.term_final_reminder?.days_before
|
|
85
89
|
].filter((e) => typeof e == "number"), a = (t?.terms ?? []).map((e) => e.days_after).filter((e) => typeof e == "number"), o = [];
|
|
86
|
-
return i.length > 0 && o.push(`${
|
|
90
|
+
return i.length > 0 && o.push(`${m(i, r)} ${r.detailsRemindersBefore}`), a.length > 0 && o.push(`${m(a, r)} ${r.detailsRemindersAfter}`), o.length > 0 ? o.join("\n") : n ? "-" : r.detailsRemindersNone;
|
|
87
91
|
}
|
|
88
|
-
function
|
|
92
|
+
function g(e, t) {
|
|
89
93
|
return {
|
|
90
94
|
day: t.detailsFrequencyDay,
|
|
91
95
|
week: t.detailsFrequencyWeek,
|
|
@@ -94,7 +98,7 @@ function _(e, t) {
|
|
|
94
98
|
year: t.detailsFrequencyYear
|
|
95
99
|
}[e] ?? "";
|
|
96
100
|
}
|
|
97
|
-
function
|
|
101
|
+
function ee(e, t) {
|
|
98
102
|
return {
|
|
99
103
|
day: t.detailsPeriodDay,
|
|
100
104
|
week: t.detailsPeriodWeek,
|
|
@@ -103,7 +107,7 @@ function v(e, t) {
|
|
|
103
107
|
year: t.detailsPeriodYear
|
|
104
108
|
}[e] ?? "";
|
|
105
109
|
}
|
|
106
|
-
function
|
|
110
|
+
function te(e, t) {
|
|
107
111
|
return {
|
|
108
112
|
active: t.detailsSeriesStatusActive,
|
|
109
113
|
paused: t.detailsSeriesStatusPaused,
|
|
@@ -111,17 +115,17 @@ function y(e, t) {
|
|
|
111
115
|
completed: t.detailsSeriesStatusCompleted
|
|
112
116
|
}[e] ?? "";
|
|
113
117
|
}
|
|
114
|
-
var
|
|
118
|
+
var ne = {
|
|
115
119
|
active: "info",
|
|
116
120
|
paused: "warning",
|
|
117
121
|
canceled: "danger",
|
|
118
122
|
completed: "success"
|
|
119
|
-
},
|
|
123
|
+
}, _ = {
|
|
120
124
|
active: "forward",
|
|
121
125
|
paused: "pause",
|
|
122
126
|
canceled: "ban",
|
|
123
127
|
completed: "check"
|
|
124
|
-
},
|
|
128
|
+
}, v = {
|
|
125
129
|
pending: "neutral",
|
|
126
130
|
skipped: "warning",
|
|
127
131
|
canceled: "danger",
|
|
@@ -129,7 +133,7 @@ var b = {
|
|
|
129
133
|
send_failed: "danger",
|
|
130
134
|
completed: "success"
|
|
131
135
|
};
|
|
132
|
-
function
|
|
136
|
+
function y(e, t) {
|
|
133
137
|
return {
|
|
134
138
|
pending: t.detailsIterationStatusPending,
|
|
135
139
|
skipped: t.detailsIterationStatusSkipped,
|
|
@@ -139,48 +143,48 @@ function S(e, t) {
|
|
|
139
143
|
completed: t.detailsIterationStatusCompleted
|
|
140
144
|
}[e] ?? "";
|
|
141
145
|
}
|
|
142
|
-
function
|
|
143
|
-
return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}",
|
|
146
|
+
function b(e, t, n) {
|
|
147
|
+
return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", g(t.frequency, n));
|
|
144
148
|
}
|
|
145
|
-
function
|
|
149
|
+
function x(e, t) {
|
|
146
150
|
return t[e] ?? t.unknown;
|
|
147
151
|
}
|
|
148
|
-
function
|
|
149
|
-
return (t.iterations ?? []).map((t,
|
|
150
|
-
let
|
|
152
|
+
function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
|
|
153
|
+
return (t.iterations ?? []).map((t, c) => {
|
|
154
|
+
let l = t.issued_invoice_id, u = l ? n.get(l) : void 0, d = u ?? e;
|
|
151
155
|
return {
|
|
152
|
-
id: `iteration-${t.iteration ?? ""}-${
|
|
156
|
+
id: `iteration-${t.iteration ?? ""}-${c}`,
|
|
153
157
|
issueDateLabel: t.issue_at ? r(t.issue_at) : a.detailsPending,
|
|
154
158
|
amountLabel: o({
|
|
155
|
-
amount:
|
|
156
|
-
currency:
|
|
159
|
+
amount: d.total_amount ?? 0,
|
|
160
|
+
currency: d.currency,
|
|
157
161
|
fallback: ""
|
|
158
162
|
}),
|
|
159
|
-
chip:
|
|
163
|
+
chip: u ? {
|
|
160
164
|
kind: "invoice",
|
|
161
|
-
label:
|
|
162
|
-
|
|
165
|
+
label: x(u.status, i),
|
|
166
|
+
status: u.status
|
|
163
167
|
} : {
|
|
164
168
|
kind: "iteration",
|
|
165
|
-
label:
|
|
166
|
-
tone:
|
|
169
|
+
label: y(t.status, a),
|
|
170
|
+
tone: v[t.status] ?? "neutral"
|
|
167
171
|
},
|
|
168
|
-
numberLabel:
|
|
169
|
-
onOpen:
|
|
170
|
-
openLabel:
|
|
172
|
+
numberLabel: l ? u?.document_id ?? "" : a.detailsPending,
|
|
173
|
+
onOpen: u ? () => s(u.id) : void 0,
|
|
174
|
+
openLabel: u ? a.detailsScheduleOpenInvoice.replace("{number}", u.document_id ?? "") : void 0
|
|
171
175
|
};
|
|
172
176
|
});
|
|
173
177
|
}
|
|
174
|
-
function
|
|
178
|
+
function re(e) {
|
|
175
179
|
if (!e?.line1) return;
|
|
176
180
|
let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
177
181
|
return [
|
|
178
182
|
e.line2 ? `${e.line1} ${e.line2}` : e.line1,
|
|
179
183
|
t,
|
|
180
|
-
e.country ?
|
|
184
|
+
e.country ? c(e.country) : void 0
|
|
181
185
|
].filter(Boolean).join(", ");
|
|
182
186
|
}
|
|
183
|
-
function
|
|
187
|
+
function C(e, t, n) {
|
|
184
188
|
let r = {
|
|
185
189
|
label: n.detailsAmountReceived,
|
|
186
190
|
value: t(e.amount_paid)
|
|
@@ -242,7 +246,7 @@ function D(e, t, n) {
|
|
|
242
246
|
};
|
|
243
247
|
}
|
|
244
248
|
}
|
|
245
|
-
function
|
|
249
|
+
function ie(t, i, a) {
|
|
246
250
|
let o = t.line_items.reduce((t, n) => {
|
|
247
251
|
let r = n.total_before_tax ?? 0;
|
|
248
252
|
return e(n.tax_status) ? {
|
|
@@ -258,7 +262,7 @@ function te(t, i, a) {
|
|
|
258
262
|
}), s = r({
|
|
259
263
|
discount: t.discount,
|
|
260
264
|
subtotal: o.taxableItemsSubtotal + o.nonTaxableItemsSubtotal
|
|
261
|
-
}), { taxableSubtotal: c, nonTaxableSubtotal:
|
|
265
|
+
}), { taxableSubtotal: c, nonTaxableSubtotal: u } = n({
|
|
262
266
|
...o,
|
|
263
267
|
discountAmount: s
|
|
264
268
|
}), d = s > 0, f = o.taxableItemsSubtotal > 0, p = o.nonTaxableItemsSubtotal > 0, m = [{
|
|
@@ -267,10 +271,10 @@ function te(t, i, a) {
|
|
|
267
271
|
}];
|
|
268
272
|
d && m.push({
|
|
269
273
|
label: a.previewDiscount,
|
|
270
|
-
value:
|
|
274
|
+
value: l(s, t.currency)
|
|
271
275
|
}), p && (f || d) && m.push({
|
|
272
276
|
label: a.previewNonTaxableSubtotal,
|
|
273
|
-
value: i(
|
|
277
|
+
value: i(u),
|
|
274
278
|
tone: "muted"
|
|
275
279
|
}), f && (p || d) && m.push({
|
|
276
280
|
label: a.previewTaxableSubtotal,
|
|
@@ -287,177 +291,182 @@ function te(t, i, a) {
|
|
|
287
291
|
emphasis: !0
|
|
288
292
|
}), m;
|
|
289
293
|
}
|
|
290
|
-
var
|
|
294
|
+
var ae = {
|
|
291
295
|
primary: [],
|
|
292
296
|
overflow: []
|
|
293
297
|
};
|
|
294
|
-
function
|
|
298
|
+
function w({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: c, depositAccount: l, isAccountListIncomplete: m, recurrence: v, paymentRecords: y = [], isLoadingPaymentRecords: x = !1, iterationInvoices: w = /* @__PURE__ */ new Map(), auditHistory: T, statusLabels: E, messages: D, canRecordPayment: O, canWrite: k = !0, onOpenReceivable: A, onOpenCustomer: j, now: oe }) {
|
|
295
299
|
if (!e || e.type !== "invoice") return;
|
|
296
|
-
let
|
|
300
|
+
let M = e, N = (e) => o({
|
|
297
301
|
amount: e ?? 0,
|
|
298
|
-
currency:
|
|
302
|
+
currency: M.currency,
|
|
299
303
|
fallback: ""
|
|
300
|
-
}),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
+
}), P = (e) => a(e, "-"), F = (e) => e ? P(e) : D.detailsPending, { status: I } = M, L = I === "canceled", R = I === "recurring" ? v : void 0, z = M.recurrence_id && I !== "recurring" ? v : void 0, B = I === "overdue" ? p(M.due_date, oe) : 0, { amountTone: V, amountRows: H } = C(M, N, D), U = M.counterpart_contact, W = re(M.counterpart_billing_address), G = M.counterpart_id, K = M.counterpart_name ? {
|
|
305
|
+
label: D.detailsCustomerName,
|
|
306
|
+
name: M.counterpart_name,
|
|
307
|
+
onOpen: j && G ? () => j(G) : void 0
|
|
308
|
+
} : void 0, se = [
|
|
309
|
+
...U?.email ? [{
|
|
310
|
+
label: D.detailsCustomerEmail,
|
|
311
|
+
value: U.email
|
|
304
312
|
}] : [],
|
|
305
|
-
...
|
|
306
|
-
label:
|
|
307
|
-
value:
|
|
313
|
+
...U?.phone ? [{
|
|
314
|
+
label: D.detailsCustomerPhone,
|
|
315
|
+
value: U.phone
|
|
308
316
|
}] : [],
|
|
309
|
-
...
|
|
310
|
-
label:
|
|
311
|
-
value:
|
|
312
|
-
}] : [],
|
|
313
|
-
...K ? [{
|
|
314
|
-
label: A.detailsCustomerAddress,
|
|
315
|
-
value: K
|
|
317
|
+
...W ? [{
|
|
318
|
+
label: D.detailsCustomerAddress,
|
|
319
|
+
value: W
|
|
316
320
|
}] : []
|
|
317
321
|
], q = {
|
|
318
|
-
label:
|
|
319
|
-
value:
|
|
322
|
+
label: D.detailsPaymentReminders,
|
|
323
|
+
value: h({
|
|
320
324
|
paymentReminder: r,
|
|
321
|
-
overdueReminder:
|
|
322
|
-
remindersConfigured: !!(
|
|
323
|
-
messages:
|
|
325
|
+
overdueReminder: c,
|
|
326
|
+
remindersConfigured: !!(M.payment_reminder_id || M.overdue_reminder_id),
|
|
327
|
+
messages: D
|
|
324
328
|
})
|
|
325
329
|
}, J = {
|
|
326
|
-
label:
|
|
327
|
-
value: l ?
|
|
330
|
+
label: D.detailsDepositAccount,
|
|
331
|
+
value: l ? s(l, D) : m && M.bank_account_id ? "-" : D.detailsNotProvided
|
|
328
332
|
}, Y = {
|
|
329
|
-
label:
|
|
330
|
-
value:
|
|
331
|
-
},
|
|
333
|
+
label: D.detailsPaymentTerms,
|
|
334
|
+
value: M.payment_terms?.name ?? D.detailsPending
|
|
335
|
+
}, ce = R ? [
|
|
332
336
|
{
|
|
333
|
-
label:
|
|
334
|
-
value:
|
|
337
|
+
label: D.detailsFrequency,
|
|
338
|
+
value: g(R.frequency, D)
|
|
335
339
|
},
|
|
336
340
|
{
|
|
337
|
-
label:
|
|
338
|
-
value:
|
|
341
|
+
label: D.detailsInvoiceAmount,
|
|
342
|
+
value: N(M.total_amount)
|
|
339
343
|
},
|
|
340
344
|
Y,
|
|
341
345
|
q,
|
|
342
346
|
{
|
|
343
|
-
label:
|
|
344
|
-
value:
|
|
347
|
+
label: D.detailsPoNumber,
|
|
348
|
+
value: M.purchase_order || D.detailsNotProvided
|
|
345
349
|
},
|
|
346
350
|
J
|
|
347
351
|
] : [
|
|
348
|
-
...
|
|
349
|
-
label:
|
|
350
|
-
value:
|
|
352
|
+
...M.document_id ? [{
|
|
353
|
+
label: D.detailsInvoiceNumber,
|
|
354
|
+
value: M.document_id
|
|
351
355
|
}] : [],
|
|
352
356
|
{
|
|
353
|
-
label:
|
|
354
|
-
value:
|
|
357
|
+
label: D.detailsInvoiceAmount,
|
|
358
|
+
value: N(M.total_amount)
|
|
355
359
|
},
|
|
356
360
|
{
|
|
357
|
-
label:
|
|
358
|
-
value:
|
|
361
|
+
label: D.detailsInvoiceDate,
|
|
362
|
+
value: F(M.issue_date)
|
|
359
363
|
},
|
|
360
364
|
{
|
|
361
|
-
label:
|
|
362
|
-
value:
|
|
365
|
+
label: D.detailsDueDate,
|
|
366
|
+
value: F(M.due_date)
|
|
363
367
|
},
|
|
364
368
|
Y,
|
|
365
369
|
q,
|
|
366
|
-
...
|
|
367
|
-
label:
|
|
368
|
-
value:
|
|
370
|
+
...M.purchase_order ? [{
|
|
371
|
+
label: D.detailsPoNumber,
|
|
372
|
+
value: M.purchase_order
|
|
369
373
|
}] : [],
|
|
370
374
|
J
|
|
371
|
-
], X =
|
|
375
|
+
], X = R ? void 0 : i(M), { primary: Z, overflow: Q } = k ? u[I] ?? {
|
|
372
376
|
primary: [],
|
|
373
377
|
overflow: ["clone"]
|
|
374
|
-
} :
|
|
375
|
-
if (
|
|
376
|
-
let e =
|
|
377
|
-
Q =
|
|
378
|
+
} : ae;
|
|
379
|
+
if (R && k) {
|
|
380
|
+
let e = R.status === "active" || R.status === "paused";
|
|
381
|
+
Q = R.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : R.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
|
|
378
382
|
}
|
|
379
|
-
|
|
380
|
-
let
|
|
381
|
-
rows:
|
|
383
|
+
O || (Z = Z.filter((e) => e !== "recordPayment"));
|
|
384
|
+
let le = d.has(I) ? {
|
|
385
|
+
rows: y.map((e) => ({
|
|
382
386
|
id: e.id,
|
|
383
|
-
dateLabel:
|
|
384
|
-
amountLabel:
|
|
387
|
+
dateLabel: P(e.paid_at),
|
|
388
|
+
amountLabel: N(e.amount)
|
|
385
389
|
})),
|
|
386
|
-
totalLabel:
|
|
387
|
-
emptyTone:
|
|
388
|
-
isLoading:
|
|
389
|
-
} : void 0,
|
|
390
|
-
statusLabel:
|
|
391
|
-
statusTone:
|
|
392
|
-
statusIcon:
|
|
393
|
-
amountLabel:
|
|
394
|
-
amountPeriodLabel:
|
|
395
|
-
startsOnLabel: R
|
|
396
|
-
endsOnLabel:
|
|
397
|
-
scheduleTitle:
|
|
398
|
-
schedule:
|
|
399
|
-
invoice:
|
|
400
|
-
recurrence:
|
|
390
|
+
totalLabel: N(M.amount_paid),
|
|
391
|
+
emptyTone: I === "overdue" ? "danger" : "default",
|
|
392
|
+
isLoading: x
|
|
393
|
+
} : void 0, ue = R ? {
|
|
394
|
+
statusLabel: te(R.status, D),
|
|
395
|
+
statusTone: ne[R.status] ?? "neutral",
|
|
396
|
+
statusIcon: _[R.status],
|
|
397
|
+
amountLabel: N(M.total_amount),
|
|
398
|
+
amountPeriodLabel: ee(R.frequency, D),
|
|
399
|
+
startsOnLabel: F(R.start_date),
|
|
400
|
+
endsOnLabel: P(R.end_date),
|
|
401
|
+
scheduleTitle: D.detailsScheduleTitle.replace("{frequency}", g(R.frequency, D)),
|
|
402
|
+
schedule: S({
|
|
403
|
+
invoice: M,
|
|
404
|
+
recurrence: R,
|
|
401
405
|
iterationInvoices: w,
|
|
402
|
-
date:
|
|
403
|
-
statusLabels:
|
|
404
|
-
messages:
|
|
405
|
-
onOpenReceivable:
|
|
406
|
+
date: P,
|
|
407
|
+
statusLabels: E,
|
|
408
|
+
messages: D,
|
|
409
|
+
onOpenReceivable: A
|
|
406
410
|
})
|
|
407
|
-
} : void 0, $ =
|
|
411
|
+
} : void 0, $ = z ? b(M, z, D) : void 0, de = z && $ ? {
|
|
408
412
|
title: $,
|
|
409
|
-
backLabel:
|
|
410
|
-
onOpen: () =>
|
|
413
|
+
backLabel: D.detailsSeriesBack.replace("{title}", $),
|
|
414
|
+
onOpen: () => A(z.invoice_id)
|
|
411
415
|
} : void 0;
|
|
412
416
|
return {
|
|
413
|
-
id:
|
|
414
|
-
type:
|
|
415
|
-
title:
|
|
416
|
-
status:
|
|
417
|
-
statusTone:
|
|
417
|
+
id: M.id,
|
|
418
|
+
type: M.type,
|
|
419
|
+
title: R ? b(M, R, D) : M.counterpart_name ?? D.invoiceType,
|
|
420
|
+
status: I,
|
|
421
|
+
statusTone: f[I] ?? "neutral",
|
|
418
422
|
pdfUrl: n,
|
|
419
|
-
lineItems:
|
|
423
|
+
lineItems: M.line_items.map((e, t) => ({
|
|
420
424
|
id: `${e.product.id ?? "item"}-${t}`,
|
|
421
425
|
name: e.product.name,
|
|
422
426
|
quantityLabel: String(e.quantity),
|
|
423
|
-
unitPriceLabel:
|
|
424
|
-
totalLabel:
|
|
427
|
+
unitPriceLabel: N(e.product.price?.value),
|
|
428
|
+
totalLabel: N(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
|
|
425
429
|
})),
|
|
426
430
|
panel: {
|
|
427
|
-
subtitle:
|
|
428
|
-
statusLabel:
|
|
429
|
-
recurring: !!
|
|
430
|
-
overdueLabel:
|
|
431
|
-
amountTone:
|
|
432
|
-
amountRows:
|
|
433
|
-
issueDateLabel:
|
|
434
|
-
dueDateLabel:
|
|
435
|
-
dueDateCaption:
|
|
436
|
-
paymentHistory:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
431
|
+
subtitle: R ? D.detailsSeriesSubtitle : M.document_id ? D.detailsInvoiceSubtitle.replace("{number}", M.document_id) : void 0,
|
|
432
|
+
statusLabel: I === "partially_paid" ? E.issued : E[I] ?? E.unknown,
|
|
433
|
+
recurring: !!M.recurrence_id || I === "recurring",
|
|
434
|
+
overdueLabel: B > 0 ? D.detailsDaysOverdue.replace("{days}", String(B)) : void 0,
|
|
435
|
+
amountTone: V,
|
|
436
|
+
amountRows: H,
|
|
437
|
+
issueDateLabel: F(M.issue_date),
|
|
438
|
+
dueDateLabel: L ? P(M.updated_at) : F(M.due_date),
|
|
439
|
+
dueDateCaption: L ? D.detailsCancelledOnCaption : D.detailsDueDate,
|
|
440
|
+
paymentHistory: le,
|
|
441
|
+
customerName: K,
|
|
442
|
+
customerContact: se,
|
|
443
|
+
recurringSeries: ue,
|
|
444
|
+
seriesLink: de,
|
|
445
|
+
billingItems: ce,
|
|
446
|
+
lineItemsSection: R ? void 0 : {
|
|
447
|
+
countLabel: String(M.line_items.length),
|
|
448
|
+
totals: ie(M, N, D)
|
|
444
449
|
},
|
|
445
450
|
notes: X && {
|
|
446
451
|
...X,
|
|
447
452
|
countLabel: String([X.opening, X.closing].filter(Boolean).length)
|
|
448
453
|
},
|
|
449
|
-
attachments: t(
|
|
450
|
-
auditHistory:
|
|
454
|
+
attachments: t(M, D),
|
|
455
|
+
auditHistory: T,
|
|
451
456
|
primaryActions: Z,
|
|
452
457
|
overflowActions: Q
|
|
453
458
|
}
|
|
454
459
|
};
|
|
455
460
|
}
|
|
456
|
-
function
|
|
457
|
-
if (e
|
|
458
|
-
title:
|
|
459
|
-
description:
|
|
461
|
+
function T(e, t, n) {
|
|
462
|
+
if (!e) return {
|
|
463
|
+
title: n.detailsNotFoundTitle,
|
|
464
|
+
description: n.detailsNotFoundDescription.replace("{invoiceId}", t)
|
|
465
|
+
};
|
|
466
|
+
if (e.type !== "invoice") return {
|
|
467
|
+
title: n.detailsUnsupportedTitle,
|
|
468
|
+
description: n.detailsUnsupportedDescription.replace("{type}", e.type)
|
|
460
469
|
};
|
|
461
470
|
}
|
|
462
471
|
//#endregion
|
|
463
|
-
export {
|
|
472
|
+
export { T as buildDetailsMessageView, w as buildReceivableDetailsView, h as formatReminderSchedule, p as getDaysOverdue };
|