@stssocialst-stp/fe-payroll 0.3.7 → 0.3.8
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/index.es.js +191 -28
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +193 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27,12 +27,12 @@ var _debounce = require('lodash/debounce');
|
|
|
27
27
|
var Button = require('@material-ui/core/Button');
|
|
28
28
|
var _ = require('lodash');
|
|
29
29
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
30
|
-
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
31
|
-
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
32
30
|
var Dialog = require('@material-ui/core/Dialog');
|
|
33
31
|
var DialogActions = require('@material-ui/core/DialogActions');
|
|
34
32
|
var DialogContent = require('@material-ui/core/DialogContent');
|
|
35
33
|
var DialogTitle = require('@material-ui/core/DialogTitle');
|
|
34
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
35
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
36
36
|
var Typography = require('@material-ui/core/Typography');
|
|
37
37
|
var reactToPrint = require('react-to-print');
|
|
38
38
|
var PrintIcon = require('@material-ui/icons/Print');
|
|
@@ -69,12 +69,12 @@ var _debounce__default = /*#__PURE__*/_interopDefaultLegacy(_debounce);
|
|
|
69
69
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
70
70
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
71
71
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
72
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
73
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
74
72
|
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
75
73
|
var DialogActions__default = /*#__PURE__*/_interopDefaultLegacy(DialogActions);
|
|
76
74
|
var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
|
77
75
|
var DialogTitle__default = /*#__PURE__*/_interopDefaultLegacy(DialogTitle);
|
|
76
|
+
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
77
|
+
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
78
78
|
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
79
79
|
var PrintIcon__default = /*#__PURE__*/_interopDefaultLegacy(PrintIcon);
|
|
80
80
|
var DialogContentText__default = /*#__PURE__*/_interopDefaultLegacy(DialogContentText);
|
|
@@ -196,6 +196,7 @@ var ACTION_TYPE = {
|
|
|
196
196
|
CLOSE_PAYROLL: 'PAYROLL_MUTATION_CLOSE_PAYROLL',
|
|
197
197
|
REJECT_PAYROLL: 'PAYROLL_MUTATION_REJECT_PAYROLL',
|
|
198
198
|
MAKE_PAYMENT_PAYROLL: 'PAYROLL_MUTATION_MAKE_PAYMENT_PAYROLL',
|
|
199
|
+
UPDATE_PAYROLL_PAYMENT_DATE: 'PAYROLL_MUTATION_UPDATE_PAYROLL_PAYMENT_DATE',
|
|
199
200
|
GET_PAYROLL_PAYMENT_FILES: 'GET_PAYROLL_PAYMENT_FILES',
|
|
200
201
|
BENEFITS_SUMMARY: 'PAYROLL_BENEFITS_SUMMARY',
|
|
201
202
|
GET_BISTP_SUMMARY: 'PAYROLL_BISTP_SUMMARY',
|
|
@@ -212,7 +213,8 @@ var MUTATION_SERVICE = {
|
|
|
212
213
|
DELETE: 'deletePayroll',
|
|
213
214
|
CLOSE: 'closePayroll',
|
|
214
215
|
REJECT: 'rejectPayroll',
|
|
215
|
-
MAKE_PAYMENT: 'makePaymentForPayroll'
|
|
216
|
+
MAKE_PAYMENT: 'makePaymentForPayroll',
|
|
217
|
+
UPDATE_PAYMENT_DATE: 'updatePayrollPaymentDate'
|
|
216
218
|
},
|
|
217
219
|
BENEFIT_CONSUMPTION: {
|
|
218
220
|
DELETE: 'deleteBenefitConsumption'
|
|
@@ -382,7 +384,8 @@ function reducer() {
|
|
|
382
384
|
return _objectSpread$6(_objectSpread$6({}, payroll), {}, {
|
|
383
385
|
id: feCore.decodeId(payroll.id),
|
|
384
386
|
dateValidTo: payroll !== null && payroll !== void 0 && payroll.dateValidTo ? payroll === null || payroll === void 0 ? void 0 : payroll.dateValidTo.split('T')[0] : null,
|
|
385
|
-
dateValidFrom: payroll !== null && payroll !== void 0 && payroll.dateValidFrom ? payroll === null || payroll === void 0 ? void 0 : payroll.dateValidFrom.split('T')[0] : null
|
|
387
|
+
dateValidFrom: payroll !== null && payroll !== void 0 && payroll.dateValidFrom ? payroll === null || payroll === void 0 ? void 0 : payroll.dateValidFrom.split('T')[0] : null,
|
|
388
|
+
paymentDate: payroll !== null && payroll !== void 0 && payroll.paymentDate ? payroll === null || payroll === void 0 ? void 0 : payroll.paymentDate.split('T')[0] : null
|
|
386
389
|
});
|
|
387
390
|
})) === null || _parseData4 === void 0 ? void 0 : _parseData4[0],
|
|
388
391
|
errorPayroll: feCore.formatGraphQLError(action.payload)
|
|
@@ -597,6 +600,8 @@ function reducer() {
|
|
|
597
600
|
return feCore.dispatchMutationResp(state, MUTATION_SERVICE.PAYMENT_POINT.UPDATE, action);
|
|
598
601
|
case SUCCESS(ACTION_TYPE.CREATE_PAYROLL):
|
|
599
602
|
return feCore.dispatchMutationResp(state, MUTATION_SERVICE.PAYROLL.CREATE, action);
|
|
603
|
+
case SUCCESS(ACTION_TYPE.UPDATE_PAYROLL_PAYMENT_DATE):
|
|
604
|
+
return feCore.dispatchMutationResp(state, MUTATION_SERVICE.PAYROLL.UPDATE_PAYMENT_DATE, action);
|
|
600
605
|
case SUCCESS(ACTION_TYPE.DELETE_PAYROLL):
|
|
601
606
|
return feCore.dispatchMutationResp(state, MUTATION_SERVICE.PAYROLL.DELETE, action);
|
|
602
607
|
case SUCCESS(ACTION_TYPE.DELETE_BENEFIT_CONSUMPTION):
|
|
@@ -688,6 +693,14 @@ var messages_en = {
|
|
|
688
693
|
"payroll.payroll.payrollStatusPicker.REJECTED": "REJECTED",
|
|
689
694
|
"payroll.payroll.payrollStatusPicker.RECONCILED": "RECONCILED",
|
|
690
695
|
"payroll.paymentMethod": "Payment Method",
|
|
696
|
+
"payroll.paymentDate": "Payment Date",
|
|
697
|
+
"payroll.paymentDateFrom": "Payment Date From",
|
|
698
|
+
"payroll.paymentDateTo": "Payment Date To",
|
|
699
|
+
"payroll.paymentDate.update": "Update Payment Date",
|
|
700
|
+
"payroll.paymentDate.mutation.updateLabel": "Update payment date {id}",
|
|
701
|
+
"payroll.validation.payroll.payment_date_required": "Payment date is required for BISTP payments.",
|
|
702
|
+
"payroll.validation.payroll.payment_date_in_past": "Payment date cannot be in the past.",
|
|
703
|
+
"payroll.validation.payroll.payment_date_locked": "Payment date can no longer be changed (payroll already sent to BISTP).",
|
|
691
704
|
"payroll.tasks.update.title": "Approve Payroll Tasks",
|
|
692
705
|
"payroll.tasks.reconciliation.title": "Payroll Reconciliation Tasks",
|
|
693
706
|
"payroll.payroll.includedUnpaid": "Included unpaid",
|
|
@@ -802,12 +815,12 @@ var PAYMENT_POINT_PROJECTION = function PAYMENT_POINT_PROJECTION(modulesManager)
|
|
|
802
815
|
return ['id', 'name', 'isDeleted', "location ".concat(modulesManager.getProjection('location.Location.FlatProjection')), "ppm ".concat(modulesManager.getProjection('admin.UserPicker.projection'))];
|
|
803
816
|
};
|
|
804
817
|
var BENEFIT_CONSUMPTION_PROJECTION = function BENEFIT_CONSUMPTION_PROJECTION() {
|
|
805
|
-
return ['id', 'jsonExt', 'code', 'individual {firstName, lastName, nib}', 'benefitAttachment {bill {id, code, terms, amountTotal, datePayed}}', 'receipt', 'photo', 'amount', 'type', 'status', 'dateDue'];
|
|
818
|
+
return ['id', 'jsonExt', 'code', 'individual {firstName, lastName, nib}', 'benefitAttachment {bill {id, code, terms, amountTotal, datePayed}}', 'receipt', 'photo', 'amount', 'type', 'status', 'dateDue', 'paymentDate'];
|
|
806
819
|
};
|
|
807
820
|
var PAYROLL_BENEFIT_CONSUMPTION_PROJECTION = function PAYROLL_BENEFIT_CONSUMPTION_PROJECTION() {
|
|
808
821
|
return ['id',
|
|
809
822
|
// eslint-disable-next-line max-len
|
|
810
|
-
'benefit{id,isDeleted,jsonExt,dateCreated,dateUpdated,dateValidFrom,dateValidTo,id,code,individual {firstName, lastName},benefitAttachment {bill {id, code, terms, datePayed}},receipt,photo,amount,type,status,dateDue}', 'payroll {id, name, status, paymentCycle {code, startDate, endDate}, paymentMethod, benefitPlanNameCode}'];
|
|
823
|
+
'benefit{id,isDeleted,jsonExt,dateCreated,dateUpdated,dateValidFrom,dateValidTo,id,code,individual {firstName, lastName},benefitAttachment {bill {id, code, terms, datePayed}},receipt,photo,amount,type,status,dateDue,paymentDate}', 'payroll {id, name, status, paymentCycle {code, startDate, endDate}, paymentMethod, paymentDate, benefitPlanNameCode}'];
|
|
811
824
|
};
|
|
812
825
|
var BENEFIT_CONSUMPTION_SUMMARY_PROJECTION = function BENEFIT_CONSUMPTION_SUMMARY_PROJECTION() {
|
|
813
826
|
return ['totalAmountReceived', 'totalAmountDue'];
|
|
@@ -819,10 +832,10 @@ var BISTP_SUMMARY_PROJECTION = function BISTP_SUMMARY_PROJECTION() {
|
|
|
819
832
|
return ['bistpSummary { total reconciled rejected pending skippedNib sendFailed }'];
|
|
820
833
|
};
|
|
821
834
|
var PAYROLL_PROJECTION = function PAYROLL_PROJECTION(modulesManager) {
|
|
822
|
-
return ['id', 'name', 'paymentMethod', 'paymentPlan { code, id, name, benefitPlanType }', 'benefitPlanNameCode', "paymentPoint { ".concat(PAYMENT_POINT_PROJECTION(modulesManager).join(' '), " }"), 'paymentCycle { code, startDate, endDate }', 'jsonExt', 'status', 'dateValidFrom', 'dateValidTo', 'isDeleted'].concat(_toConsumableArray__default["default"](BISTP_SUMMARY_PROJECTION()));
|
|
835
|
+
return ['id', 'name', 'paymentMethod', 'paymentDate', 'paymentPlan { code, id, name, benefitPlanType }', 'benefitPlanNameCode', "paymentPoint { ".concat(PAYMENT_POINT_PROJECTION(modulesManager).join(' '), " }"), 'paymentCycle { code, startDate, endDate }', 'jsonExt', 'status', 'dateValidFrom', 'dateValidTo', 'isDeleted'].concat(_toConsumableArray__default["default"](BISTP_SUMMARY_PROJECTION()));
|
|
823
836
|
};
|
|
824
837
|
var PAYROLL_SEARCHER_PROJECTION = function PAYROLL_SEARCHER_PROJECTION(modulesManager) {
|
|
825
|
-
return ['id', 'name', 'paymentMethod', 'paymentPlan { code, id, name, benefitPlanType }', 'benefitPlanNameCode', "paymentPoint { ".concat(PAYMENT_POINT_PROJECTION(modulesManager).join(' '), " }"), 'paymentCycle { code, startDate, endDate }', 'jsonExt', 'status', 'dateValidFrom', 'dateValidTo', 'isDeleted'].concat(_toConsumableArray__default["default"](BISTP_SUMMARY_PROJECTION()));
|
|
838
|
+
return ['id', 'name', 'paymentMethod', 'paymentDate', 'paymentPlan { code, id, name, benefitPlanType }', 'benefitPlanNameCode', "paymentPoint { ".concat(PAYMENT_POINT_PROJECTION(modulesManager).join(' '), " }"), 'paymentCycle { code, startDate, endDate }', 'jsonExt', 'status', 'dateValidFrom', 'dateValidTo', 'isDeleted'].concat(_toConsumableArray__default["default"](BISTP_SUMMARY_PROJECTION()));
|
|
826
839
|
};
|
|
827
840
|
var CSV_RECONCILIATION_PROJECTION = function CSV_RECONCILIATION_PROJECTION() {
|
|
828
841
|
return ['fileName', 'status', 'error', 'jsonExt'];
|
|
@@ -834,7 +847,7 @@ var formatPaymentPointGQL = function formatPaymentPointGQL(paymentPoint) {
|
|
|
834
847
|
return "\n ".concat(paymentPoint !== null && paymentPoint !== void 0 && paymentPoint.id ? "id: \"".concat(paymentPoint.id, "\"") : '', "\n ").concat(paymentPoint !== null && paymentPoint !== void 0 && paymentPoint.name ? "name: \"".concat(feCore.formatGQLString(paymentPoint.name), "\"") : '', "\n ").concat(paymentPoint !== null && paymentPoint !== void 0 && paymentPoint.location ? "locationId: ".concat(feCore.decodeId(paymentPoint.location.id)) : '', "\n ").concat(paymentPoint !== null && paymentPoint !== void 0 && paymentPoint.ppm ? "ppmId: \"".concat(feCore.decodeId(paymentPoint.ppm.id), "\"") : '', "\n ");
|
|
835
848
|
};
|
|
836
849
|
var formatPayrollGQL = function formatPayrollGQL(payroll) {
|
|
837
|
-
return "\n ".concat(payroll !== null && payroll !== void 0 && payroll.id ? "id: \"".concat(payroll.id, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.name ? "name: \"".concat(feCore.formatGQLString(payroll.name), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentPoint ? "paymentPointId: \"".concat(feCore.decodeId(payroll.paymentPoint.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentPlan ? "paymentPlanId: \"".concat(feCore.decodeId(payroll.paymentPlan.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentCycle ? "paymentCycleId: \"".concat(feCore.decodeId(payroll.paymentCycle.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentMethod ? "paymentMethod: \"".concat(payroll.paymentMethod, "\"") : '', "\n ", "status: ".concat(PAYROLL_STATUS.PENDING_APPROVAL), "\n ").concat(payroll !== null && payroll !== void 0 && payroll.jsonExt ? "jsonExt: ".concat(JSON.stringify(payroll.jsonExt)) : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.dateValidFrom ? "dateValidFrom: \"".concat(payroll.dateValidFrom, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.dateValidTo ? "dateValidTo: \"".concat(payroll.dateValidTo, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.fromFailedInvoicesPayrollId ? "fromFailedInvoicesPayrollId: \"".concat(payroll.fromFailedInvoicesPayrollId, "\"") : '', "\n ");
|
|
850
|
+
return "\n ".concat(payroll !== null && payroll !== void 0 && payroll.id ? "id: \"".concat(payroll.id, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.name ? "name: \"".concat(feCore.formatGQLString(payroll.name), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentPoint ? "paymentPointId: \"".concat(feCore.decodeId(payroll.paymentPoint.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentPlan ? "paymentPlanId: \"".concat(feCore.decodeId(payroll.paymentPlan.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentCycle ? "paymentCycleId: \"".concat(feCore.decodeId(payroll.paymentCycle.id), "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentMethod ? "paymentMethod: \"".concat(payroll.paymentMethod, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.paymentDate ? "paymentDate: \"".concat(payroll.paymentDate, "\"") : '', "\n ", "status: ".concat(PAYROLL_STATUS.PENDING_APPROVAL), "\n ").concat(payroll !== null && payroll !== void 0 && payroll.jsonExt ? "jsonExt: ".concat(JSON.stringify(payroll.jsonExt)) : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.dateValidFrom ? "dateValidFrom: \"".concat(payroll.dateValidFrom, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.dateValidTo ? "dateValidTo: \"".concat(payroll.dateValidTo, "\"") : '', "\n ").concat(payroll !== null && payroll !== void 0 && payroll.fromFailedInvoicesPayrollId ? "fromFailedInvoicesPayrollId: \"".concat(payroll.fromFailedInvoicesPayrollId, "\"") : '', "\n ");
|
|
838
851
|
};
|
|
839
852
|
var PERFORM_MUTATION = function PERFORM_MUTATION(mutationType, mutationInput, ACTION, clientMutationLabel) {
|
|
840
853
|
var mutation = feCore.formatMutation(mutationType, mutationInput, clientMutationLabel);
|
|
@@ -936,6 +949,10 @@ function makePaymentForPayroll(payroll, clientMutationLabel) {
|
|
|
936
949
|
var payrollUuids = "ids: [\"".concat(payroll === null || payroll === void 0 ? void 0 : payroll.id, "\"]");
|
|
937
950
|
return PERFORM_MUTATION(MUTATION_SERVICE.PAYROLL.MAKE_PAYMENT, payrollUuids, ACTION_TYPE.MAKE_PAYMENT_PAYROLL, clientMutationLabel);
|
|
938
951
|
}
|
|
952
|
+
function updatePayrollPaymentDate(payroll, paymentDate, clientMutationLabel) {
|
|
953
|
+
var mutationInput = "\n id: \"".concat(payroll === null || payroll === void 0 ? void 0 : payroll.id, "\"\n paymentDate: \"").concat(paymentDate, "\"\n ");
|
|
954
|
+
return PERFORM_MUTATION(MUTATION_SERVICE.PAYROLL.UPDATE_PAYMENT_DATE, mutationInput, ACTION_TYPE.UPDATE_PAYROLL_PAYMENT_DATE, clientMutationLabel);
|
|
955
|
+
}
|
|
939
956
|
function fetchBistpSummary(payrollId) {
|
|
940
957
|
var query = "\n {\n total: benefitConsumptionByPayroll(payrollUuid: \"".concat(payrollId, "\", first: 0) { totalCount }\n pendentes: benefitConsumptionByPayroll(payrollUuid: \"").concat(payrollId, "\", status: ACCEPTED, first: 0) { totalCount }\n enviados: benefitConsumptionByPayroll(payrollUuid: \"").concat(payrollId, "\", status: APPROVE_FOR_PAYMENT, first: 0) { totalCount }\n confirmados: benefitConsumptionByPayroll(payrollUuid: \"").concat(payrollId, "\", status: RECONCILED, first: 0) { totalCount }\n rejeitados: benefitConsumptionByPayroll(payrollUuid: \"").concat(payrollId, "\", status: REJECTED, first: 0) { totalCount }\n }\n ");
|
|
941
958
|
return feCore.graphql(query, ACTION_TYPE.GET_BISTP_SUMMARY);
|
|
@@ -1152,7 +1169,7 @@ function PaymentPointPage(_ref) {
|
|
|
1152
1169
|
saveTooltip: formatMessage('tooltip.save')
|
|
1153
1170
|
})));
|
|
1154
1171
|
}
|
|
1155
|
-
var mapDispatchToProps$
|
|
1172
|
+
var mapDispatchToProps$j = function mapDispatchToProps(dispatch) {
|
|
1156
1173
|
return redux.bindActionCreators({
|
|
1157
1174
|
clearPaymentPoint: clearPaymentPoint,
|
|
1158
1175
|
createPaymentPoint: createPaymentPoint,
|
|
@@ -1164,7 +1181,7 @@ var mapDispatchToProps$i = function mapDispatchToProps(dispatch) {
|
|
|
1164
1181
|
journalize: feCore.journalize
|
|
1165
1182
|
}, dispatch);
|
|
1166
1183
|
};
|
|
1167
|
-
var mapStateToProps$
|
|
1184
|
+
var mapStateToProps$j = function mapStateToProps(state, props) {
|
|
1168
1185
|
var _state$core$user$i_us, _state$core;
|
|
1169
1186
|
return {
|
|
1170
1187
|
paymentPointUuid: props.match.params.payment_point_uuid,
|
|
@@ -1175,7 +1192,7 @@ var mapStateToProps$i = function mapStateToProps(state, props) {
|
|
|
1175
1192
|
paymentPoint: state.payroll.paymentPoint
|
|
1176
1193
|
};
|
|
1177
1194
|
};
|
|
1178
|
-
var PaymentPointPage$1 = reactRedux.connect(mapStateToProps$
|
|
1195
|
+
var PaymentPointPage$1 = reactRedux.connect(mapStateToProps$j, mapDispatchToProps$j)(PaymentPointPage);
|
|
1179
1196
|
|
|
1180
1197
|
var useStyles$f = styles$7.makeStyles(function (theme) {
|
|
1181
1198
|
return {
|
|
@@ -1440,7 +1457,7 @@ function PaymentPointSearcher(_ref) {
|
|
|
1440
1457
|
rowLocked: isRowDisabled
|
|
1441
1458
|
});
|
|
1442
1459
|
}
|
|
1443
|
-
var mapStateToProps$
|
|
1460
|
+
var mapStateToProps$i = function mapStateToProps(state) {
|
|
1444
1461
|
return {
|
|
1445
1462
|
fetchingPaymentPoints: state.payroll.fetchingPaymentPoints,
|
|
1446
1463
|
fetchedPaymentPoints: state.payroll.fetchedPaymentPoints,
|
|
@@ -1453,7 +1470,7 @@ var mapStateToProps$h = function mapStateToProps(state) {
|
|
|
1453
1470
|
mutation: state.payroll.mutation
|
|
1454
1471
|
};
|
|
1455
1472
|
};
|
|
1456
|
-
var mapDispatchToProps$
|
|
1473
|
+
var mapDispatchToProps$i = function mapDispatchToProps(dispatch) {
|
|
1457
1474
|
return redux.bindActionCreators({
|
|
1458
1475
|
fetchPaymentPoints: fetchPaymentPoints,
|
|
1459
1476
|
deletePaymentPoint: deletePaymentPoint,
|
|
@@ -1462,7 +1479,7 @@ var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
|
|
|
1462
1479
|
coreConfirm: feCore.coreConfirm
|
|
1463
1480
|
}, dispatch);
|
|
1464
1481
|
};
|
|
1465
|
-
var PaymentPointSearcher$1 = reactRedux.connect(mapStateToProps$
|
|
1482
|
+
var PaymentPointSearcher$1 = reactRedux.connect(mapStateToProps$i, mapDispatchToProps$i)(PaymentPointSearcher);
|
|
1466
1483
|
|
|
1467
1484
|
var useStyles$e = styles$7.makeStyles(function (theme) {
|
|
1468
1485
|
return {
|
|
@@ -1792,7 +1809,7 @@ function AdvancedFiltersDialog(_ref) {
|
|
|
1792
1809
|
disabled: !object || confirmed || readOnly
|
|
1793
1810
|
}, feCore.formatMessage(intl, 'payroll', 'payroll.advancedFilters.button.filter')))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null)));
|
|
1794
1811
|
}
|
|
1795
|
-
var mapStateToProps$
|
|
1812
|
+
var mapStateToProps$h = function mapStateToProps(state, props) {
|
|
1796
1813
|
return {
|
|
1797
1814
|
rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
|
|
1798
1815
|
confirmed: state.core.confirmed,
|
|
@@ -1802,12 +1819,12 @@ var mapStateToProps$g = function mapStateToProps(state, props) {
|
|
|
1802
1819
|
customFilters: state.core.customFilters
|
|
1803
1820
|
};
|
|
1804
1821
|
};
|
|
1805
|
-
var mapDispatchToProps$
|
|
1822
|
+
var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
|
|
1806
1823
|
return redux.bindActionCreators({
|
|
1807
1824
|
fetchCustomFilter: feCore.fetchCustomFilter
|
|
1808
1825
|
}, dispatch);
|
|
1809
1826
|
};
|
|
1810
|
-
var AdvancedFiltersDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$3)(reactRedux.connect(mapStateToProps$
|
|
1827
|
+
var AdvancedFiltersDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$3)(reactRedux.connect(mapStateToProps$h, mapDispatchToProps$h)(AdvancedFiltersDialog))));
|
|
1811
1828
|
|
|
1812
1829
|
function PayrollStatusPicker(_ref) {
|
|
1813
1830
|
var required = _ref.required,
|
|
@@ -1875,7 +1892,7 @@ function PaymentMethodPicker(_ref) {
|
|
|
1875
1892
|
required: required
|
|
1876
1893
|
});
|
|
1877
1894
|
}
|
|
1878
|
-
var mapStateToProps$
|
|
1895
|
+
var mapStateToProps$g = function mapStateToProps(state) {
|
|
1879
1896
|
return {
|
|
1880
1897
|
rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
|
|
1881
1898
|
confirmed: state.core.confirmed,
|
|
@@ -1885,12 +1902,99 @@ var mapStateToProps$f = function mapStateToProps(state) {
|
|
|
1885
1902
|
paymentMethods: state.payroll.paymentMethods
|
|
1886
1903
|
};
|
|
1887
1904
|
};
|
|
1888
|
-
var mapDispatchToProps$
|
|
1905
|
+
var mapDispatchToProps$g = function mapDispatchToProps(dispatch) {
|
|
1889
1906
|
return redux.bindActionCreators({
|
|
1890
1907
|
fetchPaymentMethods: fetchPaymentMethods
|
|
1891
1908
|
}, dispatch);
|
|
1892
1909
|
};
|
|
1893
|
-
var PaymentMethodPicker$1 = reactRedux.connect(mapStateToProps$
|
|
1910
|
+
var PaymentMethodPicker$1 = reactRedux.connect(mapStateToProps$g, mapDispatchToProps$g)(PaymentMethodPicker);
|
|
1911
|
+
|
|
1912
|
+
var EDITABLE_STATUSES = [PAYROLL_STATUS.PENDING_APPROVAL, PAYROLL_STATUS.APPROVE_FOR_PAYMENT];
|
|
1913
|
+
function PayrollPaymentDateDialog(_ref) {
|
|
1914
|
+
var payroll = _ref.payroll,
|
|
1915
|
+
updatePayrollPaymentDate = _ref.updatePayrollPaymentDate,
|
|
1916
|
+
fetchPayroll = _ref.fetchPayroll,
|
|
1917
|
+
submittingMutation = _ref.submittingMutation,
|
|
1918
|
+
mutation = _ref.mutation;
|
|
1919
|
+
var modulesManager = feCore.useModulesManager();
|
|
1920
|
+
var _useTranslations = feCore.useTranslations(MODULE_NAME, modulesManager),
|
|
1921
|
+
formatMessage = _useTranslations.formatMessage,
|
|
1922
|
+
formatMessageWithValues = _useTranslations.formatMessageWithValues;
|
|
1923
|
+
var _useState = React.useState(false),
|
|
1924
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
1925
|
+
isOpen = _useState2[0],
|
|
1926
|
+
setIsOpen = _useState2[1];
|
|
1927
|
+
var _useState3 = React.useState(null),
|
|
1928
|
+
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
1929
|
+
paymentDate = _useState4[0],
|
|
1930
|
+
setPaymentDate = _useState4[1];
|
|
1931
|
+
var handleOpen = function handleOpen() {
|
|
1932
|
+
var _payroll$paymentDate;
|
|
1933
|
+
setPaymentDate((_payroll$paymentDate = payroll === null || payroll === void 0 ? void 0 : payroll.paymentDate) !== null && _payroll$paymentDate !== void 0 ? _payroll$paymentDate : null);
|
|
1934
|
+
setIsOpen(true);
|
|
1935
|
+
};
|
|
1936
|
+
var handleClose = function handleClose() {
|
|
1937
|
+
setIsOpen(false);
|
|
1938
|
+
};
|
|
1939
|
+
var handleSave = function handleSave() {
|
|
1940
|
+
if (!paymentDate) return;
|
|
1941
|
+
updatePayrollPaymentDate(payroll, paymentDate, formatMessageWithValues('payroll.paymentDate.mutation.updateLabel', mutationLabel(payroll)));
|
|
1942
|
+
};
|
|
1943
|
+
React.useEffect(function () {
|
|
1944
|
+
if (!submittingMutation && (mutation === null || mutation === void 0 ? void 0 : mutation.actionType) === ACTION_TYPE.UPDATE_PAYROLL_PAYMENT_DATE && mutation !== null && mutation !== void 0 && mutation.clientMutationId && isOpen) {
|
|
1945
|
+
handleClose();
|
|
1946
|
+
if (payroll !== null && payroll !== void 0 && payroll.id) {
|
|
1947
|
+
fetchPayroll(modulesManager, ["id: \"".concat(payroll.id, "\"")]);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}, [submittingMutation]);
|
|
1951
|
+
if (!(payroll !== null && payroll !== void 0 && payroll.id)) return null;
|
|
1952
|
+
if (!EDITABLE_STATUSES.includes(payroll === null || payroll === void 0 ? void 0 : payroll.status)) return null;
|
|
1953
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
1954
|
+
onClick: handleOpen,
|
|
1955
|
+
variant: "outlined",
|
|
1956
|
+
color: "primary",
|
|
1957
|
+
style: {
|
|
1958
|
+
marginTop: '16px'
|
|
1959
|
+
}
|
|
1960
|
+
}, formatMessage('payroll.paymentDate.update')), /*#__PURE__*/React__default["default"].createElement(Dialog__default["default"], {
|
|
1961
|
+
open: isOpen,
|
|
1962
|
+
onClose: handleClose
|
|
1963
|
+
}, /*#__PURE__*/React__default["default"].createElement(DialogTitle__default["default"], null, formatMessage('payroll.paymentDate.update')), /*#__PURE__*/React__default["default"].createElement(DialogContent__default["default"], {
|
|
1964
|
+
style: {
|
|
1965
|
+
minWidth: 400
|
|
1966
|
+
}
|
|
1967
|
+
}, /*#__PURE__*/React__default["default"].createElement(feCore.PublishedComponent, {
|
|
1968
|
+
pubRef: "core.DatePicker",
|
|
1969
|
+
module: "payroll",
|
|
1970
|
+
label: "payroll.paymentDate",
|
|
1971
|
+
value: paymentDate,
|
|
1972
|
+
onChange: setPaymentDate,
|
|
1973
|
+
required: true,
|
|
1974
|
+
disablePast: true
|
|
1975
|
+
})), /*#__PURE__*/React__default["default"].createElement(DialogActions__default["default"], null, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
1976
|
+
onClick: handleClose,
|
|
1977
|
+
color: "primary"
|
|
1978
|
+
}, formatMessage('payroll.beneficiaries.cancel')), /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
1979
|
+
onClick: handleSave,
|
|
1980
|
+
color: "primary",
|
|
1981
|
+
variant: "contained",
|
|
1982
|
+
disabled: !paymentDate
|
|
1983
|
+
}, formatMessage('payroll.beneficiaries.confirm')))));
|
|
1984
|
+
}
|
|
1985
|
+
var mapStateToProps$f = function mapStateToProps(state) {
|
|
1986
|
+
return {
|
|
1987
|
+
submittingMutation: state.payroll.submittingMutation,
|
|
1988
|
+
mutation: state.payroll.mutation
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
var mapDispatchToProps$f = function mapDispatchToProps(dispatch) {
|
|
1992
|
+
return redux.bindActionCreators({
|
|
1993
|
+
updatePayrollPaymentDate: updatePayrollPaymentDate,
|
|
1994
|
+
fetchPayroll: fetchPayroll
|
|
1995
|
+
}, dispatch);
|
|
1996
|
+
};
|
|
1997
|
+
var PayrollPaymentDateDialog$1 = reactRedux.connect(mapStateToProps$f, mapDispatchToProps$f)(PayrollPaymentDateDialog);
|
|
1894
1998
|
|
|
1895
1999
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1896
2000
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -2060,6 +2164,28 @@ var PayrollHeadPanel = /*#__PURE__*/function (_FormPanel) {
|
|
|
2060
2164
|
return _this2.updateAttribute('paymentMethod', paymentMethod);
|
|
2061
2165
|
},
|
|
2062
2166
|
label: feCore.formatMessage(intl, 'payroll', 'paymentMethod')
|
|
2167
|
+
})), /*#__PURE__*/React__default["default"].createElement(core.Grid, {
|
|
2168
|
+
item: true,
|
|
2169
|
+
xs: 3,
|
|
2170
|
+
className: classes.item
|
|
2171
|
+
}, /*#__PURE__*/React__default["default"].createElement(feCore.PublishedComponent, {
|
|
2172
|
+
pubRef: "core.DatePicker",
|
|
2173
|
+
module: "payroll",
|
|
2174
|
+
label: "payroll.paymentDate",
|
|
2175
|
+
value: payroll === null || payroll === void 0 ? void 0 : payroll.paymentDate,
|
|
2176
|
+
required: (payroll === null || payroll === void 0 ? void 0 : payroll.paymentMethod) === PAYMENT_METHOD.STRATEGY_BISTP_PAYMENT,
|
|
2177
|
+
readOnly: readOnly,
|
|
2178
|
+
disablePast: !readOnly,
|
|
2179
|
+
onChange: function onChange(paymentDate) {
|
|
2180
|
+
return _this2.updateAttribute('paymentDate', paymentDate);
|
|
2181
|
+
}
|
|
2182
|
+
})), readOnly && /*#__PURE__*/React__default["default"].createElement(core.Grid, {
|
|
2183
|
+
item: true,
|
|
2184
|
+
xs: 3,
|
|
2185
|
+
className: classes.item
|
|
2186
|
+
}, /*#__PURE__*/React__default["default"].createElement(PayrollPaymentDateDialog$1, {
|
|
2187
|
+
payroll: payroll,
|
|
2188
|
+
readOnly: readOnly
|
|
2063
2189
|
}))), /*#__PURE__*/React__default["default"].createElement(core.Divider, null), !isPayrollFromFailedInvoices && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(core.Typography, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2064
2190
|
className: classes.item
|
|
2065
2191
|
}, /*#__PURE__*/React__default["default"].createElement(feCore.FormattedMessage, {
|
|
@@ -3587,7 +3713,7 @@ function PayrollPage(_ref) {
|
|
|
3587
3713
|
};
|
|
3588
3714
|
}, []);
|
|
3589
3715
|
var mandatoryFieldsEmpty = function mandatoryFieldsEmpty() {
|
|
3590
|
-
if (editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.name && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentPlan && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentCycle && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentMethod && !(editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.isDeleted)) return false;
|
|
3716
|
+
if (editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.name && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentPlan && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentCycle && editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentMethod && ((editedPayroll === null || editedPayroll === void 0 ? void 0 : editedPayroll.paymentMethod) !== PAYMENT_METHOD.STRATEGY_BISTP_PAYMENT || editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.paymentDate) && !(editedPayroll !== null && editedPayroll !== void 0 && editedPayroll.isDeleted)) return false;
|
|
3591
3717
|
return true;
|
|
3592
3718
|
};
|
|
3593
3719
|
var canSave = function canSave() {
|
|
@@ -3779,6 +3905,38 @@ function PayrollFilter(_ref) {
|
|
|
3779
3905
|
filter: "paymentMethod: \"".concat(value, "\"")
|
|
3780
3906
|
}]);
|
|
3781
3907
|
}
|
|
3908
|
+
})), /*#__PURE__*/React__default["default"].createElement(core.Grid, {
|
|
3909
|
+
item: true,
|
|
3910
|
+
xs: 2,
|
|
3911
|
+
className: classes.item
|
|
3912
|
+
}, /*#__PURE__*/React__default["default"].createElement(feCore.PublishedComponent, {
|
|
3913
|
+
pubRef: "core.DatePicker",
|
|
3914
|
+
module: "payroll",
|
|
3915
|
+
label: "payroll.paymentDateFrom",
|
|
3916
|
+
value: filterValue('paymentDate_Gte'),
|
|
3917
|
+
onChange: function onChange(value) {
|
|
3918
|
+
return onChangeFilters([{
|
|
3919
|
+
id: 'paymentDate_Gte',
|
|
3920
|
+
value: value,
|
|
3921
|
+
filter: value ? "paymentDate_Gte: \"".concat(value, "\"") : EMPTY_STRING
|
|
3922
|
+
}]);
|
|
3923
|
+
}
|
|
3924
|
+
})), /*#__PURE__*/React__default["default"].createElement(core.Grid, {
|
|
3925
|
+
item: true,
|
|
3926
|
+
xs: 2,
|
|
3927
|
+
className: classes.item
|
|
3928
|
+
}, /*#__PURE__*/React__default["default"].createElement(feCore.PublishedComponent, {
|
|
3929
|
+
pubRef: "core.DatePicker",
|
|
3930
|
+
module: "payroll",
|
|
3931
|
+
label: "payroll.paymentDateTo",
|
|
3932
|
+
value: filterValue('paymentDate_Lte'),
|
|
3933
|
+
onChange: function onChange(value) {
|
|
3934
|
+
return onChangeFilters([{
|
|
3935
|
+
id: 'paymentDate_Lte',
|
|
3936
|
+
value: value,
|
|
3937
|
+
filter: value ? "paymentDate_Lte: \"".concat(value, "\"") : EMPTY_STRING
|
|
3938
|
+
}]);
|
|
3939
|
+
}
|
|
3782
3940
|
})), /*#__PURE__*/React__default["default"].createElement(feCore.ControlledField, {
|
|
3783
3941
|
module: "payroll",
|
|
3784
3942
|
id: "payrollFilter.showHistory",
|
|
@@ -3863,10 +4021,10 @@ function PayrollSearcher(_ref) {
|
|
|
3863
4021
|
prevSubmittingMutationRef.current = submittingMutation;
|
|
3864
4022
|
});
|
|
3865
4023
|
var headers = function headers() {
|
|
3866
|
-
return ['payroll.name', 'payroll.benefitPlan', 'payroll.paymentPoint', 'payroll.status', 'payroll.paymentMethod', 'payroll.bistp.progress', 'emptyLabel'];
|
|
4024
|
+
return ['payroll.name', 'payroll.benefitPlan', 'payroll.paymentPoint', 'payroll.status', 'payroll.paymentMethod', 'payroll.paymentDate', 'payroll.bistp.progress', 'emptyLabel'];
|
|
3867
4025
|
};
|
|
3868
4026
|
var sorts = function sorts() {
|
|
3869
|
-
return [['name', true], ['benefitPlanNameCode', true], ['paymentPoint', true], ['status', true], ['paymentMethod', true]];
|
|
4027
|
+
return [['name', true], ['benefitPlanNameCode', true], ['paymentPoint', true], ['status', true], ['paymentMethod', true], ['paymentDate', true]];
|
|
3870
4028
|
};
|
|
3871
4029
|
var renderBistpProgress = function renderBistpProgress(payroll) {
|
|
3872
4030
|
if (payroll.paymentMethod !== PAYMENT_METHOD.STRATEGY_BISTP_PAYMENT) return null;
|
|
@@ -3928,6 +4086,9 @@ function PayrollSearcher(_ref) {
|
|
|
3928
4086
|
return payroll.status ? "".concat(payroll.status) : '';
|
|
3929
4087
|
}, function (payroll) {
|
|
3930
4088
|
return payroll.paymentMethod ? "".concat(payroll.paymentMethod) : '';
|
|
4089
|
+
}, function (payroll) {
|
|
4090
|
+
var _payroll$paymentDate;
|
|
4091
|
+
return (_payroll$paymentDate = payroll.paymentDate) !== null && _payroll$paymentDate !== void 0 ? _payroll$paymentDate : '—';
|
|
3931
4092
|
}, function (payroll) {
|
|
3932
4093
|
return renderBistpProgress(payroll);
|
|
3933
4094
|
}, function (payroll) {
|
|
@@ -5728,9 +5889,11 @@ function BenefitConsumptionSearcher(_ref) {
|
|
|
5728
5889
|
return isPayrollFromFailedInvoices ? BENEFIT_CONSUMPTION_STATUS.APPROVE_FOR_PAYMENT : benefitConsumption === null || benefitConsumption === void 0 ? void 0 : benefitConsumption.status;
|
|
5729
5890
|
}, function (benefitConsumption) {
|
|
5730
5891
|
return checkBenefitDueDate(benefitConsumption);
|
|
5731
|
-
},
|
|
5732
|
-
|
|
5733
|
-
|
|
5892
|
+
},
|
|
5893
|
+
// paymentDate enviada ao BISTP; fallback para bill.datePayed (offline); "—" se ainda não enviado
|
|
5894
|
+
function (benefitConsumption) {
|
|
5895
|
+
var _benefitConsumption$p, _benefitConsumption$b, _benefitConsumption$b2;
|
|
5896
|
+
return (_benefitConsumption$p = benefitConsumption === null || benefitConsumption === void 0 ? void 0 : benefitConsumption.paymentDate) !== null && _benefitConsumption$p !== void 0 ? _benefitConsumption$p : !benefitConsumption.receipt ? '—' : (_benefitConsumption$b = benefitConsumption === null || benefitConsumption === void 0 || (_benefitConsumption$b2 = benefitConsumption.benefitAttachment) === null || _benefitConsumption$b2 === void 0 || (_benefitConsumption$b2 = _benefitConsumption$b2[0]) === null || _benefitConsumption$b2 === void 0 || (_benefitConsumption$b2 = _benefitConsumption$b2.bill) === null || _benefitConsumption$b2 === void 0 ? void 0 : _benefitConsumption$b2.datePayed) !== null && _benefitConsumption$b !== void 0 ? _benefitConsumption$b : '—';
|
|
5734
5897
|
}, function (benefitConsumption) {
|
|
5735
5898
|
var jsonExt = (benefitConsumption === null || benefitConsumption === void 0 ? void 0 : benefitConsumption.jsonExt) || {};
|
|
5736
5899
|
var hasBistpFields = jsonExt.bistp_skip_reason || jsonExt.bistp_processed || jsonExt.bistp_rejection_reason;
|
|
@@ -5751,7 +5914,7 @@ function BenefitConsumptionSearcher(_ref) {
|
|
|
5751
5914
|
return benefitConsumption.id;
|
|
5752
5915
|
};
|
|
5753
5916
|
var sorts = function sorts() {
|
|
5754
|
-
return [['individual_FirstName', true], ['individual_LastName', true], ['individual_Nib', true], ['photo', true], ['code', true], ['dateDue', true], ['receipt', true], ['amount', true], ['type', true], ['status', true]];
|
|
5917
|
+
return [['individual_FirstName', true], ['individual_LastName', true], ['individual_Nib', true], ['photo', true], ['code', true], ['dateDue', true], ['receipt', true], ['amount', true], ['type', true], ['status', true], ['paymentDate', true]];
|
|
5755
5918
|
};
|
|
5756
5919
|
var defaultFilters = function defaultFilters() {
|
|
5757
5920
|
var filters = {
|