@tesouro/embedded-components-react 0.11.141 → 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../../../
|
|
5
|
+
import { toast as e } from "../../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { getStateOptions as t } from "../../../../../shared/util/dist/lib/usStates.js";
|
|
7
7
|
import { extractApiErrorMessage as n } from "../../../../../shared/util/dist/lib/apiErrors.js";
|
|
8
8
|
import { parseApiValidationErrors as r } from "../../../../../shared/util/dist/lib/apiValidationErrors.js";
|
|
@@ -12,24 +12,24 @@ import { COUNTERPART_MESSAGE_LABELS_EN as i } from "../../../../../shared/counte
|
|
|
12
12
|
import { getCounterpartEmail as ee } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
13
13
|
import { useCounterpartQuery as a, useCreateCounterpartMutation as o } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
14
14
|
import { useCounterpartAddressesQuery as s } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
15
|
-
import { useCounterpartForm as
|
|
15
|
+
import { useCounterpartForm as c } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
16
16
|
import "../../../../../shared/counterpart-management/feature/dist/index.js";
|
|
17
17
|
import "../../../../ui/dist/index24.js";
|
|
18
18
|
import "../../../../ui/dist/index.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
19
|
+
import { buildLineItemControls as te, commitLineItemField as ne, commitTaxRateInput as l, convertPriceInput as u, createLineItem as re, getCurrencySymbol as ie, lineItemFromProduct as ae, reconcileLineItemIds as oe, reconcileMeasureUnits as se, sanitizeLineItemPatch as ce, sanitizeTaxRateInput as le, stepLineItemQuantity as ue, stripBlankLineItems as de, summarizeLineItemErrors as fe, toSheetLineItem as pe, validateLineItems as me } from "./lineItems.js";
|
|
20
|
+
import { buildReceivableAttachmentsView as he } from "./attachments.js";
|
|
21
|
+
import { buildCreateRecurrencePayload as ge, buildUpdateRecurrencePayload as _e, clearRecurrenceRecipients as d, countIssuedIterations as ve, isRecurring as f, presetMonthlyRecurrence as ye, recurrenceToFormFields as be, validateRecurrence as xe, willRecurrenceIssue as Se } from "./recurrence.js";
|
|
22
|
+
import { convertDiscountInput as Ce, decorateDiscountInput as we, discountInputToMinorUnits as Te, sanitizeDiscountInput as Ee } from "./discount.js";
|
|
23
|
+
import { buildFormTotalsView as De, calculateFormTotals as Oe, validateDiscount as ke, validateInvoiceTotals as Ae } from "./totals.js";
|
|
24
|
+
import { createEmptyReceivableFormValues as je, hasReceivableFormErrors as Me, receivableFormValuesToCreatePayload as Ne, receivableFormValuesToLineItemChanges as Pe, receivableFormValuesToUpdatePayload as Fe, receivableToFormValues as Ie, resolveCounterpartAddresses as Le, submittedLineItemRows as Re, validateReceivableForm as ze } from "./helpers.js";
|
|
25
|
+
import { INLINE_CUSTOMER_TYPE as Be, buildInlineCustomerPayload as Ve, seedCustomerFormValues as He } from "./customer.js";
|
|
26
|
+
import { useCreateReceivableMutation as Ue, useIssueReceivableMutation as We, useUpdateReceivableMutation as Ge } from "../../../../data-access/dist/index11.js";
|
|
27
|
+
import { useCreateRecurrenceMutation as Ke, useRecurrenceQuery as qe, useUpdateRecurrenceMutation as Je } from "../../../../data-access/dist/index16.js";
|
|
22
28
|
import "../../../../data-access/dist/index.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { useMeasureUnitsQuery as Ee } from "../../../../../shared/product-catalog/data-access/dist/index9.js";
|
|
26
|
-
import { useMeasureUnits as De } from "../../../../../shared/product-catalog/feature/dist/lib/useMeasureUnits.js";
|
|
29
|
+
import { useMeasureUnitsQuery as Ye } from "../../../../../shared/product-catalog/data-access/dist/index9.js";
|
|
30
|
+
import { useMeasureUnits as Xe } from "../../../../../shared/product-catalog/feature/dist/lib/useMeasureUnits.js";
|
|
27
31
|
import "../../../../../shared/product-catalog/feature/dist/index.js";
|
|
28
|
-
import { getInlineItems as
|
|
29
|
-
import { buildCreateRecurrencePayload as ke, buildUpdateRecurrencePayload as Ae, clearRecurrenceRecipients as u, countIssuedIterations as je, isRecurring as d, recurrenceToFormFields as Me, validateRecurrence as Ne, willRecurrenceIssue as Pe } from "./recurrence.js";
|
|
30
|
-
import { convertDiscountInput as Fe, decorateDiscountInput as Ie, discountInputToMinorUnits as Le, sanitizeDiscountInput as Re } from "./discount.js";
|
|
31
|
-
import { buildFormTotalsView as ze, calculateFormTotals as Be, validateDiscount as Ve, validateInvoiceTotals as He } from "./totals.js";
|
|
32
|
-
import { createEmptyReceivableFormValues as Ue, hasReceivableFormErrors as We, receivableFormValuesToCreatePayload as Ge, receivableFormValuesToLineItemChanges as Ke, receivableFormValuesToUpdatePayload as qe, receivableToFormValues as Je, resolveCounterpartAddresses as Ye, submittedLineItemRows as Xe, validateReceivableForm as Ze } from "./helpers.js";
|
|
32
|
+
import { getInlineItems as Ze } from "./actionsModal.js";
|
|
33
33
|
import { getIssueReminderBlocker as Qe, shouldShowRemindersInitially as $e } from "./reminders.js";
|
|
34
34
|
import { useReceivableIssuePreflight as et } from "./useReceivableIssuePreflight.js";
|
|
35
35
|
import { UNSUBMITTED_PAYLOAD_VARIANTS as tt, apiValidationErrorsToFormErrors as nt, getApiErrorMessage as rt } from "./apiValidationErrors.js";
|
|
@@ -40,10 +40,10 @@ import { useReceivableBankAccount as st } from "./useReceivableBankAccount.js";
|
|
|
40
40
|
import { useReceivableReminders as ct } from "./useReceivableReminders.js";
|
|
41
41
|
import { useReceivablePreview as lt } from "./useReceivablePreview.js";
|
|
42
42
|
import { hasUnsavedChanges as ut } from "./unsavedChanges.js";
|
|
43
|
-
import { useCallback as
|
|
43
|
+
import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
44
44
|
// ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js
|
|
45
45
|
function dt(e, t) {
|
|
46
|
-
return t === e.customerId ? e :
|
|
46
|
+
return t === e.customerId ? e : d({
|
|
47
47
|
...e,
|
|
48
48
|
customerId: t,
|
|
49
49
|
billingAddressId: "",
|
|
@@ -62,60 +62,60 @@ function ft(e, t) {
|
|
|
62
62
|
customerEmail: ""
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function pt({ messages:
|
|
66
|
-
let _t =
|
|
65
|
+
function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, canCreateCustomer: v = !0, onCreated: ht, onUpdated: gt }) {
|
|
66
|
+
let _t = Ue(), vt = Ge(), yt = Ke(), bt = Je(), xt = We(), St = o(), y = g("draft"), Ct = g(!1), [wt, Tt] = _(), b = g(!1), x = g(!1), Et = g(null), S = g(void 0), C = g([]), Dt = g(""), [w, T] = _(!1), [E, Ot] = _("create"), [kt, At] = _(!1), [jt, Mt] = _(), [Nt, Pt] = _(), [D, O] = _(() => je()), k = g(D), [Ft, A] = _(!1), [It, j] = _({}), [Lt, Rt] = _("none"), zt = Xe(), M = Ye(), N = M.data?.data, { unitNamesById: P } = zt, [Bt, Vt] = _(), [F, Ht] = _(!1), Ut = g(!1), I = g(!1), L = g(!1), R = g({
|
|
67
67
|
lines: !1,
|
|
68
68
|
discount: !1
|
|
69
|
-
}), [
|
|
69
|
+
}), [Wt, Gt] = _(!1), [Kt, qt] = _(!1), Jt = h(() => t(), []), Yt = h(() => ({
|
|
70
70
|
...i,
|
|
71
71
|
...pt
|
|
72
|
-
}), [pt]),
|
|
73
|
-
values:
|
|
74
|
-
counterpart:
|
|
75
|
-
addresses:
|
|
76
|
-
}), z = !!
|
|
77
|
-
counterpartId:
|
|
78
|
-
billingAddressId:
|
|
79
|
-
billingCountry:
|
|
80
|
-
inlineCustomerType:
|
|
72
|
+
}), [pt]), Xt = s(D.customerId), Zt = a(D.customerId || void 0), Qt = Xt.data?.data?.[0], { billingAddressId: $t, billingAddress: en, shippingAddressId: tn } = Le({
|
|
73
|
+
values: D,
|
|
74
|
+
counterpart: Zt.data,
|
|
75
|
+
addresses: Xt.data?.data
|
|
76
|
+
}), z = !!D.customerId && (Xt.isLoading || Zt.isLoading), B = et({
|
|
77
|
+
counterpartId: D.customerId,
|
|
78
|
+
billingAddressId: $t,
|
|
79
|
+
billingCountry: en?.country,
|
|
80
|
+
inlineCustomerType: v && !D.customerId && D.customerName.trim() ? Be : void 0,
|
|
81
81
|
isAddressesLoading: z
|
|
82
|
-
}),
|
|
83
|
-
|
|
82
|
+
}), nn = B.isLoading || z, rn = p((e) => {
|
|
83
|
+
O((t) => ({
|
|
84
84
|
...t,
|
|
85
85
|
attachments: e(t.attachments)
|
|
86
86
|
}));
|
|
87
87
|
}, []), V = it({
|
|
88
|
-
attachments:
|
|
89
|
-
setAttachments:
|
|
90
|
-
receivableId:
|
|
91
|
-
}), { reset: H, discardUploads:
|
|
92
|
-
attachments:
|
|
88
|
+
attachments: D.attachments,
|
|
89
|
+
setAttachments: rn,
|
|
90
|
+
receivableId: jt
|
|
91
|
+
}), { reset: H, discardUploads: an, commitRemovals: on } = V, sn = D.type === "invoice" ? he({
|
|
92
|
+
attachments: D.attachments,
|
|
93
93
|
pendingUploads: V.pendingUploads,
|
|
94
94
|
isCountLimitReached: V.isCountLimitReached,
|
|
95
|
-
isRecurring:
|
|
96
|
-
messages:
|
|
97
|
-
}) : void 0,
|
|
98
|
-
e &&
|
|
99
|
-
}, []),
|
|
100
|
-
view:
|
|
101
|
-
setView:
|
|
102
|
-
selectedId:
|
|
103
|
-
setSelectedId:
|
|
104
|
-
messages:
|
|
95
|
+
isRecurring: f(D),
|
|
96
|
+
messages: d
|
|
97
|
+
}) : void 0, cn = p((e) => {
|
|
98
|
+
e && O((t) => dt(t, e));
|
|
99
|
+
}, []), ln = c({
|
|
100
|
+
view: Lt,
|
|
101
|
+
setView: Rt,
|
|
102
|
+
selectedId: D.customerId || void 0,
|
|
103
|
+
setSelectedId: cn,
|
|
104
|
+
messages: Yt,
|
|
105
105
|
counterpartType: "customer",
|
|
106
106
|
counterpart: void 0,
|
|
107
|
-
primaryAddress:
|
|
108
|
-
}), { openCreate:
|
|
109
|
-
|
|
110
|
-
name:
|
|
111
|
-
email:
|
|
107
|
+
primaryAddress: Qt
|
|
108
|
+
}), { openCreate: un, setValues: dn } = ln, fn = p(() => {
|
|
109
|
+
un(), dn((e) => He(e, {
|
|
110
|
+
name: D.customerName,
|
|
111
|
+
email: D.customerEmail
|
|
112
112
|
}));
|
|
113
113
|
}, [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]),
|
|
114
|
+
un,
|
|
115
|
+
dn,
|
|
116
|
+
D.customerName,
|
|
117
|
+
D.customerEmail
|
|
118
|
+
]), pn = p((e) => O((t) => {
|
|
119
119
|
let n = e({
|
|
120
120
|
paymentTermsId: t.paymentTermsId,
|
|
121
121
|
paymentTermsCustomDate: t.paymentTermsCustomDate
|
|
@@ -125,58 +125,58 @@ function pt({ messages: u, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
125
125
|
...n,
|
|
126
126
|
...n.paymentTermsId === "receipt_due" ? { paymentReminderId: "" } : {}
|
|
127
127
|
};
|
|
128
|
-
}), []),
|
|
129
|
-
paymentTermsId:
|
|
130
|
-
paymentTermsCustomDate:
|
|
131
|
-
issueDate:
|
|
132
|
-
isRecurring:
|
|
133
|
-
messages:
|
|
134
|
-
onChange:
|
|
135
|
-
}),
|
|
136
|
-
t && (
|
|
137
|
-
...
|
|
128
|
+
}), []), mn = at({
|
|
129
|
+
paymentTermsId: D.paymentTermsId,
|
|
130
|
+
paymentTermsCustomDate: D.paymentTermsCustomDate,
|
|
131
|
+
issueDate: D.issueDate,
|
|
132
|
+
isRecurring: D.type === "invoice" && f(D),
|
|
133
|
+
messages: d,
|
|
134
|
+
onChange: pn
|
|
135
|
+
}), hn = mn.reset, gn = p((e, { automatic: t = !1 } = {}) => {
|
|
136
|
+
t && (k.current = {
|
|
137
|
+
...k.current,
|
|
138
138
|
...e
|
|
139
|
-
}),
|
|
139
|
+
}), O((t) => ({
|
|
140
140
|
...t,
|
|
141
141
|
...e
|
|
142
142
|
}));
|
|
143
143
|
}, []), U = st({
|
|
144
|
-
open:
|
|
145
|
-
bankAccountId:
|
|
146
|
-
bankAccountType:
|
|
144
|
+
open: w,
|
|
145
|
+
bankAccountId: D.bankAccountId,
|
|
146
|
+
bankAccountType: D.bankAccountType,
|
|
147
147
|
embeddedBankName: mt,
|
|
148
|
-
messages:
|
|
149
|
-
onSelect:
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
if (!W ||
|
|
153
|
-
|
|
154
|
-
let e =
|
|
155
|
-
|
|
156
|
-
...
|
|
148
|
+
messages: d,
|
|
149
|
+
onSelect: gn
|
|
150
|
+
}), _n = U.reset, vn = qe(Nt), W = Nt ? vn.data : void 0, G = ve(W), yn = G > 0, K = !!Nt && vn.isLoading, bn = g(void 0);
|
|
151
|
+
m(() => {
|
|
152
|
+
if (!W || bn.current === W.id) return;
|
|
153
|
+
bn.current = W.id;
|
|
154
|
+
let e = be(W);
|
|
155
|
+
k.current = {
|
|
156
|
+
...k.current,
|
|
157
157
|
...e
|
|
158
|
-
},
|
|
158
|
+
}, O((t) => ({
|
|
159
159
|
...t,
|
|
160
160
|
...e
|
|
161
161
|
}));
|
|
162
162
|
}, [W]);
|
|
163
|
-
let
|
|
163
|
+
let xn = p((e) => O(e), []), Sn = p((e) => j((t) => {
|
|
164
164
|
if (!e.some((e) => e in t)) return t;
|
|
165
165
|
let n = { ...t };
|
|
166
166
|
return e.forEach((e) => delete n[e]), n;
|
|
167
|
-
}), []),
|
|
168
|
-
|
|
169
|
-
}, [
|
|
170
|
-
|
|
171
|
-
let e =
|
|
167
|
+
}), []), Cn = g([]), wn = p((e) => {
|
|
168
|
+
F ? Cn.current.push(...e) : Sn(e);
|
|
169
|
+
}, [Sn, F]);
|
|
170
|
+
m(() => {
|
|
171
|
+
let e = Cn.current;
|
|
172
172
|
if (!e.length) return;
|
|
173
|
-
|
|
174
|
-
let t =
|
|
175
|
-
fields:
|
|
173
|
+
Cn.current = [];
|
|
174
|
+
let t = xe({
|
|
175
|
+
fields: D,
|
|
176
176
|
issuedCount: G,
|
|
177
|
-
messages:
|
|
177
|
+
messages: d
|
|
178
178
|
});
|
|
179
|
-
|
|
179
|
+
j((n) => {
|
|
180
180
|
let r = { ...n };
|
|
181
181
|
return e.forEach((e) => {
|
|
182
182
|
t[e] ? r[e] = t[e] : delete r[e];
|
|
@@ -184,237 +184,238 @@ function pt({ messages: u, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
184
184
|
});
|
|
185
185
|
}, [
|
|
186
186
|
G,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
d,
|
|
188
|
+
D
|
|
189
189
|
]);
|
|
190
|
-
let
|
|
191
|
-
values:
|
|
192
|
-
errors:
|
|
193
|
-
lockSchedule:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
190
|
+
let Tn = ot({
|
|
191
|
+
values: D,
|
|
192
|
+
errors: It,
|
|
193
|
+
lockSchedule: yn,
|
|
194
|
+
requireRepeat: E === "create" && kt,
|
|
195
|
+
messages: d,
|
|
196
|
+
onChange: xn,
|
|
197
|
+
onClearErrors: Sn,
|
|
198
|
+
onRevalidateErrors: wn
|
|
199
|
+
}), q = Tn.reset, En = p((e) => O((t) => ({
|
|
199
200
|
...t,
|
|
200
201
|
...e
|
|
201
|
-
})), []),
|
|
202
|
-
open:
|
|
203
|
-
isInvoice:
|
|
204
|
-
disabled:
|
|
205
|
-
paymentTermsId:
|
|
206
|
-
paymentTermsCustomDate:
|
|
207
|
-
paymentReminderId:
|
|
208
|
-
overdueReminderId:
|
|
209
|
-
messages:
|
|
210
|
-
onSelect:
|
|
211
|
-
}),
|
|
212
|
-
|
|
202
|
+
})), []), J = St.isPending || _t.isPending || vt.isPending || yt.isPending || bt.isPending || xt.isPending, Dn = ct({
|
|
203
|
+
open: w,
|
|
204
|
+
isInvoice: D.type === "invoice",
|
|
205
|
+
disabled: J,
|
|
206
|
+
paymentTermsId: D.paymentTermsId,
|
|
207
|
+
paymentTermsCustomDate: D.paymentTermsCustomDate,
|
|
208
|
+
paymentReminderId: D.paymentReminderId,
|
|
209
|
+
overdueReminderId: D.overdueReminderId,
|
|
210
|
+
messages: d,
|
|
211
|
+
onSelect: En
|
|
212
|
+
}), On = Dn.reset, kn = p(() => {
|
|
213
|
+
C.current = [], Vt(void 0), Ot("create"), At(!1), Mt(void 0), Pt(void 0), bn.current = void 0, S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, O(je()), A(!1), j({}), Ht(!1), Gt(!1), R.current = {
|
|
213
214
|
lines: !1,
|
|
214
215
|
discount: !1
|
|
215
|
-
}, H(),
|
|
216
|
-
}, [H,
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
...
|
|
216
|
+
}, H(), q();
|
|
217
|
+
}, [H, q]), An = p((e = "invoice", { customerId: t = "", recurring: n = !1 } = {}) => {
|
|
218
|
+
hn(), _n(), q();
|
|
219
|
+
let r = {
|
|
220
|
+
...je(),
|
|
220
221
|
type: e,
|
|
221
222
|
customerId: t
|
|
222
|
-
};
|
|
223
|
-
|
|
223
|
+
}, i = n ? ye(r) : r;
|
|
224
|
+
On($e(i)), C.current = [], S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, bn.current = void 0, Vt(void 0), Ot("create"), At(n), Mt(void 0), Pt(void 0), k.current = i, O(i), A(!1), j({}), H(), Ht(!1), Gt(!1), R.current = {
|
|
224
225
|
lines: !1,
|
|
225
226
|
discount: !1
|
|
226
|
-
},
|
|
227
|
+
}, T(!0);
|
|
227
228
|
}, [
|
|
228
229
|
H,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
]),
|
|
230
|
+
hn,
|
|
231
|
+
_n,
|
|
232
|
+
q,
|
|
233
|
+
On
|
|
234
|
+
]), jn = p((e, { highlightForIssue: t = !1 } = {}) => {
|
|
234
235
|
if (e.type === "credit_note") return;
|
|
235
|
-
|
|
236
|
-
let n =
|
|
237
|
-
|
|
236
|
+
hn(), _n(), q();
|
|
237
|
+
let n = Ie(e, N);
|
|
238
|
+
On($e(n)), C.current = e.line_items, Dt.current = e.currency, S.current = void 0, y.current = "draft", b.current = !1, x.current = t, bn.current = void 0, Vt(void 0), Ot("edit"), Mt(e.id), Pt(e.type === "invoice" ? e.recurrence_id ?? void 0 : void 0), k.current = n, O(n), A(!1), j({}), Ht(!1), Gt(!1), R.current = {
|
|
238
239
|
lines: !1,
|
|
239
240
|
discount: !1
|
|
240
|
-
}, H(),
|
|
241
|
+
}, H(), T(!0);
|
|
241
242
|
}, [
|
|
242
243
|
H,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
hn,
|
|
245
|
+
_n,
|
|
246
|
+
q,
|
|
247
|
+
On,
|
|
248
|
+
N
|
|
248
249
|
]);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
...
|
|
252
|
-
lineItems:
|
|
253
|
-
},
|
|
254
|
-
let t =
|
|
250
|
+
m(() => {
|
|
251
|
+
N?.length && (k.current = {
|
|
252
|
+
...k.current,
|
|
253
|
+
lineItems: se(k.current.lineItems, N)
|
|
254
|
+
}, O((e) => {
|
|
255
|
+
let t = se(e.lineItems, N);
|
|
255
256
|
return t === e.lineItems ? e : {
|
|
256
257
|
...e,
|
|
257
258
|
lineItems: t
|
|
258
259
|
};
|
|
259
260
|
}));
|
|
260
|
-
}, [
|
|
261
|
-
let
|
|
262
|
-
|
|
263
|
-
}, [
|
|
264
|
-
|
|
261
|
+
}, [N]);
|
|
262
|
+
let Y = V.isUploading, Mn = p(() => {
|
|
263
|
+
Y || (an(), A(!1), T(!1), j({}));
|
|
264
|
+
}, [an, Y]), Nn = p(() => {
|
|
265
|
+
Ft ? A(!1) : Y ? e.error(d.attachmentsUploading) : ut(k.current, D) ? A(!0) : Mn();
|
|
265
266
|
}, [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
]),
|
|
267
|
+
Mn,
|
|
268
|
+
Y,
|
|
269
|
+
d.attachmentsUploading,
|
|
270
|
+
Ft,
|
|
271
|
+
D
|
|
272
|
+
]), Pn = p((e) => {
|
|
272
273
|
let t = { ...e };
|
|
273
|
-
t.taxRate !== void 0 && (t.taxRate =
|
|
274
|
+
t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), L.current = !0), t.type !== void 0 && t.type !== "invoice" && an(), t.discount !== void 0 && qt(!1), t.discount !== void 0 && F && (I.current = !0), t.discountType !== void 0 && (I.current = !0), t.currency !== void 0 && (Ut.current = !0), O((e) => {
|
|
274
275
|
let n = {
|
|
275
276
|
...t.customerId === void 0 ? e : dt(e, t.customerId),
|
|
276
277
|
...t
|
|
277
278
|
};
|
|
278
|
-
return t.discount !== void 0 && (n.discount =
|
|
279
|
+
return t.discount !== void 0 && (n.discount = Ee(t.discount, n.discountType, n.currency)), n.currency !== e.currency && (n.lineItems = e.lineItems.map((t) => ({
|
|
279
280
|
...t,
|
|
280
|
-
price:
|
|
281
|
-
}))), (n.currency !== e.currency || n.discountType !== e.discountType) && (n.discount =
|
|
281
|
+
price: u(t.price, e.currency, n.currency)
|
|
282
|
+
}))), (n.currency !== e.currency || n.discountType !== e.discountType) && (n.discount = Ce({
|
|
282
283
|
value: n.discount,
|
|
283
284
|
type: n.discountType,
|
|
284
285
|
currency: n.currency
|
|
285
286
|
})), n;
|
|
286
287
|
});
|
|
287
|
-
}, [
|
|
288
|
-
|
|
288
|
+
}, [an, F]), Fn = p(() => {
|
|
289
|
+
Gt(!0), qt(Te(D.discount, D.discountType, D.currency) === 0);
|
|
289
290
|
}, [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
]),
|
|
294
|
-
|
|
291
|
+
D.discount,
|
|
292
|
+
D.discountType,
|
|
293
|
+
D.currency
|
|
294
|
+
]), In = p(() => {
|
|
295
|
+
Gt(!1), I.current = !0, O((e) => ({
|
|
295
296
|
...e,
|
|
296
|
-
discount:
|
|
297
|
+
discount: Ce({
|
|
297
298
|
value: e.discount,
|
|
298
299
|
type: e.discountType,
|
|
299
300
|
currency: e.currency
|
|
300
301
|
})
|
|
301
302
|
}));
|
|
302
|
-
}, []),
|
|
303
|
-
let e =
|
|
304
|
-
values:
|
|
305
|
-
messages:
|
|
306
|
-
canCreateCustomer:
|
|
303
|
+
}, []), Ln = p(() => {
|
|
304
|
+
let e = ze({
|
|
305
|
+
values: D,
|
|
306
|
+
messages: d,
|
|
307
|
+
canCreateCustomer: v
|
|
307
308
|
}).customerEmail;
|
|
308
|
-
|
|
309
|
+
j((t) => {
|
|
309
310
|
if (t.customerEmail === e) return t;
|
|
310
311
|
let n = { ...t };
|
|
311
312
|
return e ? n.customerEmail = e : delete n.customerEmail, n;
|
|
312
313
|
});
|
|
313
314
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
]),
|
|
318
|
-
|
|
319
|
-
let t =
|
|
315
|
+
v,
|
|
316
|
+
d,
|
|
317
|
+
D
|
|
318
|
+
]), Rn = p(() => {
|
|
319
|
+
L.current = !0, O((e) => {
|
|
320
|
+
let t = l(e.taxRate);
|
|
320
321
|
return t === e.taxRate ? e : {
|
|
321
322
|
...e,
|
|
322
323
|
taxRate: t
|
|
323
324
|
};
|
|
324
325
|
});
|
|
325
|
-
}, []),
|
|
326
|
-
t && (
|
|
326
|
+
}, []), X = p((e, { validate: t }) => {
|
|
327
|
+
t && (Ut.current = !0), O((t) => ({
|
|
327
328
|
...t,
|
|
328
329
|
lineItems: e(t.lineItems)
|
|
329
330
|
}));
|
|
330
331
|
}, []);
|
|
331
|
-
|
|
332
|
-
let e =
|
|
333
|
-
if (!e && !t && !
|
|
334
|
-
|
|
335
|
-
let n =
|
|
336
|
-
currency:
|
|
337
|
-
messages:
|
|
332
|
+
m(() => {
|
|
333
|
+
let e = Ut.current, t = I.current;
|
|
334
|
+
if (!e && !t && !L.current) return;
|
|
335
|
+
Ut.current = !1, I.current = !1, L.current = !1, e && (R.current.lines = !0), t && (R.current.discount = !0);
|
|
336
|
+
let n = b.current || G > 0, r = e ? me(D.lineItems, {
|
|
337
|
+
currency: D.currency,
|
|
338
|
+
messages: d,
|
|
338
339
|
requireComplete: n
|
|
339
340
|
}) : void 0;
|
|
340
|
-
|
|
341
|
+
j((t) => {
|
|
341
342
|
let i = { ...t };
|
|
342
|
-
return
|
|
343
|
+
return R.current.lines && (i.lineItems = e ? r : t.lineItems, i.lineItemsSummary = fe(i.lineItems, Ae(D, d), n && D.lineItems.length === 0 ? d.lineItemsRequired : void 0)), R.current.discount && (i.discount = ke(D, d)), i;
|
|
343
344
|
});
|
|
344
345
|
}, [
|
|
345
346
|
G,
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
d,
|
|
348
|
+
D
|
|
348
349
|
]);
|
|
349
|
-
let
|
|
350
|
-
let { unit: n, ...r } = t, i =
|
|
351
|
-
i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (
|
|
350
|
+
let zn = p((e, t) => {
|
|
351
|
+
let { unit: n, ...r } = t, i = ce(r);
|
|
352
|
+
i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (L.current = !0), X((t) => t.map((t) => t.id === e ? {
|
|
352
353
|
...t,
|
|
353
354
|
...i
|
|
354
|
-
} : t), { validate:
|
|
355
|
-
}, [
|
|
356
|
-
|
|
355
|
+
} : t), { validate: F });
|
|
356
|
+
}, [X, F]), Bn = p((e, t) => {
|
|
357
|
+
X((n) => n.map((n) => n.id === e ? {
|
|
357
358
|
...n,
|
|
358
|
-
...
|
|
359
|
+
...ae({
|
|
359
360
|
product: t,
|
|
360
|
-
currency:
|
|
361
|
-
unitNamesById:
|
|
361
|
+
currency: D.currency,
|
|
362
|
+
unitNamesById: P
|
|
362
363
|
})
|
|
363
364
|
} : n), { validate: !0 });
|
|
364
365
|
}, [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
]),
|
|
369
|
-
t &&
|
|
366
|
+
X,
|
|
367
|
+
P,
|
|
368
|
+
D.currency
|
|
369
|
+
]), Vn = p((e, t) => {
|
|
370
|
+
t && X((n) => t.kind === "remove" ? n.filter((t) => t.id !== e) : n.map((n) => n.id === e ? {
|
|
370
371
|
...n,
|
|
371
372
|
...t.patch
|
|
372
373
|
} : n), { validate: !0 });
|
|
373
|
-
}, [
|
|
374
|
-
let n =
|
|
375
|
-
n &&
|
|
374
|
+
}, [X]), Hn = p((e, t) => {
|
|
375
|
+
let n = D.lineItems.find((t) => t.id === e);
|
|
376
|
+
n && Vn(e, ne({
|
|
376
377
|
lineItem: n,
|
|
377
378
|
field: t,
|
|
378
|
-
rowCount:
|
|
379
|
-
currency:
|
|
379
|
+
rowCount: D.lineItems.length,
|
|
380
|
+
currency: D.currency
|
|
380
381
|
}));
|
|
381
382
|
}, [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
]),
|
|
386
|
-
let n =
|
|
387
|
-
n &&
|
|
383
|
+
Vn,
|
|
384
|
+
D.currency,
|
|
385
|
+
D.lineItems
|
|
386
|
+
]), Un = p((e, t) => {
|
|
387
|
+
let n = D.lineItems.find((t) => t.id === e);
|
|
388
|
+
n && Vn(e, ue({
|
|
388
389
|
lineItem: n,
|
|
389
390
|
step: t,
|
|
390
|
-
rowCount:
|
|
391
|
+
rowCount: D.lineItems.length
|
|
391
392
|
}));
|
|
392
|
-
}, [
|
|
393
|
-
let e =
|
|
394
|
-
|
|
393
|
+
}, [Vn, D.lineItems]), Wn = p(() => {
|
|
394
|
+
let e = re(D.currency);
|
|
395
|
+
Vt(e.id), O((t) => ({
|
|
395
396
|
...t,
|
|
396
397
|
lineItems: [...t.lineItems, e]
|
|
397
398
|
}));
|
|
398
|
-
}, [
|
|
399
|
-
|
|
400
|
-
}, [
|
|
401
|
-
...
|
|
399
|
+
}, [D.currency]), Gn = p((e) => {
|
|
400
|
+
X((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e), { validate: !0 });
|
|
401
|
+
}, [X]), Kn = p((e, t) => e.type === "invoice" && (t === "issue" || Se(e) && G === 0), [G]), qn = p((e, t) => ({
|
|
402
|
+
...ze({
|
|
402
403
|
values: e,
|
|
403
|
-
messages:
|
|
404
|
+
messages: d,
|
|
404
405
|
willIssue: t,
|
|
405
406
|
hasStartedRecurrence: G > 0,
|
|
406
|
-
canCreateCustomer:
|
|
407
|
+
canCreateCustomer: v
|
|
407
408
|
}),
|
|
408
|
-
...e.type === "invoice" &&
|
|
409
|
+
...e.type === "invoice" && f(e) ? xe({
|
|
409
410
|
fields: e,
|
|
410
411
|
issuedCount: G,
|
|
411
|
-
messages:
|
|
412
|
+
messages: d
|
|
412
413
|
}) : {}
|
|
413
414
|
}), [
|
|
414
|
-
|
|
415
|
+
v,
|
|
415
416
|
G,
|
|
416
|
-
|
|
417
|
-
]),
|
|
417
|
+
d
|
|
418
|
+
]), Jn = p(() => {
|
|
418
419
|
requestAnimationFrame(() => {
|
|
419
420
|
let e = Et.current, t = e?.querySelector("[aria-invalid=\"true\"], [data-invalid=\"true\"]");
|
|
420
421
|
if (!e || !t) return;
|
|
@@ -424,31 +425,31 @@ function pt({ messages: u, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
424
425
|
behavior: "smooth"
|
|
425
426
|
});
|
|
426
427
|
});
|
|
427
|
-
}, []),
|
|
428
|
-
|
|
428
|
+
}, []), Yn = p((e, t) => {
|
|
429
|
+
j(e), Ht(!0), b.current = t, R.current = {
|
|
429
430
|
lines: !0,
|
|
430
431
|
discount: !0
|
|
431
|
-
},
|
|
432
|
-
}, [
|
|
433
|
-
|
|
434
|
-
if (!
|
|
435
|
-
|
|
436
|
-
let e =
|
|
437
|
-
|
|
432
|
+
}, Jn();
|
|
433
|
+
}, [Jn]), Xn = !Nt || D.frequency !== "once" || vn.isError;
|
|
434
|
+
m(() => {
|
|
435
|
+
if (!w || !x.current || z || K || !Xn) return;
|
|
436
|
+
x.current = !1;
|
|
437
|
+
let e = Kn(D, "issue");
|
|
438
|
+
Yn(qn(D, e), e);
|
|
438
439
|
}, [
|
|
439
440
|
z,
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
w,
|
|
442
|
+
Xn,
|
|
442
443
|
K,
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
444
|
+
Yn,
|
|
445
|
+
qn,
|
|
446
|
+
D,
|
|
447
|
+
Kn
|
|
447
448
|
]);
|
|
448
|
-
let
|
|
449
|
-
|
|
450
|
-
let e =
|
|
451
|
-
if (
|
|
449
|
+
let Zn = g({ values: D });
|
|
450
|
+
m(() => {
|
|
451
|
+
let e = Zn.current;
|
|
452
|
+
if (Zn.current = { values: D }, !F) return;
|
|
452
453
|
let t = [
|
|
453
454
|
"customerId",
|
|
454
455
|
"customerEmail",
|
|
@@ -458,318 +459,319 @@ function pt({ messages: u, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
458
459
|
"openingNote",
|
|
459
460
|
"closingNote",
|
|
460
461
|
"taxRate"
|
|
461
|
-
].filter((t) => e.values[t] !==
|
|
462
|
+
].filter((t) => e.values[t] !== D[t] || t === "customerId" && e.values.customerName !== D.customerName || t === "paymentTermsId" && e.values.paymentTermsCustomDate !== D.paymentTermsCustomDate);
|
|
462
463
|
if (!t.length) return;
|
|
463
|
-
let n =
|
|
464
|
-
values:
|
|
465
|
-
messages:
|
|
466
|
-
willIssue:
|
|
467
|
-
canCreateCustomer:
|
|
464
|
+
let n = ze({
|
|
465
|
+
values: D,
|
|
466
|
+
messages: d,
|
|
467
|
+
willIssue: b.current,
|
|
468
|
+
canCreateCustomer: v
|
|
468
469
|
});
|
|
469
|
-
|
|
470
|
+
j((e) => {
|
|
470
471
|
let r = { ...e };
|
|
471
472
|
return t.forEach((e) => {
|
|
472
473
|
n[e] ? r[e] = n[e] : delete r[e];
|
|
473
474
|
}), r;
|
|
474
475
|
});
|
|
475
476
|
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
477
|
+
v,
|
|
478
|
+
d,
|
|
479
|
+
F,
|
|
480
|
+
D
|
|
480
481
|
]);
|
|
481
|
-
let
|
|
482
|
-
if (
|
|
483
|
-
if (
|
|
484
|
-
e.error(
|
|
482
|
+
let Qn = p(async (t) => {
|
|
483
|
+
if (y.current = t, K) return;
|
|
484
|
+
if (Y) {
|
|
485
|
+
e.error(d.attachmentsUploading);
|
|
485
486
|
return;
|
|
486
487
|
}
|
|
487
|
-
if (
|
|
488
|
-
e.error(
|
|
488
|
+
if (M.isLoading || z) {
|
|
489
|
+
e.error(d.lineItemsLoading);
|
|
489
490
|
return;
|
|
490
491
|
}
|
|
491
|
-
let i =
|
|
492
|
-
...
|
|
492
|
+
let i = de(D.lineItems), a = i.length === D.lineItems.length ? D : {
|
|
493
|
+
...D,
|
|
493
494
|
lineItems: i
|
|
494
495
|
};
|
|
495
|
-
a !==
|
|
496
|
-
let o = a.type === "invoice" &&
|
|
497
|
-
if (s && (
|
|
498
|
-
e.error(
|
|
496
|
+
a !== D && O(a);
|
|
497
|
+
let o = a.type === "invoice" && f(a), s = Kn(a, t);
|
|
498
|
+
if (s && (nn || U.isLoading)) {
|
|
499
|
+
e.error(d.issueChecksLoading);
|
|
499
500
|
return;
|
|
500
501
|
}
|
|
501
502
|
if (s && !U.canAddAccount && !a.bankAccountId && !U.hasAccounts) {
|
|
502
|
-
e.error(
|
|
503
|
+
e.error(d.issueBankAccountUnavailable);
|
|
503
504
|
return;
|
|
504
505
|
}
|
|
505
|
-
let
|
|
506
|
-
if (
|
|
507
|
-
|
|
506
|
+
let c = qn(a, s);
|
|
507
|
+
if (Me(c)) {
|
|
508
|
+
Yn(c, s);
|
|
508
509
|
return;
|
|
509
510
|
}
|
|
510
|
-
if (
|
|
511
|
-
e.error(
|
|
511
|
+
if (j({}), s && B.isTaxIdMissing) {
|
|
512
|
+
e.error(d.issueTaxIdRequired);
|
|
512
513
|
return;
|
|
513
514
|
}
|
|
514
|
-
let
|
|
515
|
+
let te = v && !a.customerId && !!a.customerName.trim(), ne = a.customerEmail.trim();
|
|
515
516
|
if (s && (a.paymentReminderId || a.overdueReminderId)) {
|
|
516
|
-
let t =
|
|
517
|
+
let t = te ? ne ? void 0 : d.issueRemindersNoEmail : Qe(B.counterpart, d);
|
|
517
518
|
if (t) {
|
|
518
519
|
e.error(t);
|
|
519
520
|
return;
|
|
520
521
|
}
|
|
521
522
|
}
|
|
522
|
-
if (
|
|
523
|
+
if (te) {
|
|
523
524
|
let t;
|
|
524
525
|
try {
|
|
525
|
-
t = (await St.mutateAsync({ body:
|
|
526
|
+
t = (await St.mutateAsync({ body: Ve({
|
|
526
527
|
name: a.customerName,
|
|
527
528
|
email: a.customerEmail
|
|
528
529
|
}) }))?.id;
|
|
529
530
|
} catch (t) {
|
|
530
|
-
e.error(rt(t, { messages:
|
|
531
|
+
e.error(rt(t, { messages: d }));
|
|
531
532
|
return;
|
|
532
533
|
}
|
|
533
534
|
if (!t) return;
|
|
534
535
|
a = ft(a, t);
|
|
535
536
|
let n = t;
|
|
536
|
-
|
|
537
|
+
O((e) => ft(e, n));
|
|
537
538
|
}
|
|
538
|
-
let
|
|
539
|
+
let l = E === "edit" ? jt : S.current, u, re, ie = "", ae = {};
|
|
539
540
|
try {
|
|
540
|
-
if (
|
|
541
|
-
let e =
|
|
541
|
+
if (l) {
|
|
542
|
+
let e = Pe({
|
|
542
543
|
values: a,
|
|
543
|
-
originalLineItems:
|
|
544
|
+
originalLineItems: C.current,
|
|
544
545
|
originalCurrency: Dt.current,
|
|
545
|
-
unitNamesById:
|
|
546
|
-
units:
|
|
546
|
+
unitNamesById: P,
|
|
547
|
+
units: N
|
|
547
548
|
});
|
|
548
|
-
|
|
549
|
+
ae = Re({
|
|
549
550
|
values: a,
|
|
550
|
-
originalLineItems:
|
|
551
|
+
originalLineItems: C.current,
|
|
551
552
|
changes: e
|
|
552
553
|
});
|
|
553
554
|
let t = await vt.mutateAsync({
|
|
554
|
-
path: { receivable_id:
|
|
555
|
-
body:
|
|
555
|
+
path: { receivable_id: l },
|
|
556
|
+
body: Fe({
|
|
556
557
|
values: a,
|
|
557
|
-
billingAddressId:
|
|
558
|
-
shippingAddressId:
|
|
558
|
+
billingAddressId: $t,
|
|
559
|
+
shippingAddressId: tn,
|
|
559
560
|
lineItemChanges: e
|
|
560
561
|
})
|
|
561
562
|
});
|
|
562
|
-
|
|
563
|
+
on(), u = l, re = t?.type ?? a.type, o && t && (C.current = t.line_items, Dt.current = t.currency, a = {
|
|
563
564
|
...a,
|
|
564
|
-
lineItems:
|
|
565
|
-
},
|
|
565
|
+
lineItems: oe(a.lineItems, t.line_items)
|
|
566
|
+
}, O(a));
|
|
566
567
|
} else {
|
|
567
|
-
|
|
568
|
-
let e = await _t.mutateAsync({ body:
|
|
568
|
+
ae = Re({ values: a });
|
|
569
|
+
let e = await _t.mutateAsync({ body: Ne({
|
|
569
570
|
values: a,
|
|
570
|
-
billingAddressId:
|
|
571
|
-
shippingAddressId:
|
|
572
|
-
unitNamesById:
|
|
571
|
+
billingAddressId: $t,
|
|
572
|
+
shippingAddressId: tn,
|
|
573
|
+
unitNamesById: P
|
|
573
574
|
}) });
|
|
574
575
|
if (!e?.id) {
|
|
575
|
-
|
|
576
|
+
T(!1), kn();
|
|
576
577
|
return;
|
|
577
578
|
}
|
|
578
|
-
|
|
579
|
+
u = e.id, re = e.type, ie = e.counterpart_name ?? "", o && (S.current = e.id, C.current = e.line_items, Dt.current = e.currency, a = {
|
|
579
580
|
...a,
|
|
580
|
-
lineItems:
|
|
581
|
-
},
|
|
581
|
+
lineItems: oe(a.lineItems, e.line_items)
|
|
582
|
+
}, O(a));
|
|
582
583
|
}
|
|
583
584
|
} catch (t) {
|
|
584
585
|
let n = tt[a.type], i = rt(t, {
|
|
585
586
|
irrelevantVariants: n,
|
|
586
|
-
messages:
|
|
587
|
+
messages: d
|
|
587
588
|
});
|
|
588
|
-
e.error((
|
|
589
|
-
let { errors: ee, listError: o } = nt(r(t, n),
|
|
590
|
-
|
|
589
|
+
e.error((l ? d.updateFailed : d.createFailed).replace("{errorMessage}", i));
|
|
590
|
+
let { errors: ee, listError: o } = nt(r(t, n), ae), c = fe(ee.lineItems, void 0, o);
|
|
591
|
+
Yn({
|
|
591
592
|
...ee,
|
|
592
|
-
...
|
|
593
|
+
...c ? { lineItemsSummary: c } : {}
|
|
593
594
|
}, s);
|
|
594
595
|
return;
|
|
595
596
|
}
|
|
596
|
-
let
|
|
597
|
+
let se = o ? "recurrence" : "draft";
|
|
597
598
|
if (o) try {
|
|
598
599
|
W ? (await bt.mutateAsync({
|
|
599
600
|
path: { recurrence_id: W.id },
|
|
600
|
-
body:
|
|
601
|
-
}), e.success(
|
|
601
|
+
body: _e(a, { lockSchedule: yn })
|
|
602
|
+
}), e.success(d.recurrenceUpdated)) : (await yt.mutateAsync({ body: ge(a, u) }), e.success(d.recurrenceActivated));
|
|
602
603
|
} catch (t) {
|
|
603
|
-
e.error(rt(t, { messages:
|
|
604
|
+
e.error(rt(t, { messages: d }));
|
|
604
605
|
return;
|
|
605
606
|
}
|
|
606
607
|
else if (s) try {
|
|
607
|
-
await xt.mutateAsync({ path: { receivable_id:
|
|
608
|
+
await xt.mutateAsync({ path: { receivable_id: u } }), se = "issue", e.success(d.issueSucceeded);
|
|
608
609
|
} catch (t) {
|
|
609
|
-
e.error(n(t) ??
|
|
610
|
+
e.error(n(t) ?? d.unrecognizedError), e.error(d.issueFailedAfterSave);
|
|
610
611
|
}
|
|
611
|
-
else
|
|
612
|
-
let
|
|
613
|
-
|
|
614
|
-
mode:
|
|
612
|
+
else E === "create" ? e.success(d.createSucceeded.replace("{customer}", ie)) : e.success(d.updateSucceeded);
|
|
613
|
+
let ce = E === "create" ? ht : gt;
|
|
614
|
+
T(!1), kn(), ce?.(u, re, {
|
|
615
|
+
mode: se,
|
|
615
616
|
counterpartId: a.customerId,
|
|
616
|
-
inlineItems:
|
|
617
|
-
hasCustomerEmail:
|
|
617
|
+
inlineItems: Ze(a.lineItems, a.currency),
|
|
618
|
+
hasCustomerEmail: te ? !!ne : !!(B.counterpart && ee(B.counterpart).trim())
|
|
618
619
|
});
|
|
619
620
|
}, [
|
|
620
621
|
U.canAddAccount,
|
|
621
622
|
U.hasAccounts,
|
|
622
623
|
U.isLoading,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
$t,
|
|
625
|
+
v,
|
|
626
|
+
on,
|
|
626
627
|
St,
|
|
627
628
|
_t,
|
|
628
629
|
yt,
|
|
629
|
-
|
|
630
|
+
jt,
|
|
630
631
|
W,
|
|
631
632
|
z,
|
|
632
|
-
|
|
633
|
-
|
|
633
|
+
Y,
|
|
634
|
+
nn,
|
|
634
635
|
xt,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
636
|
+
yn,
|
|
637
|
+
d,
|
|
638
|
+
E,
|
|
638
639
|
ht,
|
|
639
640
|
gt,
|
|
640
641
|
B.counterpart,
|
|
641
642
|
B.isTaxIdMissing,
|
|
642
643
|
K,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
M,
|
|
644
|
+
kn,
|
|
645
|
+
tn,
|
|
646
|
+
Yn,
|
|
647
647
|
N,
|
|
648
|
-
|
|
648
|
+
P,
|
|
649
|
+
M.isLoading,
|
|
649
650
|
vt,
|
|
650
651
|
bt,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
]),
|
|
652
|
+
qn,
|
|
653
|
+
D,
|
|
654
|
+
Kn
|
|
655
|
+
]), Z = p(async (e = y.current) => {
|
|
655
656
|
if (!Ct.current) {
|
|
656
657
|
Ct.current = !0, Tt(e);
|
|
657
658
|
try {
|
|
658
|
-
await
|
|
659
|
+
await Qn(e);
|
|
659
660
|
} finally {
|
|
660
661
|
Ct.current = !1, Tt(void 0);
|
|
661
662
|
}
|
|
662
663
|
}
|
|
663
|
-
}, [
|
|
664
|
-
...
|
|
665
|
-
discount:
|
|
666
|
-
lineItems:
|
|
664
|
+
}, [Qn]), $n = h(() => ({
|
|
665
|
+
...D,
|
|
666
|
+
discount: Wt ? Kt ? "" : D.discount : we(Te(D.discount, D.discountType, D.currency), D.discountType, D.currency),
|
|
667
|
+
lineItems: D.lineItems.map(pe)
|
|
667
668
|
}), [
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
]),
|
|
672
|
-
|
|
673
|
-
}, []),
|
|
674
|
-
|
|
675
|
-
}, [
|
|
676
|
-
if (!
|
|
677
|
-
await
|
|
669
|
+
Kt,
|
|
670
|
+
Wt,
|
|
671
|
+
D
|
|
672
|
+
]), er = h(() => te(D.lineItems), [D.lineItems]), tr = h(() => Oe(D), [D]), nr = D.type === "invoice", Q = nr && f(D), rr = J || M.isLoading || U.isLoading, ir = rr || z || V.isUploading || K, ar = E === "edit" ? d.updateDraftButton : d.saveDraftButton, or = Q ? W ? d.recurrenceUpdateButton : d.recurrenceActivateButton : nr ? d.issueButton : ar, $ = nr && !Q ? "issue" : "draft", sr = p(() => Z("draft"), [Z]), cr = p(() => Z($), [$, Z]), lr = p(() => Z(), [Z]), ur = p(() => {
|
|
673
|
+
y.current = "draft";
|
|
674
|
+
}, []), dr = p(() => {
|
|
675
|
+
y.current = $;
|
|
676
|
+
}, [$]), fr = ir || Q, pr = p(async () => {
|
|
677
|
+
if (!fr) try {
|
|
678
|
+
await Z("draft");
|
|
678
679
|
} finally {
|
|
679
|
-
|
|
680
|
+
A(!1);
|
|
680
681
|
}
|
|
681
|
-
}, [
|
|
682
|
-
open:
|
|
683
|
-
onSaveDraft: () => void
|
|
684
|
-
onDiscard:
|
|
685
|
-
onCancel:
|
|
686
|
-
isSaving:
|
|
687
|
-
isSaveDraftDisabled:
|
|
682
|
+
}, [fr, Z]), mr = p(() => A(!1), []), hr = h(() => ({
|
|
683
|
+
open: Ft,
|
|
684
|
+
onSaveDraft: () => void pr(),
|
|
685
|
+
onDiscard: Mn,
|
|
686
|
+
onCancel: mr,
|
|
687
|
+
isSaving: J,
|
|
688
|
+
isSaveDraftDisabled: fr
|
|
688
689
|
}), [
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
]),
|
|
696
|
-
values:
|
|
697
|
-
totals:
|
|
698
|
-
billingAddress:
|
|
690
|
+
mr,
|
|
691
|
+
Mn,
|
|
692
|
+
J,
|
|
693
|
+
fr,
|
|
694
|
+
pr,
|
|
695
|
+
Ft
|
|
696
|
+
]), gr = h(() => De(tr, D.currency), [tr, D.currency]), _r = lt({
|
|
697
|
+
values: D,
|
|
698
|
+
totals: tr,
|
|
699
|
+
billingAddress: en,
|
|
699
700
|
bankAccount: U.selectedAccount,
|
|
700
|
-
unitNamesById:
|
|
701
|
-
messages:
|
|
702
|
-
enabled:
|
|
701
|
+
unitNamesById: P,
|
|
702
|
+
messages: d,
|
|
703
|
+
enabled: w
|
|
703
704
|
});
|
|
704
705
|
return {
|
|
705
|
-
open:
|
|
706
|
-
setOpen:
|
|
707
|
-
mode:
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
706
|
+
open: w,
|
|
707
|
+
setOpen: T,
|
|
708
|
+
mode: E,
|
|
709
|
+
dialogMode: E === "create" && Q ? "createRecurring" : E,
|
|
710
|
+
values: D,
|
|
711
|
+
sheetValues: $n,
|
|
712
|
+
errors: It,
|
|
713
|
+
setValues: O,
|
|
714
|
+
updateValues: Pn,
|
|
715
|
+
commitTaxRate: Rn,
|
|
716
|
+
commitCustomerEmail: Ln,
|
|
717
|
+
focusDiscount: Fn,
|
|
718
|
+
commitDiscount: In,
|
|
719
|
+
updateLineItem: zn,
|
|
720
|
+
selectProduct: Bn,
|
|
721
|
+
commitLineItem: Hn,
|
|
722
|
+
stepLineItem: Un,
|
|
723
|
+
addLineItem: Wn,
|
|
724
|
+
removeLineItem: Gn,
|
|
725
|
+
attachmentsView: sn,
|
|
724
726
|
attachmentsUploading: V.isUploading,
|
|
725
|
-
draftButtonLabel:
|
|
726
|
-
draftDisabled:
|
|
727
|
-
draftLoading:
|
|
728
|
-
primaryButtonLabel:
|
|
729
|
-
primaryLoading:
|
|
730
|
-
primaryDisabled:
|
|
727
|
+
draftButtonLabel: nr && !Q ? ar : void 0,
|
|
728
|
+
draftDisabled: ir,
|
|
729
|
+
draftLoading: J && wt === "draft",
|
|
730
|
+
primaryButtonLabel: or,
|
|
731
|
+
primaryLoading: J && wt === $,
|
|
732
|
+
primaryDisabled: ir || nr && (nn || !Q && B.isCounterpartLoading),
|
|
731
733
|
scrollContainerRef: Et,
|
|
732
734
|
selectAttachmentFiles: V.selectFiles,
|
|
733
735
|
setAttachmentIncludeInEmail: V.setIncludeInEmail,
|
|
734
736
|
removeAttachment: V.remove,
|
|
735
|
-
autoFocusLineItemId:
|
|
736
|
-
lineItemUnitOptions:
|
|
737
|
-
lineItemsLoading:
|
|
738
|
-
lineItemControls:
|
|
739
|
-
totals:
|
|
740
|
-
preview:
|
|
741
|
-
totalsView:
|
|
742
|
-
currencySymbol:
|
|
743
|
-
isSubmitting:
|
|
744
|
-
fieldsDisabled:
|
|
745
|
-
paymentTerms:
|
|
746
|
-
showBillingSection:
|
|
747
|
-
purchaseOrder:
|
|
748
|
-
value:
|
|
749
|
-
error:
|
|
737
|
+
autoFocusLineItemId: Bt,
|
|
738
|
+
lineItemUnitOptions: zt.unitOptions,
|
|
739
|
+
lineItemsLoading: M.isLoading,
|
|
740
|
+
lineItemControls: er,
|
|
741
|
+
totals: tr,
|
|
742
|
+
preview: _r,
|
|
743
|
+
totalsView: gr,
|
|
744
|
+
currencySymbol: ie(D.currency),
|
|
745
|
+
isSubmitting: J,
|
|
746
|
+
fieldsDisabled: rr,
|
|
747
|
+
paymentTerms: mn,
|
|
748
|
+
showBillingSection: D.type === "invoice" || E === "edit",
|
|
749
|
+
purchaseOrder: E === "create" ? {
|
|
750
|
+
value: D.purchaseOrder,
|
|
751
|
+
error: It.purchaseOrder
|
|
750
752
|
} : void 0,
|
|
751
|
-
recurrence:
|
|
752
|
-
showRecurrenceSection:
|
|
753
|
+
recurrence: Tn,
|
|
754
|
+
showRecurrenceSection: D.type === "invoice",
|
|
753
755
|
recurrenceLoading: K,
|
|
754
|
-
showDueDateField:
|
|
755
|
-
openCreate:
|
|
756
|
-
openEdit:
|
|
757
|
-
close:
|
|
758
|
-
requestClose:
|
|
759
|
-
unsavedPrompt:
|
|
760
|
-
submit:
|
|
761
|
-
submitDraft:
|
|
762
|
-
submitPrimary:
|
|
763
|
-
selectDraftMode:
|
|
764
|
-
selectPrimaryMode:
|
|
765
|
-
units:
|
|
766
|
-
counterpartView:
|
|
767
|
-
counterpartForm:
|
|
768
|
-
stateOptions:
|
|
769
|
-
openCounterpartCreate:
|
|
770
|
-
customer:
|
|
756
|
+
showDueDateField: D.type === "quote",
|
|
757
|
+
openCreate: An,
|
|
758
|
+
openEdit: jn,
|
|
759
|
+
close: Mn,
|
|
760
|
+
requestClose: Nn,
|
|
761
|
+
unsavedPrompt: hr,
|
|
762
|
+
submit: lr,
|
|
763
|
+
submitDraft: sr,
|
|
764
|
+
submitPrimary: cr,
|
|
765
|
+
selectDraftMode: ur,
|
|
766
|
+
selectPrimaryMode: dr,
|
|
767
|
+
units: zt,
|
|
768
|
+
counterpartView: Lt,
|
|
769
|
+
counterpartForm: ln,
|
|
770
|
+
stateOptions: Jt,
|
|
771
|
+
openCounterpartCreate: fn,
|
|
772
|
+
customer: Zt.data?.id === D.customerId ? Zt.data : void 0,
|
|
771
773
|
bankAccount: U,
|
|
772
|
-
reminders:
|
|
774
|
+
reminders: Dn
|
|
773
775
|
};
|
|
774
776
|
}
|
|
775
777
|
export { pt as useReceivableForm };
|