@tesouro/embedded-components-react 0.4.31 → 0.5.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/README.md +17 -47
- package/dist/index.d.ts +2 -27
- package/dist/index.js +21 -27
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +96 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +49 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +129 -180
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +32 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +186 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +70 -226
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -219
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +221 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +220 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +119 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +13 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +43 -198
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +29 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +186 -222
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +229 -420
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +429 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +222 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +12 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +109 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +45 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +28 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +76 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +48 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -196
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +207 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +3 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +106 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +74 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +11 -247
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +34 -57
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +253 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +2 -48
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/labels.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +0 -639
- package/dist/lib/ExpenseApprovalPoliciesWidget.js +0 -3
- package/dist/lib/ExpenseRequirementsWidget.d.ts +0 -639
- package/dist/lib/ExpenseRequirementsWidget.js +0 -3
- package/dist/lib/ReceiptMatchWidget.d.ts +0 -640
- package/dist/lib/ReceiptMatchWidget.js +0 -3
|
@@ -1,52 +1,100 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { derivePayableStatus as t } from "./index8.js";
|
|
3
|
+
import { resolveVendor as n } from "./index9.js";
|
|
4
|
+
import { resolveAmountDueMinorUnits as r } from "./index21.js";
|
|
5
|
+
import { maskAccountNumber as i } from "./index23.js";
|
|
6
|
+
import { formatBillMoney as a } from "./index2.js";
|
|
7
|
+
import { resolveLineItemAmountMinorUnits as o } from "./index41.js";
|
|
8
|
+
import { getPaidAtLabel as s } from "./index42.js";
|
|
4
9
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
function c({ payable: c, lineItems: l, glCodeOptions: u, glCodeRosterAvailable: d = !0, history: f, paymentHistory: p, approvalPolicy: m, labels: h, hasScheduledPayment: g, rejection: _, payableAchInstructions: v, payableAchInstructionsReadable: y = !1 }) {
|
|
11
|
+
let b = c.currency, x = t({
|
|
12
|
+
apiStatus: c.status,
|
|
13
|
+
dueDate: c.due_date,
|
|
14
|
+
scheduledPaymentDate: c.scheduled_payment_date,
|
|
15
|
+
hasScheduledPayment: g
|
|
16
|
+
}), S = n(c), C = y ? v : S?.bank_account, w = C?.account_number, T = !!(C?.account_holder_name && C.routing_number && C.account_number), E = e(c.issued_at) || h.notProvided, D = e(c.due_date) || h.notProvided, O = new Map(u.map((e) => [e.value, e.label])), k = [
|
|
17
|
+
{
|
|
18
|
+
label: h.subtotalRow,
|
|
19
|
+
minorUnits: c.subtotal
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: h.discountRow,
|
|
23
|
+
minorUnits: c.discount
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: h.taxRow,
|
|
27
|
+
minorUnits: c.tax_amount
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
].map((e) => ({
|
|
30
|
+
label: e.label,
|
|
31
|
+
value: a(e.minorUnits, b)
|
|
32
|
+
})).filter((e) => !!e.value), A = a(c.total_amount, b);
|
|
33
|
+
A && k.push({
|
|
34
|
+
label: h.totalRow,
|
|
35
|
+
value: A,
|
|
36
|
+
emphasis: !0
|
|
37
|
+
});
|
|
38
|
+
let j = s(c);
|
|
39
|
+
return {
|
|
40
|
+
amountDue: a(r(c), b) ?? "",
|
|
41
|
+
amountPaid: j ? a(c.amount_paid, b) : void 0,
|
|
42
|
+
paidOnLabel: j ? h.paidOnLabel(j) : void 0,
|
|
43
|
+
invoiceDateLabel: E,
|
|
44
|
+
dueDateLabel: D,
|
|
45
|
+
dueDateTone: x.isOverdue ? "danger" : "default",
|
|
46
|
+
status: x.status,
|
|
47
|
+
statusTone: x.tone,
|
|
48
|
+
payTo: {
|
|
49
|
+
name: S?.name || h.notProvided,
|
|
50
|
+
email: S?.email ?? "",
|
|
51
|
+
methodLabel: T ? h.paymentInstructionsValue(w?.slice(-4) ?? "") : h.paymentInstructionsNotSet,
|
|
52
|
+
fields: T ? [
|
|
53
|
+
{
|
|
54
|
+
label: h.accountHolderFieldLabel,
|
|
55
|
+
value: C?.account_holder_name ?? ""
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: h.routingNumberFieldLabel,
|
|
59
|
+
value: C?.routing_number ?? ""
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: h.accountNumberFieldLabel,
|
|
63
|
+
value: w ?? "",
|
|
64
|
+
maskedValue: i(w ?? void 0)
|
|
65
|
+
}
|
|
66
|
+
] : []
|
|
67
|
+
},
|
|
68
|
+
invoiceFields: [
|
|
69
|
+
{
|
|
70
|
+
label: h.invoiceDateRow,
|
|
71
|
+
value: E
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: h.dueDateRow,
|
|
75
|
+
value: D
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: h.invoiceNumberRow,
|
|
79
|
+
value: c.document_id || h.notProvided
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
lineItems: l.map((e) => {
|
|
83
|
+
let t = a(e.unit_price, b);
|
|
84
|
+
return {
|
|
85
|
+
id: e.id,
|
|
86
|
+
description: e.name ?? e.description ?? "",
|
|
87
|
+
glCodeLabel: e.ledger_account_id ? O.get(e.ledger_account_id) ?? (d ? h.glCodeMissing : h.glCodeUnavailable) : h.glCodeMissing,
|
|
88
|
+
qtyPriceLabel: e.quantity != null && t ? h.qtyPriceValue(String(e.quantity), t) : "",
|
|
89
|
+
amount: a(o(e), b) ?? ""
|
|
90
|
+
};
|
|
91
|
+
}),
|
|
92
|
+
amountRows: k,
|
|
93
|
+
approvalPolicy: m,
|
|
94
|
+
paymentHistory: p,
|
|
95
|
+
history: f,
|
|
96
|
+
rejection: _
|
|
97
|
+
};
|
|
50
98
|
}
|
|
51
99
|
//#endregion
|
|
52
|
-
export {
|
|
100
|
+
export { c as buildBillDetailView };
|
|
@@ -1,140 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
markAsPaid: "Mark as paid",
|
|
5
|
-
reject: "Reject",
|
|
6
|
-
approve: "Approve",
|
|
7
|
-
cancel: "Cancel bill",
|
|
8
|
-
cancelScheduledPayment: "Cancel scheduled payment",
|
|
9
|
-
reopen: "Reopen bill",
|
|
10
|
-
forceApprove: "Approve",
|
|
11
|
-
forceReject: "Reject",
|
|
12
|
-
policyOverridesHeading: "Policy overrides",
|
|
13
|
-
decisionDialog: {
|
|
14
|
-
reject: {
|
|
15
|
-
title: "Reject this bill?",
|
|
16
|
-
description: "The bill goes back as rejected and nobody else is asked to approve it.",
|
|
17
|
-
confirmButton: "Reject bill",
|
|
18
|
-
reason: {
|
|
19
|
-
label: "Reason",
|
|
20
|
-
placeholder: "Tell the submitter what needs to change",
|
|
21
|
-
optionalHint: "Optional"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
cancel: {
|
|
25
|
-
title: "Cancel this bill?",
|
|
26
|
-
description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
|
|
27
|
-
confirmButton: "Cancel bill"
|
|
28
|
-
},
|
|
29
|
-
cancelScheduledPayment: {
|
|
30
|
-
title: "Cancel this scheduled payment?",
|
|
31
|
-
description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
|
|
32
|
-
confirmButton: "Cancel payment"
|
|
33
|
-
},
|
|
34
|
-
forceApprove: {
|
|
35
|
-
title: "Override approval policy?",
|
|
36
|
-
description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
|
|
37
|
-
confirmButton: "Override and approve",
|
|
38
|
-
noApprovalPolicy: {
|
|
39
|
-
title: "Approve this bill?",
|
|
40
|
-
description: "This bill has no approval policy applied. Approving now will be recorded in the audit history and can't be undone.",
|
|
41
|
-
confirmButton: "Approve bill"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
forceReject: {
|
|
45
|
-
title: "Override approval policy?",
|
|
46
|
-
description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
|
|
47
|
-
confirmButton: "Override and reject",
|
|
48
|
-
noApprovalPolicy: {
|
|
49
|
-
title: "Reject this bill?",
|
|
50
|
-
description: "This bill has no approval policy applied. Rejecting now will be recorded in the audit history and can't be undone.",
|
|
51
|
-
confirmButton: "Reject bill"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
cancelButton: "Cancel"
|
|
55
|
-
},
|
|
56
|
-
actionError: "Couldn't update this bill. Try again.",
|
|
57
|
-
actionSuccess: {
|
|
58
|
-
approve: "Bill approved.",
|
|
59
|
-
reject: "Bill rejected.",
|
|
60
|
-
markAsPaid: "Bill marked as paid.",
|
|
61
|
-
cancel: "Bill canceled.",
|
|
62
|
-
cancelScheduledPayment: "Scheduled payment canceled.",
|
|
63
|
-
reopen: "Bill reopened.",
|
|
64
|
-
forceApprove: "Bill approved, overriding the approval policy.",
|
|
65
|
-
forceReject: "Bill rejected, overriding the approval policy.",
|
|
66
|
-
forceApproveNoApprovalPolicy: "Bill approved.",
|
|
67
|
-
forceRejectNoApprovalPolicy: "Bill rejected."
|
|
68
|
-
}
|
|
69
|
-
}, t = (e) => `Payment scheduled for ${e}`, n = [
|
|
70
|
-
"reject",
|
|
71
|
-
"cancel",
|
|
72
|
-
"cancelScheduledPayment",
|
|
73
|
-
"forceApprove",
|
|
74
|
-
"forceReject"
|
|
75
|
-
];
|
|
76
|
-
function r(e, t) {
|
|
77
|
-
let n = e.reason ? {
|
|
78
|
-
...e.reason,
|
|
79
|
-
...t?.reason
|
|
80
|
-
} : void 0, r = e.noApprovalPolicy ? {
|
|
81
|
-
...e.noApprovalPolicy,
|
|
82
|
-
...t?.noApprovalPolicy
|
|
83
|
-
} : void 0, i = {
|
|
84
|
-
...e,
|
|
85
|
-
...t,
|
|
86
|
-
reason: n,
|
|
87
|
-
noApprovalPolicy: r
|
|
88
|
-
};
|
|
89
|
-
return n || delete i.reason, r || delete i.noApprovalPolicy, i;
|
|
90
|
-
}
|
|
91
|
-
function i(e, t) {
|
|
92
|
-
let i = {
|
|
93
|
-
...e,
|
|
94
|
-
...t
|
|
95
|
-
};
|
|
96
|
-
for (let a of n) i[a] = r(e[a], t?.[a]);
|
|
97
|
-
return i;
|
|
98
|
-
}
|
|
99
|
-
function a(t) {
|
|
100
|
-
let n = e;
|
|
101
|
-
return {
|
|
102
|
-
...n,
|
|
103
|
-
...t,
|
|
104
|
-
decisionDialog: i(n.decisionDialog, t?.decisionDialog),
|
|
105
|
-
actionSuccess: {
|
|
106
|
-
...n.actionSuccess,
|
|
107
|
-
...t?.actionSuccess
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
var o = {
|
|
112
|
-
paymentHistorySentLabel: "Payment sent",
|
|
113
|
-
paymentHistoryScheduledLabel: "Payment scheduled",
|
|
114
|
-
paymentHistoryCanceledLabel: "Payment canceled",
|
|
115
|
-
paymentHistoryOtherLabel: "Payment",
|
|
116
|
-
paymentHistoryMethodSuffix: (e, t) => `${e} via ${t}`,
|
|
117
|
-
paymentHistoryOverpaidLabel: (e) => `+${e} overpaid`,
|
|
118
|
-
paymentHistoryMarkedPaidExternalLabel: "Marked as paid manually",
|
|
119
|
-
paymentHistoryMarkedPaidLabel: "Marked as paid",
|
|
120
|
-
paymentHistoryPartiallyPaidExternalLabel: "Partial payment marked manually",
|
|
121
|
-
paymentHistoryPartiallyPaidLabel: "Partial payment",
|
|
122
|
-
paymentHistoryRevertedLabel: "Payment reverted",
|
|
123
|
-
paymentHistoryMethodLabels: {
|
|
124
|
-
ach: "ACH",
|
|
125
|
-
us_ach: "ACH",
|
|
126
|
-
wire: "Wire",
|
|
127
|
-
check: "Check",
|
|
128
|
-
paper_check: "Check",
|
|
129
|
-
bank_account: "Bank transfer",
|
|
130
|
-
card: "Card"
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
function s(e) {
|
|
134
|
-
return {
|
|
135
|
-
...o.paymentHistoryMethodLabels,
|
|
136
|
-
...e
|
|
137
|
-
};
|
|
2
|
+
function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
|
|
3
|
+
return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
|
|
138
4
|
}
|
|
139
5
|
//#endregion
|
|
140
|
-
export { e as
|
|
6
|
+
export { e as resolveEditorDismissal };
|
|
@@ -1,38 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { derivePayableStatus as e } from "./index8.js";
|
|
2
|
+
import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index17.js";
|
|
3
|
+
import "../../ui/dist/index.js";
|
|
2
4
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
|
|
3
|
-
var n =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
5
|
+
var n = /* @__PURE__ */ new Set([
|
|
6
|
+
"credit_note_linked",
|
|
7
|
+
"credit_note_unlinked",
|
|
8
|
+
"line_item_added",
|
|
9
|
+
"line_item_updated",
|
|
10
|
+
"line_item_removed",
|
|
11
|
+
"deleted"
|
|
12
|
+
]);
|
|
13
|
+
function r(n, r, i) {
|
|
14
|
+
switch (n) {
|
|
15
|
+
case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
|
|
16
|
+
case "payable_updated": return i.billUpdated;
|
|
17
|
+
case "file_attached": return i.attachmentAdded;
|
|
18
|
+
case "submitted_for_approval": return i.submittedForApproval;
|
|
19
|
+
case "approval_requested": return i.approvalRequested;
|
|
20
|
+
case "approval_action": {
|
|
21
|
+
let e = r?.action, t = r?.reject_reason;
|
|
22
|
+
return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
|
|
23
|
+
}
|
|
24
|
+
case "auto_approved": return i.autoApproved;
|
|
25
|
+
case "reopened": return i.reopened;
|
|
26
|
+
case "marked_as_paid": return i.markedAsPaid;
|
|
27
|
+
case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
|
|
28
|
+
case "payment_reverted": return i.paymentReverted;
|
|
29
|
+
case "status_changed": {
|
|
30
|
+
let n = r?.new_status;
|
|
31
|
+
if (typeof n != "string") return;
|
|
32
|
+
let a = e({ apiStatus: n }).status;
|
|
33
|
+
return i.statusChanged(t[a] ?? t.unknown);
|
|
34
|
+
}
|
|
35
|
+
default: return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function i(e, t, i) {
|
|
39
|
+
let a = new Map(t.map((e) => [e.id, e.name]));
|
|
40
|
+
return e.filter((e) => !n.has(e.event_type)).map((e) => {
|
|
41
|
+
let t = r(e.event_type, e.event_data, i);
|
|
42
|
+
if (!t) return;
|
|
43
|
+
let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
|
|
44
|
+
return {
|
|
45
|
+
id: e.id,
|
|
46
|
+
dateLabel: i.dateLabel(e.timestamp),
|
|
47
|
+
description: n ? i.byActor(t, n) : t
|
|
48
|
+
};
|
|
49
|
+
}).filter((e) => !!e);
|
|
36
50
|
}
|
|
37
51
|
//#endregion
|
|
38
|
-
export {
|
|
52
|
+
export { i as buildBillHistory };
|