@tesouro/embedded-components-react 0.3.20 → 0.3.22

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.
Files changed (154) hide show
  1. package/dist/index.css +9 -0
  2. package/dist/lib/monite-sdk.js +18 -18
  3. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
  5. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
  49. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
  50. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
  53. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
  54. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
  55. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
  56. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
  99. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
  100. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
  101. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
  102. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
  103. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
  104. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
  105. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
  106. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
  107. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
  108. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
  109. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
  110. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
  111. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
  112. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
  113. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
  114. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
  115. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
  116. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
  117. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
  118. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
  119. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
  120. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
  121. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
  122. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
  123. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
  124. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
  125. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
  126. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
  127. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
  128. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
  129. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
  130. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
  131. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
  132. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
  133. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
  134. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
  135. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
  136. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
  137. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
  138. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
  139. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
  140. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
  141. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
  142. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
  143. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
  144. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
  145. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
  146. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
  147. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
  148. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
  149. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
  150. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
  151. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
  152. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  153. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
  154. package/package.json +1 -1
@@ -1,118 +1,149 @@
1
1
  import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
2
2
  import "../../shared/data-access/dist/index.js";
3
3
  import { useMoniteContext as t } from "./index47.js";
4
- import { Button as n } from "./index56.js";
5
- import { MoniteScopedProviders as r } from "./index237.js";
6
- import { getDraftInvoiceValidationSchema as i, getInvoiceValidationSchema as a } from "./index98.js";
7
- import { useUserPermissions as o } from "./index116.js";
8
- import { willRecurrenceIssue as s } from "./index190.js";
9
- import { AccessRestriction as c } from "./index247.js";
10
- import { useReceivableSubmit as l } from "./index459.js";
11
- import { ReceivableFormLayout as u } from "./index511.js";
12
- import { useCallback as d, useMemo as f, useRef as p } from "react";
13
- import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
14
- import { useLingui as _ } from "@lingui/react";
15
- import { useForm as v } from "react-hook-form";
16
- import { zodResolver as y } from "@hookform/resolvers/zod";
4
+ import { useCounterpartById as n } from "./index48.js";
5
+ import { Button as r } from "./index56.js";
6
+ import { useCounterpartAddresses as i } from "./index130.js";
7
+ import { useMyEntity as a } from "./index137.js";
8
+ import "./index142.js";
9
+ import { Dialog as o, DialogContent as s, DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d } from "./index58.js";
10
+ import { ConfirmationModal as f } from "./index59.js";
11
+ import "./index60.js";
12
+ import { useUserPermissions as p } from "./index116.js";
13
+ import { buildInvoicePreviewData as ee } from "./index195.js";
14
+ import "./index202.js";
15
+ import { LoadingPage as te } from "./index260.js";
16
+ import "./index261.js";
17
+ import { CustomerSection as ne } from "./index461.js";
18
+ import { BillingSection as re } from "./index473.js";
19
+ import { ItemsSection as ie } from "./index498.js";
20
+ import { BankAccountSection as m } from "./index500.js";
21
+ import { NotesSection as h } from "./index501.js";
22
+ import { AttachmentSection as g } from "./index502.js";
23
+ import { InvoicePreview as _ } from "./index511.js";
24
+ import { useMemo as v, useState as y } from "react";
25
+ import { X as b } from "lucide-react";
26
+ import { Fragment as x, jsx as S, jsxs as C } from "@emotion/react/jsx-runtime";
27
+ import { useLingui as w } from "@lingui/react";
28
+ import { FormProvider as T } from "react-hook-form";
17
29
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js
18
- var b = (e) => {
19
- let { i18n: t } = _();
20
- return /* @__PURE__ */ h(r, { children: e.type === "invoice" ? /* @__PURE__ */ h(S, { ...e }) : /* @__PURE__ */ h(c, { description: t._("You can not create receivable with a type other than “invoice”") }) });
21
- }, x = "USD", S = ({ type: r, onCreate: c, open: b, onOpenChange: S, embeddedBankName: C, initialCounterpartId: w }) => {
22
- let { i18n: T } = _(), { componentSettings: E } = t(), D = o().has(e.CounterpartWriteOrg), O = !!E?.receivables?.enableEntityBankAccount, k = p("draft"), A = f(() => y(i(T, D)), [T, D]), j = f(() => y(a(T, O, D)), [
23
- T,
24
- O,
25
- D
26
- ]), M = d((e, t, n) => (k.current === "issue" || s(e) ? j : A)(e, t, n), [j, A]), N = v({
27
- mode: "onBlur",
28
- resolver: M,
29
- defaultValues: f(() => ({
30
- type: r,
31
- counterpart_id: w ?? "",
32
- counterpart_name: "",
33
- counterpart_email: "",
34
- payment_terms_id: "",
35
- payment_terms_custom_date: null,
36
- default_shipping_address_id: "",
37
- default_billing_address_id: "",
38
- purchase_order: "",
39
- line_items: [],
40
- bank_account_id: "",
41
- overdue_reminder_id: "",
42
- payment_reminder_id: "",
43
- memo: "",
44
- footer: "",
45
- tax_mode: "exclusive",
46
- frequency: "once",
47
- recurrence_start_date: void 0,
48
- recurrence_end_date: void 0,
49
- recurrence_issue_mode: "first_day",
50
- recurrence_days_of_week: void 0,
51
- recurrence_end_mode: "after",
52
- recurrence_max_occurrences: void 0,
53
- tax_rate: void 0,
54
- discount: null,
55
- attachments: []
56
- }), [r, w])
57
- }), P = l({
58
- mode: "create",
59
- methods: N,
60
- currency: x,
61
- submitModeRef: k,
62
- onComplete: (e) => c?.(e.receivableId, {
63
- mode: e.mode,
64
- counterpartId: e.counterpartId,
65
- inlineLineItems: e.inlineLineItems,
66
- hasCustomerEmail: e.hasCustomerEmail
67
- }),
68
- onClose: () => S(!1)
69
- });
70
- return /* @__PURE__ */ h(u, {
71
- open: b,
72
- onRequestClose: P.requestClose,
73
- methods: N,
74
- title: T._("Create invoice"),
75
- description: T._("Create and issue an invoice to your customers "),
76
- currency: x,
77
- embeddedBankName: C,
78
- showPurchaseOrder: !0,
79
- formName: P.formName,
80
- onSubmit: P.onSubmit,
81
- formScrollRef: P.formScrollRef,
82
- registerLineItemCleanupFn: P.registerLineItemCleanupFn,
83
- onAttachmentsUploadingChange: P.onAttachmentsUploadingChange,
84
- disabled: P.isLoading,
85
- closeDisabled: P.isSaving,
86
- discardModal: P.discardModal,
87
- footer: /* @__PURE__ */ g(m, { children: [
88
- /* @__PURE__ */ h(n, {
89
- variant: "outline",
90
- className: "ttw:border-border",
91
- onClick: P.requestClose,
92
- disabled: P.isSaving || P.attachmentsUploading,
93
- children: T._("Cancel")
94
- }),
95
- !P.isRecurrenceEnabled && /* @__PURE__ */ h(n, {
96
- variant: "secondary",
97
- type: "submit",
98
- form: P.formName,
99
- disabled: P.isLoading || P.attachmentsUploading,
100
- onClick: () => {
101
- P.submitModeRef.current = "draft";
102
- },
103
- children: T._("Save as draft")
104
- }),
105
- /* @__PURE__ */ h(n, {
106
- type: "submit",
107
- form: P.formName,
108
- disabled: P.isLoading || P.attachmentsUploading || P.isIssuePreflightLoading || !P.isRecurrenceEnabled && P.isCustomerEmailLoading,
109
- onClick: () => {
110
- P.submitModeRef.current = P.isRecurrenceEnabled ? "draft" : "issue";
111
- },
112
- children: P.isRecurrenceEnabled ? T._("Activate recurring billing schedule") : T._("Issue invoice")
113
- }, "next")
114
- ] })
115
- });
30
+ var E = ({ open: E, onRequestClose: D, methods: O, title: k, description: A, currency: j, embeddedBankName: M, showPurchaseOrder: N = !0, lockRecurrenceSchedule: P = !1, formName: F, onSubmit: I, formScrollRef: L, registerLineItemCleanupFn: R, onAttachmentsUploadingChange: z, disabled: B, closeDisabled: ae, footer: V, discardModal: H }) => {
31
+ let { i18n: U } = w(), { api: W, componentSettings: G } = t(), K = p().has(e.CounterpartWriteOrg), q = !!G?.receivables?.enableEntityBankAccount, { data: J, isLoading: oe } = W.finops.getPaymentTerms.useQuery(), { isLoading: se, data: ce } = a(), { watch: Y } = O, [le, ue] = y(!1), X = Y("counterpart_id"), Z = Y("default_billing_address_id"), { data: Q } = n(X), { data: $ } = i(X), de = v(() => $?.data?.find((e) => e.id === Z), [Z, $?.data]), fe = Y("line_items"), pe = Y("payment_terms_id"), me = Y("payment_terms_custom_date"), he = Y("memo"), ge = Y("footer"), _e = Y("tax_mode"), ve = Y("purchase_order"), ye = Y("tax_rate"), be = Y("discount"), xe = Y("bank_account_id"), Se = Y("bank_account_type");
32
+ return se ? /* @__PURE__ */ S(te, {}) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(o, {
33
+ open: E,
34
+ onOpenChange: (e) => {
35
+ e || D();
36
+ },
37
+ modal: !1,
38
+ children: /* @__PURE__ */ C(s, {
39
+ showCloseButton: !1,
40
+ fullScreen: !0,
41
+ className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:p-0 ttw:gap-0",
42
+ onInteractOutside: (e) => e.preventDefault(),
43
+ children: [/* @__PURE__ */ C(u, {
44
+ className: "ttw:w-full ttw:max-w-screen ttw:flex-row ttw:justify-between ttw:border-b ttw:border-border ttw:items-center ttw:px-6 ttw:pt-6 ttw:pb-7",
45
+ children: [/* @__PURE__ */ C("div", {
46
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
47
+ children: [/* @__PURE__ */ S(d, {
48
+ className: "ttw:text-3xl",
49
+ children: k
50
+ }), /* @__PURE__ */ S(c, {
51
+ className: A ? "" : "ttw:sr-only",
52
+ children: A ?? U._("Invoice details")
53
+ })]
54
+ }), /* @__PURE__ */ S(r, {
55
+ variant: "ghost",
56
+ type: "button",
57
+ className: "ttw:p-2 ttw:has-[>svg]:px-2",
58
+ onClick: D,
59
+ disabled: ae,
60
+ "aria-label": U._("Close"),
61
+ children: /* @__PURE__ */ S(b, { className: "ttw:size-6.5" })
62
+ })]
63
+ }), /* @__PURE__ */ C("div", {
64
+ className: "ttw:flex ttw:flex-1 ttw:min-h-0",
65
+ children: [/* @__PURE__ */ C("div", {
66
+ ref: L,
67
+ className: "ttw:w-1/2 ttw:h-full ttw:min-h-0 ttw:overflow-auto ttw:px-8 ttw:pt-6",
68
+ children: [/* @__PURE__ */ S(T, {
69
+ ...O,
70
+ children: /* @__PURE__ */ S("form", {
71
+ id: F,
72
+ noValidate: !0,
73
+ className: "ttw:pb-10",
74
+ onSubmit: I,
75
+ children: /* @__PURE__ */ C("div", {
76
+ className: "ttw:flex ttw:flex-col ttw:gap-8",
77
+ children: [
78
+ /* @__PURE__ */ S(ne, {
79
+ disabled: B,
80
+ canCreateCounterpart: K,
81
+ isEditCustomerOpen: le,
82
+ handleOpenEditCustomer: ue,
83
+ counterpart: Q
84
+ }),
85
+ /* @__PURE__ */ S(re, {
86
+ paymentTerms: J,
87
+ isPaymentTermsLoading: oe,
88
+ disabled: B,
89
+ showPurchaseOrder: N,
90
+ lockRecurrenceSchedule: P
91
+ }),
92
+ /* @__PURE__ */ S(ie, {
93
+ registerLineItemCleanupFn: R,
94
+ defaultCurrency: j
95
+ }),
96
+ q && /* @__PURE__ */ S(m, {
97
+ disabled: B,
98
+ embeddedBankName: M
99
+ }),
100
+ /* @__PURE__ */ S(h, { disabled: B }),
101
+ /* @__PURE__ */ S(g, {
102
+ disabled: B,
103
+ onUploadingChange: z
104
+ })
105
+ ]
106
+ })
107
+ })
108
+ }), /* @__PURE__ */ S(l, {
109
+ className: "ttw:sticky ttw:bottom-0 ttw:z-10 ttw:flex ttw:items-center ttw:justify-end ttw:gap-4 ttw:bg-background ttw:pt-3 ttw:px-6 ttw:pb-6",
110
+ children: V
111
+ })]
112
+ }), /* @__PURE__ */ S("div", {
113
+ className: "ttw:w-1/2 ttw:h-full ttw:min-h-0 ttw:overflow-auto",
114
+ style: { background: "linear-gradient(180deg, #F6F6F6 0%, #E4E4FF 100%)" },
115
+ children: /* @__PURE__ */ S(_, {
116
+ invoiceData: ee({
117
+ lineItems: fe,
118
+ paymentTermsId: pe,
119
+ paymentTermsCustomDate: me,
120
+ memo: he,
121
+ footer: ge,
122
+ bankAccountId: xe,
123
+ bankAccountType: Se,
124
+ taxMode: _e,
125
+ purchaseOrder: ve,
126
+ taxRate: ye,
127
+ discount: be
128
+ }),
129
+ counterpart: Q,
130
+ currency: j,
131
+ entityData: ce,
132
+ address: de,
133
+ paymentTerms: J
134
+ })
135
+ })]
136
+ })]
137
+ })
138
+ }), /* @__PURE__ */ S(f, {
139
+ open: H.open,
140
+ title: U._("You have unsaved changes"),
141
+ message: U._("Any unsaved changes will be lost. Are you sure you want to quit without saving?"),
142
+ confirmLabel: U._("Quit without saving"),
143
+ cancelLabel: U._("Cancel"),
144
+ onClose: () => H.onOpenChange(!1),
145
+ onConfirm: H.onConfirm
146
+ })] });
116
147
  };
