@tesouro/embedded-components-react 0.5.37 → 0.5.38
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/index54.js +20 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.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
|
@@ -24,11 +24,23 @@ function o(e) {
|
|
|
24
24
|
function s(e) {
|
|
25
25
|
return (e / 100).toFixed(2);
|
|
26
26
|
}
|
|
27
|
-
function c({ values: e,
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart: a, counterpartBankAccountId: o, editedTotals: s, document: c }) {
|
|
28
|
+
let u = { currency: t };
|
|
29
|
+
if (i ? u.counterpart_id = i : a && (u.counterpart_id = null), i ? u.counterpart_bank_account_id = o ?? null : a && (u.counterpart_bank_account_id = null), e.invoiceNumber && (u.document_id = e.invoiceNumber), e.invoiceDate && (u.issued_at = e.invoiceDate), e.dueDate && (u.due_date = e.dueDate), c && (u.base64_encoded_file = c.base64EncodedFile, u.file_name = c.fileName), s && (u.discount = n(s.discount) ?? 0, u.tax_amount = n(s.tax) ?? 0, s.total !== void 0 && (u.total_amount = n(s.total) ?? 0)), r && !("total_amount" in u)) {
|
|
30
|
+
let e = l(r, s?.tax);
|
|
31
|
+
e !== void 0 && (u.total_amount = e);
|
|
32
|
+
}
|
|
33
|
+
return u;
|
|
34
|
+
}
|
|
35
|
+
function l(e, t) {
|
|
36
|
+
let r = !1, a = e.reduce((e, t) => {
|
|
37
|
+
if (!i(t)) return e;
|
|
38
|
+
let a = n(t.amount);
|
|
39
|
+
return a === null ? e : (r = !0, e + a);
|
|
40
|
+
}, 0);
|
|
41
|
+
if (r) return a + (t ? n(t) ?? 0 : 0);
|
|
42
|
+
}
|
|
43
|
+
function u(e) {
|
|
32
44
|
return e.filter(i).map((e) => {
|
|
33
45
|
let t = n(e.amount), i = r(e.quantity) ?? 1, a = n(e.price) ?? (t === null ? 0 : Math.round(t / i)), o = Math.round(i * a);
|
|
34
46
|
return {
|
|
@@ -41,11 +53,11 @@ function l(e) {
|
|
|
41
53
|
};
|
|
42
54
|
});
|
|
43
55
|
}
|
|
44
|
-
function
|
|
56
|
+
function d(e, t) {
|
|
45
57
|
return s(Math.round(o(e) * a(t)));
|
|
46
58
|
}
|
|
47
|
-
function
|
|
59
|
+
function f(e, t, n) {
|
|
48
60
|
return s(e.reduce((e, t) => e + a(t.amount), 0) + a(t) - a(n));
|
|
49
61
|
}
|
|
50
62
|
//#endregion
|
|
51
|
-
export {
|
|
63
|
+
export { f as calculateTotal, d as displayLineAmount, i as isPersistableLineItem, c as mapBillFormToPayload, u as mapLineItemsToPayload, n as parseMoneyToMinorUnits, r as parseQuantity };
|
|
@@ -65,6 +65,7 @@ function C({ payableId: t, form: _, counterpartId: v, isVendorPending: y, clearC
|
|
|
65
65
|
fileName: F.name
|
|
66
66
|
} : void 0, r = ee({
|
|
67
67
|
values: _.values,
|
|
68
|
+
initialLineItems: P ? void 0 : _.lineItems,
|
|
68
69
|
counterpartId: t ?? v,
|
|
69
70
|
clearCounterpart: C,
|
|
70
71
|
counterpartBankAccountId: e,
|
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.38", n = "9d7fbd97f8e1233db8f081ecb15fa1e53a8c632b", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|