@tesouro/embedded-components-react 0.7.30 → 0.7.32
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/lib/monite-sdk.d.ts +0 -1
- package/dist/lib/monite-sdk.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +41 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +55 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +2 -55
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +53 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +36 -51
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +71 -38
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +6 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +79 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +1 -79
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +58 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +42 -56
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +1 -44
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +568 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +0 -577
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +160 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +0 -159
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +0 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +16 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +19 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +27 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index233.js +1 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +93 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +10 -91
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index236.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index237.js +18 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index238.js +73 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index239.js +1 -77
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index240.js +127 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +0 -127
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index242.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index243.js +54 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js +5 -56
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js +1 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js +64 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +120 -62
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js +21 -120
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js +6 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index250.js +35 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index251.js +6 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index252.js +56 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index253.js +69 -53
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +25 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index255.js +1 -28
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index256.js +61 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +17 -57
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index259.js +181 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +1 -185
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +2 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +64 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +31 -61
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +6 -28
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +29 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index267.js +42 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index268.js +11 -44
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index269.js +15 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index270.js +4 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index271.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index272.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index273.js +12 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index274.js +6 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index275.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index276.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index277.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index278.js +32 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index279.js +8 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index280.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index281.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index282.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index283.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index284.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index285.js +111 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index286.js +62 -110
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index287.js +1 -66
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index288.js +199 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index289.js +0 -199
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index290.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index291.js +38 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index292.js +6 -38
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index293.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index294.js +13 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index295.js +7 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index296.js +5 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index297.js +359 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index298.js +1 -412
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index299.js +22 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index300.js +91 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index301.js +18 -91
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index302.js +7 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index303.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index304.js +182 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index305.js +96 -178
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index306.js +1 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index307.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index308.js +55 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index309.js +44 -53
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index310.js +1 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index311.js +21 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index312.js +1 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index313.js +161 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index314.js +0 -161
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index315.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index316.js +61 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index317.js +44 -60
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index318.js +48 -44
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index319.js +82 -48
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index320.js +7 -83
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index321.js +305 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index322.js +1 -307
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index323.js +32 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index324.js +1 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index325.js +29 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index326.js +1 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index327.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index328.js +160 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index329.js +0 -160
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index330.js +37 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index331.js +33 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index332.js +3 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index333.js +102 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index334.js +172 -88
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index335.js +116 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index336.js +191 -114
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index337.js +11 -209
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index338.js +15 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index339.js +28 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index340.js +1 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index341.js +241 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index342.js +0 -241
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index343.js +36 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index344.js +138 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index345.js +1 -142
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index346.js +166 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index347.js +25 -166
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index348.js +19 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index349.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index350.js +5 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index351.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index352.js +18 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index353.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index354.js +5 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index355.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index356.js +14 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index357.js +9 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index358.js +26 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index359.js +11 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index360.js +8 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index361.js +24 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index362.js +14 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index363.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index364.js +100 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index365.js +42 -98
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index366.js +27 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index367.js +1 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index368.js +105 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index369.js +35 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index370.js +166 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index371.js +202 -163
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index372.js +87 -207
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index373.js +17 -90
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index374.js +158 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index375.js +87 -143
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index376.js +42 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index377.js +4 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index378.js +24 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index379.js +73 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index380.js +16 -74
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index381.js +19 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +5 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index383.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index384.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index385.js +131 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index386.js +4 -129
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index387.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index388.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index389.js +221 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index390.js +31 -219
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index391.js +11 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index392.js +34 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index393.js +180 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +14 -182
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index395.js +204 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index396.js +88 -192
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index397.js +61 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index398.js +54 -63
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index399.js +83 -46
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index400.js +40 -91
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index401.js +75 -39
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index402.js +71 -63
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index403.js +12 -85
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index404.js +24 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index405.js +16 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index406.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index407.js +23 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index408.js +0 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index409.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index410.js +32 -53
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index411.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index412.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index413.js +15 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index414.js +29 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index415.js +27 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index416.js +2 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index417.js +97 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index418.js +0 -97
|
@@ -5,18 +5,16 @@ import { useLingui as r } from "@lingui/react";
|
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index302.js
|
|
6
6
|
var i = (i, a, o, s) => {
|
|
7
7
|
let { api: c, queryClient: l } = t(), { i18n: u } = r();
|
|
8
|
-
return c.finops.
|
|
9
|
-
onSuccess: () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
},
|
|
8
|
+
return c.finops.postApprovalRequestsIdApprove.useMutation({ path: { approval_request_id: i } }, {
|
|
9
|
+
onSuccess: () => (c.finops.getApprovalRequests.invalidateQueries(l), n.success(u._("Payable \"{document_id}\" has been approved", { document_id: s ?? "document id is unknown" })), a?.(o ?? ""), new Promise((e) => {
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
Promise.all([c.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: o ?? "" } } }, l), c.finops.getPayables.invalidateQueries(l)]).then(() => e());
|
|
12
|
+
}, 500);
|
|
13
|
+
})),
|
|
16
14
|
onError: (t) => {
|
|
17
15
|
n.error(e(u, t));
|
|
18
16
|
}
|
|
19
17
|
});
|
|
20
18
|
};
|
|
21
19
|
//#endregion
|
|
22
|
-
export { i as
|
|
20
|
+
export { i as useApproveApprovalRequest };
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import { getAPIErrorMessage as e } from "./index26.js";
|
|
2
|
-
import { useMoniteContext as t } from "./index45.js";
|
|
3
|
-
import { toast as n } from "react-hot-toast";
|
|
4
|
-
import { useLingui as r } from "@lingui/react";
|
|
5
1
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index303.js
|
|
6
|
-
var
|
|
7
|
-
let { api: c, queryClient: l } = t(), { i18n: u } = r();
|
|
8
|
-
return c.finops.postApprovalRequestsIdApprove.useMutation({ path: { approval_request_id: i } }, {
|
|
9
|
-
onSuccess: () => (c.finops.getApprovalRequests.invalidateQueries(l), n.success(u._("Payable \"{document_id}\" has been approved", { document_id: s ?? "document id is unknown" })), a?.(o ?? ""), new Promise((e) => {
|
|
10
|
-
setTimeout(() => {
|
|
11
|
-
Promise.all([c.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: o ?? "" } } }, l), c.finops.getPayables.invalidateQueries(l)]).then(() => e());
|
|
12
|
-
}, 500);
|
|
13
|
-
})),
|
|
14
|
-
onError: (t) => {
|
|
15
|
-
n.error(e(u, t));
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
2
|
+
var e = (e) => e.source_of_payable_data === "ocr" && e.ocr_status === "processing";
|
|
19
3
|
//#endregion
|
|
20
|
-
export {
|
|
4
|
+
export { e as isPayableInOCRProcessing };
|
|
@@ -1,4 +1,184 @@
|
|
|
1
|
+
import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../shared/data-access/dist/index.js";
|
|
3
|
+
import { useMoniteContext as t } from "./index45.js";
|
|
4
|
+
import { useCurrencies as n } from "./index63.js";
|
|
5
|
+
import { useUserPermissions as r } from "./index111.js";
|
|
6
|
+
import { useEntityUserByAuthToken as i } from "./index139.js";
|
|
7
|
+
import { usePayablePaymentIntentsAndRecords as a } from "./index144.js";
|
|
8
|
+
import "./index173.js";
|
|
9
|
+
import { useGetPayableCounterpart as o } from "./index264.js";
|
|
10
|
+
import { usePayButtonVisibility as s } from "./index267.js";
|
|
11
|
+
import { useGetPayableById as c } from "./index269.js";
|
|
12
|
+
import { useGetPayableLineItems as l } from "./index270.js";
|
|
13
|
+
import { useGetPayableApprovalRequests as u } from "./index271.js";
|
|
14
|
+
import { useCreatePayable as ee } from "./index272.js";
|
|
15
|
+
import { useUpdatePayable as d } from "./index273.js";
|
|
16
|
+
import { useCreatePayableLineItem as te } from "./index274.js";
|
|
17
|
+
import { useUpdatePayableLineItem as ne } from "./index275.js";
|
|
18
|
+
import { useDeletePayableLineItem as re } from "./index276.js";
|
|
19
|
+
import { useCancelPayableById as ie } from "./index277.js";
|
|
20
|
+
import { useSubmitPayableForApproval as ae } from "./index278.js";
|
|
21
|
+
import { useForceRejectPayable as oe } from "./index279.js";
|
|
22
|
+
import { useForceApprovePayable as se } from "./index280.js";
|
|
23
|
+
import { useReopenPayable as ce } from "./index281.js";
|
|
24
|
+
import { useDeletePayable as le } from "./index282.js";
|
|
25
|
+
import { prepareLineItemSubmit as f } from "./index285.js";
|
|
26
|
+
import { usePaymentHandler as ue } from "./index300.js";
|
|
27
|
+
import { useRejectApprovalRequest as de } from "./index301.js";
|
|
28
|
+
import { useApproveApprovalRequest as fe } from "./index302.js";
|
|
29
|
+
import { isPayableInOCRProcessing as p } from "./index303.js";
|
|
30
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as pe } from "react";
|
|
31
|
+
import { toast as _ } from "react-hot-toast";
|
|
32
|
+
import { useLingui as me } from "@lingui/react";
|
|
1
33
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index304.js
|
|
2
|
-
|
|
34
|
+
function v({ id: v, enableGLCodes: he, shouldOpenInEditMode: ge, onSaved: y, onCanceled: _e, onSubmitted: ve, onRejected: b, onApproved: x, onReopened: ye, onDeleted: be, onPay: S }) {
|
|
35
|
+
let { api: C, queryClient: w } = t(), T = r(), { i18n: E } = me(), { formatToMinorUnits: D } = n(), { data: O } = i(), [k, A] = pe(ge ?? !1), j = C.finops.getPayablesId.getQueryData({ path: { payable_id: v ?? "" } }, w), M = j && p(j), { data: N, error: xe, isLoading: Se, refetch: P } = c(v ?? "", M, k), F = N?.status, { payablesPaymentIntentsRecord: Ce, refetch: I } = a(v ? [v] : []), { showPayButton: we, intentsAnalysis: Te } = s({
|
|
36
|
+
payable: N,
|
|
37
|
+
payableRecentPaymentRecordByIntent: Ce?.[v ?? ""] || []
|
|
38
|
+
}), { handlePay: L, modalComponent: Ee } = ue(v, N?.counterpart_id, () => {
|
|
39
|
+
P(), I();
|
|
40
|
+
}, Te.idPaymentIntentInCreated), { counterpart: De, isCounterpartAIMatched: Oe, AISuggestions: ke } = o({ payable: N });
|
|
41
|
+
h(() => {
|
|
42
|
+
if (M) return () => void C.finops.getPayables.invalidateQueries(w);
|
|
43
|
+
}, [
|
|
44
|
+
C,
|
|
45
|
+
M,
|
|
46
|
+
w
|
|
47
|
+
]);
|
|
48
|
+
let { data: Ae } = l(v ?? ""), R = Ae?.data, { data: z } = u(v ?? "", F), B = z?.data?.find((e) => e.status === "waiting" && !e.approved_by?.includes(O?.id ?? "") && e.user_ids?.includes(O?.id ?? "")), V = T.has(e.PayableWriteOrg), H = T.has(e.PayableWriteOrg), U = T.has(e.PayableWriteOrg), W = T.has(e.PayableApproveOrg), G = T.has(e.PayablePayOrg), K = T.has(e.PayableWriteOrg), q = T.has(e.PayableWriteOrg), J = ee(), Y = d(), X = te(v ?? ""), je = ne(v ?? ""), Me = re(v ?? ""), { mutateAsync: Ne, isPending: Pe } = ie(v ?? "", _e), { submitForApproval: Fe, isPending: Z } = ae({
|
|
49
|
+
payableId: v ?? "",
|
|
50
|
+
AISuggestions: ke?.suggested_counterpart,
|
|
51
|
+
isCounterpartAIMatched: Oe,
|
|
52
|
+
counterpartId: De?.id,
|
|
53
|
+
onSubmitted: ve
|
|
54
|
+
}), { mutateAsync: Ie, isPending: Le } = de(B?.id ?? "", b, v, N?.document_id), { mutateAsync: Re, isPending: ze } = fe(B?.id ?? "", x, v, N?.document_id), { mutateAsync: Be, isPending: Ve } = oe(v ?? "", b), { mutateAsync: He, isPending: Q } = se(v ?? "", x), { mutateAsync: Ue, isPending: We } = ce(v ?? "", ye), { mutateAsync: Ge } = le(v ?? "", be), Ke = J.isPending || Y.isPending || Pe || Z || Ve || Q || We || Le || ze, qe = J.isPending || Y.isPending || Z, $ = m(() => T.has(e.PayableApproveOrg), [T]), Je = g(() => {
|
|
55
|
+
if (!v) return ["cancelEdit", "save"];
|
|
56
|
+
if (F === "draft") return k ? H ? ["cancelEdit", "save"] : [] : [...V ? ["cancel"] : [], ...H ? ["edit"] : []];
|
|
57
|
+
if (F === "new") return k ? H ? ["cancelEdit", "save"] : [] : [
|
|
58
|
+
...V ? ["cancel"] : [],
|
|
59
|
+
...H ? ["edit"] : [],
|
|
60
|
+
...U ? ["submit"] : []
|
|
61
|
+
];
|
|
62
|
+
if (F === "approve_in_progress") {
|
|
63
|
+
let e = (z?.data?.length ?? 0) > 0 && z?.data?.[0]?.status === "waiting" && B !== void 0, t = $();
|
|
64
|
+
return [...e ? ["reject", "approve"] : [], ...W && t ? ["forceReject", "forceApprove"] : []];
|
|
65
|
+
}
|
|
66
|
+
return (F === "waiting_to_be_paid" || F === "partially_paid") && G && Number(N?.amount_to_pay) > 0 ? ["pay"] : F === "rejected" && K ? ["reopen"] : F === "canceled" && q ? ["delete"] : [];
|
|
67
|
+
}, [
|
|
68
|
+
v,
|
|
69
|
+
F,
|
|
70
|
+
k,
|
|
71
|
+
H,
|
|
72
|
+
V,
|
|
73
|
+
U,
|
|
74
|
+
W,
|
|
75
|
+
K,
|
|
76
|
+
q,
|
|
77
|
+
G,
|
|
78
|
+
z,
|
|
79
|
+
B,
|
|
80
|
+
N?.amount_to_pay,
|
|
81
|
+
$
|
|
82
|
+
]), Ye = async (e, t) => {
|
|
83
|
+
let n = await J.mutateAsync({ ...e }, { onSuccess: (e) => {
|
|
84
|
+
_.success(E._("Payable “{createdPayableDocument_id}” has been created", { createdPayableDocument_id: e.document_id })), C.finops.getCounterparts.invalidateQueries({ parameters: { query: { is_vendor: !0 } } }, w);
|
|
85
|
+
} });
|
|
86
|
+
if (t) {
|
|
87
|
+
let e = [];
|
|
88
|
+
t?.forEach((t) => {
|
|
89
|
+
n.currency && !t.id && e.push(X.mutateAsync({
|
|
90
|
+
path: { payable_id: n.id },
|
|
91
|
+
body: f(n.currency, t, D, { allowLedgerUpdate: !1 })
|
|
92
|
+
}));
|
|
93
|
+
}), await Promise.all(e);
|
|
94
|
+
}
|
|
95
|
+
await Promise.all([
|
|
96
|
+
C.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: n.id } } }, w),
|
|
97
|
+
C.finops.getPayables.invalidateQueries(w),
|
|
98
|
+
C.finops.getPayablesIdLineItems.invalidateQueries({ parameters: { path: { payable_id: n.id } } }, w)
|
|
99
|
+
]), k && A(!1), y?.(n.id);
|
|
100
|
+
}, Xe = async (e, t, n, r) => {
|
|
101
|
+
let i = await Y.mutateAsync({
|
|
102
|
+
path: { payable_id: e },
|
|
103
|
+
body: t
|
|
104
|
+
}, { onSuccess: (e) => {
|
|
105
|
+
_.success(E._("Payable “{updatedPayableDocument_id}” has been updated", { updatedPayableDocument_id: e.document_id }));
|
|
106
|
+
} });
|
|
107
|
+
if (n && r) {
|
|
108
|
+
let e = [];
|
|
109
|
+
n?.forEach((t) => {
|
|
110
|
+
i.currency && !t.id && e.push(X.mutateAsync({
|
|
111
|
+
path: { payable_id: i.id },
|
|
112
|
+
body: f(i.currency, t, D)
|
|
113
|
+
}));
|
|
114
|
+
}), r?.lineItems?.forEach((t, r) => {
|
|
115
|
+
if (!t) return;
|
|
116
|
+
let { id: a, ...o } = t, s = Object.values(o).some((e) => e), c = n[r]?.id, l = n[r], u = !a && !!s && !!c && !!l;
|
|
117
|
+
i.currency && u && e.push(je.mutateAsync({
|
|
118
|
+
path: {
|
|
119
|
+
payable_id: i.id,
|
|
120
|
+
line_item_id: c
|
|
121
|
+
},
|
|
122
|
+
body: f(i.currency, l, D, {
|
|
123
|
+
allowLedgerUpdate: he && !!o.ledger_account_id,
|
|
124
|
+
previous: R?.find((e) => e.id === c)?.ledger_account_id
|
|
125
|
+
})
|
|
126
|
+
}));
|
|
127
|
+
}), R?.forEach((t) => {
|
|
128
|
+
n?.find((e) => e.id === t.id) || e.push(Me.mutateAsync({ path: {
|
|
129
|
+
payable_id: i.id,
|
|
130
|
+
line_item_id: t.id
|
|
131
|
+
} }));
|
|
132
|
+
}), await Promise.all(e);
|
|
133
|
+
}
|
|
134
|
+
await C.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: i.id } } }, w), k && A(!1), y?.(e);
|
|
135
|
+
}, Ze = m(() => {
|
|
136
|
+
if (N) {
|
|
137
|
+
if (!S) return L();
|
|
138
|
+
if (S?.length < 2) return S(N.id);
|
|
139
|
+
S(N.id, void 0, {
|
|
140
|
+
resolve: (e) => {
|
|
141
|
+
e?.showToast && _.success(E._("Payment flow started")), P(), I();
|
|
142
|
+
},
|
|
143
|
+
reject: (e, t) => {
|
|
144
|
+
t?.showToast && _.error(E._("Payment failed or cancelled")), P(), I();
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}, [
|
|
149
|
+
E,
|
|
150
|
+
N,
|
|
151
|
+
L,
|
|
152
|
+
S,
|
|
153
|
+
P,
|
|
154
|
+
I
|
|
155
|
+
]);
|
|
156
|
+
return {
|
|
157
|
+
payable: N,
|
|
158
|
+
isLoading: Se || Ke || qe,
|
|
159
|
+
payableQueryError: xe,
|
|
160
|
+
isEdit: k,
|
|
161
|
+
permissions: Je,
|
|
162
|
+
lineItems: R,
|
|
163
|
+
showPayButton: we,
|
|
164
|
+
currentUserApprovalRequest: B,
|
|
165
|
+
actions: {
|
|
166
|
+
setEdit: A,
|
|
167
|
+
createInvoice: Ye,
|
|
168
|
+
saveInvoice: Xe,
|
|
169
|
+
submitInvoice: Fe,
|
|
170
|
+
rejectInvoice: Ie,
|
|
171
|
+
approveInvoice: Re,
|
|
172
|
+
forceRejectInvoice: Be,
|
|
173
|
+
forceApproveInvoice: He,
|
|
174
|
+
reopenInvoice: Ue,
|
|
175
|
+
cancelInvoice: Ne,
|
|
176
|
+
deleteInvoice: Ge,
|
|
177
|
+
payInvoice: Ze,
|
|
178
|
+
handlePay: L,
|
|
179
|
+
modalComponent: Ee
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
3
183
|
//#endregion
|
|
4
|
-
export {
|
|
184
|
+
export { v as usePayableDetails };
|
|
@@ -1,184 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../shared/data-access/dist/index.js";
|
|
1
|
+
import { getAPIErrorMessage as e } from "./index26.js";
|
|
3
2
|
import { useMoniteContext as t } from "./index45.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { usePayablePaymentIntentsAndRecords as a } from "./index144.js";
|
|
3
|
+
import { CenteredContentBox as n } from "./index124.js";
|
|
4
|
+
import "./index125.js";
|
|
5
|
+
import { useFileInput as r } from "./index165.js";
|
|
8
6
|
import "./index173.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useCreatePayableLineItem as te } from "./index275.js";
|
|
17
|
-
import { useUpdatePayableLineItem as ne } from "./index276.js";
|
|
18
|
-
import { useDeletePayableLineItem as re } from "./index277.js";
|
|
19
|
-
import { useCancelPayableById as ie } from "./index278.js";
|
|
20
|
-
import { useSubmitPayableForApproval as ae } from "./index279.js";
|
|
21
|
-
import { useForceRejectPayable as oe } from "./index280.js";
|
|
22
|
-
import { useForceApprovePayable as se } from "./index281.js";
|
|
23
|
-
import { useReopenPayable as ce } from "./index282.js";
|
|
24
|
-
import { useDeletePayable as le } from "./index283.js";
|
|
25
|
-
import { prepareLineItemSubmit as f } from "./index286.js";
|
|
26
|
-
import { usePaymentHandler as ue } from "./index301.js";
|
|
27
|
-
import { useRejectApprovalRequest as de } from "./index302.js";
|
|
28
|
-
import { useApproveApprovalRequest as fe } from "./index303.js";
|
|
29
|
-
import { isPayableInOCRProcessing as p } from "./index304.js";
|
|
30
|
-
import { useCallback as m, useEffect as h, useMemo as g, useState as pe } from "react";
|
|
31
|
-
import { toast as _ } from "react-hot-toast";
|
|
32
|
-
import { useLingui as me } from "@lingui/react";
|
|
7
|
+
import { useMemo as i, useState as a } from "react";
|
|
8
|
+
import { Fragment as o, jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
9
|
+
import { toast as l } from "react-hot-toast";
|
|
10
|
+
import { Box as u, Button as d, CircularProgress as f, Typography as p, alpha as m, useTheme as h } from "@mui/material";
|
|
11
|
+
import { useLingui as g } from "@lingui/react";
|
|
12
|
+
import _ from "@mui/icons-material/AttachFile";
|
|
13
|
+
import v from "@mui/icons-material/CloudUploadOutlined";
|
|
33
14
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index305.js
|
|
34
|
-
|
|
35
|
-
let {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (F === "new") return k ? H ? ["cancelEdit", "save"] : [] : [
|
|
58
|
-
...V ? ["cancel"] : [],
|
|
59
|
-
...H ? ["edit"] : [],
|
|
60
|
-
...U ? ["submit"] : []
|
|
61
|
-
];
|
|
62
|
-
if (F === "approve_in_progress") {
|
|
63
|
-
let e = (z?.data?.length ?? 0) > 0 && z?.data?.[0]?.status === "waiting" && B !== void 0, t = $();
|
|
64
|
-
return [...e ? ["reject", "approve"] : [], ...W && t ? ["forceReject", "forceApprove"] : []];
|
|
65
|
-
}
|
|
66
|
-
return (F === "waiting_to_be_paid" || F === "partially_paid") && G && Number(N?.amount_to_pay) > 0 ? ["pay"] : F === "rejected" && K ? ["reopen"] : F === "canceled" && q ? ["delete"] : [];
|
|
67
|
-
}, [
|
|
68
|
-
v,
|
|
69
|
-
F,
|
|
70
|
-
k,
|
|
71
|
-
H,
|
|
72
|
-
V,
|
|
73
|
-
U,
|
|
74
|
-
W,
|
|
75
|
-
K,
|
|
76
|
-
q,
|
|
77
|
-
G,
|
|
78
|
-
z,
|
|
79
|
-
B,
|
|
80
|
-
N?.amount_to_pay,
|
|
81
|
-
$
|
|
82
|
-
]), Ye = async (e, t) => {
|
|
83
|
-
let n = await J.mutateAsync({ ...e }, { onSuccess: (e) => {
|
|
84
|
-
_.success(E._("Payable “{createdPayableDocument_id}” has been created", { createdPayableDocument_id: e.document_id })), C.finops.getCounterparts.invalidateQueries({ parameters: { query: { is_vendor: !0 } } }, w);
|
|
85
|
-
} });
|
|
86
|
-
if (t) {
|
|
87
|
-
let e = [];
|
|
88
|
-
t?.forEach((t) => {
|
|
89
|
-
n.currency && !t.id && e.push(X.mutateAsync({
|
|
90
|
-
path: { payable_id: n.id },
|
|
91
|
-
body: f(n.currency, t, D, { allowLedgerUpdate: !1 })
|
|
92
|
-
}));
|
|
93
|
-
}), await Promise.all(e);
|
|
94
|
-
}
|
|
95
|
-
await Promise.all([
|
|
96
|
-
C.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: n.id } } }, w),
|
|
97
|
-
C.finops.getPayables.invalidateQueries(w),
|
|
98
|
-
C.finops.getPayablesIdLineItems.invalidateQueries({ parameters: { path: { payable_id: n.id } } }, w)
|
|
99
|
-
]), k && A(!1), y?.(n.id);
|
|
100
|
-
}, Xe = async (e, t, n, r) => {
|
|
101
|
-
let i = await Y.mutateAsync({
|
|
102
|
-
path: { payable_id: e },
|
|
103
|
-
body: t
|
|
104
|
-
}, { onSuccess: (e) => {
|
|
105
|
-
_.success(E._("Payable “{updatedPayableDocument_id}” has been updated", { updatedPayableDocument_id: e.document_id }));
|
|
106
|
-
} });
|
|
107
|
-
if (n && r) {
|
|
108
|
-
let e = [];
|
|
109
|
-
n?.forEach((t) => {
|
|
110
|
-
i.currency && !t.id && e.push(X.mutateAsync({
|
|
111
|
-
path: { payable_id: i.id },
|
|
112
|
-
body: f(i.currency, t, D)
|
|
113
|
-
}));
|
|
114
|
-
}), r?.lineItems?.forEach((t, r) => {
|
|
115
|
-
if (!t) return;
|
|
116
|
-
let { id: a, ...o } = t, s = Object.values(o).some((e) => e), c = n[r]?.id, l = n[r], u = !a && !!s && !!c && !!l;
|
|
117
|
-
i.currency && u && e.push(je.mutateAsync({
|
|
118
|
-
path: {
|
|
119
|
-
payable_id: i.id,
|
|
120
|
-
line_item_id: c
|
|
121
|
-
},
|
|
122
|
-
body: f(i.currency, l, D, {
|
|
123
|
-
allowLedgerUpdate: he && !!o.ledger_account_id,
|
|
124
|
-
previous: R?.find((e) => e.id === c)?.ledger_account_id
|
|
125
|
-
})
|
|
126
|
-
}));
|
|
127
|
-
}), R?.forEach((t) => {
|
|
128
|
-
n?.find((e) => e.id === t.id) || e.push(Me.mutateAsync({ path: {
|
|
129
|
-
payable_id: i.id,
|
|
130
|
-
line_item_id: t.id
|
|
131
|
-
} }));
|
|
132
|
-
}), await Promise.all(e);
|
|
133
|
-
}
|
|
134
|
-
await C.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: i.id } } }, w), k && A(!1), y?.(e);
|
|
135
|
-
}, Ze = m(() => {
|
|
136
|
-
if (N) {
|
|
137
|
-
if (!S) return L();
|
|
138
|
-
if (S?.length < 2) return S(N.id);
|
|
139
|
-
S(N.id, void 0, {
|
|
140
|
-
resolve: (e) => {
|
|
141
|
-
e?.showToast && _.success(E._("Payment flow started")), P(), I();
|
|
142
|
-
},
|
|
143
|
-
reject: (e, t) => {
|
|
144
|
-
t?.showToast && _.error(E._("Payment failed or cancelled")), P(), I();
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}, [
|
|
149
|
-
E,
|
|
150
|
-
N,
|
|
151
|
-
L,
|
|
152
|
-
S,
|
|
153
|
-
P,
|
|
154
|
-
I
|
|
155
|
-
]);
|
|
156
|
-
return {
|
|
157
|
-
payable: N,
|
|
158
|
-
isLoading: Se || Ke || qe,
|
|
159
|
-
payableQueryError: xe,
|
|
160
|
-
isEdit: k,
|
|
161
|
-
permissions: Je,
|
|
162
|
-
lineItems: R,
|
|
163
|
-
showPayButton: we,
|
|
164
|
-
currentUserApprovalRequest: B,
|
|
165
|
-
actions: {
|
|
166
|
-
setEdit: A,
|
|
167
|
-
createInvoice: Ye,
|
|
168
|
-
saveInvoice: Xe,
|
|
169
|
-
submitInvoice: Fe,
|
|
170
|
-
rejectInvoice: Ie,
|
|
171
|
-
approveInvoice: Re,
|
|
172
|
-
forceRejectInvoice: Be,
|
|
173
|
-
forceApproveInvoice: He,
|
|
174
|
-
reopenInvoice: Ue,
|
|
175
|
-
cancelInvoice: Ne,
|
|
176
|
-
deleteInvoice: Ge,
|
|
177
|
-
payInvoice: Ze,
|
|
178
|
-
handlePay: L,
|
|
179
|
-
modalComponent: Ee
|
|
15
|
+
var y = ({ payableId: y }) => {
|
|
16
|
+
let { i18n: b } = g(), { api: x, queryClient: S } = t(), C = h(), { FileInput: w, openFileInput: T, checkFileError: E } = r(), [D, O] = a(!1), k = x.finops.postPayablesIdAttachFile.useMutation({ path: { payable_id: y } }, {
|
|
17
|
+
onSuccess: () => Promise.all([x.finops.getPayables.invalidateQueries(S), x.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: y } } }, S)]),
|
|
18
|
+
onError: () => {}
|
|
19
|
+
}), A = i(() => ({
|
|
20
|
+
border: 2,
|
|
21
|
+
borderRadius: 2,
|
|
22
|
+
borderStyle: "dashed",
|
|
23
|
+
borderColor: "primary.main",
|
|
24
|
+
backgroundColor: m(C.palette.primary.main, .05)
|
|
25
|
+
}), [C.palette.primary.main]), j = (e) => {
|
|
26
|
+
e.preventDefault(), O(!0);
|
|
27
|
+
}, M = (e) => {
|
|
28
|
+
e.preventDefault(), O(!1);
|
|
29
|
+
}, N = (e) => {
|
|
30
|
+
e.preventDefault(), O(!1);
|
|
31
|
+
let t = Array.from(e.dataTransfer.files)[0];
|
|
32
|
+
t && P(t);
|
|
33
|
+
}, P = (t) => {
|
|
34
|
+
let n = E(t);
|
|
35
|
+
if (n) {
|
|
36
|
+
l.error(n);
|
|
37
|
+
return;
|
|
180
38
|
}
|
|
39
|
+
y && k.mutate({ file: t }, {
|
|
40
|
+
onSuccess: () => {
|
|
41
|
+
l.success(b._("File successfully attached"));
|
|
42
|
+
},
|
|
43
|
+
onError: (t) => {
|
|
44
|
+
l.error(e(b, t));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
181
47
|
};
|
|
182
|
-
}
|
|
48
|
+
return k.isPending ? /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s(f, {}) }) : /* @__PURE__ */ s(u, {
|
|
49
|
+
className: "Monite-PayableDetailsAttachFile",
|
|
50
|
+
sx: {
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
display: "flex",
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
textAlign: "center",
|
|
57
|
+
...D && A
|
|
58
|
+
},
|
|
59
|
+
onDragOver: j,
|
|
60
|
+
onDragLeave: M,
|
|
61
|
+
onDrop: N,
|
|
62
|
+
children: /* @__PURE__ */ s(u, {
|
|
63
|
+
sx: { margin: "auto" },
|
|
64
|
+
children: D ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(v, {
|
|
65
|
+
color: "primary",
|
|
66
|
+
fontSize: "large"
|
|
67
|
+
}), /* @__PURE__ */ s(p, {
|
|
68
|
+
color: "primary",
|
|
69
|
+
variant: "subtitle2",
|
|
70
|
+
children: b._("Drop the file here to upload")
|
|
71
|
+
})] }) : /* @__PURE__ */ c(o, { children: [
|
|
72
|
+
/* @__PURE__ */ s(_, {
|
|
73
|
+
color: "primary",
|
|
74
|
+
fontSize: "large",
|
|
75
|
+
sx: { marginBottom: 2 }
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ s(p, {
|
|
78
|
+
variant: "h3",
|
|
79
|
+
sx: { marginBottom: 1 },
|
|
80
|
+
children: b._("Attach a file")
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ s(p, { children: b._("This invoice doesn't have a file attached.") }),
|
|
83
|
+
/* @__PURE__ */ s(p, {
|
|
84
|
+
sx: { marginBottom: 2 },
|
|
85
|
+
children: b._("Drag & Drop it here to save for administrative purposes.")
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ s(d, {
|
|
88
|
+
variant: "outlined",
|
|
89
|
+
component: "label",
|
|
90
|
+
onClick: T,
|
|
91
|
+
children: b._("Choose from device")
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ s(w, { onChange: (e) => {
|
|
94
|
+
let t = e.target.files ? e.target.files[0] : null;
|
|
95
|
+
t && P(t);
|
|
96
|
+
} })
|
|
97
|
+
] })
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
};
|
|
183
101
|
//#endregion
|
|
184
|
-
export {
|
|
102
|
+
export { y as PayableDetailsAttachFile };
|
|
@@ -1,102 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useMoniteContext as t } from "./index45.js";
|
|
3
|
-
import { CenteredContentBox as n } from "./index124.js";
|
|
4
|
-
import "./index125.js";
|
|
5
|
-
import { useFileInput as r } from "./index165.js";
|
|
6
|
-
import "./index173.js";
|
|
7
|
-
import { useMemo as i, useState as a } from "react";
|
|
8
|
-
import { Fragment as o, jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
9
|
-
import { toast as l } from "react-hot-toast";
|
|
10
|
-
import { Box as u, Button as d, CircularProgress as f, Typography as p, alpha as m, useTheme as h } from "@mui/material";
|
|
11
|
-
import { useLingui as g } from "@lingui/react";
|
|
12
|
-
import _ from "@mui/icons-material/AttachFile";
|
|
13
|
-
import v from "@mui/icons-material/CloudUploadOutlined";
|
|
14
|
-
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index306.js
|
|
15
|
-
var y = ({ payableId: y }) => {
|
|
16
|
-
let { i18n: b } = g(), { api: x, queryClient: S } = t(), C = h(), { FileInput: w, openFileInput: T, checkFileError: E } = r(), [D, O] = a(!1), k = x.finops.postPayablesIdAttachFile.useMutation({ path: { payable_id: y } }, {
|
|
17
|
-
onSuccess: () => Promise.all([x.finops.getPayables.invalidateQueries(S), x.finops.getPayablesId.invalidateQueries({ parameters: { path: { payable_id: y } } }, S)]),
|
|
18
|
-
onError: () => {}
|
|
19
|
-
}), A = i(() => ({
|
|
20
|
-
border: 2,
|
|
21
|
-
borderRadius: 2,
|
|
22
|
-
borderStyle: "dashed",
|
|
23
|
-
borderColor: "primary.main",
|
|
24
|
-
backgroundColor: m(C.palette.primary.main, .05)
|
|
25
|
-
}), [C.palette.primary.main]), j = (e) => {
|
|
26
|
-
e.preventDefault(), O(!0);
|
|
27
|
-
}, M = (e) => {
|
|
28
|
-
e.preventDefault(), O(!1);
|
|
29
|
-
}, N = (e) => {
|
|
30
|
-
e.preventDefault(), O(!1);
|
|
31
|
-
let t = Array.from(e.dataTransfer.files)[0];
|
|
32
|
-
t && P(t);
|
|
33
|
-
}, P = (t) => {
|
|
34
|
-
let n = E(t);
|
|
35
|
-
if (n) {
|
|
36
|
-
l.error(n);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
y && k.mutate({ file: t }, {
|
|
40
|
-
onSuccess: () => {
|
|
41
|
-
l.success(b._("File successfully attached"));
|
|
42
|
-
},
|
|
43
|
-
onError: (t) => {
|
|
44
|
-
l.error(e(b, t));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
return k.isPending ? /* @__PURE__ */ s(n, { children: /* @__PURE__ */ s(f, {}) }) : /* @__PURE__ */ s(u, {
|
|
49
|
-
className: "Monite-PayableDetailsAttachFile",
|
|
50
|
-
sx: {
|
|
51
|
-
width: "100%",
|
|
52
|
-
height: "100%",
|
|
53
|
-
display: "flex",
|
|
54
|
-
flexDirection: "column",
|
|
55
|
-
justifyContent: "center",
|
|
56
|
-
textAlign: "center",
|
|
57
|
-
...D && A
|
|
58
|
-
},
|
|
59
|
-
onDragOver: j,
|
|
60
|
-
onDragLeave: M,
|
|
61
|
-
onDrop: N,
|
|
62
|
-
children: /* @__PURE__ */ s(u, {
|
|
63
|
-
sx: { margin: "auto" },
|
|
64
|
-
children: D ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(v, {
|
|
65
|
-
color: "primary",
|
|
66
|
-
fontSize: "large"
|
|
67
|
-
}), /* @__PURE__ */ s(p, {
|
|
68
|
-
color: "primary",
|
|
69
|
-
variant: "subtitle2",
|
|
70
|
-
children: b._("Drop the file here to upload")
|
|
71
|
-
})] }) : /* @__PURE__ */ c(o, { children: [
|
|
72
|
-
/* @__PURE__ */ s(_, {
|
|
73
|
-
color: "primary",
|
|
74
|
-
fontSize: "large",
|
|
75
|
-
sx: { marginBottom: 2 }
|
|
76
|
-
}),
|
|
77
|
-
/* @__PURE__ */ s(p, {
|
|
78
|
-
variant: "h3",
|
|
79
|
-
sx: { marginBottom: 1 },
|
|
80
|
-
children: b._("Attach a file")
|
|
81
|
-
}),
|
|
82
|
-
/* @__PURE__ */ s(p, { children: b._("This invoice doesn't have a file attached.") }),
|
|
83
|
-
/* @__PURE__ */ s(p, {
|
|
84
|
-
sx: { marginBottom: 2 },
|
|
85
|
-
children: b._("Drag & Drop it here to save for administrative purposes.")
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ s(d, {
|
|
88
|
-
variant: "outlined",
|
|
89
|
-
component: "label",
|
|
90
|
-
onClick: T,
|
|
91
|
-
children: b._("Choose from device")
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ s(w, { onChange: (e) => {
|
|
94
|
-
let t = e.target.files ? e.target.files[0] : null;
|
|
95
|
-
t && P(t);
|
|
96
|
-
} })
|
|
97
|
-
] })
|
|
98
|
-
})
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
//#endregion
|
|
102
|
-
export { y as PayableDetailsAttachFile };
|
|
1
|
+
import "./index305.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./index118.js";
|