@tesouro/embedded-components-react 0.5.53 → 0.5.55
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/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +62 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +49 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +104 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -28,16 +28,20 @@ function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart:
|
|
|
28
28
|
let m = { currency: t };
|
|
29
29
|
i ? m.counterpart_id = i : a && (m.counterpart_id = null), i ? m.counterpart_bank_account_id = o ?? null : a && (m.counterpart_bank_account_id = null), e.invoiceNumber && (m.document_id = e.invoiceNumber), e.invoiceDate && (m.issued_at = e.invoiceDate), e.dueDate && (m.due_date = e.dueDate);
|
|
30
30
|
let h = e.poNumber.trim();
|
|
31
|
-
if ((h || p) && (m.purchase_order_number = h || null), f && (m.base64_encoded_file = f.base64EncodedFile, m.file_name = f.fileName), s
|
|
31
|
+
if ((h || p) && (m.purchase_order_number = h || null), f && (m.base64_encoded_file = f.base64EncodedFile, m.file_name = f.fileName), s) {
|
|
32
|
+
let e = n(s.discount) ?? 0;
|
|
33
|
+
m.discount = e, m.tax_amount = n(s.tax) ?? 0, s.total !== void 0 && (m.total_amount = (n(s.total) ?? 0) + e);
|
|
34
|
+
}
|
|
35
|
+
if (c && d) {
|
|
32
36
|
let e = u(d), t = n(c.tax) ?? 0, r = n(c.discount) ?? 0, i = c.total === void 0 ? (e ?? 0) + t : (n(c.total) ?? 0) + r;
|
|
33
|
-
e !== void 0 && (m.subtotal = e), m.tax_amount = t, m.total_amount = i;
|
|
37
|
+
e !== void 0 && (m.subtotal = e), m.discount = r, m.tax_amount = t, m.total_amount = i;
|
|
34
38
|
} else if (r && !("total_amount" in m)) {
|
|
35
|
-
let e = l(r, s?.tax);
|
|
39
|
+
let e = l(r, { tax: s?.tax });
|
|
36
40
|
e !== void 0 && (m.total_amount = e);
|
|
37
41
|
}
|
|
38
42
|
return m;
|
|
39
43
|
}
|
|
40
|
-
function l(e, t) {
|
|
44
|
+
function l(e, { tax: t }) {
|
|
41
45
|
let r = u(e);
|
|
42
46
|
if (r !== void 0) return r + (t ? n(t) ?? 0 : 0);
|
|
43
47
|
}
|
|
@@ -17,27 +17,31 @@ function r(e) {
|
|
|
17
17
|
function i(e) {
|
|
18
18
|
return typeof e == "string" ? e : "";
|
|
19
19
|
}
|
|
20
|
-
function a(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
function a(e) {
|
|
21
|
+
if (typeof e.amount_due == "number") return e.amount_due;
|
|
22
|
+
if (typeof e.total_amount == "number") return e.total_amount - (e.discount ?? 0);
|
|
23
|
+
}
|
|
24
|
+
function o({ payable: o, lineItems: s }) {
|
|
25
|
+
let c = {
|
|
26
|
+
invoiceNumber: o.document_id ?? "",
|
|
27
|
+
invoiceDate: o.issued_at ?? "",
|
|
28
|
+
dueDate: o.due_date ?? "",
|
|
29
|
+
poNumber: i(o.purchase_order_number)
|
|
30
|
+
}, l = s.map((n) => ({
|
|
27
31
|
id: n.id,
|
|
28
32
|
description: n.name ?? "",
|
|
29
33
|
glCode: n.ledger_account_id ?? "",
|
|
30
34
|
quantity: String(t(n)),
|
|
31
35
|
price: r(n.unit_price),
|
|
32
36
|
amount: r(e(n))
|
|
33
|
-
})),
|
|
37
|
+
})), u = a(o);
|
|
34
38
|
return {
|
|
35
|
-
values:
|
|
36
|
-
lineItems:
|
|
37
|
-
discount: r(
|
|
38
|
-
tax: r(
|
|
39
|
-
total:
|
|
39
|
+
values: c,
|
|
40
|
+
lineItems: l.length ? l : [n()],
|
|
41
|
+
discount: r(o.discount),
|
|
42
|
+
tax: r(o.tax_amount),
|
|
43
|
+
total: u ? r(u) : ""
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
46
|
//#endregion
|
|
43
|
-
export { n as emptyLineItem,
|
|
47
|
+
export { n as emptyLineItem, o as mapPayableToBillForm };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.55", n = "79d2b352eef5c5ee7dd525ae6744ac25f85a262f", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|