@tesouro/embedded-components-react 0.5.19 → 0.5.23

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 (134) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +2 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +4 -91
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +78 -83
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -49
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +47 -136
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +136 -33
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +33 -187
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +188 -75
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -21
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -232
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +223 -210
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +202 -108
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +126 -13
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -47
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +47 -53
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +49 -202
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +202 -31
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +32 -234
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -19
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +19 -434
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +436 -4
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -38
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +35 -231
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +233 -3
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -10
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +10 -110
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +112 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +43 -18
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -104
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +110 -206
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +213 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +6 -113
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +115 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +2 -2
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +10 -16
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +16 -20
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +21 -12
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +10 -9
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -2
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +1 -1
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +140 -139
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +139 -134
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +1 -1
  65. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -2
  66. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index.js +1 -1
  67. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index10.js +6 -6
  68. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index11.js +3 -0
  69. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index12.js +7 -7
  70. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +24 -0
  71. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index14.js +7 -7
  72. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index15.js +7 -7
  73. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index16.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index17.js +7 -7
  75. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index18.js +6 -6
  76. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index19.js +7 -7
  77. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index2.js +10 -0
  78. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index20.js +1 -1
  79. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index21.js +7 -7
  80. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index22.js +6 -6
  81. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index23.js +7 -7
  82. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index3.js +4 -4
  83. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index4.js +29 -0
  84. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index5.js +10 -0
  85. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index6.js +10 -0
  86. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index7.js +7 -7
  87. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index8.js +6 -6
  88. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index9.js +6 -6
  89. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index10.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index11.js +4 -4
  91. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index12.js +9 -9
  92. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index13.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index14.js +6 -6
  94. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index15.js +8 -8
  95. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index16.js +5 -5
  96. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index17.js +11 -11
  97. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index2.js +10 -0
  98. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index3.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index4.js +2 -2
  100. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index5.js +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index6.js +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index7.js +3 -3
  103. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index8.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index9.js +1 -1
  105. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index10.js +5 -5
  106. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index11.js +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index12.js +4 -4
  108. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index13.js +1 -1
  109. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index14.js +2 -2
  110. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index15.js +4 -4
  111. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index16.js +5 -5
  112. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index17.js +4 -4
  113. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index18.js +2 -2
  114. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index2.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index3.js +2 -2
  116. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index4.js +2 -2
  117. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index5.js +3 -3
  118. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index6.js +1 -1
  119. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index7.js +2 -2
  120. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index8.js +4 -4
  121. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index9.js +1 -1
  122. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +12 -1
  123. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  124. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  125. package/package.json +1 -1
  126. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index11.js +0 -3
  127. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index13.js +0 -24
  128. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index2.js +0 -10
  129. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index4.js +0 -29
  130. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index5.js +0 -10
  131. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index6.js +0 -10
  132. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index2.js +0 -9
  133. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index.js +0 -0
  134. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index.js +0 -0
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { RefreshingRootWidgetProvider as _ } from "./libs/tesouro-embedded-compo
14
14
  import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefetchWidget as b, useWidgetConfig as x, useWidgetError as S, useWidgetInitStaleForToken as C, useWidgetLoading as w } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
15
15
  import { BankAccountsWidget as T } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
16
16
  import { CounterpartsWidget as E } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
17
- import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js";
17
+ import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
18
18
  import { CardDetailsWidget as O } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
