@stssocialst-stp/fe-payroll 0.3.2 → 0.3.4

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.js CHANGED
@@ -198,6 +198,7 @@ var ACTION_TYPE = {
198
198
  MAKE_PAYMENT_PAYROLL: 'PAYROLL_MUTATION_MAKE_PAYMENT_PAYROLL',
199
199
  GET_PAYROLL_PAYMENT_FILES: 'GET_PAYROLL_PAYMENT_FILES',
200
200
  BENEFITS_SUMMARY: 'PAYROLL_BENEFITS_SUMMARY',
201
+ GET_BISTP_SUMMARY: 'PAYROLL_BISTP_SUMMARY',
201
202
  DELETE_BENEFIT_CONSUMPTION: 'BENEFIT_CONSUMPTION_MUTATION_DELETE_BENEFIT_CONSUMPTION'
202
203
  };
203
204
  var MUTATION_SERVICE = {
@@ -271,7 +272,11 @@ var STORE_STATE = {
271
272
  benefitsSummary: [],
272
273
  benefitsSummaryError: null,
273
274
  fetchingBenefitsSummary: true,
274
- fetchedBenefitsSummary: false
275
+ fetchedBenefitsSummary: false,
276
+ fetchingBistpSummary: false,
277
+ fetchedBistpSummary: false,
278
+ bistpSummary: {},
279
+ errorBistpSummary: null
275
280
  };
276
281
  function reducer() {
277
282
  var _parseData, _action$payload$data$, _action$payload$data$2, _parseData2, _action$payload$data$3, _action$payload$data$4, _parseData3, _parseData4, _parseData5, _action$payload$data$5, _action$payload$data$6, _parseData6, _action$payload$data$7, _action$payload$data$8, _parseData7, _action$payload$data$9, _action$payload$data$0, _parseData8, _action$payload$data$1, _action$payload$data$10;
@@ -561,6 +566,25 @@ function reducer() {
561
566
  fetchingBenefitsSummary: false,
562
567
  benefitsSummaryError: feCore.formatServerError(action.payload)
563
568
  });
569
+ case REQUEST(ACTION_TYPE.GET_BISTP_SUMMARY):
570
+ return _objectSpread$6(_objectSpread$6({}, state), {}, {
571
+ fetchingBistpSummary: true,
572
+ fetchedBistpSummary: false,
573
+ bistpSummary: {},
574
+ errorBistpSummary: null
575
+ });
576
+ case SUCCESS(ACTION_TYPE.GET_BISTP_SUMMARY):
577
+ return _objectSpread$6(_objectSpread$6({}, state), {}, {
578
+ fetchingBistpSummary: false,
579
+ fetchedBistpSummary: true,
580
+ bistpSummary: action.payload.data,
581
+ errorBistpSummary: feCore.formatGraphQLError(action.payload)
582
+ });
583
+ case ERROR(ACTION_TYPE.GET_BISTP_SUMMARY):
584
+ return _objectSpread$6(_objectSpread$6({}, state), {}, {
585
+ fetchingBistpSummary: false,
586
+ errorBistpSummary: feCore.formatServerError(action.payload)
587
+ });
564
588
  case REQUEST(ACTION_TYPE.MUTATION):
565
589
  return feCore.dispatchMutationReq(state, action);
566
590
  case ERROR(ACTION_TYPE.MUTATION):
@@ -907,6 +931,12 @@ function makePaymentForPayroll(payroll, clientMutationLabel) {
907
931
  var payrollUuids = "ids: [\"".concat(payroll === null || payroll === void 0 ? void 0 : payroll.id, "\"]");
908
932
  return PERFORM_MUTATION(MUTATION_SERVICE.PAYROLL.MAKE_PAYMENT, payrollUuids, ACTION_TYPE.MAKE_PAYMENT_PAYROLL, clientMutationLabel);
909
933
  }
934
+ function fetchBistpSummary(payrollId) {
935
+ var query = "\n query ResumoPagamentos($payrollId: UUID!) {\n total: benefitConsumptionByPayroll(payrollUuid: $payrollId, first: 0) { totalCount }\n pendentes: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: ACCEPTED, first: 0) { totalCount }\n enviados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: APPROVE_FOR_PAYMENT, first: 0) { totalCount }\n confirmados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: RECONCILED, first: 0) { totalCount }\n rejeitados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: REJECTED, first: 0) { totalCount }\n }\n ";
936
+ return feCore.graphql(query, ACTION_TYPE.GET_BISTP_SUMMARY, {
937
+ payrollId: payrollId
938
+ });
939
+ }
910
940
 
911
941
  var pageTitle = function pageTitle(item) {
912
942
  return {
@@ -1119,7 +1149,7 @@ function PaymentPointPage(_ref) {
1119
1149
  saveTooltip: formatMessage('tooltip.save')
1120
1150
  })));
1121
1151
  }
