@tesouro/embedded-components-react 0.5.293 → 0.5.294
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/README.md +1 -1
- package/dist/index.d.ts +26 -1
- package/dist/lib/CounterpartsWidget.d.ts +2 -0
- package/dist/lib/CounterpartsWidgetPublic.d.ts +2 -0
- package/dist/lib/CustomersWidget.d.ts +2 -0
- package/dist/lib/ReceivablesWidget.d.ts +26 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +5 -88
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +70 -173
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +210 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index17.js +29 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +142 -141
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +84 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +21 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +27 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +13 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +84 -80
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +32 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +417 -414
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +83 -66
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +133 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +26 -22
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +16 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +20 -22
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +91 -85
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +119 -88
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +19 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +130 -96
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +24 -8
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +101 -98
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +34 -20
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +4 -3
- package/dist/packages/shared-ui-shadcn/dist/index.js +15 -10
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
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 } from "./helpers.js";
|
|
5
|
-
import { formatCountryName as
|
|
6
|
-
import { getPaymentAccountLineLabel as
|
|
4
|
+
import { buildReceivableNotesView as i, formatDate as a, formatMoney as o, getDaysOverdue as s } from "./helpers.js";
|
|
5
|
+
import { formatCountryName as c, formatDeduction as l } from "./preview.js";
|
|
6
|
+
import { getPaymentAccountLineLabel as u } from "./bankAccounts.js";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js
|
|
8
|
-
var
|
|
8
|
+
var d = {
|
|
9
9
|
draft: {
|
|
10
10
|
primary: [
|
|
11
11
|
"edit",
|
|
@@ -46,13 +46,13 @@ var u = {
|
|
|
46
46
|
primary: [],
|
|
47
47
|
overflow: []
|
|
48
48
|
}
|
|
49
|
-
},
|
|
49
|
+
}, f = /* @__PURE__ */ new Set([
|
|
50
50
|
"issued",
|
|
51
51
|
"overdue",
|
|
52
52
|
"partially_paid",
|
|
53
53
|
"paid",
|
|
54
54
|
"uncollectible"
|
|
55
|
-
]),
|
|
55
|
+
]), p = {
|
|
56
56
|
draft: "neutral",
|
|
57
57
|
issuing: "info",
|
|
58
58
|
issued: "info",
|
|
@@ -68,13 +68,6 @@ var u = {
|
|
|
68
68
|
recurring: "neutral",
|
|
69
69
|
deleted: "neutral"
|
|
70
70
|
};
|
|
71
|
-
function p(e, t = /* @__PURE__ */ new Date()) {
|
|
72
|
-
if (!e) return 0;
|
|
73
|
-
let n = new Date(e);
|
|
74
|
-
if (Number.isNaN(n.getTime())) return 0;
|
|
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);
|
|
76
|
-
return a > 0 ? a : 0;
|
|
77
|
-
}
|
|
78
71
|
function m(e, t) {
|
|
79
72
|
let n = e.map((e) => `${e} ${e === 1 ? t.reminderUnitDay : t.reminderUnitDays}`);
|
|
80
73
|
if (n.length <= 1) return n[0] ?? "";
|
|
@@ -98,7 +91,7 @@ function g(e, t) {
|
|
|
98
91
|
year: t.detailsFrequencyYear
|
|
99
92
|
}[e] ?? "";
|
|
100
93
|
}
|
|
101
|
-
function
|
|
94
|
+
function _(e, t) {
|
|
102
95
|
return {
|
|
103
96
|
day: t.detailsPeriodDay,
|
|
104
97
|
week: t.detailsPeriodWeek,
|
|
@@ -107,7 +100,7 @@ function ee(e, t) {
|
|
|
107
100
|
year: t.detailsPeriodYear
|
|
108
101
|
}[e] ?? "";
|
|
109
102
|
}
|
|
110
|
-
function
|
|
103
|
+
function v(e, t) {
|
|
111
104
|
return {
|
|
112
105
|
active: t.detailsSeriesStatusActive,
|
|
113
106
|
paused: t.detailsSeriesStatusPaused,
|
|
@@ -115,17 +108,24 @@ function te(e, t) {
|
|
|
115
108
|
completed: t.detailsSeriesStatusCompleted
|
|
116
109
|
}[e] ?? "";
|
|
117
110
|
}
|
|
118
|
-
var
|
|
111
|
+
var y = {
|
|
119
112
|
active: "info",
|
|
120
113
|
paused: "warning",
|
|
121
114
|
canceled: "danger",
|
|
122
115
|
completed: "success"
|
|
123
|
-
}
|
|
116
|
+
};
|
|
117
|
+
function b(e, t) {
|
|
118
|
+
return {
|
|
119
|
+
label: v(e, t),
|
|
120
|
+
tone: y[e] ?? "neutral"
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var x = {
|
|
124
124
|
active: "forward",
|
|
125
125
|
paused: "pause",
|
|
126
126
|
canceled: "ban",
|
|
127
127
|
completed: "check"
|
|
128
|
-
},
|
|
128
|
+
}, S = {
|
|
129
129
|
pending: "neutral",
|
|
130
130
|
skipped: "warning",
|
|
131
131
|
canceled: "danger",
|
|
@@ -133,7 +133,7 @@ var ne = {
|
|
|
133
133
|
send_failed: "danger",
|
|
134
134
|
completed: "success"
|
|
135
135
|
};
|
|
136
|
-
function
|
|
136
|
+
function C(e, t) {
|
|
137
137
|
return {
|
|
138
138
|
pending: t.detailsIterationStatusPending,
|
|
139
139
|
skipped: t.detailsIterationStatusSkipped,
|
|
@@ -143,13 +143,13 @@ function y(e, t) {
|
|
|
143
143
|
completed: t.detailsIterationStatusCompleted
|
|
144
144
|
}[e] ?? "";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function w(e, t, n) {
|
|
147
147
|
return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", g(t.frequency, n));
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function T(e, t) {
|
|
150
150
|
return t[e] ?? t.unknown;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
|
|
153
153
|
return (t.iterations ?? []).map((t, c) => {
|
|
154
154
|
let l = t.issued_invoice_id, u = l ? n.get(l) : void 0, d = u ?? e;
|
|
155
155
|
return {
|
|
@@ -162,12 +162,12 @@ function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
162
162
|
}),
|
|
163
163
|
chip: u ? {
|
|
164
164
|
kind: "invoice",
|
|
165
|
-
label:
|
|
165
|
+
label: T(u.status, i),
|
|
166
166
|
status: u.status
|
|
167
167
|
} : {
|
|
168
168
|
kind: "iteration",
|
|
169
|
-
label:
|
|
170
|
-
tone:
|
|
169
|
+
label: C(t.status, a),
|
|
170
|
+
tone: S[t.status] ?? "neutral"
|
|
171
171
|
},
|
|
172
172
|
numberLabel: l ? u?.document_id ?? "" : a.detailsPending,
|
|
173
173
|
onOpen: u ? () => s(u.id) : void 0,
|
|
@@ -175,16 +175,16 @@ function S({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
175
175
|
};
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ee(e) {
|
|
179
179
|
if (!e?.line1) return;
|
|
180
180
|
let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
181
181
|
return [
|
|
182
182
|
e.line2 ? `${e.line1} ${e.line2}` : e.line1,
|
|
183
183
|
t,
|
|
184
|
-
e.country ?
|
|
184
|
+
e.country ? c(e.country) : void 0
|
|
185
185
|
].filter(Boolean).join(", ");
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function te(e, t, n) {
|
|
188
188
|
let r = {
|
|
189
189
|
label: n.detailsAmountReceived,
|
|
190
190
|
value: t(e.amount_paid)
|
|
@@ -246,7 +246,7 @@ function C(e, t, n) {
|
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function ne(t, i, a) {
|
|
250
250
|
let o = t.line_items.reduce((t, n) => {
|
|
251
251
|
let r = n.total_before_tax ?? 0;
|
|
252
252
|
return e(n.tax_status) ? {
|
|
@@ -262,7 +262,7 @@ function ie(t, i, a) {
|
|
|
262
262
|
}), s = r({
|
|
263
263
|
discount: t.discount,
|
|
264
264
|
subtotal: o.taxableItemsSubtotal + o.nonTaxableItemsSubtotal
|
|
265
|
-
}), { taxableSubtotal:
|
|
265
|
+
}), { taxableSubtotal: c, nonTaxableSubtotal: u } = n({
|
|
266
266
|
...o,
|
|
267
267
|
discountAmount: s
|
|
268
268
|
}), d = s > 0, f = o.taxableItemsSubtotal > 0, p = o.nonTaxableItemsSubtotal > 0, m = [{
|
|
@@ -271,14 +271,14 @@ function ie(t, i, a) {
|
|
|
271
271
|
}];
|
|
272
272
|
d && m.push({
|
|
273
273
|
label: a.previewDiscount,
|
|
274
|
-
value:
|
|
274
|
+
value: l(s, t.currency)
|
|
275
275
|
}), p && (f || d) && m.push({
|
|
276
276
|
label: a.previewNonTaxableSubtotal,
|
|
277
277
|
value: i(u),
|
|
278
278
|
tone: "muted"
|
|
279
279
|
}), f && (p || d) && m.push({
|
|
280
280
|
label: a.previewTaxableSubtotal,
|
|
281
|
-
value: i(
|
|
281
|
+
value: i(c),
|
|
282
282
|
tone: "muted"
|
|
283
283
|
});
|
|
284
284
|
for (let e of t.total_tax_amounts ?? []) m.push({
|
|
@@ -291,174 +291,175 @@ function ie(t, i, a) {
|
|
|
291
291
|
emphasis: !0
|
|
292
292
|
}), m;
|
|
293
293
|
}
|
|
294
|
-
var
|
|
294
|
+
var re = {
|
|
295
295
|
primary: [],
|
|
296
296
|
overflow: []
|
|
297
297
|
};
|
|
298
|
-
function
|
|
298
|
+
function D({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: c, depositAccount: l, isAccountListIncomplete: m, recurrence: b, paymentRecords: S = [], isLoadingPaymentRecords: C = !1, iterationInvoices: T = /* @__PURE__ */ new Map(), auditHistory: D, statusLabels: O, messages: k, canRecordPayment: A, hasBeenSent: ie = !1, canWrite: j = !0, onOpenReceivable: M, onOpenCustomer: N, now: ae }) {
|
|
299
299
|
if (!e || e.type !== "invoice") return;
|
|
300
|
-
let
|
|
300
|
+
let P = e, F = (e) => o({
|
|
301
301
|
amount: e ?? 0,
|
|
302
|
-
currency:
|
|
302
|
+
currency: P.currency,
|
|
303
303
|
fallback: ""
|
|
304
|
-
}),
|
|
305
|
-
label:
|
|
306
|
-
name:
|
|
307
|
-
onOpen:
|
|
308
|
-
} : void 0,
|
|
309
|
-
...
|
|
310
|
-
label:
|
|
311
|
-
value:
|
|
304
|
+
}), I = (e) => a(e, "-"), L = (e) => e ? I(e) : k.detailsPending, { status: R } = P, z = R === "canceled", B = R === "recurring" ? b : void 0, V = P.recurrence_id && R !== "recurring" ? b : void 0, H = R === "overdue" ? s(P.due_date, ae) : 0, { amountTone: oe, amountRows: U } = te(P, F, k), W = P.counterpart_contact, G = ee(P.counterpart_billing_address), K = P.counterpart_id, se = P.counterpart_name ? {
|
|
305
|
+
label: k.detailsCustomerName,
|
|
306
|
+
name: P.counterpart_name,
|
|
307
|
+
onOpen: N && K ? () => N(K) : void 0
|
|
308
|
+
} : void 0, ce = [
|
|
309
|
+
...W?.email ? [{
|
|
310
|
+
label: k.detailsCustomerEmail,
|
|
311
|
+
value: W.email
|
|
312
312
|
}] : [],
|
|
313
|
-
...
|
|
314
|
-
label:
|
|
315
|
-
value:
|
|
313
|
+
...W?.phone ? [{
|
|
314
|
+
label: k.detailsCustomerPhone,
|
|
315
|
+
value: W.phone
|
|
316
316
|
}] : [],
|
|
317
|
-
...
|
|
318
|
-
label:
|
|
319
|
-
value:
|
|
317
|
+
...G ? [{
|
|
318
|
+
label: k.detailsCustomerAddress,
|
|
319
|
+
value: G
|
|
320
320
|
}] : []
|
|
321
321
|
], q = {
|
|
322
|
-
label:
|
|
322
|
+
label: k.detailsPaymentReminders,
|
|
323
323
|
value: h({
|
|
324
324
|
paymentReminder: r,
|
|
325
|
-
overdueReminder:
|
|
326
|
-
remindersConfigured: !!(
|
|
327
|
-
messages:
|
|
325
|
+
overdueReminder: c,
|
|
326
|
+
remindersConfigured: !!(P.payment_reminder_id || P.overdue_reminder_id),
|
|
327
|
+
messages: k
|
|
328
328
|
})
|
|
329
329
|
}, J = {
|
|
330
|
-
label:
|
|
331
|
-
value:
|
|
330
|
+
label: k.detailsDepositAccount,
|
|
331
|
+
value: l ? u(l, k) : m && P.bank_account_id ? "-" : k.detailsNotProvided
|
|
332
332
|
}, Y = {
|
|
333
|
-
label:
|
|
334
|
-
value:
|
|
335
|
-
},
|
|
333
|
+
label: k.detailsPaymentTerms,
|
|
334
|
+
value: P.payment_terms?.name ?? k.detailsPending
|
|
335
|
+
}, le = B ? [
|
|
336
336
|
{
|
|
337
|
-
label:
|
|
338
|
-
value: g(
|
|
337
|
+
label: k.detailsFrequency,
|
|
338
|
+
value: g(B.frequency, k)
|
|
339
339
|
},
|
|
340
340
|
{
|
|
341
|
-
label:
|
|
342
|
-
value:
|
|
341
|
+
label: k.detailsInvoiceAmount,
|
|
342
|
+
value: F(P.total_amount)
|
|
343
343
|
},
|
|
344
344
|
Y,
|
|
345
345
|
q,
|
|
346
346
|
{
|
|
347
|
-
label:
|
|
348
|
-
value:
|
|
347
|
+
label: k.detailsPoNumber,
|
|
348
|
+
value: P.purchase_order || k.detailsNotProvided
|
|
349
349
|
},
|
|
350
350
|
J
|
|
351
351
|
] : [
|
|
352
|
-
...
|
|
353
|
-
label:
|
|
354
|
-
value:
|
|
352
|
+
...P.document_id ? [{
|
|
353
|
+
label: k.detailsInvoiceNumber,
|
|
354
|
+
value: P.document_id
|
|
355
355
|
}] : [],
|
|
356
356
|
{
|
|
357
|
-
label:
|
|
358
|
-
value:
|
|
357
|
+
label: k.detailsInvoiceAmount,
|
|
358
|
+
value: F(P.total_amount)
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
label:
|
|
362
|
-
value:
|
|
361
|
+
label: k.detailsInvoiceDate,
|
|
362
|
+
value: L(P.issue_date)
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
|
-
label:
|
|
366
|
-
value:
|
|
365
|
+
label: k.detailsDueDate,
|
|
366
|
+
value: L(P.due_date)
|
|
367
367
|
},
|
|
368
368
|
Y,
|
|
369
369
|
q,
|
|
370
|
-
...
|
|
371
|
-
label:
|
|
372
|
-
value:
|
|
370
|
+
...P.purchase_order ? [{
|
|
371
|
+
label: k.detailsPoNumber,
|
|
372
|
+
value: P.purchase_order
|
|
373
373
|
}] : [],
|
|
374
374
|
J
|
|
375
|
-
], X =
|
|
375
|
+
], X = B ? void 0 : i(P), { primary: Z, overflow: Q } = j ? d[R] ?? {
|
|
376
376
|
primary: [],
|
|
377
377
|
overflow: ["clone"]
|
|
378
|
-
} :
|
|
379
|
-
if (
|
|
380
|
-
let e =
|
|
381
|
-
Q =
|
|
378
|
+
} : re;
|
|
379
|
+
if (B && j) {
|
|
380
|
+
let e = B.status === "active" || B.status === "paused";
|
|
381
|
+
Q = B.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : B.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
|
|
382
382
|
}
|
|
383
|
-
|
|
384
|
-
let
|
|
385
|
-
rows:
|
|
383
|
+
A || (Z = Z.filter((e) => e !== "recordPayment"));
|
|
384
|
+
let ue = f.has(R) ? {
|
|
385
|
+
rows: S.map((e) => ({
|
|
386
386
|
id: e.id,
|
|
387
|
-
dateLabel:
|
|
388
|
-
amountLabel:
|
|
387
|
+
dateLabel: I(e.paid_at),
|
|
388
|
+
amountLabel: F(e.amount)
|
|
389
389
|
})),
|
|
390
|
-
totalLabel:
|
|
391
|
-
emptyTone:
|
|
392
|
-
isLoading:
|
|
393
|
-
} : void 0,
|
|
394
|
-
statusLabel:
|
|
395
|
-
statusTone:
|
|
396
|
-
statusIcon:
|
|
397
|
-
amountLabel:
|
|
398
|
-
amountPeriodLabel:
|
|
399
|
-
startsOnLabel:
|
|
400
|
-
endsOnLabel:
|
|
401
|
-
scheduleTitle:
|
|
402
|
-
schedule:
|
|
403
|
-
invoice:
|
|
404
|
-
recurrence:
|
|
405
|
-
iterationInvoices:
|
|
406
|
-
date:
|
|
407
|
-
statusLabels:
|
|
408
|
-
messages:
|
|
409
|
-
onOpenReceivable:
|
|
390
|
+
totalLabel: F(P.amount_paid),
|
|
391
|
+
emptyTone: R === "overdue" ? "danger" : "default",
|
|
392
|
+
isLoading: C
|
|
393
|
+
} : void 0, de = B ? {
|
|
394
|
+
statusLabel: v(B.status, k),
|
|
395
|
+
statusTone: y[B.status] ?? "neutral",
|
|
396
|
+
statusIcon: x[B.status],
|
|
397
|
+
amountLabel: F(P.total_amount),
|
|
398
|
+
amountPeriodLabel: _(B.frequency, k),
|
|
399
|
+
startsOnLabel: L(B.start_date),
|
|
400
|
+
endsOnLabel: I(B.end_date ?? (B.max_occurrences ? B.iterations?.at(-1)?.issue_at : void 0)),
|
|
401
|
+
scheduleTitle: k.detailsScheduleTitle.replace("{frequency}", g(B.frequency, k)),
|
|
402
|
+
schedule: E({
|
|
403
|
+
invoice: P,
|
|
404
|
+
recurrence: B,
|
|
405
|
+
iterationInvoices: T,
|
|
406
|
+
date: I,
|
|
407
|
+
statusLabels: O,
|
|
408
|
+
messages: k,
|
|
409
|
+
onOpenReceivable: M
|
|
410
410
|
})
|
|
411
|
-
} : void 0, $ =
|
|
411
|
+
} : void 0, $ = V ? w(P, V, k) : void 0, fe = V && $ ? {
|
|
412
412
|
title: $,
|
|
413
|
-
backLabel:
|
|
414
|
-
onOpen: () =>
|
|
413
|
+
backLabel: k.detailsSeriesBack.replace("{title}", $),
|
|
414
|
+
onOpen: () => M(V.invoice_id)
|
|
415
415
|
} : void 0;
|
|
416
416
|
return {
|
|
417
|
-
id:
|
|
418
|
-
type:
|
|
419
|
-
title:
|
|
420
|
-
status:
|
|
421
|
-
statusTone:
|
|
417
|
+
id: P.id,
|
|
418
|
+
type: P.type,
|
|
419
|
+
title: B ? w(P, B, k) : P.counterpart_name ?? k.invoiceType,
|
|
420
|
+
status: R,
|
|
421
|
+
statusTone: p[R] ?? "neutral",
|
|
422
422
|
pdfUrl: n,
|
|
423
|
-
lineItems:
|
|
423
|
+
lineItems: P.line_items.map((e, t) => ({
|
|
424
424
|
id: `${e.product.id ?? "item"}-${t}`,
|
|
425
425
|
name: e.product.name,
|
|
426
426
|
quantityLabel: String(e.quantity),
|
|
427
|
-
unitPriceLabel:
|
|
428
|
-
totalLabel:
|
|
427
|
+
unitPriceLabel: F(e.product.price?.value),
|
|
428
|
+
totalLabel: F(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
|
|
429
429
|
})),
|
|
430
430
|
panel: {
|
|
431
|
-
subtitle:
|
|
432
|
-
statusLabel:
|
|
433
|
-
recurring: !!
|
|
434
|
-
overdueLabel:
|
|
435
|
-
amountTone:
|
|
436
|
-
amountRows:
|
|
437
|
-
issueDateLabel:
|
|
438
|
-
dueDateLabel:
|
|
439
|
-
dueDateCaption:
|
|
440
|
-
paymentHistory:
|
|
441
|
-
customerName:
|
|
442
|
-
customerContact:
|
|
443
|
-
recurringSeries:
|
|
444
|
-
seriesLink:
|
|
445
|
-
billingItems:
|
|
446
|
-
lineItemsSection:
|
|
447
|
-
countLabel: String(
|
|
448
|
-
totals:
|
|
431
|
+
subtitle: B ? k.detailsSeriesSubtitle : P.document_id ? k.detailsInvoiceSubtitle.replace("{number}", P.document_id) : void 0,
|
|
432
|
+
statusLabel: R === "partially_paid" ? O.issued : O[R] ?? O.unknown,
|
|
433
|
+
recurring: !!P.recurrence_id || R === "recurring",
|
|
434
|
+
overdueLabel: H > 0 ? k.detailsDaysOverdue.replace("{days}", String(H)) : void 0,
|
|
435
|
+
amountTone: oe,
|
|
436
|
+
amountRows: U,
|
|
437
|
+
issueDateLabel: L(P.issue_date),
|
|
438
|
+
dueDateLabel: z ? I(P.updated_at) : L(P.due_date),
|
|
439
|
+
dueDateCaption: z ? k.detailsCancelledOnCaption : k.detailsDueDate,
|
|
440
|
+
paymentHistory: ue,
|
|
441
|
+
customerName: se,
|
|
442
|
+
customerContact: ce,
|
|
443
|
+
recurringSeries: de,
|
|
444
|
+
seriesLink: fe,
|
|
445
|
+
billingItems: le,
|
|
446
|
+
lineItemsSection: B ? void 0 : {
|
|
447
|
+
countLabel: String(P.line_items.length),
|
|
448
|
+
totals: ne(P, F, k)
|
|
449
449
|
},
|
|
450
450
|
notes: X && {
|
|
451
451
|
...X,
|
|
452
452
|
countLabel: String([X.opening, X.closing].filter(Boolean).length)
|
|
453
453
|
},
|
|
454
|
-
attachments: t(
|
|
455
|
-
auditHistory:
|
|
454
|
+
attachments: t(P, k),
|
|
455
|
+
auditHistory: D,
|
|
456
456
|
primaryActions: Z,
|
|
457
|
-
overflowActions: Q
|
|
457
|
+
overflowActions: Q,
|
|
458
|
+
actionLabels: { send: ie ? k.detailsResendButton : k.detailsSendButton }
|
|
458
459
|
}
|
|
459
460
|
};
|
|
460
461
|
}
|
|
461
|
-
function
|
|
462
|
+
function O(e, t, n) {
|
|
462
463
|
if (!e) return {
|
|
463
464
|
title: n.detailsNotFoundTitle,
|
|
464
465
|
description: n.detailsNotFoundDescription.replace("{invoiceId}", t)
|
|
@@ -469,4 +470,4 @@ function T(e, t, n) {
|
|
|
469
470
|
};
|
|
470
471
|
}
|
|
471
472
|
//#endregion
|
|
472
|
-
export {
|
|
473
|
+
export { O as buildDetailsMessageView, D as buildReceivableDetailsView, b as buildSeriesStatusChipView, h as formatReminderSchedule };
|