@tesouro/embedded-components-react 0.7.0 → 0.7.1
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/dist/index.css +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/ExpenseManagementWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useTrackReceiptMatching.js +126 -73
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +185 -182
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +187 -180
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +86 -84
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +110 -100
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -27,28 +27,29 @@ import { useExpenseHistoryQuery as pe } from "../../../../data-access/dist/lib/u
|
|
|
27
27
|
import { useGetTransactionQuery as me } from "../../../../data-access/dist/lib/useGetTransactionQuery.js";
|
|
28
28
|
import { usePatchReceiptMutation as he } from "../../../../data-access/dist/lib/usePatchReceiptMutation.js";
|
|
29
29
|
import { useUploadReceiptMutation as ge } from "../../../../data-access/dist/lib/useUploadReceiptMutation.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
30
|
+
import { useTrackReceiptMatching as _e } from "../../../../data-access/dist/lib/useTrackReceiptMatching.js";
|
|
31
|
+
import { useTransactionValidationsQuery as ve } from "../../../../data-access/dist/lib/useTransactionValidationsQuery.js";
|
|
32
|
+
import { useGetApprovalRequestsQuery as ye } from "../../../../data-access/dist/lib/useGetApprovalRequestsQuery.js";
|
|
33
|
+
import { useUpdateTransactionMutation as be } from "../../../../data-access/dist/lib/useTransactionReviewMutations.js";
|
|
33
34
|
import "../../../../data-access/dist/index.js";
|
|
34
|
-
import { TransactionDetailsActionsFeature as
|
|
35
|
-
import { entityUserLabel as
|
|
36
|
-
import { canApproveExpenses as
|
|
37
|
-
import { buildExpenseAuditHistory as
|
|
38
|
-
import { EXPENSE_AUDIT_HISTORY_LABELS_EN as
|
|
39
|
-
import { ReceiptMatchWidget as
|
|
35
|
+
import { TransactionDetailsActionsFeature as xe } from "./TransactionDetailsActionsFeature.js";
|
|
36
|
+
import { entityUserLabel as Se } from "../ExpenseManagementWidget/entityUserLabel.js";
|
|
37
|
+
import { canApproveExpenses as Ce, canWriteExpenses as we, isExpenseAdmin as Te } from "../ExpenseManagementWidget/permissions.js";
|
|
38
|
+
import { buildExpenseAuditHistory as Ee } from "./auditHistory/buildExpenseAuditHistory.js";
|
|
39
|
+
import { EXPENSE_AUDIT_HISTORY_LABELS_EN as De } from "./auditHistory/labels.js";
|
|
40
|
+
import { ReceiptMatchWidget as Oe } from "../../../../receipt-match/feature/dist/index4.js";
|
|
40
41
|
import "../../../../receipt-match/feature/dist/index.js";
|
|
41
|
-
import { useMemo as
|
|
42
|
-
import { Fragment as
|
|
42
|
+
import { useMemo as ke, useRef as Ae, useState as a } from "react";
|
|
43
|
+
import { Fragment as je, jsx as o, jsxs as Me } from "react/jsx-runtime";
|
|
43
44
|
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js
|
|
44
|
-
var
|
|
45
|
+
var Ne = "—", Pe = /* @__PURE__ */ new Map(), s = "__none__";
|
|
45
46
|
function c(e) {
|
|
46
47
|
return e === s ? null : e;
|
|
47
48
|
}
|
|
48
49
|
function l(e) {
|
|
49
50
|
return !!(e && e !== "user");
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function Fe(e) {
|
|
52
53
|
if (!e || typeof e != "object" || !("all" in e)) return {};
|
|
53
54
|
let t = e.all, n, r;
|
|
54
55
|
for (let e of t ?? []) {
|
|
@@ -63,7 +64,7 @@ function Pe(e) {
|
|
|
63
64
|
lessThanCents: r
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function Ie(e) {
|
|
67
68
|
for (let t of e ?? []) {
|
|
68
69
|
let e = t.event_data;
|
|
69
70
|
if (!e || typeof e != "object") continue;
|
|
@@ -85,10 +86,10 @@ function Fe(e) {
|
|
|
85
86
|
}
|
|
86
87
|
return {};
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function Le(e) {
|
|
89
90
|
return e && "required_approval_count" in e && typeof e.required_approval_count == "number" ? e.required_approval_count : 0;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function Re(e) {
|
|
92
93
|
for (let t of e ?? []) {
|
|
93
94
|
if (t.event_type !== "approval_action") continue;
|
|
94
95
|
let e = t.event_data;
|
|
@@ -97,60 +98,60 @@ function Le(e) {
|
|
|
97
98
|
if (typeof n == "string" && n) return n;
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
|
-
var
|
|
101
|
+
var ze = ".pdf,.png,.jpg,.jpeg,.gif,.svg";
|
|
101
102
|
function u(e, t, n) {
|
|
102
103
|
let r = e.find((e) => e.field === t);
|
|
103
104
|
return r != null && (r.amount_threshold == null || n >= r.amount_threshold);
|
|
104
105
|
}
|
|
105
|
-
function d({ open: d, onClose:
|
|
106
|
+
function d({ open: d, onClose: Be, selectedTransactionId: Ve, actionItemIds: He, cardholderByUserId: f, labels: Ue, detailsLabels: We, cardLabels: Ge, actionsLabels: Ke, statusBadgeLabels: qe, fileViewerLabels: Je }) {
|
|
106
107
|
let p = {
|
|
107
108
|
...oe,
|
|
108
|
-
...
|
|
109
|
-
}, [m, h] = a(0), [
|
|
109
|
+
...Ue
|
|
110
|
+
}, [m, h] = a(0), [Ye, Xe] = a(!1), [g, _] = a(null), [v, y] = a(null), [b, x] = a(null), [Ze, S] = a(!1), [Qe, C] = a(null), $e = Ae(null), w = He ?? [], et = w.length > 1, T = w.length > 0 ? w[m] ?? "" : Ve ?? "", { initResponse: tt } = ee(), nt = tt?.userId ?? "", E = tt?.scopes, D = Te(E), O = we(E), rt = Ce(E), it = r(E, [i.ApprovalRequestUpdateOrg]), at = !O && !it && !rt, k = me({ transactionId: d ? T : void 0 }), A = k.data, j = A?.applied_policy_id || void 0, ot = ne({
|
|
110
111
|
objectType: te.Transaction,
|
|
111
|
-
enabled: d && !!
|
|
112
|
-
}).data?.data?.find((e) => e.id ===
|
|
113
|
-
transactionId: d ?
|
|
112
|
+
enabled: d && !!j
|
|
113
|
+
}).data?.data?.find((e) => e.id === j), st = ye({ transactionId: d ? T : void 0 }), M = st.latestRequest, N = ve({ enabled: d }), P = be(), ct = ge(), F = he(), { trackAttachedReceipt: lt } = _e(), [ut, dt] = a(null), ft = le({ enabled: d && D }), pt = de({ enabled: d && D }), mt = fe({ enabled: d && D }), I = pe({
|
|
114
|
+
transactionId: d ? T : void 0,
|
|
114
115
|
enabled: d
|
|
115
|
-
}),
|
|
116
|
+
}), L = ae(A?.expense_status), ht = ie(L, !!A?.has_validation_errors, {
|
|
116
117
|
...re,
|
|
117
|
-
...
|
|
118
|
-
}), R =
|
|
119
|
-
ids:
|
|
120
|
-
enabled: d &&
|
|
121
|
-
}).data?.data?.find((e) => e.id ===
|
|
122
|
-
if (
|
|
118
|
+
...qe
|
|
119
|
+
}), R = A?.merchant_amount ?? 0, z = A?.description ?? "", gt = g?.transactionId === T ? g.value : z, _t = u(N.requiredFields, "description", R), B = u(N.requiredFields, "receipt_id", R), V = A?.receipt_file_url ?? "", vt = M?.caller_is_policy_approver ?? !1, yt = !!(nt && M?.approved_by?.includes(nt)), bt = vt && !yt, xt = rt && !vt, St = D || L === "new" || L === "rejected", Ct = A?.payment_method, H = Ct?.type === "card" ? Ct.details : null, wt = H ? p.cardLabel(H.card_type === "debit" ? p.debitCard : p.creditCard, H.last4 ?? "") : Ne, U = A?.entity_user_id ?? "", Tt = ke(() => U ? [U] : [], [U]), Et = ue({
|
|
120
|
+
ids: Tt,
|
|
121
|
+
enabled: d && Tt.length > 0
|
|
122
|
+
}).data?.data?.find((e) => e.id === U), Dt = Et ? Se(Et) : f?.get(U) ?? Ne, W = ut === T, Ot = !!T && (k.isPending || st.isPending || N.isPending), kt = () => {
|
|
123
|
+
if (et && m < w.length - 1) {
|
|
123
124
|
h((e) => e + 1);
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
h(0),
|
|
129
|
-
},
|
|
130
|
-
transactionId:
|
|
131
|
-
glCategory:
|
|
132
|
-
department:
|
|
133
|
-
location:
|
|
134
|
-
},
|
|
127
|
+
G();
|
|
128
|
+
}, G = () => {
|
|
129
|
+
h(0), _(null), y(null), x(null), C(null), Be();
|
|
130
|
+
}, K = O && St, q = v?.transactionId === T && v.value, J = A?.receipt_id, Y = A?.ledger_account_id || s, At = A?.department_id || s, jt = A?.location_id || s, X = Qe?.transactionId === T ? Qe : {
|
|
131
|
+
transactionId: T,
|
|
132
|
+
glCategory: Y,
|
|
133
|
+
department: At,
|
|
134
|
+
location: jt
|
|
135
|
+
}, Mt = [{
|
|
135
136
|
value: s,
|
|
136
137
|
label: p.glCategoryUncategorized
|
|
137
|
-
}, ...(
|
|
138
|
+
}, ...(mt.data?.data ?? []).map((e) => ({
|
|
138
139
|
value: e.id,
|
|
139
140
|
label: e.name ?? ""
|
|
140
|
-
}))],
|
|
141
|
+
}))], Nt = [{
|
|
141
142
|
value: s,
|
|
142
143
|
label: p.accountingNone
|
|
143
|
-
}, ...(
|
|
144
|
+
}, ...(ft.data?.data ?? []).map((e) => ({
|
|
144
145
|
value: e.id,
|
|
145
146
|
label: e.name
|
|
146
|
-
}))],
|
|
147
|
+
}))], Pt = [{
|
|
147
148
|
value: s,
|
|
148
149
|
label: p.accountingNone
|
|
149
|
-
}, ...(
|
|
150
|
+
}, ...(pt.data?.data ?? []).map((e) => ({
|
|
150
151
|
value: e.id,
|
|
151
152
|
label: e.name
|
|
152
|
-
}))],
|
|
153
|
-
let e = (
|
|
153
|
+
}))], Ft = ke(() => {
|
|
154
|
+
let e = (I.data?.data ?? []).map((e) => ({
|
|
154
155
|
id: e.id,
|
|
155
156
|
event_type: e.event_type,
|
|
156
157
|
event_data: e.event_data,
|
|
@@ -160,199 +161,205 @@ function d({ open: d, onClose: ze, selectedTransactionId: Be, actionItemIds: Ve,
|
|
|
160
161
|
entity_user_last_name: e.entity_user_last_name,
|
|
161
162
|
recorded_by: e.recorded_by
|
|
162
163
|
}));
|
|
163
|
-
return
|
|
164
|
-
}, [
|
|
164
|
+
return Ee(e, f ?? Pe, De);
|
|
165
|
+
}, [I.data, f]), It = async (t) => {
|
|
165
166
|
try {
|
|
166
167
|
let e = await ct.mutateAsync({ body: { file: t } });
|
|
167
168
|
if (!e.id) throw Error("Receipt upload returned no id");
|
|
168
|
-
await
|
|
169
|
+
await F.mutateAsync({
|
|
169
170
|
path: { receipt_id: e.id },
|
|
170
|
-
body: { transaction_id:
|
|
171
|
-
}),
|
|
172
|
-
transactionId:
|
|
171
|
+
body: { transaction_id: T }
|
|
172
|
+
}), y({
|
|
173
|
+
transactionId: T,
|
|
173
174
|
value: !1
|
|
174
|
-
})
|
|
175
|
+
}), dt(T), lt({
|
|
176
|
+
receiptId: e.id,
|
|
177
|
+
transactionId: T
|
|
178
|
+
}).catch(() => void 0).finally(() => dt((e) => e === T ? null : e));
|
|
175
179
|
} catch {
|
|
176
180
|
e.error(p.receiptUploadFailed);
|
|
177
181
|
}
|
|
178
|
-
},
|
|
179
|
-
if (
|
|
180
|
-
await
|
|
181
|
-
path: { receipt_id:
|
|
182
|
+
}, Lt = async () => {
|
|
183
|
+
if (J) try {
|
|
184
|
+
await F.mutateAsync({
|
|
185
|
+
path: { receipt_id: J },
|
|
182
186
|
body: { transaction_id: null },
|
|
183
|
-
previousTransactionId:
|
|
187
|
+
previousTransactionId: T
|
|
184
188
|
});
|
|
185
189
|
} catch {
|
|
186
190
|
e.error(p.receiptDeleteFailed);
|
|
187
191
|
} finally {
|
|
188
|
-
|
|
192
|
+
S(!1);
|
|
189
193
|
}
|
|
190
|
-
},
|
|
191
|
-
currencyCode:
|
|
194
|
+
}, Z = Fe(ot?.trigger), Rt = Z.greaterThanCents == null ? void 0 : n(Z.greaterThanCents / 100, {
|
|
195
|
+
currencyCode: A?.merchant_currency,
|
|
192
196
|
includeSpaceAfterCurrencySymbol: !1
|
|
193
|
-
}),
|
|
194
|
-
currencyCode:
|
|
197
|
+
}), zt = Z.lessThanCents == null ? void 0 : n(Z.lessThanCents / 100, {
|
|
198
|
+
currencyCode: A?.merchant_currency,
|
|
195
199
|
includeSpaceAfterCurrencySymbol: !1
|
|
196
|
-
}),
|
|
197
|
-
return /* @__PURE__ */ je
|
|
200
|
+
}), Bt = L === "approved" || L === "rejected" ? I.data?.data : void 0, Vt = Re(Bt), Q = Ie(Bt), $ = Le(M), Ht = L === "approved" && (Q.source ? Q.source === "auto" : $ === 0), Ut = L === "approved" && (Q.source ? Q.source !== "auto" : $ > 0), Wt = Vt ?? (Rt || zt ? void 0 : ot?.name);
|
|
201
|
+
return /* @__PURE__ */ Me(je, { children: [
|
|
198
202
|
/* @__PURE__ */ o("input", {
|
|
199
|
-
ref:
|
|
203
|
+
ref: $e,
|
|
200
204
|
type: "file",
|
|
201
|
-
accept:
|
|
205
|
+
accept: ze,
|
|
202
206
|
className: "ttw:hidden",
|
|
203
207
|
"aria-hidden": !0,
|
|
204
208
|
tabIndex: -1,
|
|
205
209
|
onChange: (e) => {
|
|
206
210
|
let t = e.target.files?.[0];
|
|
207
|
-
e.target.value = "", t &&
|
|
211
|
+
e.target.value = "", t && It(t);
|
|
208
212
|
}
|
|
209
213
|
}),
|
|
210
214
|
/* @__PURE__ */ o(se, {
|
|
211
215
|
open: d,
|
|
212
|
-
onClose:
|
|
213
|
-
transactionId:
|
|
214
|
-
transactionDate: t(
|
|
215
|
-
statusLabel:
|
|
216
|
-
statusTone:
|
|
217
|
-
isRejected:
|
|
218
|
-
isPendingReview:
|
|
216
|
+
onClose: G,
|
|
217
|
+
transactionId: T,
|
|
218
|
+
transactionDate: t(A?.started_at, { month: "long" }),
|
|
219
|
+
statusLabel: ht.label,
|
|
220
|
+
statusTone: ht.tone,
|
|
221
|
+
isRejected: L === "rejected",
|
|
222
|
+
isPendingReview: L === "approve_in_progress",
|
|
219
223
|
amount: n(Math.abs(R) / 100, {
|
|
220
|
-
currencyCode:
|
|
224
|
+
currencyCode: A?.merchant_currency,
|
|
221
225
|
includeSpaceAfterCurrencySymbol: !1
|
|
222
226
|
}),
|
|
223
|
-
merchant:
|
|
224
|
-
receiptUrl:
|
|
225
|
-
isLoading:
|
|
226
|
-
isError:
|
|
227
|
-
isClosingDisabled:
|
|
228
|
-
cardLabel:
|
|
229
|
-
cardName:
|
|
230
|
-
cardholder:
|
|
231
|
-
showCardholder: !!
|
|
232
|
-
showPhysicalPill: !!
|
|
233
|
-
isDescriptionRequired:
|
|
234
|
-
isReceiptRequired:
|
|
235
|
-
isReceiptAutoMatched:
|
|
236
|
-
isReceiptActionDisabled: !
|
|
237
|
-
receiptButtonLabel:
|
|
238
|
-
receiptButtonIcon:
|
|
239
|
-
receiptButtonVariant:
|
|
240
|
-
showNoReceiptWarning:
|
|
241
|
-
onUploadClick:
|
|
242
|
-
onFileDrop:
|
|
243
|
-
onOpenReceiptInbox:
|
|
244
|
-
onSubmitWithoutReceipt:
|
|
245
|
-
transactionId:
|
|
227
|
+
merchant: A?.merchant_name ?? "",
|
|
228
|
+
receiptUrl: V,
|
|
229
|
+
isLoading: Ot,
|
|
230
|
+
isError: k.isError,
|
|
231
|
+
isClosingDisabled: Ye,
|
|
232
|
+
cardLabel: wt,
|
|
233
|
+
cardName: H ? p.travelCard : void 0,
|
|
234
|
+
cardholder: Dt,
|
|
235
|
+
showCardholder: !!U,
|
|
236
|
+
showPhysicalPill: !!H,
|
|
237
|
+
isDescriptionRequired: _t,
|
|
238
|
+
isReceiptRequired: B,
|
|
239
|
+
isReceiptAutoMatched: A?.source_of_data?.receipt_id === "automatched",
|
|
240
|
+
isReceiptActionDisabled: !K && !V,
|
|
241
|
+
receiptButtonLabel: V ? p.receiptAttached : q ? p.receiptSubmitWithout : K ? p.receiptAttach : p.receiptMissing,
|
|
242
|
+
receiptButtonIcon: V ? "receipt" : q ? "send" : "paperclip",
|
|
243
|
+
receiptButtonVariant: V ? "ghost" : "outline",
|
|
244
|
+
showNoReceiptWarning: B && !V && q,
|
|
245
|
+
onUploadClick: K && !V ? () => $e.current?.click() : void 0,
|
|
246
|
+
onFileDrop: K && !V ? (e) => void It(e) : void 0,
|
|
247
|
+
onOpenReceiptInbox: K && !V ? () => x(T) : void 0,
|
|
248
|
+
onSubmitWithoutReceipt: K && !V ? () => y({
|
|
249
|
+
transactionId: T,
|
|
246
250
|
value: !0
|
|
247
251
|
}) : void 0,
|
|
248
|
-
onDeleteReceiptClick:
|
|
249
|
-
isUploading: ct.isPending ||
|
|
250
|
-
descriptionValue:
|
|
252
|
+
onDeleteReceiptClick: K && J ? () => S(!0) : void 0,
|
|
253
|
+
isUploading: ct.isPending || F.isPending,
|
|
254
|
+
descriptionValue: gt,
|
|
251
255
|
initialDescriptionValue: z,
|
|
252
|
-
onDescriptionChange: (e) =>
|
|
253
|
-
transactionId:
|
|
256
|
+
onDescriptionChange: (e) => _({
|
|
257
|
+
transactionId: T,
|
|
254
258
|
value: e.target.value
|
|
255
259
|
}),
|
|
256
260
|
onSaveDescription: () => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
+
let t = gt;
|
|
262
|
+
P.mutateAsync({
|
|
263
|
+
transactionId: T,
|
|
264
|
+
body: { description: t || null }
|
|
265
|
+
}).then(() => _((e) => e?.transactionId === T && e.value === t ? null : e)).catch(() => {
|
|
261
266
|
e.error(p.memoSaveFailed);
|
|
262
267
|
});
|
|
263
268
|
},
|
|
264
|
-
onCancelDescription: () =>
|
|
265
|
-
isSavingDescription:
|
|
266
|
-
isMemoEditable:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
269
|
+
onCancelDescription: () => _(null),
|
|
270
|
+
isSavingDescription: P.isPending,
|
|
271
|
+
isMemoEditable: O && St && !W,
|
|
272
|
+
isReadingReceipt: W,
|
|
273
|
+
isAccountingDisabled: W,
|
|
274
|
+
memoBadgeLabel: A?.source_of_data?.description === "generated" ? p.memoAiAssigned : void 0,
|
|
275
|
+
showApprovalCard: L !== "new",
|
|
276
|
+
isAutoApproved: Ht,
|
|
277
|
+
isManuallyApproved: Ut,
|
|
278
|
+
approverName: Q.approverName,
|
|
279
|
+
rejectionReason: A?.reject_reason ?? void 0,
|
|
280
|
+
hasAppliedPolicy: !!j,
|
|
281
|
+
greaterThanValue: Rt,
|
|
282
|
+
lessThanValue: zt,
|
|
283
|
+
ruleLabel: Wt,
|
|
284
|
+
showAccountingCard: D,
|
|
285
|
+
glCategory: X.glCategory,
|
|
286
|
+
initialGlCategory: Y,
|
|
287
|
+
glCategoryOptions: Mt,
|
|
288
|
+
onGlCategoryChange: (e) => C({
|
|
289
|
+
...X,
|
|
283
290
|
glCategory: e
|
|
284
291
|
}),
|
|
285
|
-
department:
|
|
286
|
-
initialDepartment:
|
|
287
|
-
departmentOptions:
|
|
288
|
-
onDepartmentChange: (e) =>
|
|
289
|
-
...
|
|
292
|
+
department: X.department,
|
|
293
|
+
initialDepartment: At,
|
|
294
|
+
departmentOptions: Nt,
|
|
295
|
+
onDepartmentChange: (e) => C({
|
|
296
|
+
...X,
|
|
290
297
|
department: e
|
|
291
298
|
}),
|
|
292
|
-
location:
|
|
293
|
-
initialLocation:
|
|
294
|
-
locationOptions:
|
|
295
|
-
onLocationChange: (e) =>
|
|
296
|
-
...
|
|
299
|
+
location: X.location,
|
|
300
|
+
initialLocation: jt,
|
|
301
|
+
locationOptions: Pt,
|
|
302
|
+
onLocationChange: (e) => C({
|
|
303
|
+
...X,
|
|
297
304
|
location: e
|
|
298
305
|
}),
|
|
299
306
|
onSaveAccounting: () => {
|
|
300
|
-
|
|
301
|
-
transactionId:
|
|
307
|
+
P.mutateAsync({
|
|
308
|
+
transactionId: T,
|
|
302
309
|
body: {
|
|
303
|
-
ledger_account_id: c(
|
|
304
|
-
department_id: c(
|
|
305
|
-
location_id: c(
|
|
310
|
+
ledger_account_id: c(X.glCategory),
|
|
311
|
+
department_id: c(X.department),
|
|
312
|
+
location_id: c(X.location)
|
|
306
313
|
}
|
|
307
|
-
}).then(() =>
|
|
314
|
+
}).then(() => C(null)).catch(() => {
|
|
308
315
|
e.error(p.accountingSaveFailed);
|
|
309
316
|
});
|
|
310
317
|
},
|
|
311
|
-
onCancelAccounting: () =>
|
|
312
|
-
isSavingAccounting:
|
|
313
|
-
glCategoryHighlight: l(
|
|
314
|
-
departmentHighlight: l(
|
|
315
|
-
locationHighlight: l(
|
|
318
|
+
onCancelAccounting: () => C(null),
|
|
319
|
+
isSavingAccounting: P.isPending,
|
|
320
|
+
glCategoryHighlight: l(A?.source_of_data?.ledger_account_id),
|
|
321
|
+
departmentHighlight: l(A?.source_of_data?.department_id),
|
|
322
|
+
locationHighlight: l(A?.source_of_data?.location_id),
|
|
316
323
|
showAuditHistoryCard: !0,
|
|
317
|
-
auditHistoryRows:
|
|
318
|
-
isLoadingAuditHistory:
|
|
319
|
-
isAuditHistoryError:
|
|
320
|
-
labels:
|
|
321
|
-
cardLabels:
|
|
322
|
-
fileViewerLabels:
|
|
323
|
-
children:
|
|
324
|
-
transactionId:
|
|
325
|
-
status:
|
|
326
|
-
approvalRequestId:
|
|
327
|
-
canUseApprovalRequestActions:
|
|
328
|
-
canUseForceActions:
|
|
329
|
-
canWrite:
|
|
330
|
-
hasOnlyViewPermission:
|
|
331
|
-
isDisabled:
|
|
332
|
-
showNoReceiptField:
|
|
333
|
-
isBulkMode:
|
|
324
|
+
auditHistoryRows: Ft,
|
|
325
|
+
isLoadingAuditHistory: I.isPending,
|
|
326
|
+
isAuditHistoryError: I.isError,
|
|
327
|
+
labels: We,
|
|
328
|
+
cardLabels: Ge,
|
|
329
|
+
fileViewerLabels: Je,
|
|
330
|
+
children: A && !k.isError ? /* @__PURE__ */ o(xe, {
|
|
331
|
+
transactionId: T,
|
|
332
|
+
status: L,
|
|
333
|
+
approvalRequestId: M?.id,
|
|
334
|
+
canUseApprovalRequestActions: bt,
|
|
335
|
+
canUseForceActions: xt,
|
|
336
|
+
canWrite: O,
|
|
337
|
+
hasOnlyViewPermission: at,
|
|
338
|
+
isDisabled: _t && !z,
|
|
339
|
+
showNoReceiptField: B && !V && L !== "approved",
|
|
340
|
+
isBulkMode: et,
|
|
334
341
|
currentItem: m + 1,
|
|
335
|
-
totalItems:
|
|
336
|
-
onCompleted:
|
|
337
|
-
onClose:
|
|
338
|
-
onPendingChange:
|
|
339
|
-
labels:
|
|
340
|
-
},
|
|
342
|
+
totalItems: w.length,
|
|
343
|
+
onCompleted: kt,
|
|
344
|
+
onClose: G,
|
|
345
|
+
onPendingChange: Xe,
|
|
346
|
+
labels: Ke
|
|
347
|
+
}, T) : null
|
|
341
348
|
}),
|
|
342
|
-
|
|
349
|
+
b && /* @__PURE__ */ o(Oe, {
|
|
343
350
|
isOpen: !0,
|
|
344
|
-
targetTransactionId:
|
|
345
|
-
onClose: () =>
|
|
351
|
+
targetTransactionId: b,
|
|
352
|
+
onClose: () => x(null),
|
|
346
353
|
onSingleTransactionUpdate: () => {
|
|
347
|
-
|
|
354
|
+
k.refetch();
|
|
348
355
|
}
|
|
349
356
|
}),
|
|
350
357
|
/* @__PURE__ */ o(ce, {
|
|
351
|
-
open:
|
|
352
|
-
onOpenChange:
|
|
353
|
-
isRemoving:
|
|
354
|
-
onConfirm: () => void
|
|
355
|
-
onCancel: () =>
|
|
358
|
+
open: Ze,
|
|
359
|
+
onOpenChange: S,
|
|
360
|
+
isRemoving: F.isPending,
|
|
361
|
+
onConfirm: () => void Lt(),
|
|
362
|
+
onCancel: () => S(!1)
|
|
356
363
|
})
|
|
357
364
|
] });
|
|
358
365
|
}
|