@tesouro/embedded-components-react 0.11.235 → 0.11.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.css +12 -0
- package/dist/index.d.ts +24 -0
- package/dist/lib/ReceivablesWidget.d.ts +24 -0
- package/dist/lib/WidgetSuite.d.ts +24 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +198 -118
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +76 -194
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +67 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +111 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +459 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +101 -449
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +9 -117
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +85 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +67 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +246 -71
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +40 -251
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +237 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +21 -244
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +529 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +4 -530
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +44 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +242 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +3 -245
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +63 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/billPay.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +386 -354
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +260 -258
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +219 -179
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +31 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +40 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +30 -63
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +463 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +15 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +19 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +15 -66
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +66 -391
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +148 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +173 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +3 -71
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +37 -432
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +66 -188
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +455 -22
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +191 -5
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +5 -265
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +261 -125
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +2 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +122 -230
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +27 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +216 -224
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +3 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +228 -168
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +29 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +152 -109
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +22 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +140 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index65.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/document-preview.js +1 -0
- 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/feature/dist/lib/document/documentPreview.js +122 -0
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +0 -2
|
@@ -63,59 +63,59 @@ function ft(e, t) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
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), [
|
|
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] = _(), [Ft, It] = _(), [D, O] = _(() => je()), k = g(D), [Lt, A] = _(!1), [Rt, j] = _({}), [zt, Bt] = _("none"), Vt = Xe(), M = Ye(), N = M.data?.data, { unitNamesById: P } = Vt, [Ht, Ut] = _(), [F, Wt] = _(!1), Gt = g(!1), I = g(!1), L = g(!1), R = g({
|
|
67
67
|
lines: !1,
|
|
68
68
|
discount: !1
|
|
69
|
-
}), [
|
|
69
|
+
}), [Kt, z] = _(!1), [qt, Jt] = _(!1), Yt = h(() => t(), []), Xt = h(() => ({
|
|
70
70
|
...i,
|
|
71
71
|
...pt
|
|
72
|
-
}), [pt]),
|
|
72
|
+
}), [pt]), Zt = s(D.customerId), Qt = a(D.customerId || void 0), $t = Zt.data?.data?.[0], { billingAddressId: en, billingAddress: tn, shippingAddressId: nn } = Le({
|
|
73
73
|
values: D,
|
|
74
|
-
counterpart:
|
|
75
|
-
addresses:
|
|
76
|
-
}),
|
|
74
|
+
counterpart: Qt.data,
|
|
75
|
+
addresses: Zt.data?.data
|
|
76
|
+
}), B = !!D.customerId && (Zt.isLoading || Qt.isLoading), V = et({
|
|
77
77
|
counterpartId: D.customerId,
|
|
78
|
-
billingAddressId:
|
|
79
|
-
billingCountry:
|
|
78
|
+
billingAddressId: en,
|
|
79
|
+
billingCountry: tn?.country,
|
|
80
80
|
inlineCustomerType: v && !D.customerId && D.customerName.trim() ? Be : void 0,
|
|
81
|
-
isAddressesLoading:
|
|
82
|
-
}),
|
|
81
|
+
isAddressesLoading: B
|
|
82
|
+
}), rn = V.isLoading || B, an = p((e) => {
|
|
83
83
|
O((t) => ({
|
|
84
84
|
...t,
|
|
85
85
|
attachments: e(t.attachments)
|
|
86
86
|
}));
|
|
87
|
-
}, []),
|
|
87
|
+
}, []), H = it({
|
|
88
88
|
attachments: D.attachments,
|
|
89
|
-
setAttachments:
|
|
90
|
-
receivableId:
|
|
91
|
-
}), { reset:
|
|
89
|
+
setAttachments: an,
|
|
90
|
+
receivableId: Nt
|
|
91
|
+
}), { reset: U, discardUploads: on, commitRemovals: sn } = H, cn = D.type === "invoice" ? he({
|
|
92
92
|
attachments: D.attachments,
|
|
93
|
-
pendingUploads:
|
|
94
|
-
isCountLimitReached:
|
|
93
|
+
pendingUploads: H.pendingUploads,
|
|
94
|
+
isCountLimitReached: H.isCountLimitReached,
|
|
95
95
|
isRecurring: f(D),
|
|
96
96
|
messages: d
|
|
97
|
-
}) : void 0,
|
|
97
|
+
}) : void 0, ln = p((e) => {
|
|
98
98
|
e && O((t) => dt(t, e));
|
|
99
|
-
}, []),
|
|
100
|
-
view:
|
|
101
|
-
setView:
|
|
99
|
+
}, []), un = c({
|
|
100
|
+
view: zt,
|
|
101
|
+
setView: Bt,
|
|
102
102
|
selectedId: D.customerId || void 0,
|
|
103
|
-
setSelectedId:
|
|
104
|
-
messages:
|
|
103
|
+
setSelectedId: ln,
|
|
104
|
+
messages: Xt,
|
|
105
105
|
counterpartType: "customer",
|
|
106
106
|
counterpart: void 0,
|
|
107
|
-
primaryAddress:
|
|
108
|
-
}), { openCreate:
|
|
109
|
-
|
|
107
|
+
primaryAddress: $t
|
|
108
|
+
}), { openCreate: dn, setValues: fn } = un, pn = p(() => {
|
|
109
|
+
dn(), fn((e) => He(e, {
|
|
110
110
|
name: D.customerName,
|
|
111
111
|
email: D.customerEmail
|
|
112
112
|
}));
|
|
113
113
|
}, [
|
|
114
|
-
un,
|
|
115
114
|
dn,
|
|
115
|
+
fn,
|
|
116
116
|
D.customerName,
|
|
117
117
|
D.customerEmail
|
|
118
|
-
]),
|
|
118
|
+
]), mn = p((e) => O((t) => {
|
|
119
119
|
let n = e({
|
|
120
120
|
paymentTermsId: t.paymentTermsId,
|
|
121
121
|
paymentTermsCustomDate: t.paymentTermsCustomDate
|
|
@@ -125,14 +125,14 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
125
125
|
...n,
|
|
126
126
|
...n.paymentTermsId === "receipt_due" ? { paymentReminderId: "" } : {}
|
|
127
127
|
};
|
|
128
|
-
}), []),
|
|
128
|
+
}), []), hn = at({
|
|
129
129
|
paymentTermsId: D.paymentTermsId,
|
|
130
130
|
paymentTermsCustomDate: D.paymentTermsCustomDate,
|
|
131
131
|
issueDate: D.issueDate,
|
|
132
132
|
isRecurring: D.type === "invoice" && f(D),
|
|
133
133
|
messages: d,
|
|
134
|
-
onChange:
|
|
135
|
-
}),
|
|
134
|
+
onChange: mn
|
|
135
|
+
}), gn = hn.reset, _n = p((e, { automatic: t = !1 } = {}) => {
|
|
136
136
|
t && (k.current = {
|
|
137
137
|
...k.current,
|
|
138
138
|
...e
|
|
@@ -140,18 +140,18 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
140
140
|
...t,
|
|
141
141
|
...e
|
|
142
142
|
}));
|
|
143
|
-
}, []),
|
|
143
|
+
}, []), W = st({
|
|
144
144
|
open: w,
|
|
145
145
|
bankAccountId: D.bankAccountId,
|
|
146
146
|
bankAccountType: D.bankAccountType,
|
|
147
147
|
embeddedBankName: mt,
|
|
148
148
|
messages: d,
|
|
149
|
-
onSelect:
|
|
150
|
-
}),
|
|
149
|
+
onSelect: _n
|
|
150
|
+
}), vn = W.reset, yn = qe(Ft), G = Ft ? yn.data : void 0, K = ve(G), bn = K > 0, q = !!Ft && yn.isLoading, xn = g(void 0);
|
|
151
151
|
m(() => {
|
|
152
|
-
if (!
|
|
153
|
-
|
|
154
|
-
let e = be(
|
|
152
|
+
if (!G || xn.current === G.id) return;
|
|
153
|
+
xn.current = G.id;
|
|
154
|
+
let e = be(G);
|
|
155
155
|
k.current = {
|
|
156
156
|
...k.current,
|
|
157
157
|
...e
|
|
@@ -159,21 +159,21 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
159
159
|
...t,
|
|
160
160
|
...e
|
|
161
161
|
}));
|
|
162
|
-
}, [
|
|
163
|
-
let
|
|
162
|
+
}, [G]);
|
|
163
|
+
let Sn = p((e) => O(e), []), Cn = 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
|
-
F ?
|
|
169
|
-
}, [
|
|
167
|
+
}), []), wn = g([]), Tn = p((e) => {
|
|
168
|
+
F ? wn.current.push(...e) : Cn(e);
|
|
169
|
+
}, [Cn, F]);
|
|
170
170
|
m(() => {
|
|
171
|
-
let e =
|
|
171
|
+
let e = wn.current;
|
|
172
172
|
if (!e.length) return;
|
|
173
|
-
|
|
173
|
+
wn.current = [];
|
|
174
174
|
let t = xe({
|
|
175
175
|
fields: D,
|
|
176
|
-
issuedCount:
|
|
176
|
+
issuedCount: K,
|
|
177
177
|
messages: d
|
|
178
178
|
});
|
|
179
179
|
j((n) => {
|
|
@@ -183,68 +183,68 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
183
183
|
}), r;
|
|
184
184
|
});
|
|
185
185
|
}, [
|
|
186
|
-
|
|
186
|
+
K,
|
|
187
187
|
d,
|
|
188
188
|
D
|
|
189
189
|
]);
|
|
190
|
-
let
|
|
190
|
+
let En = ot({
|
|
191
191
|
values: D,
|
|
192
|
-
errors:
|
|
193
|
-
lockSchedule:
|
|
192
|
+
errors: Rt,
|
|
193
|
+
lockSchedule: bn,
|
|
194
194
|
requireRepeat: E === "create" && kt,
|
|
195
195
|
messages: d,
|
|
196
|
-
onChange:
|
|
197
|
-
onClearErrors:
|
|
198
|
-
onRevalidateErrors:
|
|
199
|
-
}),
|
|
196
|
+
onChange: Sn,
|
|
197
|
+
onClearErrors: Cn,
|
|
198
|
+
onRevalidateErrors: Tn
|
|
199
|
+
}), J = En.reset, Dn = p((e) => O((t) => ({
|
|
200
200
|
...t,
|
|
201
201
|
...e
|
|
202
|
-
})), []),
|
|
202
|
+
})), []), Y = St.isPending || _t.isPending || vt.isPending || yt.isPending || bt.isPending || xt.isPending, On = ct({
|
|
203
203
|
open: w,
|
|
204
204
|
isInvoice: D.type === "invoice",
|
|
205
|
-
disabled:
|
|
205
|
+
disabled: Y,
|
|
206
206
|
paymentTermsId: D.paymentTermsId,
|
|
207
207
|
paymentTermsCustomDate: D.paymentTermsCustomDate,
|
|
208
208
|
paymentReminderId: D.paymentReminderId,
|
|
209
209
|
overdueReminderId: D.overdueReminderId,
|
|
210
210
|
messages: d,
|
|
211
|
-
onSelect:
|
|
212
|
-
}),
|
|
213
|
-
C.current = [],
|
|
211
|
+
onSelect: Dn
|
|
212
|
+
}), kn = On.reset, An = p(() => {
|
|
213
|
+
C.current = [], Ut(void 0), Ot("create"), At(!1), Pt(void 0), It(void 0), xn.current = void 0, S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, O(je()), A(!1), j({}), Wt(!1), z(!1), R.current = {
|
|
214
214
|
lines: !1,
|
|
215
215
|
discount: !1
|
|
216
|
-
},
|
|
217
|
-
}, [
|
|
218
|
-
|
|
216
|
+
}, U(), J();
|
|
217
|
+
}, [U, J]), jn = p((e = "invoice", { customerId: t = "", recurring: n = !1 } = {}) => {
|
|
218
|
+
gn(), vn(), J();
|
|
219
219
|
let r = {
|
|
220
220
|
...je(),
|
|
221
221
|
type: e,
|
|
222
222
|
customerId: t
|
|
223
223
|
}, i = n ? ye(r) : r;
|
|
224
|
-
|
|
224
|
+
kn($e(i)), C.current = [], S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, xn.current = void 0, Ut(void 0), Ot("create"), At(n), Pt(void 0), It(void 0), k.current = i, O(i), A(!1), j({}), U(), Wt(!1), z(!1), R.current = {
|
|
225
225
|
lines: !1,
|
|
226
226
|
discount: !1
|
|
227
227
|
}, T(!0);
|
|
228
228
|
}, [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
]),
|
|
229
|
+
U,
|
|
230
|
+
gn,
|
|
231
|
+
vn,
|
|
232
|
+
J,
|
|
233
|
+
kn
|
|
234
|
+
]), Mn = p((e, { highlightForIssue: t = !1 } = {}) => {
|
|
235
235
|
if (e.type === "credit_note") return;
|
|
236
|
-
|
|
236
|
+
gn(), vn(), J();
|
|
237
237
|
let n = Ie(e, N);
|
|
238
|
-
|
|
238
|
+
kn($e(n)), C.current = e.line_items, Dt.current = e.currency, S.current = void 0, y.current = "draft", b.current = !1, x.current = t, xn.current = void 0, Ut(void 0), Ot("edit"), Mt(e), Pt(e.id), It(e.type === "invoice" ? e.recurrence_id ?? void 0 : void 0), k.current = n, O(n), A(!1), j({}), Wt(!1), z(!1), R.current = {
|
|
239
239
|
lines: !1,
|
|
240
240
|
discount: !1
|
|
241
|
-
},
|
|
241
|
+
}, U(), T(!0);
|
|
242
242
|
}, [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
U,
|
|
244
|
+
gn,
|
|
245
|
+
vn,
|
|
246
|
+
J,
|
|
247
|
+
kn,
|
|
248
248
|
N
|
|
249
249
|
]);
|
|
250
250
|
m(() => {
|
|
@@ -259,19 +259,19 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
259
259
|
};
|
|
260
260
|
}));
|
|
261
261
|
}, [N]);
|
|
262
|
-
let
|
|
263
|
-
|
|
264
|
-
}, [
|
|
265
|
-
|
|
262
|
+
let X = H.isUploading, Nn = p(() => {
|
|
263
|
+
X || (on(), A(!1), T(!1), j({}));
|
|
264
|
+
}, [on, X]), Pn = p(() => {
|
|
265
|
+
Lt ? A(!1) : X ? e.error(d.attachmentsUploading) : ut(k.current, D) ? A(!0) : Nn();
|
|
266
266
|
}, [
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
Nn,
|
|
268
|
+
X,
|
|
269
269
|
d.attachmentsUploading,
|
|
270
|
-
|
|
270
|
+
Lt,
|
|
271
271
|
D
|
|
272
|
-
]),
|
|
272
|
+
]), Fn = p(() => ut(k.current, D), [D]), In = p((e) => {
|
|
273
273
|
let t = { ...e };
|
|
274
|
-
t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), L.current = !0), t.type !== void 0 && t.type !== "invoice" &&
|
|
274
|
+
t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), L.current = !0), t.type !== void 0 && t.type !== "invoice" && on(), t.discount !== void 0 && Jt(!1), t.discount !== void 0 && F && (I.current = !0), t.discountType !== void 0 && (I.current = !0), t.currency !== void 0 && (Gt.current = !0), O((e) => {
|
|
275
275
|
let n = {
|
|
276
276
|
...t.customerId === void 0 ? e : dt(e, t.customerId),
|
|
277
277
|
...t
|
|
@@ -285,14 +285,14 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
285
285
|
currency: n.currency
|
|
286
286
|
})), n;
|
|
287
287
|
});
|
|
288
|
-
}, [
|
|
289
|
-
|
|
288
|
+
}, [on, F]), Ln = p(() => {
|
|
289
|
+
z(!0), Jt(Te(D.discount, D.discountType, D.currency) === 0);
|
|
290
290
|
}, [
|
|
291
291
|
D.discount,
|
|
292
292
|
D.discountType,
|
|
293
293
|
D.currency
|
|
294
|
-
]),
|
|
295
|
-
|
|
294
|
+
]), Rn = p(() => {
|
|
295
|
+
z(!1), I.current = !0, O((e) => ({
|
|
296
296
|
...e,
|
|
297
297
|
discount: Ce({
|
|
298
298
|
value: e.discount,
|
|
@@ -300,7 +300,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
300
300
|
currency: e.currency
|
|
301
301
|
})
|
|
302
302
|
}));
|
|
303
|
-
}, []),
|
|
303
|
+
}, []), zn = p(() => {
|
|
304
304
|
let e = ze({
|
|
305
305
|
values: D,
|
|
306
306
|
messages: d,
|
|
@@ -315,7 +315,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
315
315
|
v,
|
|
316
316
|
d,
|
|
317
317
|
D
|
|
318
|
-
]),
|
|
318
|
+
]), Bn = p(() => {
|
|
319
319
|
L.current = !0, O((e) => {
|
|
320
320
|
let t = l(e.taxRate);
|
|
321
321
|
return t === e.taxRate ? e : {
|
|
@@ -323,17 +323,17 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
323
323
|
taxRate: t
|
|
324
324
|
};
|
|
325
325
|
});
|
|
326
|
-
}, []),
|
|
327
|
-
t && (
|
|
326
|
+
}, []), Z = p((e, { validate: t }) => {
|
|
327
|
+
t && (Gt.current = !0), O((t) => ({
|
|
328
328
|
...t,
|
|
329
329
|
lineItems: e(t.lineItems)
|
|
330
330
|
}));
|
|
331
331
|
}, []);
|
|
332
332
|
m(() => {
|
|
333
|
-
let e =
|
|
333
|
+
let e = Gt.current, t = I.current;
|
|
334
334
|
if (!e && !t && !L.current) return;
|
|
335
|
-
|
|
336
|
-
let n = b.current ||
|
|
335
|
+
Gt.current = !1, I.current = !1, L.current = !1, e && (R.current.lines = !0), t && (R.current.discount = !0);
|
|
336
|
+
let n = b.current || K > 0, r = e ? me(D.lineItems, {
|
|
337
337
|
currency: D.currency,
|
|
338
338
|
messages: d,
|
|
339
339
|
requireComplete: n
|
|
@@ -343,18 +343,18 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
343
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;
|
|
344
344
|
});
|
|
345
345
|
}, [
|
|
346
|
-
|
|
346
|
+
K,
|
|
347
347
|
d,
|
|
348
348
|
D
|
|
349
349
|
]);
|
|
350
|
-
let
|
|
350
|
+
let Vn = p((e, t) => {
|
|
351
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),
|
|
352
|
+
i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (L.current = !0), Z((t) => t.map((t) => t.id === e ? {
|
|
353
353
|
...t,
|
|
354
354
|
...i
|
|
355
355
|
} : t), { validate: F });
|
|
356
|
-
}, [
|
|
357
|
-
|
|
356
|
+
}, [Z, F]), Hn = p((e, t) => {
|
|
357
|
+
Z((n) => n.map((n) => n.id === e ? {
|
|
358
358
|
...n,
|
|
359
359
|
...ae({
|
|
360
360
|
product: t,
|
|
@@ -363,59 +363,59 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
363
363
|
})
|
|
364
364
|
} : n), { validate: !0 });
|
|
365
365
|
}, [
|
|
366
|
-
|
|
366
|
+
Z,
|
|
367
367
|
P,
|
|
368
368
|
D.currency
|
|
369
|
-
]),
|
|
370
|
-
t &&
|
|
369
|
+
]), Un = p((e, t) => {
|
|
370
|
+
t && Z((n) => t.kind === "remove" ? n.filter((t) => t.id !== e) : n.map((n) => n.id === e ? {
|
|
371
371
|
...n,
|
|
372
372
|
...t.patch
|
|
373
373
|
} : n), { validate: !0 });
|
|
374
|
-
}, [
|
|
374
|
+
}, [Z]), Wn = p((e, t) => {
|
|
375
375
|
let n = D.lineItems.find((t) => t.id === e);
|
|
376
|
-
n &&
|
|
376
|
+
n && Un(e, ne({
|
|
377
377
|
lineItem: n,
|
|
378
378
|
field: t,
|
|
379
379
|
rowCount: D.lineItems.length,
|
|
380
380
|
currency: D.currency
|
|
381
381
|
}));
|
|
382
382
|
}, [
|
|
383
|
-
|
|
383
|
+
Un,
|
|
384
384
|
D.currency,
|
|
385
385
|
D.lineItems
|
|
386
|
-
]),
|
|
386
|
+
]), Gn = p((e, t) => {
|
|
387
387
|
let n = D.lineItems.find((t) => t.id === e);
|
|
388
|
-
n &&
|
|
388
|
+
n && Un(e, ue({
|
|
389
389
|
lineItem: n,
|
|
390
390
|
step: t,
|
|
391
391
|
rowCount: D.lineItems.length
|
|
392
392
|
}));
|
|
393
|
-
}, [
|
|
393
|
+
}, [Un, D.lineItems]), Kn = p(() => {
|
|
394
394
|
let e = re(D.currency);
|
|
395
|
-
|
|
395
|
+
Ut(e.id), O((t) => ({
|
|
396
396
|
...t,
|
|
397
397
|
lineItems: [...t.lineItems, e]
|
|
398
398
|
}));
|
|
399
|
-
}, [D.currency]),
|
|
400
|
-
|
|
401
|
-
}, [
|
|
399
|
+
}, [D.currency]), qn = p((e) => {
|
|
400
|
+
Z((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e), { validate: !0 });
|
|
401
|
+
}, [Z]), Jn = p((e, t) => e.type === "invoice" && (t === "issue" || Se(e) && K === 0), [K]), Yn = p((e, t) => ({
|
|
402
402
|
...ze({
|
|
403
403
|
values: e,
|
|
404
404
|
messages: d,
|
|
405
405
|
willIssue: t,
|
|
406
|
-
hasStartedRecurrence:
|
|
406
|
+
hasStartedRecurrence: K > 0,
|
|
407
407
|
canCreateCustomer: v
|
|
408
408
|
}),
|
|
409
409
|
...e.type === "invoice" && f(e) ? xe({
|
|
410
410
|
fields: e,
|
|
411
|
-
issuedCount:
|
|
411
|
+
issuedCount: K,
|
|
412
412
|
messages: d
|
|
413
413
|
}) : {}
|
|
414
414
|
}), [
|
|
415
415
|
v,
|
|
416
|
-
|
|
416
|
+
K,
|
|
417
417
|
d
|
|
418
|
-
]),
|
|
418
|
+
]), Xn = p(() => {
|
|
419
419
|
requestAnimationFrame(() => {
|
|
420
420
|
let e = Et.current, t = e?.querySelector("[aria-invalid=\"true\"], [data-invalid=\"true\"]");
|
|
421
421
|
if (!e || !t) return;
|
|
@@ -425,31 +425,31 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
425
425
|
behavior: "smooth"
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
|
-
}, []),
|
|
429
|
-
j(e),
|
|
428
|
+
}, []), Zn = p((e, t) => {
|
|
429
|
+
j(e), Wt(!0), b.current = t, R.current = {
|
|
430
430
|
lines: !0,
|
|
431
431
|
discount: !0
|
|
432
|
-
},
|
|
433
|
-
}, [
|
|
432
|
+
}, Xn();
|
|
433
|
+
}, [Xn]), Qn = !Ft || D.frequency !== "once" || yn.isError;
|
|
434
434
|
m(() => {
|
|
435
|
-
if (!w || !x.current ||
|
|
435
|
+
if (!w || !x.current || B || q || !Qn) return;
|
|
436
436
|
x.current = !1;
|
|
437
|
-
let e =
|
|
438
|
-
Yn(
|
|
437
|
+
let e = Jn(D, "issue");
|
|
438
|
+
Zn(Yn(D, e), e);
|
|
439
439
|
}, [
|
|
440
|
-
|
|
440
|
+
B,
|
|
441
441
|
w,
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
Qn,
|
|
443
|
+
q,
|
|
444
|
+
Zn,
|
|
444
445
|
Yn,
|
|
445
|
-
qn,
|
|
446
446
|
D,
|
|
447
|
-
|
|
447
|
+
Jn
|
|
448
448
|
]);
|
|
449
|
-
let
|
|
449
|
+
let $n = g({ values: D });
|
|
450
450
|
m(() => {
|
|
451
|
-
let e =
|
|
452
|
-
if (
|
|
451
|
+
let e = $n.current;
|
|
452
|
+
if ($n.current = { values: D }, !F) return;
|
|
453
453
|
let t = [
|
|
454
454
|
"customerId",
|
|
455
455
|
"customerEmail",
|
|
@@ -479,13 +479,13 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
479
479
|
F,
|
|
480
480
|
D
|
|
481
481
|
]);
|
|
482
|
-
let
|
|
483
|
-
if (y.current = t,
|
|
484
|
-
if (
|
|
482
|
+
let er = p(async (t) => {
|
|
483
|
+
if (y.current = t, q) return;
|
|
484
|
+
if (X) {
|
|
485
485
|
e.error(d.attachmentsUploading);
|
|
486
486
|
return;
|
|
487
487
|
}
|
|
488
|
-
if (M.isLoading ||
|
|
488
|
+
if (M.isLoading || B) {
|
|
489
489
|
e.error(d.lineItemsLoading);
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
@@ -494,27 +494,27 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
494
494
|
lineItems: i
|
|
495
495
|
};
|
|
496
496
|
a !== D && O(a);
|
|
497
|
-
let o = a.type === "invoice" && f(a), s =
|
|
498
|
-
if (s && (
|
|
497
|
+
let o = a.type === "invoice" && f(a), s = Jn(a, t);
|
|
498
|
+
if (s && (rn || W.isLoading)) {
|
|
499
499
|
e.error(d.issueChecksLoading);
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
|
-
if (s && !
|
|
502
|
+
if (s && !W.canAddAccount && !a.bankAccountId && !W.hasAccounts) {
|
|
503
503
|
e.error(d.issueBankAccountUnavailable);
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
|
-
let c =
|
|
506
|
+
let c = Yn(a, s);
|
|
507
507
|
if (Me(c)) {
|
|
508
|
-
|
|
508
|
+
Zn(c, s);
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
|
-
if (j({}), s &&
|
|
511
|
+
if (j({}), s && V.isTaxIdMissing) {
|
|
512
512
|
e.error(d.issueTaxIdRequired);
|
|
513
513
|
return;
|
|
514
514
|
}
|
|
515
515
|
let te = v && !a.customerId && !!a.customerName.trim(), ne = a.customerEmail.trim();
|
|
516
516
|
if (s && (a.paymentReminderId || a.overdueReminderId)) {
|
|
517
|
-
let t = te ? ne ? void 0 : d.issueRemindersNoEmail : Qe(
|
|
517
|
+
let t = te ? ne ? void 0 : d.issueRemindersNoEmail : Qe(V.counterpart, d);
|
|
518
518
|
if (t) {
|
|
519
519
|
e.error(t);
|
|
520
520
|
return;
|
|
@@ -536,7 +536,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
536
536
|
let n = t;
|
|
537
537
|
O((e) => ft(e, n));
|
|
538
538
|
}
|
|
539
|
-
let l = E === "edit" ?
|
|
539
|
+
let l = E === "edit" ? Nt : S.current, u, re, ie = "", ae = {};
|
|
540
540
|
try {
|
|
541
541
|
if (l) {
|
|
542
542
|
let e = Pe({
|
|
@@ -555,12 +555,12 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
555
555
|
path: { receivable_id: l },
|
|
556
556
|
body: Fe({
|
|
557
557
|
values: a,
|
|
558
|
-
billingAddressId:
|
|
559
|
-
shippingAddressId:
|
|
558
|
+
billingAddressId: en,
|
|
559
|
+
shippingAddressId: nn,
|
|
560
560
|
lineItemChanges: e
|
|
561
561
|
})
|
|
562
562
|
});
|
|
563
|
-
|
|
563
|
+
sn(), u = l, re = t?.type ?? a.type, o && t && (C.current = t.line_items, Dt.current = t.currency, a = {
|
|
564
564
|
...a,
|
|
565
565
|
lineItems: oe(a.lineItems, t.line_items)
|
|
566
566
|
}, O(a));
|
|
@@ -568,12 +568,12 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
568
568
|
ae = Re({ values: a });
|
|
569
569
|
let e = await _t.mutateAsync({ body: Ne({
|
|
570
570
|
values: a,
|
|
571
|
-
billingAddressId:
|
|
572
|
-
shippingAddressId:
|
|
571
|
+
billingAddressId: en,
|
|
572
|
+
shippingAddressId: nn,
|
|
573
573
|
unitNamesById: P
|
|
574
574
|
}) });
|
|
575
575
|
if (!e?.id) {
|
|
576
|
-
T(!1),
|
|
576
|
+
T(!1), An();
|
|
577
577
|
return;
|
|
578
578
|
}
|
|
579
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 = {
|
|
@@ -588,7 +588,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
588
588
|
});
|
|
589
589
|
e.error((l ? d.updateFailed : d.createFailed).replace("{errorMessage}", i));
|
|
590
590
|
let { errors: ee, listError: o } = nt(r(t, n), ae), c = fe(ee.lineItems, void 0, o);
|
|
591
|
-
|
|
591
|
+
Zn({
|
|
592
592
|
...ee,
|
|
593
593
|
...c ? { lineItemsSummary: c } : {}
|
|
594
594
|
}, s);
|
|
@@ -596,9 +596,9 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
596
596
|
}
|
|
597
597
|
let se = o ? "recurrence" : "draft";
|
|
598
598
|
if (o) try {
|
|
599
|
-
|
|
600
|
-
path: { recurrence_id:
|
|
601
|
-
body: _e(a, { lockSchedule:
|
|
599
|
+
G ? (await bt.mutateAsync({
|
|
600
|
+
path: { recurrence_id: G.id },
|
|
601
|
+
body: _e(a, { lockSchedule: bn })
|
|
602
602
|
}), e.success(d.recurrenceUpdated)) : (await yt.mutateAsync({ body: ge(a, u) }), e.success(d.recurrenceActivated));
|
|
603
603
|
} catch (t) {
|
|
604
604
|
e.error(rt(t, { messages: d }));
|
|
@@ -611,93 +611,93 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
611
611
|
}
|
|
612
612
|
else E === "create" ? e.success(d.createSucceeded.replace("{customer}", ie)) : e.success(d.updateSucceeded);
|
|
613
613
|
let ce = E === "create" ? ht : gt;
|
|
614
|
-
T(!1),
|
|
614
|
+
T(!1), An(), ce?.(u, re, {
|
|
615
615
|
mode: se,
|
|
616
616
|
counterpartId: a.customerId,
|
|
617
617
|
inlineItems: Ze(a.lineItems, a.currency),
|
|
618
|
-
hasCustomerEmail: te ? !!ne : !!(
|
|
618
|
+
hasCustomerEmail: te ? !!ne : !!(V.counterpart && ee(V.counterpart).trim())
|
|
619
619
|
});
|
|
620
620
|
}, [
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
W.canAddAccount,
|
|
622
|
+
W.hasAccounts,
|
|
623
|
+
W.isLoading,
|
|
624
|
+
en,
|
|
625
625
|
v,
|
|
626
|
-
|
|
626
|
+
sn,
|
|
627
627
|
St,
|
|
628
628
|
_t,
|
|
629
629
|
yt,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
Nt,
|
|
631
|
+
G,
|
|
632
|
+
B,
|
|
633
|
+
X,
|
|
634
|
+
rn,
|
|
635
635
|
xt,
|
|
636
|
-
|
|
636
|
+
bn,
|
|
637
637
|
d,
|
|
638
638
|
E,
|
|
639
639
|
ht,
|
|
640
640
|
gt,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
641
|
+
V.counterpart,
|
|
642
|
+
V.isTaxIdMissing,
|
|
643
|
+
q,
|
|
644
|
+
An,
|
|
645
|
+
nn,
|
|
646
|
+
Zn,
|
|
647
647
|
N,
|
|
648
648
|
P,
|
|
649
649
|
M.isLoading,
|
|
650
650
|
vt,
|
|
651
651
|
bt,
|
|
652
|
-
|
|
652
|
+
Yn,
|
|
653
653
|
D,
|
|
654
|
-
|
|
655
|
-
]),
|
|
654
|
+
Jn
|
|
655
|
+
]), Q = p(async (e = y.current) => {
|
|
656
656
|
if (!Ct.current) {
|
|
657
657
|
Ct.current = !0, Tt(e);
|
|
658
658
|
try {
|
|
659
|
-
await
|
|
659
|
+
await er(e);
|
|
660
660
|
} finally {
|
|
661
661
|
Ct.current = !1, Tt(void 0);
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
}, [
|
|
664
|
+
}, [er]), tr = h(() => ({
|
|
665
665
|
...D,
|
|
666
|
-
discount:
|
|
666
|
+
discount: Kt ? qt ? "" : D.discount : we(Te(D.discount, D.discountType, D.currency), D.discountType, D.currency),
|
|
667
667
|
lineItems: D.lineItems.map(pe)
|
|
668
668
|
}), [
|
|
669
|
+
qt,
|
|
669
670
|
Kt,
|
|
670
|
-
Wt,
|
|
671
671
|
D
|
|
672
|
-
]),
|
|
672
|
+
]), nr = h(() => te(D.lineItems), [D.lineItems]), rr = h(() => Oe(D), [D]), ir = D.type === "invoice", $ = ir && f(D), ar = Y || M.isLoading || W.isLoading, or = ar || B || H.isUploading || q, sr = E === "edit" ? d.updateDraftButton : d.saveDraftButton, cr = $ ? G ? d.recurrenceUpdateButton : d.recurrenceActivateButton : ir ? d.issueButton : sr, lr = ir && !$ ? "issue" : "draft", ur = p(() => Q("draft"), [Q]), dr = p(() => Q(lr), [lr, Q]), fr = p(() => Q(), [Q]), pr = p(() => {
|
|
673
673
|
y.current = "draft";
|
|
674
|
-
}, []),
|
|
675
|
-
y.current =
|
|
676
|
-
}, [
|
|
677
|
-
if (!
|
|
678
|
-
await
|
|
674
|
+
}, []), mr = p(() => {
|
|
675
|
+
y.current = lr;
|
|
676
|
+
}, [lr]), hr = or || $, gr = p(async () => {
|
|
677
|
+
if (!hr) try {
|
|
678
|
+
await Q("draft");
|
|
679
679
|
} finally {
|
|
680
680
|
A(!1);
|
|
681
681
|
}
|
|
682
|
-
}, [
|
|
683
|
-
open:
|
|
684
|
-
onSaveDraft: () => void
|
|
685
|
-
onDiscard:
|
|
686
|
-
onCancel:
|
|
687
|
-
isSaving:
|
|
688
|
-
isSaveDraftDisabled:
|
|
682
|
+
}, [hr, Q]), _r = p(() => A(!1), []), vr = h(() => ({
|
|
683
|
+
open: Lt,
|
|
684
|
+
onSaveDraft: () => void gr(),
|
|
685
|
+
onDiscard: Nn,
|
|
686
|
+
onCancel: _r,
|
|
687
|
+
isSaving: Y,
|
|
688
|
+
isSaveDraftDisabled: hr
|
|
689
689
|
}), [
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
]),
|
|
690
|
+
_r,
|
|
691
|
+
Nn,
|
|
692
|
+
Y,
|
|
693
|
+
hr,
|
|
694
|
+
gr,
|
|
695
|
+
Lt
|
|
696
|
+
]), yr = h(() => De(rr, D.currency), [rr, D.currency]), br = lt({
|
|
697
697
|
values: D,
|
|
698
|
-
totals:
|
|
699
|
-
billingAddress:
|
|
700
|
-
bankAccount:
|
|
698
|
+
totals: rr,
|
|
699
|
+
billingAddress: tn,
|
|
700
|
+
bankAccount: W.selectedAccount,
|
|
701
701
|
unitNamesById: P,
|
|
702
702
|
messages: d,
|
|
703
703
|
enabled: w
|
|
@@ -706,72 +706,74 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
|
|
|
706
706
|
open: w,
|
|
707
707
|
setOpen: T,
|
|
708
708
|
mode: E,
|
|
709
|
-
dialogMode: E === "create" &&
|
|
709
|
+
dialogMode: E === "create" && $ ? "createRecurring" : E,
|
|
710
710
|
values: D,
|
|
711
|
-
sheetValues:
|
|
712
|
-
errors:
|
|
711
|
+
sheetValues: tr,
|
|
712
|
+
errors: Rt,
|
|
713
713
|
setValues: O,
|
|
714
|
-
updateValues:
|
|
715
|
-
commitTaxRate:
|
|
716
|
-
commitCustomerEmail:
|
|
717
|
-
focusDiscount:
|
|
718
|
-
commitDiscount:
|
|
719
|
-
updateLineItem:
|
|
720
|
-
selectProduct:
|
|
721
|
-
commitLineItem:
|
|
722
|
-
stepLineItem:
|
|
723
|
-
addLineItem:
|
|
724
|
-
removeLineItem:
|
|
725
|
-
attachmentsView:
|
|
726
|
-
attachmentsUploading:
|
|
727
|
-
draftButtonLabel:
|
|
728
|
-
draftDisabled:
|
|
729
|
-
draftLoading:
|
|
730
|
-
primaryButtonLabel:
|
|
731
|
-
primaryLoading:
|
|
732
|
-
primaryDisabled:
|
|
714
|
+
updateValues: In,
|
|
715
|
+
commitTaxRate: Bn,
|
|
716
|
+
commitCustomerEmail: zn,
|
|
717
|
+
focusDiscount: Ln,
|
|
718
|
+
commitDiscount: Rn,
|
|
719
|
+
updateLineItem: Vn,
|
|
720
|
+
selectProduct: Hn,
|
|
721
|
+
commitLineItem: Wn,
|
|
722
|
+
stepLineItem: Gn,
|
|
723
|
+
addLineItem: Kn,
|
|
724
|
+
removeLineItem: qn,
|
|
725
|
+
attachmentsView: cn,
|
|
726
|
+
attachmentsUploading: H.isUploading,
|
|
727
|
+
draftButtonLabel: ir && !$ ? sr : void 0,
|
|
728
|
+
draftDisabled: or,
|
|
729
|
+
draftLoading: Y && wt === "draft",
|
|
730
|
+
primaryButtonLabel: cr,
|
|
731
|
+
primaryLoading: Y && wt === lr,
|
|
732
|
+
primaryDisabled: or || ir && (rn || !$ && V.isCounterpartLoading),
|
|
733
733
|
scrollContainerRef: Et,
|
|
734
|
-
selectAttachmentFiles:
|
|
735
|
-
setAttachmentIncludeInEmail:
|
|
736
|
-
removeAttachment:
|
|
737
|
-
autoFocusLineItemId:
|
|
738
|
-
lineItemUnitOptions:
|
|
734
|
+
selectAttachmentFiles: H.selectFiles,
|
|
735
|
+
setAttachmentIncludeInEmail: H.setIncludeInEmail,
|
|
736
|
+
removeAttachment: H.remove,
|
|
737
|
+
autoFocusLineItemId: Ht,
|
|
738
|
+
lineItemUnitOptions: Vt.unitOptions,
|
|
739
739
|
lineItemsLoading: M.isLoading,
|
|
740
|
-
lineItemControls:
|
|
741
|
-
totals:
|
|
742
|
-
preview:
|
|
743
|
-
totalsView:
|
|
740
|
+
lineItemControls: nr,
|
|
741
|
+
totals: rr,
|
|
742
|
+
preview: br,
|
|
743
|
+
totalsView: yr,
|
|
744
744
|
currencySymbol: ie(D.currency),
|
|
745
|
-
isSubmitting:
|
|
746
|
-
fieldsDisabled:
|
|
747
|
-
paymentTerms:
|
|
745
|
+
isSubmitting: Y,
|
|
746
|
+
fieldsDisabled: ar,
|
|
747
|
+
paymentTerms: hn,
|
|
748
748
|
showBillingSection: D.type === "invoice" || E === "edit",
|
|
749
749
|
purchaseOrder: E === "create" ? {
|
|
750
750
|
value: D.purchaseOrder,
|
|
751
|
-
error:
|
|
751
|
+
error: Rt.purchaseOrder
|
|
752
752
|
} : void 0,
|
|
753
|
-
recurrence:
|
|
753
|
+
recurrence: En,
|
|
754
754
|
showRecurrenceSection: D.type === "invoice",
|
|
755
|
-
recurrenceLoading:
|
|
755
|
+
recurrenceLoading: q,
|
|
756
756
|
showDueDateField: D.type === "quote",
|
|
757
|
-
openCreate:
|
|
758
|
-
openEdit:
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
757
|
+
openCreate: jn,
|
|
758
|
+
openEdit: Mn,
|
|
759
|
+
editingReceivable: E === "edit" ? jt : void 0,
|
|
760
|
+
hasPendingChanges: Fn,
|
|
761
|
+
close: Nn,
|
|
762
|
+
requestClose: Pn,
|
|
763
|
+
unsavedPrompt: vr,
|
|
764
|
+
submit: fr,
|
|
765
|
+
submitDraft: ur,
|
|
766
|
+
submitPrimary: dr,
|
|
767
|
+
selectDraftMode: pr,
|
|
768
|
+
selectPrimaryMode: mr,
|
|
769
|
+
units: Vt,
|
|
770
|
+
counterpartView: zt,
|
|
771
|
+
counterpartForm: un,
|
|
772
|
+
stateOptions: Yt,
|
|
773
|
+
openCounterpartCreate: pn,
|
|
774
|
+
customer: Qt.data?.id === D.customerId ? Qt.data : void 0,
|
|
775
|
+
bankAccount: W,
|
|
776
|
+
reminders: On
|
|
775
777
|
};
|
|
776
778
|
}
|
|
777
779
|
export { pt as useReceivableForm };
|