1122
- var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
1152
+ var mapDispatchToProps$i = function mapDispatchToProps(dispatch) {
1123
1153
  return redux.bindActionCreators({
1124
1154
  clearPaymentPoint: clearPaymentPoint,
1125
1155
  createPaymentPoint: createPaymentPoint,
@@ -1131,7 +1161,7 @@ var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
1131
1161
  journalize: feCore.journalize
1132
1162
  }, dispatch);
1133
1163
  };
1134
- var mapStateToProps$h = function mapStateToProps(state, props) {
1164
+ var mapStateToProps$i = function mapStateToProps(state, props) {
1135
1165
  var _state$core$user$i_us, _state$core;
1136
1166
  return {
1137
1167
  paymentPointUuid: props.match.params.payment_point_uuid,
@@ -1142,7 +1172,7 @@ var mapStateToProps$h = function mapStateToProps(state, props) {
1142
1172
  paymentPoint: state.payroll.paymentPoint
1143
1173
  };
1144
1174
  };
1145
- var PaymentPointPage$1 = reactRedux.connect(mapStateToProps$h, mapDispatchToProps$h)(PaymentPointPage);
1175
+ var PaymentPointPage$1 = reactRedux.connect(mapStateToProps$i, mapDispatchToProps$i)(PaymentPointPage);
1146
1176
 
1147
1177
  var useStyles$f = styles$7.makeStyles(function (theme) {
1148
1178
  return {
@@ -1407,7 +1437,7 @@ function PaymentPointSearcher(_ref) {
1407
1437
  rowLocked: isRowDisabled
1408
1438
  });
1409
1439
  }
1410
- var mapStateToProps$g = function mapStateToProps(state) {
1440
+ var mapStateToProps$h = function mapStateToProps(state) {
1411
1441
  return {
1412
1442
  fetchingPaymentPoints: state.payroll.fetchingPaymentPoints,
1413
1443
  fetchedPaymentPoints: state.payroll.fetchedPaymentPoints,
@@ -1420,7 +1450,7 @@ var mapStateToProps$g = function mapStateToProps(state) {
1420
1450
  mutation: state.payroll.mutation
1421
1451
  };
1422
1452
  };
1423
- var mapDispatchToProps$g = function mapDispatchToProps(dispatch) {
1453
+ var mapDispatchToProps$h = function mapDispatchToProps(dispatch) {
1424
1454
  return redux.bindActionCreators({
1425
1455
  fetchPaymentPoints: fetchPaymentPoints,
1426
1456
  deletePaymentPoint: deletePaymentPoint,
@@ -1429,7 +1459,7 @@ var mapDispatchToProps$g = function mapDispatchToProps(dispatch) {
1429
1459
  coreConfirm: feCore.coreConfirm
1430
1460
  }, dispatch);
1431
1461
  };
1432
- var PaymentPointSearcher$1 = reactRedux.connect(mapStateToProps$g, mapDispatchToProps$g)(PaymentPointSearcher);
1462
+ var PaymentPointSearcher$1 = reactRedux.connect(mapStateToProps$h, mapDispatchToProps$h)(PaymentPointSearcher);
1433
1463
 
1434
1464
  var useStyles$e = styles$7.makeStyles(function (theme) {
1435
1465
  return {
@@ -1759,7 +1789,7 @@ function AdvancedFiltersDialog(_ref) {
1759
1789
  disabled: !object || confirmed || readOnly
1760
1790
  }, feCore.formatMessage(intl, 'payroll', 'payroll.advancedFilters.button.filter')))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null)));
1761
1791
  }
1762
- var mapStateToProps$f = function mapStateToProps(state, props) {
1792
+ var mapStateToProps$g = function mapStateToProps(state, props) {
1763
1793
  return {
1764
1794
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
1765
1795
  confirmed: state.core.confirmed,
@@ -1769,12 +1799,12 @@ var mapStateToProps$f = function mapStateToProps(state, props) {
1769
1799
  customFilters: state.core.customFilters
1770
1800
  };
1771
1801
  };
1772
- var mapDispatchToProps$f = function mapDispatchToProps(dispatch) {
1802
+ var mapDispatchToProps$g = function mapDispatchToProps(dispatch) {
1773
1803
  return redux.bindActionCreators({
1774
1804
  fetchCustomFilter: feCore.fetchCustomFilter
1775
1805
  }, dispatch);
1776
1806
  };
1777
- var AdvancedFiltersDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$3)(reactRedux.connect(mapStateToProps$f, mapDispatchToProps$f)(AdvancedFiltersDialog))));
1807
+ var AdvancedFiltersDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$3)(reactRedux.connect(mapStateToProps$g, mapDispatchToProps$g)(AdvancedFiltersDialog))));
1778
1808
 
1779
1809
  function PayrollStatusPicker(_ref) {
1780
1810
  var required = _ref.required,
@@ -1842,7 +1872,7 @@ function PaymentMethodPicker(_ref) {
1842
1872
  required: required
1843
1873
  });
1844
1874
  }