19
19
  import { CreditCardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
20
20
  import { DebitCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -263,7 +263,8 @@ async function q({ client: e, organizationId: t, payableId: n }) {
263
263
  return await y({
264
264
  client: e,
265
265
  organizationId: t,
266
- payableId: n
266
+ payableId: n,
267
+ includeLineItems: !0
267
268
  }), o;
268
269
  }
269
270
  //#endregion
@@ -10,23 +10,23 @@ import "./index14.js";
10
10
  import "./index27.js";
11
11
  import "./index28.js";
12
12
  import "./index39.js";
13
- import "./index41.js";
14
- import "./index47.js";
15
- import "./index56.js";
16
- import "./index58.js";
17
- import "./index60.js";
13
+ import "./index42.js";
14
+ import "./index48.js";
15
+ import "./index57.js";
16
+ import "./index59.js";
18
17
  import "./index61.js";
19
18
  import "./index62.js";
20
19
  import "./index63.js";
21
20
  import "./index64.js";
22
- import "./index68.js";
21
+ import "./index65.js";
23
22
  import "./index69.js";
24
23
  import "./index70.js";
25
24
  import "./index71.js";
26
25
  import "./index72.js";
27
- import "./index75.js";
28
- import "./index81.js";
26
+ import "./index73.js";
27
+ import "./index76.js";
29
28
  import "./index82.js";
30
29
  import "./index83.js";
31
- import { BillPayWidget as e } from "./index87.js";
30
+ import "./index84.js";
31
+ import { BillPayWidget as e } from "./index88.js";
32
32
  export { e as BillPayWidget };
@@ -1,94 +1,7 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index7.js";
3
- import { resolveVendor as n, resolveVendorName as r } from "./index8.js";
4
- import { formatBillMoney as i } from "./index2.js";
5
- import { resolveLineItemAmountMinorUnits as a } from "./index40.js";
6
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
7
- function o({ payable: o, lineItems: c, ledgerAccounts: l, labels: u, hasScheduledPayment: d, now: f, rejection: p, achInstructions: m, achInstructionsReadable: h = !1 }) {
8
- let g = o.currency, _ = (e) => i(e, g), v = t({
9
- apiStatus: o.status,
10
- dueDate: o.due_date,
11
- scheduledPaymentDate: o.scheduled_payment_date,
12
- hasScheduledPayment: d,
13
- now: f
14
- }), y = n(o), b = r(o), x = e(o.issued_at) || u.notProvided, S = e(o.due_date) || u.notProvided, C = [{
15
- label: u.vendorRow,
16
- value: b || u.notProvided,
17
- secondaryValue: y?.email ?? void 0
18
- }], w = h ? m?.account_number : void 0;
19
- w && C.push({
20
- label: u.bankAccountRow,
21
- value: u.bankAccountValue(w.slice(-4))
22
- });
23
- let T = [
24
- {
25
- label: u.invoiceNumberRow,
26
- value: o.document_id || u.notProvided
27
- },
28
- {
29
- label: u.issueDateRow,
30
- value: x
31
- },
32
- {
33
- label: u.dueDateRow,
34
- value: S
35
- },
36
- {
37
- label: u.poNumberRow,
38
- value: u.notProvided
39
- }
40
- ], E = new Map(l.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), D = c.map((e) => {
41
- let t = _(e.unit_price);
42
- return {
43
- id: e.id,
44
- description: e.name ?? e.description ?? "",
45
- glCodeLabel: (e.ledger_account_id ? E.get(e.ledger_account_id) : void 0) || u.glCodeMissing,
46
- quantityLabel: e.quantity != null && t ? u.quantityValue(String(e.quantity), t) : "",
47
- amountLabel: _(a(e)) ?? ""
48
- };
49
- }), O = [
50
- {
51
- label: u.subtotalRow,
52
- value: o.subtotal
53
- },
54
- {
55
- label: u.discountsRow,
56
- value: o.discount
57
- },
58
- {
59
- label: u.taxRow,
60
- value: o.tax_amount
61
- }
62
- ].map(({ label: e, value: t }) => ({
63
- label: e,
64
- value: _(t)
65
- })).filter((e) => !!e.value), k = _(o.total_amount);
66
- k && O.push({
67
- label: u.totalRow,
68
- value: k,
69
- emphasis: !0
70
- });
71
- let A = s(o);
72
- return {
73
- title: b,
74
- subtitle: u.subtitle,
75
- status: v.status,
76
- statusTone: v.tone,
77
- amountDueLabel: _(o.amount_due) ?? _(o.total_amount) ?? "",
78
- amountPaidLabel: A ? _(o.amount_paid) : void 0,
79
- paidOnLabel: A ? u.paidOnLabel(A) : void 0,
80
- invoiceDateLabel: x,
81
- dueDateLabel: S,
82
- dueDateTone: v.isOverdue ? "danger" : "default",
83
- payToItems: C,
84
- invoiceItems: T,
85
- lineItems: D,
86
- totals: O,
87
- rejection: p
88
- };
89
- }
90
- function s(t) {
91
- return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
2
+ var e = (e) => typeof e == "number" && Number.isFinite(e) && e > 0;
3
+ function t({ quantity: t, unit_price: n, subtotal: r }) {
4
+ return e(t) ? t : e(n) && e(r) && r % n === 0 ? r / n : 1;
92
5
  }
93
6
  //#endregion
94
- export { s as getPaidAtLabel, o as mapPayableToBillDetails };
7
+ export { t as resolveLineItemQuantity };
@@ -1,100 +1,95 @@
1
1
  import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
2
  import { derivePayableStatus as t } from "./index7.js";
3
- import { resolveVendor as n } from "./index8.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 "./index40.js";
8
- import { getPaidAtLabel as s } from "./index41.js";
3
+ import { resolveVendor as n, resolveVendorName as r } from "./index8.js";
4
+ import { formatBillMoney as i } from "./index2.js";
5
+ import { resolveLineItemAmountMinorUnits as a } from "./index40.js";
6
+ import { resolveLineItemQuantity as o } from "./index41.js";
9
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
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 : void 0, 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 = [
8
+ function s({ payable: s, lineItems: l, ledgerAccounts: u, labels: d, hasScheduledPayment: f, now: p, rejection: m, achInstructions: h, achInstructionsReadable: g = !1 }) {
9
+ let _ = s.currency, v = (e) => i(e, _), y = t({
10
+ apiStatus: s.status,
11
+ dueDate: s.due_date,
12
+ scheduledPaymentDate: s.scheduled_payment_date,
13
+ hasScheduledPayment: f,
14
+ now: p
15
+ }), b = n(s), x = r(s), S = e(s.issued_at) || d.notProvided, C = e(s.due_date) || d.notProvided, w = [{
16
+ label: d.vendorRow,
17
+ value: x || d.notProvided,
18
+ secondaryValue: b?.email ?? void 0
19
+ }], T = g ? h?.account_number : void 0;
20
+ T && w.push({
21
+ label: d.bankAccountRow,
22
+ value: d.bankAccountValue(T.slice(-4))
23
+ });
24
+ let E = [
25
+ {
26
+ label: d.invoiceNumberRow,
27
+ value: s.document_id || d.notProvided
28
+ },
17
29
  {
18
- label: h.subtotalRow,
19
- minorUnits: c.subtotal
30
+ label: d.issueDateRow,
31
+ value: S
20
32
  },
21
33
  {
22
- label: h.discountRow,
23
- minorUnits: c.discount
34
+ label: d.dueDateRow,
35
+ value: C
24
36
  },
25
37
  {
26
- label: h.taxRow,
27
- minorUnits: c.tax_amount
38
+ label: d.poNumberRow,
39
+ value: d.notProvided
28
40
  }
29
- ].map((e) => ({
30
- label: e.label,
31
- value: a(e.minorUnits, b)
32
- })).filter((e) => !!e.value), A = a(c.total_amount, b);
41
+ ], D = new Map(u.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), O = l.map((e) => {
42
+ let t = v(e.unit_price), n = String(o(e));
43
+ return {
44
+ id: e.id,
45
+ description: e.name ?? e.description ?? "",
46
+ glCodeLabel: (e.ledger_account_id ? D.get(e.ledger_account_id) : void 0) || d.glCodeMissing,
47
+ quantityLabel: t ? d.quantityValue(n, t) : d.quantityOnlyValue(n),
48
+ amountLabel: v(a(e)) ?? ""
49
+ };
50
+ }), k = [
51
+ {
52
+ label: d.subtotalRow,
53
+ value: s.subtotal
54
+ },
55
+ {
56
+ label: d.discountsRow,
57
+ value: s.discount
58
+ },
59
+ {
60
+ label: d.taxRow,
61
+ value: s.tax_amount
62
+ }
63
+ ].map(({ label: e, value: t }) => ({
64
+ label: e,
65
+ value: v(t)
66
+ })).filter((e) => !!e.value), A = v(s.total_amount);
33
67
  A && k.push({
34
- label: h.totalRow,
68
+ label: d.totalRow,
35
69
  value: A,
36
70
  emphasis: !0
37
71
  });
38
- let j = s(c);
72
+ let j = c(s);
39
73
  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: _
74
+ title: x,
75
+ subtitle: d.subtitle,
76
+ status: y.status,
77
+ statusTone: y.tone,
78
+ amountDueLabel: v(s.amount_due) ?? v(s.total_amount) ?? "",
79
+ amountPaidLabel: j ? v(s.amount_paid) : void 0,
80
+ paidOnLabel: j ? d.paidOnLabel(j) : void 0,
81
+ invoiceDateLabel: S,
82
+ dueDateLabel: C,
83
+ dueDateTone: y.isOverdue ? "danger" : "default",
84
+ payToItems: w,
85
+ invoiceItems: E,
86
+ lineItems: O,
87
+ totals: k,
88
+ rejection: m
97
89
  };
98
90
  }
91
+ function c(t) {
92
+ return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
93
+ }
99
94
  //#endregion
100
- export { c as buildBillDetailView };
95
+ export { c as getPaidAtLabel, s as mapPayableToBillDetails };
@@ -1,6 +1,101 @@
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { derivePayableStatus as t } from "./index7.js";
3
+ import { resolveVendor as n } from "./index8.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 "./index40.js";
8
+ import { resolveLineItemQuantity as s } from "./index41.js";
9
+ import { getPaidAtLabel as c } from "./index42.js";
1
10
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
2
- function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
- return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
11
+ function l({ payable: l, lineItems: u, glCodeOptions: d, glCodeRosterAvailable: f = !0, history: p, paymentHistory: m, approvalPolicy: h, labels: g, hasScheduledPayment: _, rejection: v, payableAchInstructions: y, payableAchInstructionsReadable: b = !1 }) {
12
+ let x = l.currency, S = t({
13
+ apiStatus: l.status,
14
+ dueDate: l.due_date,
15
+ scheduledPaymentDate: l.scheduled_payment_date,
16
+ hasScheduledPayment: _
17
+ }), C = n(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
18
+ {
19
+ label: g.subtotalRow,
20
+ minorUnits: l.subtotal
21
+ },
22
+ {
23
+ label: g.discountRow,
24
+ minorUnits: l.discount
25
+ },
26
+ {
27
+ label: g.taxRow,
28
+ minorUnits: l.tax_amount
29
+ }
30
+ ].map((e) => ({
31
+ label: e.label,
32
+ value: a(e.minorUnits, x)
33
+ })).filter((e) => !!e.value), j = a(l.total_amount, x);
34
+ j && A.push({
35
+ label: g.totalRow,
36
+ value: j,
37
+ emphasis: !0
38
+ });
39
+ let M = c(l);
40
+ return {
41
+ amountDue: a(r(l), x) ?? "",
42
+ amountPaid: M ? a(l.amount_paid, x) : void 0,
43
+ paidOnLabel: M ? g.paidOnLabel(M) : void 0,
44
+ invoiceDateLabel: D,
45
+ dueDateLabel: O,
46
+ dueDateTone: S.isOverdue ? "danger" : "default",
47
+ status: S.status,
48
+ statusTone: S.tone,
49
+ payTo: {
50
+ name: C?.name || g.notProvided,
51
+ email: C?.email ?? "",
52
+ methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
53
+ fields: E ? [
54
+ {
55
+ label: g.accountHolderFieldLabel,
56
+ value: w?.account_holder_name ?? ""
57
+ },
58
+ {
59
+ label: g.routingNumberFieldLabel,
60
+ value: w?.routing_number ?? ""
61
+ },
62
+ {
63
+ label: g.accountNumberFieldLabel,
64
+ value: T ?? "",
65
+ maskedValue: i(T ?? void 0)
66
+ }
67
+ ] : []
68
+ },
69
+ invoiceFields: [
70
+ {
71
+ label: g.invoiceDateRow,
72
+ value: D
73
+ },
74
+ {
75
+ label: g.dueDateRow,
76
+ value: O
77
+ },
78
+ {
79
+ label: g.invoiceNumberRow,
80
+ value: l.document_id || g.notProvided
81
+ }
82
+ ],
83
+ lineItems: u.map((e) => {
84
+ let t = a(e.unit_price, x), n = String(s(e));
85
+ return {
86
+ id: e.id,
87
+ description: e.name ?? e.description ?? "",
88
+ glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
89
+ qtyPriceLabel: t ? g.qtyPriceValue(n, t) : g.qtyOnlyValue(n),
90
+ amount: a(o(e), x) ?? ""
91
+ };
92
+ }),
93
+ amountRows: A,
94
+ approvalPolicy: h,
95
+ paymentHistory: m,
96
+ history: p,
97
+ rejection: v
98
+ };
4
99
  }
5
100
  //#endregion
6
- export { e as resolveEditorDismissal };
101
+ export { l as buildBillDetailView };
@@ -1,52 +1,6 @@
1
- import { derivePayableStatus as e } from "./index7.js";
2
- import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index17.js";
3
- import "../../ui/dist/index.js";
4
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
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);
2
+ function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
+ return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
50
4
  }
51
5
  //#endregion
52
- export { i as buildBillHistory };
6
+ export { e as resolveEditorDismissal };