@tesouro/embedded-components-react 0.11.140 → 0.11.167
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/NOTICE +24 -0
- package/README.md +15 -37
- package/dist/experimental/BalanceHistoryWidget.d.ts +0 -11
- package/dist/experimental/QuickViewWidget.d.ts +0 -11
- package/dist/experimental/RemoteCheckCapture.d.ts +0 -11
- package/dist/experimental/index.d.ts +0 -11
- package/dist/fixtures/index.d.ts +27 -1
- package/dist/index.css +6976 -6246
- package/dist/index.d.ts +64 -173
- package/dist/index.js +9 -10
- package/dist/lib/AcceptDisclosuresWidget.d.ts +0 -11
- package/dist/lib/BalancesWidget.d.ts +0 -11
- package/dist/lib/BankAccountOnboardingWidget.d.ts +0 -11
- package/dist/lib/BankAccountsWidget.d.ts +2 -11
- package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -11
- package/dist/lib/BillPayWidget.d.ts +0 -11
- package/dist/lib/CardDetailsWidget.d.ts +0 -11
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CreditCardsWidget.d.ts +0 -11
- package/dist/lib/DebitCardsWidget.d.ts +0 -11
- package/dist/lib/ExpenseManagementWidget.d.ts +1 -12
- package/dist/lib/InsightsWidget.d.ts +0 -11
- package/dist/lib/LinkedAccountsWidget.d.ts +0 -11
- package/dist/lib/OfferWidget.d.ts +0 -11
- package/dist/lib/ReceivablesWidget.d.ts +60 -17
- package/dist/lib/ReceivablesWidget.js +3 -2
- package/dist/lib/SettingsWidget.d.ts +0 -11
- package/dist/lib/TransfersWidget.d.ts +0 -11
- package/dist/lib/WidgetProvider.d.ts +0 -11
- package/dist/lib/WidgetProviderPublic.d.ts +0 -11
- package/dist/lib/WidgetSuite.d.ts +60 -15
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +83 -82
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +84 -79
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +51 -46
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useActivateCard.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useCardLock.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useEditCardNickname.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -1
- 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/index16.js +66 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +351 -318
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +126 -133
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +63 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +78 -72
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +138 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +119 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +37 -28
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +131 -81
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +46 -46
- 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/useReceivableAttachmentUploads.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +440 -438
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +62 -56
- 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 +47 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +78 -86
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +180 -158
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +132 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +153 -137
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +137 -129
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +21 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +143 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/products.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/scenarios.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +11 -13
- package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +20 -17
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +2 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +233 -211
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -42
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +5 -4
- 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/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/toasts.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmbeddedToaster.js +33 -32
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +9 -8
- package/dist/node_modules/sonner/dist/index.js +620 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +6072 -6062
- package/dist/scenarios/index.d.ts +1 -3
- package/dist/scenarios/index.js +17 -20
- package/package.json +17 -4
- package/dist/lib/CustomersWidget.d.ts +0 -993
- package/dist/lib/CustomersWidget.js +0 -2
- package/dist/lib/ProductsWidget.d.ts +0 -893
- package/dist/lib/ProductsWidget.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +0 -41
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/analytics/events.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/scenarios.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +0 -15
|
@@ -108,24 +108,17 @@ function v(e, t) {
|
|
|
108
108
|
completed: t.detailsSeriesStatusCompleted
|
|
109
109
|
}[e] ?? "";
|
|
110
110
|
}
|
|
111
|
-
var
|
|
111
|
+
var ee = {
|
|
112
112
|
active: "info",
|
|
113
113
|
paused: "warning",
|
|
114
114
|
canceled: "danger",
|
|
115
115
|
completed: "success"
|
|
116
|
-
}
|
|
117
|
-
function b(e, t) {
|
|
118
|
-
return {
|
|
119
|
-
label: v(e, t),
|
|
120
|
-
tone: y[e] ?? "neutral"
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
var x = {
|
|
116
|
+
}, te = {
|
|
124
117
|
active: "forward",
|
|
125
118
|
paused: "pause",
|
|
126
119
|
canceled: "ban",
|
|
127
120
|
completed: "check"
|
|
128
|
-
},
|
|
121
|
+
}, y = {
|
|
129
122
|
pending: "neutral",
|
|
130
123
|
skipped: "warning",
|
|
131
124
|
canceled: "danger",
|
|
@@ -133,7 +126,7 @@ var x = {
|
|
|
133
126
|
send_failed: "danger",
|
|
134
127
|
completed: "success"
|
|
135
128
|
};
|
|
136
|
-
function
|
|
129
|
+
function b(e, t) {
|
|
137
130
|
return {
|
|
138
131
|
pending: t.detailsIterationStatusPending,
|
|
139
132
|
skipped: t.detailsIterationStatusSkipped,
|
|
@@ -143,13 +136,13 @@ function C(e, t) {
|
|
|
143
136
|
completed: t.detailsIterationStatusCompleted
|
|
144
137
|
}[e] ?? "";
|
|
145
138
|
}
|
|
146
|
-
function
|
|
139
|
+
function x(e, t, n) {
|
|
147
140
|
return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", g(t.frequency, n));
|
|
148
141
|
}
|
|
149
|
-
function
|
|
142
|
+
function S(e, t) {
|
|
150
143
|
return t[e] ?? t.unknown;
|
|
151
144
|
}
|
|
152
|
-
function
|
|
145
|
+
function ne({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
|
|
153
146
|
return (t.iterations ?? []).map((t, c) => {
|
|
154
147
|
let l = t.issued_invoice_id, u = l ? n.get(l) : void 0, d = u ?? e;
|
|
155
148
|
return {
|
|
@@ -162,12 +155,12 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
162
155
|
}),
|
|
163
156
|
chip: u ? {
|
|
164
157
|
kind: "invoice",
|
|
165
|
-
label:
|
|
158
|
+
label: S(u.status, i),
|
|
166
159
|
status: u.status
|
|
167
160
|
} : {
|
|
168
161
|
kind: "iteration",
|
|
169
|
-
label:
|
|
170
|
-
tone:
|
|
162
|
+
label: b(t.status, a),
|
|
163
|
+
tone: y[t.status] ?? "neutral"
|
|
171
164
|
},
|
|
172
165
|
numberLabel: l ? u?.document_id ?? "" : a.detailsPending,
|
|
173
166
|
onOpen: u ? () => s(u.id) : void 0,
|
|
@@ -175,7 +168,7 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
|
|
|
175
168
|
};
|
|
176
169
|
});
|
|
177
170
|
}
|
|
178
|
-
function
|
|
171
|
+
function C(e) {
|
|
179
172
|
if (!e?.line1) return;
|
|
180
173
|
let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
181
174
|
return [
|
|
@@ -184,7 +177,7 @@ function ee(e) {
|
|
|
184
177
|
e.country ? l(e.country) : void 0
|
|
185
178
|
].filter(Boolean).join(", ");
|
|
186
179
|
}
|
|
187
|
-
function
|
|
180
|
+
function re(e, t, n) {
|
|
188
181
|
let r = {
|
|
189
182
|
label: n.detailsAmountReceived,
|
|
190
183
|
value: t(e.amount_paid)
|
|
@@ -246,7 +239,7 @@ function te(e, t, n) {
|
|
|
246
239
|
};
|
|
247
240
|
}
|
|
248
241
|
}
|
|
249
|
-
function
|
|
242
|
+
function ie(t, i, a) {
|
|
250
243
|
let o = t.line_items.reduce((t, n) => {
|
|
251
244
|
let r = n.total_before_tax ?? 0;
|
|
252
245
|
return e(n.tax_status) ? {
|
|
@@ -291,175 +284,175 @@ function ne(t, i, a) {
|
|
|
291
284
|
emphasis: !0
|
|
292
285
|
}), m;
|
|
293
286
|
}
|
|
294
|
-
var
|
|
287
|
+
var ae = {
|
|
295
288
|
primary: [],
|
|
296
289
|
overflow: []
|
|
297
290
|
};
|
|
298
|
-
function
|
|
291
|
+
function w({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: l, depositAccount: u, isAccountListIncomplete: m, recurrence: y, paymentRecords: b = [], isLoadingPaymentRecords: S = !1, iterationInvoices: w = /* @__PURE__ */ new Map(), auditHistory: T, statusLabels: E, messages: D, canRecordPayment: O, hasBeenSent: oe = !1, canWrite: k = !0, onOpenReceivable: A, onOpenCustomer: j, now: M }) {
|
|
299
292
|
if (!e || e.type !== "invoice") return;
|
|
300
|
-
let
|
|
293
|
+
let N = e, P = (e) => o({
|
|
301
294
|
amount: e ?? 0,
|
|
302
|
-
currency:
|
|
295
|
+
currency: N.currency,
|
|
303
296
|
fallback: ""
|
|
304
|
-
}),
|
|
305
|
-
label:
|
|
306
|
-
name:
|
|
307
|
-
onOpen:
|
|
308
|
-
} : void 0,
|
|
309
|
-
...
|
|
310
|
-
label:
|
|
311
|
-
value:
|
|
297
|
+
}), F = (e) => a(e, "-"), I = (e) => e ? F(e) : D.detailsPending, { status: L } = N, R = L === "canceled", z = L === "recurring" ? y : void 0, B = N.recurrence_id && L !== "recurring" ? y : void 0, V = L === "overdue" ? s(N.due_date, M) : 0, { amountTone: se, amountRows: H } = re(N, P, D), U = N.counterpart_contact, W = C(N.counterpart_billing_address), G = N.counterpart_id, ce = N.counterpart_name ? {
|
|
298
|
+
label: D.detailsCustomerName,
|
|
299
|
+
name: N.counterpart_name,
|
|
300
|
+
onOpen: j && G ? () => j(G) : void 0
|
|
301
|
+
} : void 0, le = [
|
|
302
|
+
...U?.email ? [{
|
|
303
|
+
label: D.detailsCustomerEmail,
|
|
304
|
+
value: U.email
|
|
312
305
|
}] : [],
|
|
313
|
-
...
|
|
314
|
-
label:
|
|
315
|
-
value:
|
|
306
|
+
...U?.phone ? [{
|
|
307
|
+
label: D.detailsCustomerPhone,
|
|
308
|
+
value: U.phone
|
|
316
309
|
}] : [],
|
|
317
|
-
...
|
|
318
|
-
label:
|
|
319
|
-
value:
|
|
310
|
+
...W ? [{
|
|
311
|
+
label: D.detailsCustomerAddress,
|
|
312
|
+
value: W
|
|
320
313
|
}] : []
|
|
321
|
-
],
|
|
322
|
-
label:
|
|
314
|
+
], K = {
|
|
315
|
+
label: D.detailsPaymentReminders,
|
|
323
316
|
value: h({
|
|
324
317
|
paymentReminder: r,
|
|
325
318
|
overdueReminder: l,
|
|
326
|
-
remindersConfigured: !!(
|
|
327
|
-
messages:
|
|
319
|
+
remindersConfigured: !!(N.payment_reminder_id || N.overdue_reminder_id),
|
|
320
|
+
messages: D
|
|
328
321
|
})
|
|
322
|
+
}, q = {
|
|
323
|
+
label: D.detailsDepositAccount,
|
|
324
|
+
value: u ? c(u, D) : m && N.bank_account_id ? "-" : D.detailsNotProvided
|
|
329
325
|
}, J = {
|
|
330
|
-
label:
|
|
331
|
-
value:
|
|
332
|
-
}, Y =
|
|
333
|
-
label: k.detailsPaymentTerms,
|
|
334
|
-
value: P.payment_terms?.name ?? k.detailsPending
|
|
335
|
-
}, le = B ? [
|
|
326
|
+
label: D.detailsPaymentTerms,
|
|
327
|
+
value: N.payment_terms?.name ?? D.detailsPending
|
|
328
|
+
}, Y = z ? [
|
|
336
329
|
{
|
|
337
|
-
label:
|
|
338
|
-
value: g(
|
|
330
|
+
label: D.detailsFrequency,
|
|
331
|
+
value: g(z.frequency, D)
|
|
339
332
|
},
|
|
340
333
|
{
|
|
341
|
-
label:
|
|
342
|
-
value:
|
|
334
|
+
label: D.detailsInvoiceAmount,
|
|
335
|
+
value: P(N.total_amount)
|
|
343
336
|
},
|
|
344
|
-
|
|
345
|
-
|
|
337
|
+
J,
|
|
338
|
+
K,
|
|
346
339
|
{
|
|
347
|
-
label:
|
|
348
|
-
value:
|
|
340
|
+
label: D.detailsPoNumber,
|
|
341
|
+
value: N.purchase_order || D.detailsNotProvided
|
|
349
342
|
},
|
|
350
|
-
|
|
343
|
+
q
|
|
351
344
|
] : [
|
|
352
|
-
...
|
|
353
|
-
label:
|
|
354
|
-
value:
|
|
345
|
+
...N.document_id ? [{
|
|
346
|
+
label: D.detailsInvoiceNumber,
|
|
347
|
+
value: N.document_id
|
|
355
348
|
}] : [],
|
|
356
349
|
{
|
|
357
|
-
label:
|
|
358
|
-
value:
|
|
350
|
+
label: D.detailsInvoiceAmount,
|
|
351
|
+
value: P(N.total_amount)
|
|
359
352
|
},
|
|
360
353
|
{
|
|
361
|
-
label:
|
|
362
|
-
value:
|
|
354
|
+
label: D.detailsInvoiceDate,
|
|
355
|
+
value: I(N.issue_date)
|
|
363
356
|
},
|
|
364
357
|
{
|
|
365
|
-
label:
|
|
366
|
-
value:
|
|
358
|
+
label: D.detailsDueDate,
|
|
359
|
+
value: I(N.due_date)
|
|
367
360
|
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
...
|
|
371
|
-
label:
|
|
372
|
-
value:
|
|
361
|
+
J,
|
|
362
|
+
K,
|
|
363
|
+
...N.purchase_order ? [{
|
|
364
|
+
label: D.detailsPoNumber,
|
|
365
|
+
value: N.purchase_order
|
|
373
366
|
}] : [],
|
|
374
|
-
|
|
375
|
-
], X =
|
|
367
|
+
q
|
|
368
|
+
], X = z ? void 0 : i(N), { primary: Z, overflow: Q } = k ? d[L] ?? {
|
|
376
369
|
primary: [],
|
|
377
370
|
overflow: ["clone"]
|
|
378
|
-
} :
|
|
379
|
-
if (
|
|
380
|
-
let e =
|
|
381
|
-
Q =
|
|
371
|
+
} : ae;
|
|
372
|
+
if (z && k) {
|
|
373
|
+
let e = z.status === "active" || z.status === "paused";
|
|
374
|
+
Q = z.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : z.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
|
|
382
375
|
}
|
|
383
|
-
|
|
384
|
-
let ue = f.has(
|
|
385
|
-
rows:
|
|
376
|
+
O || (Z = Z.filter((e) => e !== "recordPayment"));
|
|
377
|
+
let ue = f.has(L) ? {
|
|
378
|
+
rows: b.map((e) => ({
|
|
386
379
|
id: e.id,
|
|
387
|
-
dateLabel:
|
|
388
|
-
amountLabel:
|
|
380
|
+
dateLabel: F(e.paid_at),
|
|
381
|
+
amountLabel: P(e.amount)
|
|
389
382
|
})),
|
|
390
|
-
totalLabel:
|
|
391
|
-
emptyTone:
|
|
392
|
-
isLoading:
|
|
393
|
-
} : void 0, de =
|
|
394
|
-
statusLabel: v(
|
|
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:
|
|
383
|
+
totalLabel: P(N.amount_paid),
|
|
384
|
+
emptyTone: L === "overdue" ? "danger" : "default",
|
|
385
|
+
isLoading: S
|
|
386
|
+
} : void 0, de = z ? {
|
|
387
|
+
statusLabel: v(z.status, D),
|
|
388
|
+
statusTone: ee[z.status] ?? "neutral",
|
|
389
|
+
statusIcon: te[z.status],
|
|
390
|
+
amountLabel: P(N.total_amount),
|
|
391
|
+
amountPeriodLabel: _(z.frequency, D),
|
|
392
|
+
startsOnLabel: I(z.start_date),
|
|
393
|
+
endsOnLabel: F(z.end_date ?? (z.max_occurrences ? z.iterations?.at(-1)?.issue_at : void 0)),
|
|
394
|
+
scheduleTitle: D.detailsScheduleTitle.replace("{frequency}", g(z.frequency, D)),
|
|
395
|
+
schedule: ne({
|
|
396
|
+
invoice: N,
|
|
397
|
+
recurrence: z,
|
|
398
|
+
iterationInvoices: w,
|
|
399
|
+
date: F,
|
|
400
|
+
statusLabels: E,
|
|
401
|
+
messages: D,
|
|
402
|
+
onOpenReceivable: A
|
|
410
403
|
})
|
|
411
|
-
} : void 0, $ =
|
|
404
|
+
} : void 0, $ = B ? x(N, B, D) : void 0, fe = B && $ ? {
|
|
412
405
|
title: $,
|
|
413
|
-
backLabel:
|
|
414
|
-
onOpen: () =>
|
|
406
|
+
backLabel: D.detailsSeriesBack.replace("{title}", $),
|
|
407
|
+
onOpen: () => A(B.invoice_id)
|
|
415
408
|
} : void 0;
|
|
416
409
|
return {
|
|
417
|
-
id:
|
|
418
|
-
type:
|
|
419
|
-
title:
|
|
420
|
-
status:
|
|
421
|
-
statusTone: p[
|
|
410
|
+
id: N.id,
|
|
411
|
+
type: N.type,
|
|
412
|
+
title: z ? x(N, z, D) : N.counterpart_name ?? D.invoiceType,
|
|
413
|
+
status: L,
|
|
414
|
+
statusTone: p[L] ?? "neutral",
|
|
422
415
|
pdfUrl: n,
|
|
423
|
-
lineItems:
|
|
416
|
+
lineItems: N.line_items.map((e, t) => ({
|
|
424
417
|
id: `${e.product.id ?? "item"}-${t}`,
|
|
425
418
|
name: e.product.name,
|
|
426
419
|
quantityLabel: String(e.quantity),
|
|
427
|
-
unitPriceLabel:
|
|
428
|
-
totalLabel:
|
|
420
|
+
unitPriceLabel: P(e.product.price?.value),
|
|
421
|
+
totalLabel: P(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
|
|
429
422
|
})),
|
|
430
423
|
panel: {
|
|
431
|
-
subtitle:
|
|
432
|
-
statusLabel:
|
|
433
|
-
recurring: !!
|
|
434
|
-
overdueLabel:
|
|
435
|
-
amountTone:
|
|
436
|
-
amountRows:
|
|
437
|
-
issueDateLabel:
|
|
438
|
-
dueDateLabel:
|
|
439
|
-
dueDateCaption:
|
|
424
|
+
subtitle: z ? D.detailsSeriesSubtitle : N.document_id ? D.detailsInvoiceSubtitle.replace("{number}", N.document_id) : void 0,
|
|
425
|
+
statusLabel: L === "partially_paid" ? E.issued : E[L] ?? E.unknown,
|
|
426
|
+
recurring: !!N.recurrence_id || L === "recurring",
|
|
427
|
+
overdueLabel: V > 0 ? D.detailsDaysOverdue.replace("{days}", String(V)) : void 0,
|
|
428
|
+
amountTone: se,
|
|
429
|
+
amountRows: H,
|
|
430
|
+
issueDateLabel: I(N.issue_date),
|
|
431
|
+
dueDateLabel: R ? F(N.updated_at) : I(N.due_date),
|
|
432
|
+
dueDateCaption: R ? D.detailsCancelledOnCaption : D.detailsDueDate,
|
|
440
433
|
paymentHistory: ue,
|
|
441
|
-
customerName:
|
|
442
|
-
customerContact:
|
|
434
|
+
customerName: ce,
|
|
435
|
+
customerContact: le,
|
|
443
436
|
recurringSeries: de,
|
|
444
437
|
seriesLink: fe,
|
|
445
|
-
billingItems:
|
|
446
|
-
lineItemsSection:
|
|
447
|
-
countLabel: String(
|
|
448
|
-
totals:
|
|
438
|
+
billingItems: Y,
|
|
439
|
+
lineItemsSection: z ? void 0 : {
|
|
440
|
+
countLabel: String(N.line_items.length),
|
|
441
|
+
totals: ie(N, P, D)
|
|
449
442
|
},
|
|
450
443
|
notes: X && {
|
|
451
444
|
...X,
|
|
452
445
|
countLabel: String([X.opening, X.closing].filter(Boolean).length)
|
|
453
446
|
},
|
|
454
|
-
attachments: t(
|
|
455
|
-
auditHistory:
|
|
447
|
+
attachments: t(N, D),
|
|
448
|
+
auditHistory: T,
|
|
456
449
|
primaryActions: Z,
|
|
457
450
|
overflowActions: Q,
|
|
458
|
-
actionLabels: { send:
|
|
451
|
+
actionLabels: { send: oe ? D.detailsResendButton : D.detailsSendButton }
|
|
459
452
|
}
|
|
460
453
|
};
|
|
461
454
|
}
|
|
462
|
-
function
|
|
455
|
+
function T(e, t, n) {
|
|
463
456
|
if (!e) return {
|
|
464
457
|
title: n.detailsNotFoundTitle,
|
|
465
458
|
description: n.detailsNotFoundDescription.replace("{invoiceId}", t)
|
|
@@ -469,4 +462,4 @@ function O(e, t, n) {
|
|
|
469
462
|
description: n.detailsUnsupportedDescription.replace("{type}", e.type)
|
|
470
463
|
};
|
|
471
464
|
}
|
|
472
|
-
export {
|
|
465
|
+
export { T as buildDetailsMessageView, w as buildReceivableDetailsView, h as formatReminderSchedule, g as frequencyLabel, v as seriesStatusLabel };
|
|
@@ -7,9 +7,9 @@ import { createLineItem as i, isBlankLineItem as a, keepsSavedTaxRates as o, lin
|
|
|
7
7
|
import { attachmentFormValuesToPayload as p, receivableToAttachmentFormValues as m } from "./attachments.js";
|
|
8
8
|
import { createEmptyRecurrenceFields as h, willRecurrenceIssue as g } from "./recurrence.js";
|
|
9
9
|
import { buildPaymentTermsPayload as _, buildPaymentTermsUpdatePayload as v, paymentTermsToFormFields as y } from "./paymentTerms.js";
|
|
10
|
-
import { createEmptyDiscount as b, discountFromDraft as x, discountToDraft as
|
|
11
|
-
import { validateDiscount as
|
|
12
|
-
import { format as E } from "date-fns";
|
|
10
|
+
import { createEmptyDiscount as b, discountFromDraft as x, discountToDraft as ee } from "./discount.js";
|
|
11
|
+
import { validateDiscount as S, validateInvoiceTotals as C, validateIssuableTotal as w } from "./totals.js";
|
|
12
|
+
import { differenceInCalendarDays as T, format as E } from "date-fns";
|
|
13
13
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js
|
|
14
14
|
function D() {
|
|
15
15
|
return {
|
|
@@ -74,38 +74,41 @@ function N(e, t, n) {
|
|
|
74
74
|
customerState: "missing"
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function P(e, t
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (Number.isNaN(n.getTime())) return 0;
|
|
81
|
-
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);
|
|
82
|
-
return a > 0 ? a : 0;
|
|
77
|
+
function P(e, t) {
|
|
78
|
+
let r = n(e);
|
|
79
|
+
return r ? T(r, t) : void 0;
|
|
83
80
|
}
|
|
84
|
-
function F(e, t
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return r === 0 ? {} : { dueDateOverdueLabel: (r === 1 ? t.listDayOverdue : t.listDaysOverdue).replace("{days}", String(r)) };
|
|
81
|
+
function F(e, t = /* @__PURE__ */ new Date()) {
|
|
82
|
+
let n = P(e, t) ?? 0;
|
|
83
|
+
return n < 0 ? -n : 0;
|
|
88
84
|
}
|
|
89
|
-
var I =
|
|
85
|
+
var I = /* @__PURE__ */ new Set([
|
|
86
|
+
"issued",
|
|
87
|
+
"partially_paid",
|
|
88
|
+
"overdue"
|
|
89
|
+
]);
|
|
90
|
+
function L(e, t, n) {
|
|
91
|
+
let r = e.type === "invoice" ? e.due_date : null, i = O(r, t.pendingValue);
|
|
92
|
+
if (!I.has(e.status)) return { dueDateLabel: i };
|
|
93
|
+
let a = P(r, n);
|
|
94
|
+
if (a === 0) return { dueDateLabel: t.listDueToday };
|
|
95
|
+
if (a === 1) return { dueDateLabel: t.listDueTomorrow };
|
|
96
|
+
if (a === void 0 || a > 0) return { dueDateLabel: i };
|
|
97
|
+
let o = (a === -1 ? t.listDayOverdue : t.listDaysOverdue).replace("{days}", String(-a));
|
|
98
|
+
return {
|
|
99
|
+
dueDateLabel: i,
|
|
100
|
+
dueDateOverdueLabel: o,
|
|
101
|
+
dueDateAccessibleLabel: t.listOverdueAccessibleName.replace("{overdue}", o).replace("{date}", i)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
var R = {
|
|
90
105
|
names: /* @__PURE__ */ new Map(),
|
|
91
106
|
isResolving: !1
|
|
92
107
|
};
|
|
93
|
-
function
|
|
94
|
-
return e
|
|
95
|
-
kind: "chip",
|
|
96
|
-
...e.status
|
|
97
|
-
} : { kind: "blank" };
|
|
98
|
-
}
|
|
99
|
-
function R(e, t, n) {
|
|
100
|
-
if (e.type !== "invoice" || e.status !== "recurring") return {};
|
|
101
|
-
let r = e.recurrence_id ? t.get(e.recurrence_id) : void 0;
|
|
102
|
-
return {
|
|
103
|
-
documentLabel: e.document_id || n.recurringNumber,
|
|
104
|
-
statusOverride: L(r),
|
|
105
|
-
showDocumentSyncIcon: !0
|
|
106
|
-
};
|
|
108
|
+
function z(e, t) {
|
|
109
|
+
return e.type !== "invoice" || !e.recurrence_id ? {} : { recurringBadgeLabel: t.listRecurringBadge };
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function B({ receivables: e, messages: t, customerNames: n = R, now: r = /* @__PURE__ */ new Date() }) {
|
|
109
112
|
return e.map((e) => ({
|
|
110
113
|
id: e.id,
|
|
111
114
|
type: e.type,
|
|
@@ -113,23 +116,27 @@ function z({ receivables: e, messages: t, customerNames: n = I, seriesStatuses:
|
|
|
113
116
|
...N(e, n, t),
|
|
114
117
|
status: e.status,
|
|
115
118
|
issueDateLabel: O(e.issue_date, t.pendingValue),
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
...L(e, t, r),
|
|
120
|
+
balanceDueLabel: k({
|
|
121
|
+
amount: "amount_due" in e ? e.amount_due ?? 0 : 0,
|
|
122
|
+
currency: e.currency,
|
|
123
|
+
fallback: ""
|
|
124
|
+
}),
|
|
118
125
|
totalLabel: k({
|
|
119
126
|
amount: e.total_amount ?? 0,
|
|
120
127
|
currency: e.currency,
|
|
121
128
|
fallback: ""
|
|
122
129
|
}),
|
|
123
|
-
...
|
|
130
|
+
...z(e, t)
|
|
124
131
|
}));
|
|
125
132
|
}
|
|
126
|
-
function
|
|
133
|
+
function V(e) {
|
|
127
134
|
if (e.memo || e.footer) return {
|
|
128
135
|
opening: e.memo || void 0,
|
|
129
136
|
closing: e.footer || void 0
|
|
130
137
|
};
|
|
131
138
|
}
|
|
132
|
-
function
|
|
139
|
+
function H({ values: e, counterpart: t, addresses: n }) {
|
|
133
140
|
let r = n?.length && t?.id === e.customerId ? t : void 0, i = e.billingAddressId || r?.default_billing_address_id || (n?.length === 1 ? n[0].id : ""), a = e.shippingAddressId || r?.default_shipping_address_id || "";
|
|
134
141
|
return {
|
|
135
142
|
billingAddressId: i,
|
|
@@ -137,7 +144,7 @@ function V({ values: e, counterpart: t, addresses: n }) {
|
|
|
137
144
|
shippingAddressId: a
|
|
138
145
|
};
|
|
139
146
|
}
|
|
140
|
-
function
|
|
147
|
+
function U({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i = !1, canCreateCustomer: a = !0 }) {
|
|
141
148
|
let o = {}, s = a && !!e.customerName.trim();
|
|
142
149
|
!e.customerId && !s && (o.customerId = t.customerRequired);
|
|
143
150
|
let c = e.customerEmail.trim();
|
|
@@ -146,28 +153,28 @@ function H({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i
|
|
|
146
153
|
currency: e.currency,
|
|
147
154
|
messages: t,
|
|
148
155
|
requireComplete: n || i
|
|
149
|
-
}), d = (n || i && g(e)) && !l && e.lineItems.length > 0 ?
|
|
156
|
+
}), d = (n || i && g(e)) && !l && e.lineItems.length > 0 ? w(e, t) : void 0, p = u(l, C(e, t) ?? d, (n || i) && e.lineItems.length === 0 ? t.lineItemsRequired : void 0);
|
|
150
157
|
l && (o.lineItems = l), p && (o.lineItemsSummary = p);
|
|
151
|
-
let m =
|
|
158
|
+
let m = S(e, t);
|
|
152
159
|
return m && (o.discount = m), o;
|
|
153
160
|
}
|
|
154
|
-
function
|
|
161
|
+
function W(e) {
|
|
155
162
|
return Object.keys(e).length > 0;
|
|
156
163
|
}
|
|
157
|
-
function
|
|
158
|
-
return !U(
|
|
159
|
-
values:
|
|
164
|
+
function G(e, t) {
|
|
165
|
+
return !W(U({
|
|
166
|
+
values: J(e),
|
|
160
167
|
messages: t,
|
|
161
168
|
willIssue: !0
|
|
162
169
|
}));
|
|
163
170
|
}
|
|
164
|
-
function
|
|
171
|
+
function K({ bankAccountId: e, bankAccountType: t }) {
|
|
165
172
|
return {
|
|
166
173
|
bank_account_id: e || void 0,
|
|
167
174
|
bank_account_type: e && t || void 0
|
|
168
175
|
};
|
|
169
176
|
}
|
|
170
|
-
function
|
|
177
|
+
function q({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
|
|
171
178
|
let i = e.lineItems.filter((e) => !a(e)).map((t) => s({
|
|
172
179
|
lineItem: t,
|
|
173
180
|
currency: e.currency,
|
|
@@ -182,7 +189,7 @@ function K({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
|
|
|
182
189
|
memo: e.openingNote,
|
|
183
190
|
footer: e.closingNote,
|
|
184
191
|
discount: x(e) ?? void 0,
|
|
185
|
-
...
|
|
192
|
+
...K(e)
|
|
186
193
|
};
|
|
187
194
|
return e.type === "quote" ? {
|
|
188
195
|
...o,
|
|
@@ -198,7 +205,7 @@ function K({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
|
|
|
198
205
|
type: "invoice"
|
|
199
206
|
};
|
|
200
207
|
}
|
|
201
|
-
function
|
|
208
|
+
function J(e, t) {
|
|
202
209
|
let n = e.type === "quote" ? "quote" : "invoice", r = d(e.line_items), a = e.type === "invoice" ? e : void 0, o = e.line_items.map((n) => l({
|
|
203
210
|
lineItem: n,
|
|
204
211
|
currency: e.currency,
|
|
@@ -209,17 +216,17 @@ function q(e, t) {
|
|
|
209
216
|
type: n,
|
|
210
217
|
customerId: e.counterpart_id,
|
|
211
218
|
currency: e.currency,
|
|
212
|
-
issueDate:
|
|
213
|
-
dueDate: e.type === "quote" ?
|
|
219
|
+
issueDate: $(e.issue_date),
|
|
220
|
+
dueDate: e.type === "quote" ? $(e.expiry_date) : "",
|
|
214
221
|
openingNote: e.memo ?? "",
|
|
215
222
|
closingNote: e.footer ?? "",
|
|
216
223
|
...e.type === "invoice" ? y(e.payment_terms) : {},
|
|
217
224
|
taxRate: r,
|
|
218
225
|
savedTaxRate: r,
|
|
219
|
-
...
|
|
226
|
+
...ee(e.discount, e.currency),
|
|
220
227
|
lineItems: o.length > 0 ? o : [i(e.currency)],
|
|
221
228
|
bankAccountId: e.bank_account_id ?? "",
|
|
222
|
-
bankAccountType:
|
|
229
|
+
bankAccountType: Y(e.bank_account_type),
|
|
223
230
|
billingAddressId: e.counterpart_billing_address?.id ?? "",
|
|
224
231
|
shippingAddressId: e.counterpart_shipping_address?.id ?? "",
|
|
225
232
|
paymentReminderId: a?.payment_reminder_id ?? "",
|
|
@@ -228,10 +235,10 @@ function q(e, t) {
|
|
|
228
235
|
attachments: m(e)
|
|
229
236
|
};
|
|
230
237
|
}
|
|
231
|
-
function
|
|
238
|
+
function Y(e) {
|
|
232
239
|
return e === "BANK_DETAILS" || e === "INTERNAL" || e === "EXTERNAL" ? e : "";
|
|
233
240
|
}
|
|
234
|
-
function
|
|
241
|
+
function X({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
|
|
235
242
|
let i = {
|
|
236
243
|
counterpart_billing_address_id: t || null,
|
|
237
244
|
counterpart_shipping_address_id: n || null,
|
|
@@ -241,7 +248,7 @@ function Y({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
|
|
|
241
248
|
memo: e.openingNote,
|
|
242
249
|
footer: e.closingNote,
|
|
243
250
|
discount: x(e),
|
|
244
|
-
...
|
|
251
|
+
...K(e)
|
|
245
252
|
};
|
|
246
253
|
return e.type === "quote" ? { quote: {
|
|
247
254
|
...i,
|
|
@@ -257,7 +264,7 @@ function Y({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
|
|
|
257
264
|
attachments: p(e.attachments) ?? null
|
|
258
265
|
} };
|
|
259
266
|
}
|
|
260
|
-
function
|
|
267
|
+
function Z({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: i }) {
|
|
261
268
|
let s = d(t), u = o(e.taxRate, s), f = (e, t, n) => c({
|
|
262
269
|
lineItem: e,
|
|
263
270
|
currency: t,
|
|
@@ -283,7 +290,7 @@ function X({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById
|
|
|
283
290
|
...v.length ? { remove: v } : {}
|
|
284
291
|
};
|
|
285
292
|
}
|
|
286
|
-
function
|
|
293
|
+
function Q({ values: e, originalLineItems: t, changes: n }) {
|
|
287
294
|
let r = e.lineItems.filter((e) => !a(e)).map((e) => e.id);
|
|
288
295
|
if (!t) return { created: r };
|
|
289
296
|
let i = new Set(t.map((e) => e.id));
|
|
@@ -292,7 +299,7 @@ function Z({ values: e, originalLineItems: t, changes: n }) {
|
|
|
292
299
|
replaced: n?.replace?.map((e) => e.id) ?? []
|
|
293
300
|
};
|
|
294
301
|
}
|
|
295
|
-
function
|
|
302
|
+
function $(e) {
|
|
296
303
|
return e?.slice(0, 10) ?? "";
|
|
297
304
|
}
|
|
298
|
-
export {
|
|
305
|
+
export { V as buildReceivableNotesView, B as buildReceivableRows, D as createEmptyReceivableFormValues, i as createLineItem, O as formatDate, k as formatMoney, A as fromMajorUnits, F as getDaysOverdue, j as getDocumentTitle, M as getDocumentTypeLabel, W as hasReceivableFormErrors, G as isReceivableReadyToIssue, q as receivableFormValuesToCreatePayload, Z as receivableFormValuesToLineItemChanges, X as receivableFormValuesToUpdatePayload, J as receivableToFormValues, H as resolveCounterpartAddresses, N as resolveCustomer, Q as submittedLineItemRows, U as validateReceivableForm };
|