1845
- var mapStateToProps$e = function mapStateToProps(state) {
1875
+ var mapStateToProps$f = function mapStateToProps(state) {
1846
1876
  return {
1847
1877
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
1848
1878
  confirmed: state.core.confirmed,
@@ -1852,12 +1882,12 @@ var mapStateToProps$e = function mapStateToProps(state) {
1852
1882
  paymentMethods: state.payroll.paymentMethods
1853
1883
  };
1854
1884
  };
1855
- var mapDispatchToProps$e = function mapDispatchToProps(dispatch) {
1885
+ var mapDispatchToProps$f = function mapDispatchToProps(dispatch) {
1856
1886
  return redux.bindActionCreators({
1857
1887
  fetchPaymentMethods: fetchPaymentMethods
1858
1888
  }, dispatch);
1859
1889
  };
1860
- var PaymentMethodPicker$1 = reactRedux.connect(mapStateToProps$e, mapDispatchToProps$e)(PaymentMethodPicker);
1890
+ var PaymentMethodPicker$1 = reactRedux.connect(mapStateToProps$f, mapDispatchToProps$f)(PaymentMethodPicker);
1861
1891
 
1862
1892
  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; }
1863
1893
  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; }
@@ -2226,16 +2256,16 @@ function PayrollPaymentDataUploadDialog(_ref) {
2226
2256
  disabled: !((_forms$paymentData = forms.paymentData) !== null && _forms$paymentData !== void 0 && _forms$paymentData.file && payrollUuid)
2227
2257
  }, feCore.formatMessage(intl, 'payroll', 'payroll.paymentData.upload.label'))))))));
2228
2258
  }
2229
- var mapStateToProps$d = function mapStateToProps(state) {
2259
+ var mapStateToProps$e = function mapStateToProps(state) {
2230
2260
  return {
2231
2261
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
2232
2262
  confirmed: state.core.confirmed
2233
2263
  };
2234
2264
  };
2235
- var mapDispatchToProps$d = function mapDispatchToProps(dispatch) {
2265
+ var mapDispatchToProps$e = function mapDispatchToProps(dispatch) {
2236
2266
  return redux.bindActionCreators({}, dispatch);
2237
2267
  };
2238
- var PayrollPaymentDataUploadDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$1)(reactRedux.connect(mapStateToProps$d, mapDispatchToProps$d)(PayrollPaymentDataUploadDialog))));
2268
+ var PayrollPaymentDataUploadDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles$1)(reactRedux.connect(mapStateToProps$e, mapDispatchToProps$e)(PayrollPaymentDataUploadDialog))));
2239
2269
 
2240
2270
  var useStyles$d = styles$7.makeStyles(function (theme) {
2241
2271
  return {
@@ -2500,15 +2530,15 @@ function AdditionalFieldsDialog(_ref) {
2500
2530
  }
2501
2531
  }))))));
2502
2532
  }
2503
- var mapStateToProps$c = function mapStateToProps(state) {
2533
+ var mapStateToProps$d = function mapStateToProps(state) {
2504
2534
  return {
2505
2535
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : []
2506
2536
  };
2507
2537
  };
2508
- var mapDispatchToProps$c = function mapDispatchToProps(dispatch) {
2538
+ var mapDispatchToProps$d = function mapDispatchToProps(dispatch) {
2509
2539
  return redux.bindActionCreators({}, dispatch);
2510
2540
  };
2511
- var AdditionalFieldsDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles)(reactRedux.connect(mapStateToProps$c, mapDispatchToProps$c)(AdditionalFieldsDialog))));
2541
+ var AdditionalFieldsDialog$1 = reactIntl.injectIntl(styles$6.withTheme(styles$6.withStyles(styles)(reactRedux.connect(mapStateToProps$d, mapDispatchToProps$d)(AdditionalFieldsDialog))));
2512
2542
 
2513
2543
  /* eslint-disable max-len */
2514
2544
  var useStyles$c = styles$7.makeStyles(function () {
@@ -2882,7 +2912,7 @@ function BenefitConsumptionSearcherModal(_ref) {
2882
2912
  benefitAttachments: benefitAttachments
2883
2913
  }))));
2884
2914
  }
2885
- var mapStateToProps$b = function mapStateToProps(state) {
2915
+ var mapStateToProps$c = function mapStateToProps(state) {
2886
2916
  return {
2887
2917
  fetchingBenefitAttachments: state.payroll.fetchingBenefitAttachments,
2888
2918
  fetchedBenefitAttachments: state.payroll.fetchedBenefitAttachments,
@@ -2892,13 +2922,13 @@ var mapStateToProps$b = function mapStateToProps(state) {
2892
2922
  benefitAttachmentsTotalCount: state.payroll.benefitAttachmentsTotalCount
2893
2923
  };
2894
2924
  };
2895
- var mapDispatchToProps$b = function mapDispatchToProps(dispatch) {
2925
+ var mapDispatchToProps$c = function mapDispatchToProps(dispatch) {
2896
2926
  return redux.bindActionCreators({
2897
2927
  fetchBenefitAttachments: fetchBenefitAttachments,
2898
2928
  deleteBenefitConsumption: deleteBenefitConsumption
2899
2929
  }, dispatch);
2900
2930
  };
2901
- var BenefitConsumptionSearcherModal$1 = reactRedux.connect(mapStateToProps$b, mapDispatchToProps$b)(BenefitConsumptionSearcherModal);
2931
+ var BenefitConsumptionSearcherModal$1 = reactRedux.connect(mapStateToProps$c, mapDispatchToProps$c)(BenefitConsumptionSearcherModal);
2902
2932
 
2903
2933
  function downloadPayroll(payrollId, payrollFileName) {
2904
2934
  var blank = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
@@ -3166,14 +3196,14 @@ function PaymentApproveForPaymentDialog(_ref) {
3166
3196
  }
3167
3197
  }, formatMessage('payroll.summary.close')))))));