117
148
  //#endregion
118
- export { b as CreateReceivables };
149
+ export { E as ReceivableFormLayout };
@@ -1,43 +1,118 @@
1
- import { cn as e } from "./index49.js";
2
- import "react";
3
- import { ChevronDownIcon as t } from "lucide-react";
4
- import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
5
- import * as i from "@radix-ui/react-accordion";
1
+ import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
2
+ import "../../shared/data-access/dist/index.js";
3
+ import { useMoniteContext as t } from "./index47.js";
4
+ import { Button as n } from "./index56.js";
5
+ import { MoniteScopedProviders as r } from "./index237.js";
6
+ import { getDraftInvoiceValidationSchema as i, getInvoiceValidationSchema as a } from "./index98.js";
7
+ import { useUserPermissions as o } from "./index116.js";
8
+ import { willRecurrenceIssue as s } from "./index190.js";
9
+ import { AccessRestriction as c } from "./index247.js";
10
+ import { useReceivableSubmit as l } from "./index459.js";
11
+ import { ReceivableFormLayout as u } from "./index512.js";
12
+ import { useCallback as d, useMemo as f, useRef as p } from "react";
13
+ import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
14
+ import { useLingui as _ } from "@lingui/react";
15
+ import { useForm as v } from "react-hook-form";
16
+ import { zodResolver as y } from "@hookform/resolvers/zod";
6
17
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js
7
- function a({ ...e }) {
8
- return /* @__PURE__ */ n(i.Root, {
9
- "data-slot": "accordion",
10
- ...e
18
+ var b = (e) => {
19
+ let { i18n: t } = _();
20
+ return /* @__PURE__ */ h(r, { children: e.type === "invoice" ? /* @__PURE__ */ h(S, { ...e }) : /* @__PURE__ */ h(c, { description: t._("You can not create receivable with a type other than “invoice”") }) });
21
+ }, x = "USD", S = ({ type: r, onCreate: c, open: b, onOpenChange: S, embeddedBankName: C, initialCounterpartId: w }) => {
22
+ let { i18n: T } = _(), { componentSettings: E } = t(), D = o().has(e.CounterpartWriteOrg), O = !!E?.receivables?.enableEntityBankAccount, k = p("draft"), A = f(() => y(i(T, D)), [T, D]), j = f(() => y(a(T, O, D)), [
23
+ T,
24
+ O,
25
+ D
26
+ ]), M = d((e, t, n) => (k.current === "issue" || s(e) ? j : A)(e, t, n), [j, A]), N = v({
27
+ mode: "onBlur",
28
+ resolver: M,
29
+ defaultValues: f(() => ({
30
+ type: r,
31
+ counterpart_id: w ?? "",
32
+ counterpart_name: "",
33
+ counterpart_email: "",
34
+ payment_terms_id: "",
35
+ payment_terms_custom_date: null,
36
+ default_shipping_address_id: "",
37
+ default_billing_address_id: "",
38
+ purchase_order: "",
39
+ line_items: [],
40
+ bank_account_id: "",
41
+ overdue_reminder_id: "",
42
+ payment_reminder_id: "",
43
+ memo: "",
44
+ footer: "",
45
+ tax_mode: "exclusive",
46
+ frequency: "once",
47
+ recurrence_start_date: void 0,
48
+ recurrence_end_date: void 0,
49
+ recurrence_issue_mode: "first_day",
50
+ recurrence_days_of_week: void 0,
51
+ recurrence_end_mode: "after",
52
+ recurrence_max_occurrences: void 0,
53
+ tax_rate: void 0,
54
+ discount: null,
55
+ attachments: []
56
+ }), [r, w])
57
+ }), P = l({
58
+ mode: "create",
59
+ methods: N,
60
+ currency: x,
61
+ submitModeRef: k,
62
+ onComplete: (e) => c?.(e.receivableId, {
63
+ mode: e.mode,
64
+ counterpartId: e.counterpartId,
65
+ inlineLineItems: e.inlineLineItems,
66
+ hasCustomerEmail: e.hasCustomerEmail
67
+ }),
68
+ onClose: () => S(!1)
11
69
  });
12
- }
13
- function o({ className: t, ...r }) {
14
- return /* @__PURE__ */ n(i.Item, {
15
- "data-slot": "accordion-item",
16
- className: e("ttw:border-b ttw:border-border ttw:last:border-b-0", t),
17
- ...r
70
+ return /* @__PURE__ */ h(u, {
71
+ open: b,
72
+ onRequestClose: P.requestClose,
73
+ methods: N,
74
+ title: T._("Create invoice"),
75
+ description: T._("Create and issue an invoice to your customers "),
76
+ currency: x,
77
+ embeddedBankName: C,
78
+ showPurchaseOrder: !0,
79
+ formName: P.formName,
80
+ onSubmit: P.onSubmit,
81
+ formScrollRef: P.formScrollRef,
82
+ registerLineItemCleanupFn: P.registerLineItemCleanupFn,
83
+ onAttachmentsUploadingChange: P.onAttachmentsUploadingChange,
84
+ disabled: P.isLoading,
85
+ closeDisabled: P.isSaving,
86
+ discardModal: P.discardModal,
87
+ footer: /* @__PURE__ */ g(m, { children: [
88
+ /* @__PURE__ */ h(n, {
89
+ variant: "outline",
90
+ className: "ttw:border-border",
91
+ onClick: P.requestClose,
92
+ disabled: P.isSaving || P.attachmentsUploading,
93
+ children: T._("Cancel")
94
+ }),
95
+ !P.isRecurrenceEnabled && /* @__PURE__ */ h(n, {
96
+ variant: "secondary",
97
+ type: "submit",
98
+ form: P.formName,
99
+ disabled: P.isLoading || P.attachmentsUploading,
100
+ onClick: () => {
101
+ P.submitModeRef.current = "draft";
102
+ },
103
+ children: T._("Save as draft")
104
+ }),
105
+ /* @__PURE__ */ h(n, {
106
+ type: "submit",
107
+ form: P.formName,
108
+ disabled: P.isLoading || P.attachmentsUploading || P.isIssuePreflightLoading || !P.isRecurrenceEnabled && P.isCustomerEmailLoading,
109
+ onClick: () => {
110
+ P.submitModeRef.current = P.isRecurrenceEnabled ? "draft" : "issue";
111
+ },
112
+ children: P.isRecurrenceEnabled ? T._("Activate recurring billing schedule") : T._("Issue invoice")
113
+ }, "next")
114
+ ] })
18
115
  });
19
- }
20
- function s({ className: a, children: o, ...s }) {
21
- return /* @__PURE__ */ n(i.Header, {
22
- className: "ttw:flex",
23
- children: /* @__PURE__ */ r(i.Trigger, {
24
- "data-slot": "accordion-trigger",
25
- className: e("ttw:group ttw:focus-visible:border-ring ttw:focus-visible:ring-ring/50 ttw:flex ttw:flex-1 ttw:cursor-pointer ttw:items-start ttw:justify-between ttw:gap-4 ttw:rounded-md ttw:py-4 ttw:text-left ttw:text-sm ttw:font-medium ttw:transition-all ttw:outline-none ttw:focus-visible:ring-[3px] ttw:disabled:pointer-events-none ttw:disabled:opacity-50 ttw:[&[data-state=open]>svg]:rotate-180", a),
26
- ...s,
27
- children: [o, /* @__PURE__ */ n(t, { className: "ttw:text-muted-foreground ttw:pointer-events-none ttw:size-4 ttw:shrink-0 ttw:translate-y-0.5 ttw:transition-transform ttw:duration-200" })]
28
- })
29
- });
30
- }
31
- function c({ className: t, children: r, ...a }) {
32
- return /* @__PURE__ */ n(i.Content, {
33
- "data-slot": "accordion-content",
34
- className: "ttw:data-[state=closed]:animate-accordion-up ttw:data-[state=open]:animate-accordion-down ttw:overflow-hidden ttw:text-sm",
35
- ...a,
36
- children: /* @__PURE__ */ n("div", {
37
- className: e("ttw:pt-0 ttw:pb-4", t),
38
- children: r
39
- })
40
- });
41
- }
116
+ };
42
117
  //#endregion
43
- export { a as Accordion, c as AccordionContent, o as AccordionItem, s as AccordionTrigger };
118
+ export { b as CreateReceivables };
@@ -1,35 +1,43 @@
1
1
  import { cn as e } from "./index49.js";
2
2
  import "react";
3
- import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
4
- import * as r from "@radix-ui/react-tooltip";
3
+ import { ChevronDownIcon as t } from "lucide-react";
4
+ import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
5
+ import * as i from "@radix-ui/react-accordion";
5
6
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js
6
- function i({ delayDuration: e = 0, ...n }) {
7
- return /* @__PURE__ */ t(r.Provider, {
8
- "data-slot": "tooltip-provider",
9
- delayDuration: e,
10
- ...n
11
- });
12
- }
13
7
  function a({ ...e }) {
14
- return /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(r.Root, {
15
- "data-slot": "tooltip",
8
+ return /* @__PURE__ */ n(i.Root, {
9
+ "data-slot": "accordion",
16
10
  ...e
17
- }) });
11
+ });
18
12
  }
19
- function o({ ...e }) {
20
- return /* @__PURE__ */ t(r.Trigger, {
21
- "data-slot": "tooltip-trigger",
22
- ...e
13
+ function o({ className: t, ...r }) {
14
+ return /* @__PURE__ */ n(i.Item, {
15
+ "data-slot": "accordion-item",
16
+ className: e("ttw:border-b ttw:border-border ttw:last:border-b-0", t),
17
+ ...r
23
18
  });
24
19
  }
25
- function s({ className: i, sideOffset: a = 0, children: o, ...s }) {
26
- return /* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ n(r.Content, {
27
- "data-slot": "tooltip-content",
28
- sideOffset: a,
29
- className: e("ttw:bg-primary ttw:text-primary-foreground ttw:animate-in ttw:fade-in-0 ttw:zoom-in-95 ttw:data-[state=closed]:animate-out ttw:data-[state=closed]:fade-out-0 ttw:data-[state=closed]:zoom-out-95 ttw:data-[side=bottom]:slide-in-from-top-2 ttw:data-[side=left]:slide-in-from-right-2 ttw:data-[side=right]:slide-in-from-left-2 ttw:data-[side=top]:slide-in-from-bottom-2 ttw:z-1300 ttw:w-fit ttw:origin-(--radix-tooltip-content-transform-origin) ttw:rounded-md ttw:px-3 ttw:py-1.5 ttw:text-xs ttw:text-balance", i),
30
- ...s,
31
- children: [o, /* @__PURE__ */ t(r.Arrow, { className: "ttw:bg-primary ttw:fill-primary ttw:z-1300 ttw:size-2.5 ttw:translate-y-[calc(-50%_-_2px)] ttw:rotate-45 ttw:rounded-[2px]" })]
32
- }) });
20
+ function s({ className: a, children: o, ...s }) {
21
+ return /* @__PURE__ */ n(i.Header, {
22
+ className: "ttw:flex",
23
+ children: /* @__PURE__ */ r(i.Trigger, {
24
+ "data-slot": "accordion-trigger",
25
+ className: e("ttw:group ttw:focus-visible:border-ring ttw:focus-visible:ring-ring/50 ttw:flex ttw:flex-1 ttw:cursor-pointer ttw:items-start ttw:justify-between ttw:gap-4 ttw:rounded-md ttw:py-4 ttw:text-left ttw:text-sm ttw:font-medium ttw:transition-all ttw:outline-none ttw:focus-visible:ring-[3px] ttw:disabled:pointer-events-none ttw:disabled:opacity-50 ttw:[&[data-state=open]>svg]:rotate-180", a),
26
+ ...s,
27
+ children: [o, /* @__PURE__ */ n(t, { className: "ttw:text-muted-foreground ttw:pointer-events-none ttw:size-4 ttw:shrink-0 ttw:translate-y-0.5 ttw:transition-transform ttw:duration-200" })]
28
+ })
29
+ });
30
+ }
31
+ function c({ className: t, children: r, ...a }) {
32
+ return /* @__PURE__ */ n(i.Content, {
33
+ "data-slot": "accordion-content",
34
+ className: "ttw:data-[state=closed]:animate-accordion-up ttw:data-[state=open]:animate-accordion-down ttw:overflow-hidden ttw:text-sm",
35
+ ...a,
36
+ children: /* @__PURE__ */ n("div", {
37
+ className: e("ttw:pt-0 ttw:pb-4", t),
38
+ children: r
39
+ })
40
+ });
33
41
  }
34
42
  //#endregion
35
- export { a as Tooltip, s as TooltipContent, i as TooltipProvider, o as TooltipTrigger };
43
+ export { a as Accordion, c as AccordionContent, o as AccordionItem, s as AccordionTrigger };
@@ -1,22 +1,35 @@
1
- import { getAPIErrorMessage as e } from "./index26.js";
2
- import { useMoniteContext as t } from "./index47.js";
3
- import { toast as n } from "react-hot-toast";
4
- import { useLingui as r } from "@lingui/react";
1
+ import { cn as e } from "./index49.js";
2
+ import "react";
3
+ import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
4
+ import * as r from "@radix-ui/react-tooltip";
5
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js
6
- var i = (i, a) => {
7
- let { i18n: o } = r(), { api: s, queryClient: c } = t();
8
- return s.finops.postRecurrencesIdPause.useMutation({ path: { recurrence_id: i } }, {
9
- onError: (t) => {
10
- n.error(e(o, t));
11
- },
12
- onSuccess: async () => {
13
- await Promise.all([
14
- s.finops.getReceivables.invalidateQueries(c),
15
- s.finops.getReceivablesId.invalidateQueries({ parameters: { path: { receivable_id: a } } }, c),
16
- s.finops.getRecurrencesId.invalidateQueries({ parameters: { path: { recurrence_id: i } } }, c)
17
- ]), n.success(o._("Series has been paused"));
18
- }
6
+ function i({ delayDuration: e = 0, ...n }) {
7
+ return /* @__PURE__ */ t(r.Provider, {
8
+ "data-slot": "tooltip-provider",
9
+ delayDuration: e,
10
+ ...n
19
11
  });
20
- };
12
+ }
13
+ function a({ ...e }) {
14
+ return /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(r.Root, {
15
+ "data-slot": "tooltip",
16
+ ...e
17
+ }) });
18
+ }
19
+ function o({ ...e }) {
20
+ return /* @__PURE__ */ t(r.Trigger, {
21
+ "data-slot": "tooltip-trigger",
22
+ ...e
23
+ });
24
+ }
25
+ function s({ className: i, sideOffset: a = 0, children: o, ...s }) {
26
+ return /* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ n(r.Content, {
27
+ "data-slot": "tooltip-content",
28
+ sideOffset: a,
29
+ className: e("ttw:bg-primary ttw:text-primary-foreground ttw:animate-in ttw:fade-in-0 ttw:zoom-in-95 ttw:data-[state=closed]:animate-out ttw:data-[state=closed]:fade-out-0 ttw:data-[state=closed]:zoom-out-95 ttw:data-[side=bottom]:slide-in-from-top-2 ttw:data-[side=left]:slide-in-from-right-2 ttw:data-[side=right]:slide-in-from-left-2 ttw:data-[side=top]:slide-in-from-bottom-2 ttw:z-1300 ttw:w-fit ttw:origin-(--radix-tooltip-content-transform-origin) ttw:rounded-md ttw:px-3 ttw:py-1.5 ttw:text-xs ttw:text-balance", i),
30
+ ...s,
31
+ children: [o, /* @__PURE__ */ t(r.Arrow, { className: "ttw:bg-primary ttw:fill-primary ttw:z-1300 ttw:size-2.5 ttw:translate-y-[calc(-50%_-_2px)] ttw:rotate-45 ttw:rounded-[2px]" })]
32
+ }) });
33
+ }
21
34
  //#endregion
