@gusto/embedded-react-sdk 0.55.3 → 0.55.5
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/CHANGELOG.md +29 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +18 -17
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +27 -25
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
- package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
- package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
- package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
- package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Flow/Flow.js +22 -22
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/useFlow.js +3 -3
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +66 -52
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +52 -50
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +193 -191
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +31 -31
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +176 -167
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -164
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/helpers/openPdfInNewTab.d.ts +15 -0
- package/dist/helpers/openPdfInNewTab.js +28 -0
- package/dist/helpers/openPdfInNewTab.js.map +1 -0
- package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +43 -41
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/types.d.ts +20 -0
- package/dist/style.css +1 -1
- package/package.json +17 -17
|
@@ -1,196 +1,198 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useGustoEmbeddedContext as ge } from "@gusto/embedded-api/react-query/_context";
|
|
1
|
+
import { jsx as C, jsxs as Pe, Fragment as Ue } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as D, useMemo as q, useEffect as O } from "react";
|
|
3
|
+
import { usePayrollsGetSuspense as ge } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
4
|
+
import { payrollsCalculate as he } from "@gusto/embedded-api/funcs/payrollsCalculate";
|
|
5
|
+
import { useGustoEmbeddedContext as Le } from "@gusto/embedded-api/react-query/_context";
|
|
7
6
|
import { PayrollProcessingRequestStatus as E } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { usePayrollsUpdateMutation as
|
|
10
|
-
import { usePayrollsCalculateGrossUpMutation as
|
|
11
|
-
import { usePayrollsGetBlockersSuspense as
|
|
12
|
-
import { payrollSubmitHandler as
|
|
13
|
-
import { PayrollOverview as
|
|
14
|
-
import { PayrollConfigurationPresentation as
|
|
7
|
+
import { useTranslation as Se } from "react-i18next";
|
|
8
|
+
import { usePayrollsUpdateMutation as we } from "@gusto/embedded-api/react-query/payrollsUpdate";
|
|
9
|
+
import { usePayrollsCalculateGrossUpMutation as Re } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
|
|
10
|
+
import { usePayrollsGetBlockersSuspense as Ae } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
|
|
11
|
+
import { payrollSubmitHandler as _e } from "../PayrollBlocker/payrollHelpers.js";
|
|
12
|
+
import { PayrollOverview as De } from "../PayrollOverview/PayrollOverview.js";
|
|
13
|
+
import { PayrollConfigurationPresentation as Oe } from "./PayrollConfigurationPresentation.js";
|
|
15
14
|
import { usePayrollConfigurationData as Ee } from "./usePayrollConfigurationData.js";
|
|
16
|
-
import { isGrossUpEligible as
|
|
17
|
-
import { BaseComponent as
|
|
15
|
+
import { isGrossUpEligible as Te, getGrossUpTargetCompensationName as xe } from "./grossUpHelpers.js";
|
|
16
|
+
import { BaseComponent as be } from "../../Base/Base.js";
|
|
18
17
|
import { componentEvents as l } from "../../../shared/constants.js";
|
|
19
|
-
import { useComponentDictionary as
|
|
18
|
+
import { useComponentDictionary as ke, useI18n as Ge } from "../../../i18n/I18n.js";
|
|
20
19
|
import { useBase as Ne } from "../../Base/useBase.js";
|
|
21
|
-
import { useDateFormatter as
|
|
22
|
-
import { SDKInternalError as
|
|
23
|
-
import { API_QUERY_NAMESPACE as Ye } from "../../../contexts/ApiProvider/apiVersion.js";
|
|
20
|
+
import { useDateFormatter as Ye } from "../../../hooks/useDateFormatter.js";
|
|
21
|
+
import { SDKInternalError as W } from "../../../types/sdkError.js";
|
|
24
22
|
import { GrossUpModal as Me } from "../GrossUpModal/GrossUpModal.js";
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
return /* @__PURE__ */
|
|
23
|
+
const v = (o) => o?.status === E.Calculating, Be = (o, n) => n != null && (o?.status === E.CalculateSuccess || o == null);
|
|
24
|
+
function ut(o) {
|
|
25
|
+
return /* @__PURE__ */ C(be, { ...o, children: /* @__PURE__ */ C(Fe, { ...o, children: o.children }) });
|
|
28
26
|
}
|
|
29
27
|
const Fe = ({
|
|
30
|
-
onEvent:
|
|
31
|
-
companyId:
|
|
28
|
+
onEvent: o,
|
|
29
|
+
companyId: n,
|
|
32
30
|
payrollId: i,
|
|
33
|
-
dictionary:
|
|
34
|
-
alerts:
|
|
35
|
-
withReimbursements:
|
|
31
|
+
dictionary: K,
|
|
32
|
+
alerts: H,
|
|
33
|
+
withReimbursements: T = !0
|
|
36
34
|
}) => {
|
|
37
|
-
|
|
38
|
-
const { t: c } =
|
|
35
|
+
ke("Payroll.PayrollConfiguration", K), Ge("Payroll.PayrollConfiguration");
|
|
36
|
+
const { t: c } = Se("Payroll.PayrollConfiguration"), { baseSubmitHandler: P } = Ne(), m = Ye(), [u, d] = f(!1), [x, b] = f(!1), g = D(null), p = D(!1), V = Le(), { data: a } = ge(
|
|
39
37
|
{
|
|
40
|
-
companyId:
|
|
38
|
+
companyId: n,
|
|
41
39
|
payrollId: i,
|
|
42
40
|
include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
|
|
43
41
|
},
|
|
44
|
-
{ refetchInterval:
|
|
45
|
-
),
|
|
46
|
-
() =>
|
|
47
|
-
[
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
{ refetchInterval: u ? 5e3 : !1 }
|
|
43
|
+
), I = q(
|
|
44
|
+
() => a.payrollShow?.employeeCompensations?.filter((e) => e.excluded).map((e) => e.employeeUuid).filter(Boolean) ?? [],
|
|
45
|
+
[a.payrollShow?.employeeCompensations]
|
|
46
|
+
);
|
|
47
|
+
v(a.payrollShow?.processingRequest) && (p.current = !0);
|
|
48
|
+
const k = x || u || p.current, {
|
|
49
|
+
employeeDetails: J,
|
|
50
|
+
employeeCompensations: G,
|
|
51
|
+
paySchedule: z,
|
|
52
52
|
payPeriod: Q,
|
|
53
|
-
payrollCategory:
|
|
54
|
-
pagination:
|
|
55
|
-
isLoading:
|
|
56
|
-
isAlreadyProcessed:
|
|
53
|
+
payrollCategory: h,
|
|
54
|
+
pagination: X,
|
|
55
|
+
isLoading: Z,
|
|
56
|
+
isAlreadyProcessed: L,
|
|
57
57
|
refetch: S
|
|
58
58
|
} = Ee({
|
|
59
|
-
companyId:
|
|
59
|
+
companyId: n,
|
|
60
60
|
payrollId: i,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
// Don't prepare while calculating, or once we've seen it calculate. If the payroll was already
|
|
62
|
+
// calculated when we opened (e.g. clicking Edit), we do prepare so it can be edited.
|
|
63
|
+
disablePrepare: u || x || p.current,
|
|
64
|
+
excludedEmployeeUuids: I
|
|
65
|
+
}), w = q(
|
|
64
66
|
() => ({
|
|
65
67
|
type: "error",
|
|
66
68
|
title: c("alerts.alreadyProcessed"),
|
|
67
69
|
alertKey: "alreadyProcessed"
|
|
68
70
|
}),
|
|
69
71
|
[c]
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
if (!
|
|
73
|
-
|
|
72
|
+
), R = D(!1);
|
|
73
|
+
O(() => {
|
|
74
|
+
if (!L) {
|
|
75
|
+
R.current = !1;
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
|
-
|
|
78
|
+
R.current || (R.current = !0, o(l.RUN_PAYROLL_ALREADY_PROCESSED, {
|
|
77
79
|
payrollId: i,
|
|
78
|
-
alert:
|
|
79
|
-
payPeriod:
|
|
80
|
+
alert: w,
|
|
81
|
+
payPeriod: a.payrollShow?.payPeriod
|
|
80
82
|
}));
|
|
81
83
|
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
L,
|
|
85
|
+
o,
|
|
84
86
|
i,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
w,
|
|
88
|
+
a.payrollShow?.payPeriod
|
|
87
89
|
]);
|
|
88
|
-
const { mutateAsync:
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
if (!
|
|
92
|
-
let
|
|
93
|
-
return await
|
|
94
|
-
|
|
90
|
+
const { mutateAsync: N, isPending: $ } = we(), { mutateAsync: ee } = Re(), [y, Y] = f(null), [te, A] = f(!1), M = Te(h), U = xe(h), oe = (e) => {
|
|
91
|
+
Y(e), A(!0), o(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
|
|
92
|
+
}, ae = async (e) => {
|
|
93
|
+
if (!y) return null;
|
|
94
|
+
let t = null;
|
|
95
|
+
return await P(null, async () => {
|
|
96
|
+
t = (await ee({
|
|
95
97
|
request: {
|
|
96
98
|
payrollUuid: i,
|
|
97
99
|
payrollGrossUpRequest: {
|
|
98
|
-
employeeUuid:
|
|
100
|
+
employeeUuid: y,
|
|
99
101
|
netPay: e.toString()
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
})).payrollGrossUpResponse?.grossUp ?? null,
|
|
103
|
-
grossUp:
|
|
104
|
+
})).payrollGrossUpResponse?.grossUp ?? null, t && o(l.RUN_PAYROLL_GROSS_UP_CALCULATED, {
|
|
105
|
+
grossUp: t,
|
|
104
106
|
netPay: e,
|
|
105
|
-
employeeUuid:
|
|
107
|
+
employeeUuid: y
|
|
106
108
|
});
|
|
107
|
-
}),
|
|
108
|
-
},
|
|
109
|
-
if (!
|
|
110
|
-
throw new
|
|
109
|
+
}), t;
|
|
110
|
+
}, se = async (e) => {
|
|
111
|
+
if (!y || !U)
|
|
112
|
+
throw new W(
|
|
111
113
|
"Unable to apply gross-up: missing employee or target compensation."
|
|
112
114
|
);
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
throw new
|
|
116
|
-
const r =
|
|
117
|
-
(
|
|
118
|
-
),
|
|
119
|
-
name:
|
|
120
|
-
jobUuid:
|
|
121
|
-
amount:
|
|
115
|
+
const t = G.find((s) => s.employeeUuid === y);
|
|
116
|
+
if (!t)
|
|
117
|
+
throw new W("Unable to apply gross-up: employee compensation not found.");
|
|
118
|
+
const r = t.fixedCompensations ?? [], de = r.some(
|
|
119
|
+
(s) => s.name?.toLowerCase() === U.toLowerCase()
|
|
120
|
+
), j = r.map((s) => ({
|
|
121
|
+
name: s.name,
|
|
122
|
+
jobUuid: s.jobUuid,
|
|
123
|
+
amount: s.name?.toLowerCase() === U.toLowerCase() ? e : "0"
|
|
122
124
|
}));
|
|
123
|
-
if (!
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
name:
|
|
127
|
-
jobUuid:
|
|
125
|
+
if (!de) {
|
|
126
|
+
const s = t.hourlyCompensations?.[0]?.jobUuid ?? r[0]?.jobUuid ?? "";
|
|
127
|
+
j.push({
|
|
128
|
+
name: U,
|
|
129
|
+
jobUuid: s,
|
|
128
130
|
amount: e
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
|
-
const
|
|
132
|
-
name:
|
|
133
|
-
jobUuid:
|
|
133
|
+
const ye = (t.hourlyCompensations ?? []).map((s) => ({
|
|
134
|
+
name: s.name,
|
|
135
|
+
jobUuid: s.jobUuid,
|
|
134
136
|
hours: "0"
|
|
135
|
-
})),
|
|
136
|
-
name:
|
|
137
|
+
})), fe = (t.paidTimeOff ?? []).map((s) => ({
|
|
138
|
+
name: s.name,
|
|
137
139
|
hours: "0"
|
|
138
|
-
})),
|
|
139
|
-
...
|
|
140
|
-
fixedCompensations:
|
|
141
|
-
hourlyCompensations:
|
|
142
|
-
paidTimeOff:
|
|
140
|
+
})), Ce = F({
|
|
141
|
+
...t,
|
|
142
|
+
fixedCompensations: j,
|
|
143
|
+
hourlyCompensations: ye,
|
|
144
|
+
paidTimeOff: fe
|
|
143
145
|
});
|
|
144
|
-
await
|
|
145
|
-
const
|
|
146
|
+
await P({}, async () => {
|
|
147
|
+
const s = await N({
|
|
146
148
|
request: {
|
|
147
|
-
companyId:
|
|
149
|
+
companyId: n,
|
|
148
150
|
payrollId: i,
|
|
149
151
|
payrollUpdate: {
|
|
150
|
-
employeeCompensations: [{ ...
|
|
152
|
+
employeeCompensations: [{ ...Ce, excluded: !1 }]
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
});
|
|
154
|
-
|
|
155
|
-
payrollPrepared:
|
|
156
|
+
o(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
157
|
+
payrollPrepared: s.payrollPrepared
|
|
156
158
|
}), await S();
|
|
157
|
-
}),
|
|
158
|
-
},
|
|
159
|
+
}), Y(null), A(!1);
|
|
160
|
+
}, re = async (e) => {
|
|
159
161
|
try {
|
|
160
|
-
await
|
|
162
|
+
await se(e);
|
|
161
163
|
} catch {
|
|
162
164
|
}
|
|
163
|
-
}, { data:
|
|
164
|
-
companyUuid:
|
|
165
|
-
}),
|
|
165
|
+
}, { data: le } = Ae({
|
|
166
|
+
companyUuid: n
|
|
167
|
+
}), B = (le.payrollBlockers ?? []).map((e) => ({
|
|
166
168
|
key: e.key,
|
|
167
169
|
message: e.message
|
|
168
|
-
})), [
|
|
169
|
-
|
|
170
|
-
const e = await
|
|
171
|
-
|
|
170
|
+
})), [ie, _] = f(B), ne = async () => {
|
|
171
|
+
_([]), p.current = !0, g.current = a.payrollShow?.calculatedAt?.getTime() ?? null, await P({}, async () => {
|
|
172
|
+
const e = await _e(async () => {
|
|
173
|
+
b(!0);
|
|
172
174
|
try {
|
|
173
|
-
const
|
|
174
|
-
companyId:
|
|
175
|
+
const t = await he(V, {
|
|
176
|
+
companyId: n,
|
|
175
177
|
payrollId: i
|
|
176
178
|
});
|
|
177
|
-
if (!
|
|
178
|
-
throw
|
|
179
|
-
|
|
179
|
+
if (!t.ok)
|
|
180
|
+
throw t.error;
|
|
181
|
+
d(!0);
|
|
180
182
|
} finally {
|
|
181
|
-
|
|
183
|
+
b(!1);
|
|
182
184
|
}
|
|
183
185
|
});
|
|
184
|
-
!e.success && e.blockers.length > 0 &&
|
|
186
|
+
!e.success && e.blockers.length > 0 && _(e.blockers);
|
|
185
187
|
});
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
+
}, ue = (e) => {
|
|
189
|
+
o(l.RUN_PAYROLL_EMPLOYEE_EDIT, {
|
|
188
190
|
employeeId: e.uuid,
|
|
189
191
|
firstName: e.firstName,
|
|
190
192
|
lastName: e.lastName
|
|
191
193
|
});
|
|
192
|
-
},
|
|
193
|
-
const { paymentMethod:
|
|
194
|
+
}, F = (e) => {
|
|
195
|
+
const { paymentMethod: t } = e;
|
|
194
196
|
return {
|
|
195
197
|
employeeUuid: e.employeeUuid,
|
|
196
198
|
version: e.version,
|
|
@@ -199,133 +201,133 @@ const Fe = ({
|
|
|
199
201
|
hourlyCompensations: e.hourlyCompensations,
|
|
200
202
|
paidTimeOff: e.paidTimeOff,
|
|
201
203
|
deductions: e.deductions,
|
|
202
|
-
...
|
|
204
|
+
...t && t !== "Historical" ? { paymentMethod: t } : {},
|
|
203
205
|
memo: e.memo || void 0
|
|
204
206
|
};
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
+
}, ce = async (e) => {
|
|
208
|
+
o(l.RUN_PAYROLL_EMPLOYEE_SKIP, {
|
|
207
209
|
employeeId: e.employeeUuid
|
|
208
|
-
}), await
|
|
209
|
-
const
|
|
210
|
+
}), await P({}, async () => {
|
|
211
|
+
const t = F(e), r = await N({
|
|
210
212
|
request: {
|
|
211
|
-
companyId:
|
|
213
|
+
companyId: n,
|
|
212
214
|
payrollId: i,
|
|
213
215
|
payrollUpdate: {
|
|
214
216
|
employeeCompensations: [
|
|
215
|
-
{ ...
|
|
217
|
+
{ ...t, excluded: !t.excluded }
|
|
216
218
|
]
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
});
|
|
220
|
-
|
|
222
|
+
o(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
221
223
|
payrollPrepared: r.payrollPrepared
|
|
222
224
|
}), await S();
|
|
223
225
|
});
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
+
}, pe = () => {
|
|
227
|
+
o(l.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
|
|
226
228
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const e =
|
|
230
|
-
|
|
229
|
+
O(() => {
|
|
230
|
+
v(a.payrollShow?.processingRequest) && !u && (g.current = a.payrollShow?.calculatedAt?.getTime() ?? null, d(!0));
|
|
231
|
+
const e = a.payrollShow?.calculatedAt, t = e?.getTime() !== g.current;
|
|
232
|
+
u && t && Be(a.payrollShow?.processingRequest, e) && (o(l.RUN_PAYROLL_CALCULATED, {
|
|
231
233
|
payrollId: i,
|
|
232
234
|
alert: {
|
|
233
235
|
type: "success",
|
|
234
236
|
title: c("alerts.progressSaved"),
|
|
235
237
|
alertKey: "progressSaved"
|
|
236
238
|
},
|
|
237
|
-
payPeriod:
|
|
238
|
-
}),
|
|
239
|
+
payPeriod: a.payrollShow?.payPeriod
|
|
240
|
+
}), _([]), d(!1)), u && a.payrollShow?.processingRequest?.status === E.ProcessingFailed && (o(l.RUN_PAYROLL_PROCESSING_FAILED), d(!1), p.current = !1);
|
|
239
241
|
}, [
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
a.payrollShow?.processingRequest?.status,
|
|
243
|
+
a.payrollShow?.calculatedAt,
|
|
244
|
+
u,
|
|
245
|
+
o,
|
|
244
246
|
c,
|
|
245
247
|
i
|
|
246
|
-
]),
|
|
247
|
-
if (!
|
|
248
|
-
const e = 180 * 1e3,
|
|
249
|
-
|
|
248
|
+
]), O(() => {
|
|
249
|
+
if (!u) return;
|
|
250
|
+
const e = 180 * 1e3, t = setTimeout(() => {
|
|
251
|
+
o(l.RUN_PAYROLL_PROCESSING_FAILED), d(!1), p.current = !1;
|
|
250
252
|
}, e);
|
|
251
253
|
return () => {
|
|
252
|
-
clearTimeout(
|
|
254
|
+
clearTimeout(t);
|
|
253
255
|
};
|
|
254
|
-
}, [
|
|
255
|
-
const
|
|
256
|
-
const e =
|
|
256
|
+
}, [u, o]);
|
|
257
|
+
const me = (() => {
|
|
258
|
+
const e = a.payrollShow?.payrollStatusMeta;
|
|
257
259
|
if (e?.payrollLate && e.initialCheckDate && e.expectedDebitTime && e.expectedCheckDate)
|
|
258
260
|
return {
|
|
259
261
|
label: c("alerts.payrollLate", {
|
|
260
|
-
initialCheckDate:
|
|
262
|
+
initialCheckDate: m.formatShortWithWeekday(e.initialCheckDate)
|
|
261
263
|
}),
|
|
262
264
|
content: c("alerts.payrollLateText", {
|
|
263
|
-
...
|
|
264
|
-
newCheckDate:
|
|
265
|
+
...m.formatWithTime(e.expectedDebitTime),
|
|
266
|
+
newCheckDate: m.formatShortWithWeekday(e.expectedCheckDate)
|
|
265
267
|
}),
|
|
266
268
|
variant: "warning"
|
|
267
269
|
};
|
|
268
|
-
const { payrollShow: r } =
|
|
270
|
+
const { payrollShow: r } = a;
|
|
269
271
|
if (r?.checkDate && r.payrollDeadline)
|
|
270
272
|
return {
|
|
271
273
|
label: c("alerts.directDepositDeadline", {
|
|
272
|
-
payDate:
|
|
273
|
-
...
|
|
274
|
+
payDate: m.formatShortWithWeekday(r.checkDate),
|
|
275
|
+
...m.formatWithTime(r.payrollDeadline)
|
|
274
276
|
}),
|
|
275
277
|
content: c("alerts.directDepositDeadlineText"),
|
|
276
278
|
variant: "info"
|
|
277
279
|
};
|
|
278
280
|
})();
|
|
279
|
-
return
|
|
280
|
-
|
|
281
|
+
return L ? /* @__PURE__ */ C(
|
|
282
|
+
De,
|
|
281
283
|
{
|
|
282
|
-
companyId:
|
|
284
|
+
companyId: n,
|
|
283
285
|
payrollId: i,
|
|
284
|
-
onEvent: (
|
|
285
|
-
|
|
286
|
+
onEvent: (t, r) => {
|
|
287
|
+
t === l.RUN_PAYROLL_CANCELLED && S(), o(t, r);
|
|
286
288
|
},
|
|
287
|
-
withReimbursements:
|
|
288
|
-
alerts: [
|
|
289
|
+
withReimbursements: T,
|
|
290
|
+
alerts: [w]
|
|
289
291
|
}
|
|
290
|
-
) : /* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
292
|
+
) : /* @__PURE__ */ Pe(Ue, { children: [
|
|
293
|
+
/* @__PURE__ */ C(
|
|
294
|
+
Oe,
|
|
293
295
|
{
|
|
294
|
-
onCalculatePayroll:
|
|
295
|
-
isCalculateDisabled:
|
|
296
|
-
onEdit:
|
|
297
|
-
onToggleExclude:
|
|
298
|
-
onViewBlockers:
|
|
299
|
-
employeeCompensations:
|
|
300
|
-
employeeDetails:
|
|
296
|
+
onCalculatePayroll: ne,
|
|
297
|
+
isCalculateDisabled: B.length > 0,
|
|
298
|
+
onEdit: ue,
|
|
299
|
+
onToggleExclude: ce,
|
|
300
|
+
onViewBlockers: pe,
|
|
301
|
+
employeeCompensations: G,
|
|
302
|
+
employeeDetails: J,
|
|
301
303
|
payPeriod: Q,
|
|
302
|
-
paySchedule:
|
|
303
|
-
payrollCategory:
|
|
304
|
-
alerts:
|
|
305
|
-
payrollAlert:
|
|
306
|
-
isPending:
|
|
307
|
-
isCalculating:
|
|
308
|
-
payrollBlockers:
|
|
309
|
-
pagination:
|
|
310
|
-
withReimbursements:
|
|
311
|
-
grossUpEnabled:
|
|
312
|
-
onGrossUpSelect:
|
|
304
|
+
paySchedule: z,
|
|
305
|
+
payrollCategory: h,
|
|
306
|
+
alerts: H,
|
|
307
|
+
payrollAlert: me,
|
|
308
|
+
isPending: k || Z || $,
|
|
309
|
+
isCalculating: k,
|
|
310
|
+
payrollBlockers: ie,
|
|
311
|
+
pagination: X,
|
|
312
|
+
withReimbursements: T,
|
|
313
|
+
grossUpEnabled: M,
|
|
314
|
+
onGrossUpSelect: oe
|
|
313
315
|
}
|
|
314
316
|
),
|
|
315
|
-
|
|
317
|
+
M && /* @__PURE__ */ C(
|
|
316
318
|
Me,
|
|
317
319
|
{
|
|
318
|
-
isOpen:
|
|
319
|
-
onCalculateGrossUp:
|
|
320
|
-
onApply:
|
|
320
|
+
isOpen: te,
|
|
321
|
+
onCalculateGrossUp: ae,
|
|
322
|
+
onApply: re,
|
|
321
323
|
onCancel: () => {
|
|
322
|
-
|
|
324
|
+
A(!1);
|
|
323
325
|
}
|
|
324
326
|
}
|
|
325
327
|
)
|
|
326
328
|
] });
|
|
327
329
|
};
|
|
328
330
|
export {
|
|
329
|
-
|
|
331
|
+
ut as PayrollConfiguration
|
|
330
332
|
};
|
|
331
333
|
//# sourceMappingURL=PayrollConfiguration.js.map
|