3168
3198
  }
3169
- var mapStateToProps$a = function mapStateToProps(state) {
3199
+ var mapStateToProps$b = function mapStateToProps(state) {
3170
3200
  return {
3171
3201
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
3172
3202
  confirmed: state.core.confirmed,
3173
3203
  payroll: state.payroll.payroll
3174
3204
  };
3175
3205
  };
3176
- var mapDispatchToProps$a = function mapDispatchToProps(dispatch) {
3206
+ var mapDispatchToProps$b = function mapDispatchToProps(dispatch) {
3177
3207
  return redux.bindActionCreators({
3178
3208
  closePayroll: closePayroll,
3179
3209
  rejectPayroll: rejectPayroll,
@@ -3181,7 +3211,7 @@ var mapDispatchToProps$a = function mapDispatchToProps(dispatch) {
3181
3211
  makePaymentForPayroll: makePaymentForPayroll
3182
3212
  }, dispatch);
3183
3213
  };
3184
- var PaymentApproveForPaymentSummary = reactRedux.connect(mapStateToProps$a, mapDispatchToProps$a)(PaymentApproveForPaymentDialog);
3214
+ var PaymentApproveForPaymentSummary = reactRedux.connect(mapStateToProps$b, mapDispatchToProps$b)(PaymentApproveForPaymentDialog);
3185
3215
 
3186
3216
  var useStyles$b = styles$7.makeStyles(function (theme) {
3187
3217
  return {
@@ -3450,7 +3480,7 @@ function PayrollPage(_ref) {
3450
3480
  benefitPlanId: benefitPlanId
3451
3481
  }));
3452
3482
  }
3453
- var mapDispatchToProps$9 = function mapDispatchToProps(dispatch) {
3483
+ var mapDispatchToProps$a = function mapDispatchToProps(dispatch) {
3454
3484
  return redux.bindActionCreators({
3455
3485
  fetchPayroll: fetchPayroll,
3456
3486
  createPayroll: createPayroll,
@@ -3460,7 +3490,7 @@ var mapDispatchToProps$9 = function mapDispatchToProps(dispatch) {
3460
3490
  journalize: feCore.journalize
3461
3491
  }, dispatch);
3462
3492
  };
3463
- var mapStateToProps$9 = function mapStateToProps(state, props) {
3493
+ var mapStateToProps$a = function mapStateToProps(state, props) {
3464
3494
  var _props$match, _props$match2, _props$match3, _props$match4, _state$core$user$i_us, _state$core;
3465
3495
  return {
3466
3496
  statePayrollUuid: (props === null || props === void 0 || (_props$match = props.match) === null || _props$match === void 0 || (_props$match = _props$match.params) === null || _props$match === void 0 ? void 0 : _props$match.payroll_uuid) === 'null' ? null : props === null || props === void 0 || (_props$match2 = props.match) === null || _props$match2 === void 0 ? void 0 : _props$match2.params.payroll_uuid,
@@ -3473,7 +3503,7 @@ var mapStateToProps$9 = function mapStateToProps(state, props) {
3473
3503
  payroll: state.payroll.payroll
3474
3504
  };
3475
3505
  };
3476
- var PayrollPage$1 = reactRedux.connect(mapStateToProps$9, mapDispatchToProps$9)(PayrollPage);
3506
+ var PayrollPage$1 = reactRedux.connect(mapStateToProps$a, mapDispatchToProps$a)(PayrollPage);
3477
3507
 
3478
3508
  var useStyles$9 = styles$7.makeStyles(function (theme) {
3479
3509
  return {
@@ -3808,7 +3838,7 @@ function PayrollSearcher(_ref) {
3808
3838
  rowLocked: isRowDisabled
3809
3839
  });
3810
3840
  }
3811
- var mapStateToProps$8 = function mapStateToProps(state) {
3841
+ var mapStateToProps$9 = function mapStateToProps(state) {
3812
3842
  return {
3813
3843
  fetchingPayrolls: state.payroll.fetchingPayrolls,
3814
3844
  fetchedPayrolls: state.payroll.fetchedPayrolls,
@@ -3821,7 +3851,7 @@ var mapStateToProps$8 = function mapStateToProps(state) {
3821
3851
  mutation: state.payroll.mutation
3822
3852
  };
3823
3853
  };
3824
- var mapDispatchToProps$8 = function mapDispatchToProps(dispatch) {
3854
+ var mapDispatchToProps$9 = function mapDispatchToProps(dispatch) {
3825
3855
  return redux.bindActionCreators({
3826
3856
  fetchPayrolls: fetchPayrolls,
3827
3857
  deletePayrolls: deletePayrolls,
@@ -3830,7 +3860,7 @@ var mapDispatchToProps$8 = function mapDispatchToProps(dispatch) {
3830
3860
  coreConfirm: feCore.coreConfirm
3831
3861
  }, dispatch);
3832
3862
  };
3833
- var PayrollSearcher$1 = reactRedux.connect(mapStateToProps$8, mapDispatchToProps$8)(PayrollSearcher);
3863
+ var PayrollSearcher$1 = reactRedux.connect(mapStateToProps$9, mapDispatchToProps$9)(PayrollSearcher);
3834
3864
 
3835
3865
  var useStyles$8 = styles$7.makeStyles(function (theme) {
3836
3866
  return {
@@ -3947,7 +3977,7 @@ function PayrollPaymentFilesSearcher(_ref) {
3947
3977
  defaultFilters: defaultFilters()
3948
3978
  });
3949
3979
  }
3950
- var mapStateToProps$7 = function mapStateToProps(state) {
3980
+ var mapStateToProps$8 = function mapStateToProps(state) {
3951
3981
  return {
3952
3982
  fetchingPayrollFiles: state.payroll.fetchingPayrollFiles,
3953
3983
  fetchedPayrollFiles: state.payroll.fetchedPayrollFiles,
@@ -3957,12 +3987,12 @@ var mapStateToProps$7 = function mapStateToProps(state) {
3957
3987
  totalCount: state.payroll.payrollFilesTotalCount
3958
3988
  };
3959
3989
  };
3960
- var mapDispatchToProps$7 = function mapDispatchToProps(dispatch) {
3990
+ var mapDispatchToProps$8 = function mapDispatchToProps(dispatch) {
3961
3991
  return redux.bindActionCreators({
3962
3992
  fetchPayrollPaymentFiles: fetchPayrollPaymentFiles
3963
3993
  }, dispatch);
3964
3994
  };
3965
- var PayrollPaymentFilesSearcher$1 = reactRedux.connect(mapStateToProps$7, mapDispatchToProps$7)(PayrollPaymentFilesSearcher);
3995
+ var PayrollPaymentFilesSearcher$1 = reactRedux.connect(mapStateToProps$8, mapDispatchToProps$8)(PayrollPaymentFilesSearcher);
3966
3996
 
3967
3997
  function PayrollReconciliationFilesDialog(_ref) {
3968
3998
  var payroll = _ref.payroll,
@@ -4174,7 +4204,7 @@ function PayrollSearcherApproved(_ref) {
4174
4204
  defaultFilters: defaultFilters()
4175
4205
  });
4176
4206
  }
4177
- var mapStateToProps$6 = function mapStateToProps(state) {
4207
+ var mapStateToProps$7 = function mapStateToProps(state) {
4178
4208
  return {
4179
4209
  fetchingPayrolls: state.payroll.fetchingPayrolls,
4180
4210
  fetchedPayrolls: state.payroll.fetchedPayrolls,
@@ -4187,7 +4217,7 @@ var mapStateToProps$6 = function mapStateToProps(state) {
4187
4217
  mutation: state.payroll.mutation
4188
4218
  };
4189
4219
  };
4190
- var mapDispatchToProps$6 = function mapDispatchToProps(dispatch) {
4220
+ var mapDispatchToProps$7 = function mapDispatchToProps(dispatch) {
4191
4221
  return redux.bindActionCreators({
4192
4222
  fetchPayrolls: fetchPayrolls,
4193
4223
  journalize: feCore.journalize,
@@ -4195,7 +4225,7 @@ var mapDispatchToProps$6 = function mapDispatchToProps(dispatch) {
4195
4225
  coreConfirm: feCore.coreConfirm
4196
4226
  }, dispatch);
4197
4227
  };
4198
- var PayrollSearcherApproved$1 = reactRedux.connect(mapStateToProps$6, mapDispatchToProps$6)(PayrollSearcherApproved);
4228
+ var PayrollSearcherApproved$1 = reactRedux.connect(mapStateToProps$7, mapDispatchToProps$7)(PayrollSearcherApproved);
4199
4229
 
4200
4230
  var useStyles$7 = styles$7.makeStyles(function (theme) {
4201
4231
  return {
@@ -4426,19 +4456,19 @@ function PaymentReconcilationSummarytDialog(_ref) {
4426
4456
  }
4427
4457
  }, formatMessage('payroll.summary.close')))))));
4428
4458
  }
4429
- var mapStateToProps$5 = function mapStateToProps(state) {
4459
+ var mapStateToProps$6 = function mapStateToProps(state) {
4430
4460
  return {
4431
4461
  rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [],
4432
4462
  confirmed: state.core.confirmed,
4433
4463
  payroll: state.payroll.payroll
4434
4464
  };
4435
4465
  };
4436
- var mapDispatchToProps$5 = function mapDispatchToProps(dispatch) {
4466
+ var mapDispatchToProps$6 = function mapDispatchToProps(dispatch) {
4437
4467
  return redux.bindActionCreators({
4438
4468
  fetchPayroll: fetchPayroll
4439
4469
  }, dispatch);
4440
4470
  };
4441
- var PaymentReconciliationSummaryDialog = reactRedux.connect(mapStateToProps$5, mapDispatchToProps$5)(PaymentReconcilationSummarytDialog);
4471
+ var PaymentReconciliationSummaryDialog = reactRedux.connect(mapStateToProps$6, mapDispatchToProps$6)(PaymentReconcilationSummarytDialog);
4442
4472
 
4443
4473
  function PayrollSearcherReconciled(_ref) {
4444
4474
  var fetchingPayrolls = _ref.fetchingPayrolls,
@@ -4583,7 +4613,7 @@ function PayrollSearcherReconciled(_ref) {
4583
4613
  defaultFilters: defaultFilters()
4584
4614
  });
4585
4615
  }
4586
- var mapStateToProps$4 = function mapStateToProps(state) {
4616
+ var mapStateToProps$5 = function mapStateToProps(state) {
4587
4617
  return {
4588
4618
  fetchingPayrolls: state.payroll.fetchingPayrolls,
4589
4619
  fetchedPayrolls: state.payroll.fetchedPayrolls,
@@ -4596,7 +4626,7 @@ var mapStateToProps$4 = function mapStateToProps(state) {
4596
4626
  mutation: state.payroll.mutation
4597
4627
  };
4598
4628
  };
4599
- var mapDispatchToProps$4 = function mapDispatchToProps(dispatch) {
4629
+ var mapDispatchToProps$5 = function mapDispatchToProps(dispatch) {
4600
4630
  return redux.bindActionCreators({
4601
4631
  fetchPayrolls: fetchPayrolls,
4602
4632
  journalize: feCore.journalize,
@@ -4604,7 +4634,7 @@ var mapDispatchToProps$4 = function mapDispatchToProps(dispatch) {
4604
4634
  coreConfirm: feCore.coreConfirm
4605
4635
  }, dispatch);
4606
4636
  };
4607
- var PayrollSearcherReconciled$1 = reactRedux.connect(mapStateToProps$4, mapDispatchToProps$4)(PayrollSearcherReconciled);
4637
+ var PayrollSearcherReconciled$1 = reactRedux.connect(mapStateToProps$5, mapDispatchToProps$5)(PayrollSearcherReconciled);
4608
4638
 
4609
4639
  var useStyles$6 = styles$7.makeStyles(function (theme) {
4610
4640
  return {
@@ -5094,7 +5124,7 @@ function BenefitConsumptionPayrollSearcher(_ref) {
5094
5124
  defaultFilters: defaultFilters()
5095
5125
  }));
5096
5126
  }
5097
- var mapStateToProps$3 = function mapStateToProps(state) {
5127
+ var mapStateToProps$4 = function mapStateToProps(state) {
5098
5128
  return {
5099
5129
  fetchingPayrollBenefitConsumptions: state.payroll.fetchingPayrollBenefitConsumptions,
5100
5130
  fetchedPayrollBenefitConsumptions: state.payroll.fetchedPayrollBenefitConsumptions,
@@ -5108,13 +5138,13 @@ var mapStateToProps$3 = function mapStateToProps(state) {
5108
5138
  benefitsSummary: state.payroll.benefitsSummary
5109
5139
  };
5110
5140
  };
5111
- var mapDispatchToProps$3 = function mapDispatchToProps(dispatch) {
5141
+ var mapDispatchToProps$4 = function mapDispatchToProps(dispatch) {
5112
5142
  return redux.bindActionCreators({
5113
5143
  fetchPayrollBenefitConsumptions: fetchPayrollBenefitConsumptions,
5114
5144
  fetchBenefitsSummary: fetchBenefitsSummary
5115
5145
  }, dispatch);
5116
5146
  };
5117
- var BenefitConsumptionPayrollSearcher$1 = reactRedux.connect(mapStateToProps$3, mapDispatchToProps$3)(BenefitConsumptionPayrollSearcher);
5147
+ var BenefitConsumptionPayrollSearcher$1 = reactRedux.connect(mapStateToProps$4, mapDispatchToProps$4)(BenefitConsumptionPayrollSearcher);
5118
5148
 
5119
5149
  var PayrollTaskTableHeaders = function PayrollTaskTableHeaders() {
5120
5150
  return [EMPTY_STRING];
@@ -5642,7 +5672,7 @@ function BenefitConsumptionSearcher(_ref) {
5642
5672
  benefitConsumptions: benefitConsumptions
5643
5673
  }))));
5644
5674
  }
5645
- var mapStateToProps$2 = function mapStateToProps(state) {
5675
+ var mapStateToProps$3 = function mapStateToProps(state) {
5646
5676
  return {
5647
5677
  fetchingBenefitConsumptions: state.payroll.fetchingBenefitConsumptions,
5648
5678
  fetchedBenefitConsumptions: state.payroll.fetchedBenefitConsumptions,
@@ -5652,12 +5682,12 @@ var mapStateToProps$2 = function mapStateToProps(state) {
5652
5682
  benefitConsumptionsTotalCount: state.payroll.benefitConsumptionsTotalCount
5653
5683
  };
5654
5684
  };
5655
- var mapDispatchToProps$2 = function mapDispatchToProps(dispatch) {
5685
+ var mapDispatchToProps$3 = function mapDispatchToProps(dispatch) {
5656
5686
  return redux.bindActionCreators({
5657
5687
  fetchBenefitConsumptions: fetchBenefitConsumptions
5658
5688
  }, dispatch);
5659
5689
  };
5660
- var BenefitConsumptionSearcher$1 = reactRedux.connect(mapStateToProps$2, mapDispatchToProps$2)(BenefitConsumptionSearcher);
5690
+ var BenefitConsumptionSearcher$1 = reactRedux.connect(mapStateToProps$3, mapDispatchToProps$3)(BenefitConsumptionSearcher);
5661
5691
 
5662
5692
  function BenefitConsumptionsTabLabel(_ref) {
5663
5693
  var onChange = _ref.onChange,
@@ -5849,59 +5879,28 @@ function BistpMetric(_ref2) {
5849
5879
  }, value)));
5850
5880
  }
5851
5881
  function BistpPaymentStatusPanel(_ref3) {
5882
+ var _bistpSummary$total, _bistpSummary$confirm, _bistpSummary$pendent, _bistpSummary$rejeita, _bistpSummary$enviado;
5852
5883
  var value = _ref3.value,
5853
5884
  payrollUuid = _ref3.payrollUuid,
5854
- payroll = _ref3.payroll;
5885
+ payroll = _ref3.payroll,
5886
+ fetchBistpSummary = _ref3.fetchBistpSummary,
5887
+ bistpSummary = _ref3.bistpSummary;
5855
5888
  var classes = useStyles$2();
5856
5889
  var modulesManager = feCore.useModulesManager();
5857
5890
  var _useTranslations2 = feCore.useTranslations(MODULE_NAME, modulesManager),
5858
5891
  formatMessage = _useTranslations2.formatMessage;
5859
- var _useState = React.useState({
5860
- total: 0,
5861
- pendentes: 0,
5862
- enviados: 0,
5863
- confirmados: 0,
5864
- rejeitados: 0
5865
- }),
5866
- _useState2 = _slicedToArray__default["default"](_useState, 2),
5867
- summary = _useState2[0],
5868
- setSummary = _useState2[1];
5869
5892
  React.useEffect(function () {
5870
5893
  if (payrollUuid) {
5871
- var query = "\n query ResumoPagamentos($payrollId: UUID!) {\n total: benefitConsumptionByPayroll(payrollUuid: $payrollId, first: 0) { totalCount }\n pendentes: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: \"ACCEPTED\", first: 0) { totalCount }\n enviados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: \"APPROVE_FOR_PAYMENT\", first: 0) { totalCount }\n confirmados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: \"RECONCILED\", first: 0) { totalCount }\n rejeitados: benefitConsumptionByPayroll(payrollUuid: $payrollId, status: \"REJECTED\", first: 0) { totalCount }\n }\n ";
5872
-
5873
- // Using fetch directly as suggested in the guide to avoid Redux complications for a simple summary
5874
- fetch('/api/graphql', {
5875
- method: 'POST',
5876
- headers: {
5877
- 'Content-Type': 'application/json',
5878
- 'Authorization': "Bearer ".concat(localStorage.getItem('token'))
5879
- },
5880
- body: JSON.stringify({
5881
- query: query,
5882
- variables: {
5883
- payrollId: payrollUuid
5884
- }
5885
- })
5886
- }).then(function (response) {
5887
- return response.json();
5888
- }).then(function (result) {
5889
- if (result.data) {
5890
- setSummary({
5891
- total: result.data.total.totalCount,
5892
- pendentes: result.data.pendentes.totalCount,
5893
- enviados: result.data.enviados.totalCount,
5894
- confirmados: result.data.confirmados.totalCount,
5895
- rejeitados: result.data.rejeitados.totalCount
5896
- });
5897
- }
5898
- });
5894
+ fetchBistpSummary(payrollUuid);
5899
5895
  }
5900
5896
  }, [payrollUuid]);
5901
5897
  if ((payroll === null || payroll === void 0 ? void 0 : payroll.paymentMethod) !== PAYMENT_METHOD.STRATEGY_BISTP_PAYMENT) return null;
5902
- var total = summary.total || 0;
5903
- var reconciled = summary.confirmados || 0;
5904
- var progress = total > 0 ? Math.min(reconciled / total * 100, 100) : 0;
5898
+ var total = (bistpSummary === null || bistpSummary === void 0 || (_bistpSummary$total = bistpSummary.total) === null || _bistpSummary$total === void 0 ? void 0 : _bistpSummary$total.totalCount) || 0;
5899
+ var confirmados = (bistpSummary === null || bistpSummary === void 0 || (_bistpSummary$confirm = bistpSummary.confirmados) === null || _bistpSummary$confirm === void 0 ? void 0 : _bistpSummary$confirm.totalCount) || 0;
5900
+ var pendentes = (bistpSummary === null || bistpSummary === void 0 || (_bistpSummary$pendent = bistpSummary.pendentes) === null || _bistpSummary$pendent === void 0 ? void 0 : _bistpSummary$pendent.totalCount) || 0;
5901
+ var rejeitados = (bistpSummary === null || bistpSummary === void 0 || (_bistpSummary$rejeita = bistpSummary.rejeitados) === null || _bistpSummary$rejeita === void 0 ? void 0 : _bistpSummary$rejeita.totalCount) || 0;
5902
+ var enviados = (bistpSummary === null || bistpSummary === void 0 || (_bistpSummary$enviado = bistpSummary.enviados) === null || _bistpSummary$enviado === void 0 ? void 0 : _bistpSummary$enviado.totalCount) || 0;
5903
+ var progress = total > 0 ? Math.min(confirmados / total * 100, 100) : 0;
5905
5904
  return /*#__PURE__*/React__default["default"].createElement(feCore.PublishedComponent, {
5906
5905
  pubRef: "policyHolder.TabPanel",
5907
5906
  module: "payroll",
@@ -5921,28 +5920,39 @@ function BistpPaymentStatusPanel(_ref3) {
5921
5920
  }), /*#__PURE__*/React__default["default"].createElement(BistpMetric, {
5922
5921
  classes: classes,
5923
5922
  label: formatMessage('payroll.bistp.status.reconciled'),
5924
- value: summary.confirmados || 0
5923
+ value: confirmados
5925
5924
  }), /*#__PURE__*/React__default["default"].createElement(BistpMetric, {
5926
5925
  classes: classes,
5927
5926
  label: formatMessage('payroll.bistp.status.pending'),
5928
- value: summary.pendentes || 0
5927
+ value: pendentes
5929
5928
  }), /*#__PURE__*/React__default["default"].createElement(BistpMetric, {
5930
5929
  classes: classes,
5931
5930
  label: formatMessage('payroll.bistp.status.rejected'),
5932
- value: summary.rejeitados || 0
5931
+ value: rejeitados
5933
5932
  }), /*#__PURE__*/React__default["default"].createElement(BistpMetric, {
5934
5933
  classes: classes,
5935
5934
  label: formatMessage('payroll.bistp.status.enviados'),
5936
- value: summary.enviados || 0
5935
+ value: enviados
5937
5936
  })), /*#__PURE__*/React__default["default"].createElement("div", {
5938
5937
  className: classes.progress
5939
5938
  }, /*#__PURE__*/React__default["default"].createElement(core.Typography, {
5940
5939
  variant: "body2"
5941
- }, formatMessage('payroll.bistp.progress'), ": ", reconciled, "/", total), /*#__PURE__*/React__default["default"].createElement(core.LinearProgress, {
5940
+ }, formatMessage('payroll.bistp.progress'), ": ", confirmados, "/", total), /*#__PURE__*/React__default["default"].createElement(core.LinearProgress, {
5942
5941
  variant: "determinate",
5943
5942
  value: progress
5944
5943
  })))));
5945
5944
  }
5945
+ var mapStateToProps$2 = function mapStateToProps(state) {
5946
+ return {
5947
+ bistpSummary: state.payroll.bistpSummary
5948
+ };
5949
+ };
5950
+ var mapDispatchToProps$2 = function mapDispatchToProps(dispatch) {
5951
+ return redux.bindActionCreators({
5952
+ fetchBistpSummary: fetchBistpSummary
5953
+ }, dispatch);
5954
+ };
5955
+ var BistpPaymentStatusPanel$1 = reactRedux.connect(mapStateToProps$2, mapDispatchToProps$2)(BistpPaymentStatusPanel);
5946
5956
 
5947
5957
  function PaymentPendingPayrollPaymentDialog(_ref) {
5948
5958
  var _payrollDetail$id;
@@ -7101,7 +7111,7 @@ var DEFAULT_CONFIG = {
7101
7111
  id: 'legalAndFinance.beneficiariesManagement'
7102
7112
  }],
7103
7113
  'payroll.TabPanel.label': [BenefitConsumptionsTabLabel, PayrollTaskTabLabel, PayrollPaymentFilesTabLabel, BistpPaymentStatusTabLabel],
7104
- 'payroll.TabPanel.panel': [BenefitConsumptionsTabPanel, PayrollTaskTabPanel, PayrollPaymentFilesTabPanel, BistpPaymentStatusPanel],
7114
+ 'payroll.TabPanel.panel': [BenefitConsumptionsTabPanel, PayrollTaskTabPanel, PayrollPaymentFilesTabPanel, BistpPaymentStatusPanel$1],
7105
7115
  'tasksManagement.tasks': [{
7106
7116
  text: /*#__PURE__*/React__default["default"].createElement(feCore.FormattedMessage, {
7107
7117
  module: "payroll",