22
- export { i as usePauseRecurrence };
35
+ export { a as Tooltip, s as TooltipContent, i as TooltipProvider, o as TooltipTrigger };
@@ -5,7 +5,7 @@ import { useLingui as r } from "@lingui/react";
5
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js
6
6
  var i = (i, a) => {
7
7
  let { i18n: o } = r(), { api: s, queryClient: c } = t();
8
- return s.finops.postRecurrencesIdResume.useMutation({ path: { recurrence_id: i } }, {
8
+ return s.finops.postRecurrencesIdPause.useMutation({ path: { recurrence_id: i } }, {
9
9
  onError: (t) => {
10
10
  n.error(e(o, t));
11
11
  },
@@ -14,9 +14,9 @@ var i = (i, a) => {
14
14
  s.finops.getReceivables.invalidateQueries(c),
15
15
  s.finops.getReceivablesId.invalidateQueries({ parameters: { path: { receivable_id: a } } }, c),
16
16
  s.finops.getRecurrencesId.invalidateQueries({ parameters: { path: { recurrence_id: i } } }, c)
17
- ]), n.success(o._("Series has been resumed"));
17
+ ]), n.success(o._("Series has been paused"));
18
18
  }
19
19
  });
20
20
  };
21
21
  //#endregion
22
- export { i as useResumeRecurrence };
22
+ export { i as usePauseRecurrence };
@@ -1,24 +1,22 @@
1
- import { cn as e } from "./index49.js";
2
- import { Typography as t } from "./index62.js";
3
- import { amountValueToneClass as n } from "./index93.js";
4
- import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
1
+ import { getAPIErrorMessage as e } from "./index26.js";
2
+ import { useMoniteContext as t } from "./index47.js";
3
+ import { toast as n } from "react-hot-toast";
4
+ import { useLingui as r } from "@lingui/react";
5
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js
6
- function a({ row: a, defaultTone: o }) {
7
- let s = a.tone ?? (a.emphasis ? o : "default");
8
- return /* @__PURE__ */ i("div", {
9
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
10
- children: [/* @__PURE__ */ r(t, {
11
- variant: "caption",
12
- color: "muted",
13
- className: "ttw:font-medium",
14
- children: a.label
15
- }), /* @__PURE__ */ r(t, {
16
- component: "span",
17
- variant: a.emphasis ? "h3" : "body1",
18
- className: e(!a.emphasis && "ttw:font-medium", n[s]),
19
- children: a.value
20
- })]
6
+ var i = (i, a) => {
7
+ let { i18n: o } = r(), { api: s, queryClient: c } = t();
8
+ return s.finops.postRecurrencesIdResume.useMutation({ path: { recurrence_id: i } }, {
9
+ onError: (t) => {
10
+ n.error(e(o, t));
11
+ },
12
+ onSuccess: async () => {
13
+ await Promise.all([
14
+ s.finops.getReceivables.invalidateQueries(c),
15
+ s.finops.getReceivablesId.invalidateQueries({ parameters: { path: { receivable_id: a } } }, c),
16
+ s.finops.getRecurrencesId.invalidateQueries({ parameters: { path: { recurrence_id: i } } }, c)
17
+ ]), n.success(o._("Series has been resumed"));
18
+ }
21
19
  });
22
- }
20
+ };
23
21
  //#endregion
24
- export { a as InvoiceDetailsAmountCell };
22
+ export { i as useResumeRecurrence };