@senior-gestao-pessoas/payroll-core 9.2.0-f1576e5d-10f9-432e-b073-1aa58ae3cbc8 → 9.3.0-06156ffc-852c-4f04-8482-5c4f9317ecff

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.
Files changed (32) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +380 -11
  2. package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
  3. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +1 -1
  4. package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
  5. package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +1 -1
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +7 -1
  7. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +51 -0
  8. package/components/historical-pix-account-list/historical-pix-account-list.module.d.ts +2 -0
  9. package/components/historical-pix-account-list/historical-pix-account-list.service.d.ts +9 -0
  10. package/components/historical-pix-account-list/index.d.ts +3 -0
  11. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +6 -5
  12. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +41 -8
  13. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +252 -0
  14. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.module.js +39 -0
  15. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.service.js +35 -0
  16. package/esm2015/components/historical-pix-account-list/index.js +4 -0
  17. package/esm2015/public_api.js +2 -1
  18. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +6 -5
  19. package/esm5/components/historical-pix-account/historical-pix-account.component.js +53 -8
  20. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +276 -0
  21. package/esm5/components/historical-pix-account-list/historical-pix-account-list.module.js +42 -0
  22. package/esm5/components/historical-pix-account-list/historical-pix-account-list.service.js +37 -0
  23. package/esm5/components/historical-pix-account-list/index.js +4 -0
  24. package/esm5/public_api.js +2 -1
  25. package/fesm2015/senior-gestao-pessoas-payroll-core.js +337 -12
  26. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  27. package/fesm5/senior-gestao-pessoas-payroll-core.js +378 -12
  28. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  29. package/locale/es-ES.json +1 -1
  30. package/package.json +1 -1
  31. package/public_api.d.ts +1 -0
  32. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -9422,11 +9422,12 @@
9422
9422
  }());
9423
9423
 
9424
9424
  var HistoricalPixAccountComponent = /** @class */ (function () {
9425
- function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9425
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9426
9426
  var _this = this;
9427
9427
  this.translateService = translateService;
9428
9428
  this.cd = cd;
9429
9429
  this.formBuilder = formBuilder;
9430
+ this.messageService = messageService;
9430
9431
  this.recordByRow = 1;
9431
9432
  this.showDateChange = false;
9432
9433
  this.isEditMode = false;
@@ -9475,17 +9476,35 @@
9475
9476
  visible: !!(!_this.isEditMode && _this.withSideBar),
9476
9477
  label: _this.translateService.instant("hcm.payroll.edit"),
9477
9478
  command: function () {
9478
- rowData["index"] = key;
9479
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9480
- _this.visible = true;
9479
+ if (_this.isAllowToEditHistorical && rowData) {
9480
+ rowData["index"] = key;
9481
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9482
+ _this.visible = true;
9483
+ }
9484
+ else {
9485
+ _this.messageService.add({
9486
+ severity: "error",
9487
+ summary: _this.translateService.instant("hcm.payroll.error"),
9488
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9489
+ });
9490
+ }
9481
9491
  },
9482
9492
  },
9483
9493
  {
9484
9494
  visible: !_this.isEditMode,
9485
9495
  label: _this.translateService.instant("hcm.payroll.delete"),
9486
9496
  command: function () {
9487
- _this.loading = true;
9488
- _this.deleteAnnuityItem(key);
9497
+ if (_this.isAllowToDeleteHistorical && rowData) {
9498
+ _this.loading = true;
9499
+ _this.deleteAnnuityItem(key);
9500
+ }
9501
+ else {
9502
+ _this.messageService.add({
9503
+ severity: "error",
9504
+ summary: _this.translateService.instant("hcm.payroll.error"),
9505
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9506
+ });
9507
+ }
9489
9508
  },
9490
9509
  },
9491
9510
  ];
@@ -9696,10 +9715,32 @@
9696
9715
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9697
9716
  return FormatUtilsService.getFormattedPercentage(value);
9698
9717
  };
9718
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9719
+ get: function () {
9720
+ return (this.permission["Excluir"]);
9721
+ },
9722
+ enumerable: true,
9723
+ configurable: true
9724
+ });
9725
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9726
+ get: function () {
9727
+ return (this.permission["Editar"]);
9728
+ },
9729
+ enumerable: true,
9730
+ configurable: true
9731
+ });
9732
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9733
+ get: function () {
9734
+ return (this.permission["Visualizar"]);
9735
+ },
9736
+ enumerable: true,
9737
+ configurable: true
9738
+ });
9699
9739
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9700
9740
  { type: core$1.TranslateService },
9701
9741
  { type: core.ChangeDetectorRef },
9702
- { type: forms.FormBuilder }
9742
+ { type: forms.FormBuilder },
9743
+ { type: api.MessageService }
9703
9744
  ]; };
9704
9745
  __decorate([
9705
9746
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9749,6 +9790,9 @@
9749
9790
  __decorate([
9750
9791
  core.Input()
9751
9792
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9793
+ __decorate([
9794
+ core.Input()
9795
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9752
9796
  __decorate([
9753
9797
  core.Input()
9754
9798
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -9980,6 +10024,7 @@
9980
10024
  percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9981
10025
  forms.Validators.max(this.maxValuePercentage),
9982
10026
  ]))),
10027
+ externalId: this.formBuilder.control(null),
9983
10028
  customFields: this.formBuilder.control(null),
9984
10029
  });
9985
10030
  };
@@ -10023,7 +10068,7 @@
10023
10068
  else {
10024
10069
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10025
10070
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10026
- this.formatPixKeyTelehponeNumber();
10071
+ this.formatPixKeyTelephoneNumber();
10027
10072
  }
10028
10073
  }
10029
10074
  }
@@ -10034,7 +10079,7 @@
10034
10079
  enumerable: true,
10035
10080
  configurable: true
10036
10081
  });
10037
- HistoricalPixAccountFormComponent.prototype.formatPixKeyTelehponeNumber = function () {
10082
+ HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10038
10083
  if (this.pixKeyType === "TELEPHONE") {
10039
10084
  this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10040
10085
  }
@@ -10049,7 +10094,7 @@
10049
10094
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10050
10095
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10051
10096
  this.setPixKeyValidators(isEditMode);
10052
- this.formatPixKeyTelehponeNumber();
10097
+ this.formatPixKeyTelephoneNumber();
10053
10098
  }
10054
10099
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10055
10100
  "pixKeyType",
@@ -10307,7 +10352,7 @@
10307
10352
  HistoricalPixAccountFormComponent = __decorate([
10308
10353
  core.Component({
10309
10354
  selector: "pix-account",
10310
- template: "<div id=\"main\">\n <form [formGroup]=\"pixAccountFormGroup\" autocomplete=\"off\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <!-- Tipo de chave -->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label>{{'hcm.payroll.employees_addition_pix_key_type'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]=\"true\" server=\"payroll\"\n enumeration=\"PixKeyType\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n name=\"pixKeyType\" [form]=\"pixAccountFormGroup\"\n (onSelect)=\"onChangePixKeyType($event)\"\n (onClear)=\"onClearPixKeyType()\"\n id=\"ta-pixKeyType\"></input-rest-auto-complete-enum>\n <s-control-errors [control]=\"pixAccountFormGroup.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Chave Pix-->\n <div class=\"ui-md-6 ui-sm-12\" [ngClass]=\"{'required': pixKeyType !== 'BANK_ACCOUNT'}\">\n <label>{{'hcm.payroll.employees_addition_pix_key' | translate}}</label>\n <ng-container [ngSwitch]=\"pixKeyType\">\n <input *ngSwitchCase=\"'TELEPHONE'\" only-number\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\" maxlength=\"15\"\n placeholder=\"(__) ____-____\">\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\" [unmask]=\"true\"></p-inputMask>\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\" [unmask]=\"true\"></p-inputMask>\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"{{'hcm.payroll.employees_addition_email'|translate}}\"/>\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\" disabled\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n <input *ngSwitchDefault\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n </ng-container>\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\" id=\"er-pix-key\"\n [control]=\"pixAccountFormGroup.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: pixAccountFormGroup.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Percentual-->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label id=\"lb-percentage\"\n for=\"ff-percentage\">{{ 'hcm.payroll.historical_bank_account_label_percentage' | translate }}</label>\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\">%</span>\n <input pInputText id=\"ff-percentage\" name=\"percentage\"\n formControlName=\"percentage\"\n currencyMask\n [options]=\"optionsPercentage\"\n [placeholder]=\"percentagePlaceholder\"/>\n </div>\n <s-control-errors [control]=\"pixAccountFormGroup.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </div>\n <div class=\"ui-g-12\">\n <p-fieldset\n legend=\"{{ 'hcm.payroll.custom_fields' | translate }}\"\n [attr.data-hidden]=\"!customFields || !customFields.fields.length\"\n >\n <s-custom-fields\n domain=\"hcm\"\n service=\"{{customService}}\"\n entity=\"{{customEntity}}\"\n formControlName=\"customFields\"\n [invalidErrorLabel]=\"'hcm.payroll.employees_invalid_field' | translate\"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]=\"withSideBar ? 'footer' : 'footer-s-border'\">\n <div class=\"form-group\">\n <s-button id=\"btn-save\" label=\"{{ labelBtnAdd | translate}}\" priority=\"primary\"\n (onClick)=\"addItem()\" *ngIf=\"visibleBtnSave && !this.isView\"></s-button>\n <s-button *ngIf=\"withSideBar\" id=\"btn-close\" label=\"{{'hcm.payroll.cancel'|translate}}\" priority=\"secondary\"\n priority=\"link\" (onClick)=\"close()\"></s-button>\n </div>\n </div>\n</div>\n",
10355
+ template: "<div id=\"main\">\n <form [formGroup]=\"pixAccountFormGroup\" autocomplete=\"off\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <!-- Tipo de chave -->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label>{{'hcm.payroll.employees_addition_pix_key_type'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]=\"true\" server=\"payroll\"\n enumeration=\"PixKeyType\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n name=\"pixKeyType\" [form]=\"pixAccountFormGroup\"\n (onSelect)=\"onChangePixKeyType($event)\"\n (onClear)=\"onClearPixKeyType()\"\n id=\"ta-pixKeyType\"></input-rest-auto-complete-enum>\n <s-control-errors [control]=\"pixAccountFormGroup.get('pixKeyType')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n pixKeyTypeBankAccountDuplicate: 'hcm.payroll.historical_pix_key_type_bank_account_duplicate' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Chave Pix-->\n <div class=\"ui-md-6 ui-sm-12\" [ngClass]=\"{'required': pixKeyType !== 'BANK_ACCOUNT'}\">\n <label>{{'hcm.payroll.employees_addition_pix_key' | translate}}</label>\n <ng-container [ngSwitch]=\"pixKeyType\">\n <input *ngSwitchCase=\"'TELEPHONE'\" only-number\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\" maxlength=\"15\"\n placeholder=\"(__) ____-____\">\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\" [unmask]=\"true\"></p-inputMask>\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\" [unmask]=\"true\"></p-inputMask>\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"\n placeholder=\"{{'hcm.payroll.employees_addition_email'|translate}}\"/>\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\" disabled\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\"/>\n <input *ngSwitchDefault\n pInputText id=\"ta-pixKey\" name=\"pixKey\" formControlName=\"pixKey\" maxlength=\"100\" />\n </ng-container>\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\" id=\"er-pix-key\"\n [control]=\"pixAccountFormGroup.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: pixAccountFormGroup.get('pixKey').value },\n invalidEmail: 'hcm.payroll.employees_addition_email_invalid' | translate,\n cpfNotValid: 'hcm.payroll.employees_addition_cpf_error' | translate,\n cnpjNotValid: 'hcm.payroll.employees_addition_cnpj_error' | translate\n }\">\n </s-control-errors>\n </div>\n <!--Percentual-->\n <div class=\"ui-md-6 ui-sm-12 required\">\n <label id=\"lb-percentage\"\n for=\"ff-percentage\">{{ 'hcm.payroll.historical_bank_account_label_percentage' | translate }}</label>\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\">%</span>\n <input pInputText id=\"ff-percentage\" name=\"percentage\"\n formControlName=\"percentage\"\n currencyMask\n [options]=\"optionsPercentage\"\n [placeholder]=\"percentagePlaceholder\"/>\n </div>\n <s-control-errors [control]=\"pixAccountFormGroup.get('percentage')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n maxlength: 'hcm.payroll.error_max_length' | translate: { value: '6' },\n max: 'hcm.payroll.error_max_value_number' | translate: { value: maxValuePercentage },\n min: 'hcm.payroll.error_min_value_number' | translate: { value: '0,01' }\n }\">\n </s-control-errors>\n </div>\n <div class=\"ui-g-12\">\n <p-fieldset\n legend=\"{{ 'hcm.payroll.custom_fields' | translate }}\"\n [attr.data-hidden]=\"!customFields || !customFields.fields.length\"\n >\n <s-custom-fields\n domain=\"hcm\"\n service=\"{{customService}}\"\n entity=\"{{customEntity}}\"\n formControlName=\"customFields\"\n [invalidErrorLabel]=\"'hcm.payroll.employees_invalid_field' | translate\"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]=\"withSideBar ? 'footer' : 'footer-s-border'\">\n <div class=\"form-group\">\n <s-button id=\"btn-save\" label=\"{{ labelBtnAdd | translate}}\" priority=\"primary\"\n (onClick)=\"addItem()\" *ngIf=\"visibleBtnSave && !this.isView\"></s-button>\n <s-button *ngIf=\"withSideBar\" id=\"btn-close\" label=\"{{'hcm.payroll.cancel'|translate}}\" priority=\"secondary\"\n priority=\"link\" (onClick)=\"close()\"></s-button>\n </div>\n </div>\n</div>\n",
10311
10356
  styles: [".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]
10312
10357
  })
10313
10358
  ], HistoricalPixAccountFormComponent);
@@ -10368,6 +10413,327 @@
10368
10413
  return HistoricalPixAccountModule;
10369
10414
  }());
10370
10415
 
10416
+ var HistoricalPixAccountListService = /** @class */ (function () {
10417
+ function HistoricalPixAccountListService(http, httpClient) {
10418
+ this.http = http;
10419
+ this.httpClient = httpClient;
10420
+ }
10421
+ HistoricalPixAccountListService.prototype.remove = function (id, dateWhen, service, dependentId) {
10422
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10423
+ if (service === exports.ServiceType.DEPENDENT) {
10424
+ return this.httpClient
10425
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
10426
+ dependentId: dependentId,
10427
+ dateWhen: dateWhen,
10428
+ });
10429
+ }
10430
+ else {
10431
+ return this.http.post("actions/historicalEmployeePixDelete", {
10432
+ employeeId: id,
10433
+ dateWhen: dateWhen
10434
+ });
10435
+ }
10436
+ };
10437
+ HistoricalPixAccountListService.ctorParameters = function () { return [
10438
+ { type: HttpClientService },
10439
+ { type: http.HttpClient }
10440
+ ]; };
10441
+ HistoricalPixAccountListService = __decorate([
10442
+ core.Injectable()
10443
+ ], HistoricalPixAccountListService);
10444
+ return HistoricalPixAccountListService;
10445
+ }());
10446
+
10447
+ var moment$e = moment_;
10448
+ var HistoricalPixAccountListComponent = /** @class */ (function () {
10449
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10450
+ this.confirmationService = confirmationService;
10451
+ this.translateService = translateService;
10452
+ this.activatedRoute = activatedRoute;
10453
+ this.cd = cd;
10454
+ this.router = router;
10455
+ this.messageService = messageService;
10456
+ this.historicalPixAccountListService = historicalPixAccountListService;
10457
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10458
+ this.keyPayload = "historicalEmployeePix";
10459
+ this.withSidebar = true;
10460
+ this.enableView = new core.EventEmitter();
10461
+ this.ngUnsubscribe = new rxjs.Subject();
10462
+ this.loading = true;
10463
+ this.columns = [
10464
+ {
10465
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10466
+ field: "dateChange",
10467
+ },
10468
+ {
10469
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10470
+ field: "pixKeyType.value",
10471
+ },
10472
+ {
10473
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10474
+ field: "pixKey",
10475
+ },
10476
+ {
10477
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10478
+ field: "percentage",
10479
+ },
10480
+ {
10481
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10482
+ field: "numberOfPixAccount",
10483
+ },
10484
+ ];
10485
+ }
10486
+ HistoricalPixAccountListComponent.prototype.ngOnInit = function () {
10487
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
10488
+ };
10489
+ HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10490
+ this.ngUnsubscribe.next();
10491
+ this.ngUnsubscribe.complete();
10492
+ };
10493
+ HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10494
+ this.cd.detectChanges();
10495
+ };
10496
+ HistoricalPixAccountListComponent.prototype.onLazyLoad = function (payload) {
10497
+ var _this = this;
10498
+ payload.forEach(function (value) {
10499
+ value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10500
+ value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10501
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10502
+ });
10503
+ this.onGridLoad(payload);
10504
+ this.loading = false;
10505
+ };
10506
+ HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10507
+ var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10508
+ if (keyType === "TELEPHONE") {
10509
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10510
+ }
10511
+ else if (keyType === "CPF") {
10512
+ return FormatUtilsService.getFormattedCpf(pixKey);
10513
+ }
10514
+ else if (keyType === "CNPJ") {
10515
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10516
+ }
10517
+ else {
10518
+ return pixKey;
10519
+ }
10520
+ };
10521
+ HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10522
+ var _this = this;
10523
+ return [
10524
+ {
10525
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10526
+ command: function () {
10527
+ console.log(_this.isAllowToViewHistorical);
10528
+ if (_this.isAllowToViewHistorical && rowData) {
10529
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10530
+ if (_this.withSidebar) {
10531
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10532
+ relativeTo: _this.activatedRoute,
10533
+ });
10534
+ }
10535
+ else {
10536
+ _this.enableView.emit(dateChange);
10537
+ }
10538
+ }
10539
+ else {
10540
+ _this.messageService.add({
10541
+ severity: "error",
10542
+ summary: _this.translateService.instant("hcm.payroll.error"),
10543
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10544
+ });
10545
+ }
10546
+ },
10547
+ },
10548
+ {
10549
+ label: this.translateService.instant("hcm.payroll.delete"),
10550
+ command: function () {
10551
+ if (_this.isAllowToDeleteHistorical && rowData) {
10552
+ _this.delete(rowData.id, rowData.dateChange);
10553
+ }
10554
+ else {
10555
+ _this.messageService.add({
10556
+ severity: "error",
10557
+ summary: _this.translateService.instant("hcm.payroll.error"),
10558
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10559
+ });
10560
+ }
10561
+ },
10562
+ },
10563
+ ];
10564
+ };
10565
+ HistoricalPixAccountListComponent.prototype.delete = function (id, dateChange) {
10566
+ var _this = this;
10567
+ if (id === this.lastRecord.id) {
10568
+ var dateChangeToDto_1 = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
10569
+ this.confirmationService.confirm({
10570
+ message: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete") + "?",
10571
+ accept: function () {
10572
+ _this.loading = true;
10573
+ var service = _this.withSidebar ? exports.ServiceType.PAYROLL : exports.ServiceType.DEPENDENT;
10574
+ _this.historicalPixAccountListService
10575
+ .remove(_this.employeeId, dateChangeToDto_1, service, _this.dependentId)
10576
+ .pipe(operators.takeUntil(_this.ngUnsubscribe))
10577
+ .subscribe(function () {
10578
+ _this.messageService.add({
10579
+ severity: "success",
10580
+ summary: _this.translateService.instant("hcm.payroll.success"),
10581
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
10582
+ });
10583
+ _this.parameters = (_this.parameters && __assign({}, _this.parameters)) || {};
10584
+ }, function () {
10585
+ _this.messageService.add({
10586
+ severity: "error",
10587
+ summary: _this.translateService.instant("hcm.payroll.error"),
10588
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
10589
+ });
10590
+ _this.loading = false;
10591
+ });
10592
+ },
10593
+ });
10594
+ }
10595
+ else {
10596
+ this.messageService.add({
10597
+ severity: "error",
10598
+ summary: this.translateService.instant("hcm.payroll.error"),
10599
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
10600
+ });
10601
+ }
10602
+ };
10603
+ HistoricalPixAccountListComponent.prototype.add = function () {
10604
+ if (this.isAllowToAddHistorical) {
10605
+ this.router.navigate(["historical-pix-account-new"], {
10606
+ relativeTo: this.activatedRoute,
10607
+ });
10608
+ }
10609
+ else {
10610
+ this.messageService.add({
10611
+ severity: "error",
10612
+ summary: this.translateService.instant("hcm.payroll.error"),
10613
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10614
+ });
10615
+ }
10616
+ };
10617
+ HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10618
+ if (payload && payload.length) {
10619
+ this.lastRecord = payload[0];
10620
+ }
10621
+ };
10622
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10623
+ get: function () {
10624
+ return (this.permission["Incluir"]);
10625
+ },
10626
+ enumerable: true,
10627
+ configurable: true
10628
+ });
10629
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10630
+ get: function () {
10631
+ return (this.permission["Excluir"]);
10632
+ },
10633
+ enumerable: true,
10634
+ configurable: true
10635
+ });
10636
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10637
+ get: function () {
10638
+ return (this.permission["Visualizar"]);
10639
+ },
10640
+ enumerable: true,
10641
+ configurable: true
10642
+ });
10643
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10644
+ get: function () {
10645
+ return this.getMenuActions.bind(this);
10646
+ },
10647
+ enumerable: true,
10648
+ configurable: true
10649
+ });
10650
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "reloadList", {
10651
+ set: function (condition) {
10652
+ if (condition) {
10653
+ this.loading = true;
10654
+ this.parameters = (this.parameters && __assign({}, this.parameters)) || {};
10655
+ }
10656
+ },
10657
+ enumerable: true,
10658
+ configurable: true
10659
+ });
10660
+ HistoricalPixAccountListComponent.ctorParameters = function () { return [
10661
+ { type: api.ConfirmationService },
10662
+ { type: core$1.TranslateService },
10663
+ { type: router.ActivatedRoute },
10664
+ { type: core.ChangeDetectorRef },
10665
+ { type: router.Router },
10666
+ { type: api.MessageService },
10667
+ { type: HistoricalPixAccountListService }
10668
+ ]; };
10669
+ __decorate([
10670
+ core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10671
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
10672
+ __decorate([
10673
+ core.Input()
10674
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
10675
+ __decorate([
10676
+ core.Input()
10677
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
10678
+ __decorate([
10679
+ core.Input()
10680
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
10681
+ __decorate([
10682
+ core.Input()
10683
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
10684
+ __decorate([
10685
+ core.Input()
10686
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
10687
+ __decorate([
10688
+ core.Input()
10689
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
10690
+ __decorate([
10691
+ core.Input()
10692
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10693
+ __decorate([
10694
+ core.Output()
10695
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10696
+ __decorate([
10697
+ core.Input()
10698
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
10699
+ HistoricalPixAccountListComponent = __decorate([
10700
+ core.Component({
10701
+ // tslint:disable-next-line:component-selector
10702
+ selector: "c-historical-pix-account-list",
10703
+ template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <c-data-list-rest\n id=\"ta-historical-pix-account-list\"\n [columns]=\"columns\"\n actionLabel=\"{{ 'hcm.payroll.movimentation_generic_action' | translate }}\"\n emptyMessage=\"{{ 'hcm.payroll.admission_empty_message' | translate }}\"\n [endpoint]=\"endPoint\"\n singularMessageRecords=\"{{\n 'hcm.payroll.admission_register' | translate\n }}\"\n [actions]=\"scopedActions\"\n pluralMessageRecords=\"{{\n 'hcm.payroll.admission_registers' | translate\n }}\"\n [keyPayload]=\"keyPayload\"\n [lazy]=\"true\"\n (lazyLoad)=\"onLazyLoad($event)\"\n [(loading)]=\"loading\"\n [initParameters]=\"initParameters\"\n [parameters]=\"parameters\"\n [isSortable]=\"false\"\n ></c-data-list-rest>\n </div>\n</div>\n\n",
10704
+ styles: [""]
10705
+ })
10706
+ ], HistoricalPixAccountListComponent);
10707
+ return HistoricalPixAccountListComponent;
10708
+ }());
10709
+
10710
+ var HistoricalPixAccountListModule = /** @class */ (function () {
10711
+ function HistoricalPixAccountListModule() {
10712
+ }
10713
+ HistoricalPixAccountListModule = __decorate([
10714
+ core.NgModule({
10715
+ imports: [
10716
+ common.CommonModule,
10717
+ forms.FormsModule,
10718
+ http.HttpClientModule,
10719
+ autocomplete.AutoCompleteModule,
10720
+ SharedModule,
10721
+ forms.ReactiveFormsModule,
10722
+ table.TableModule,
10723
+ angularComponents.ButtonModule,
10724
+ tooltip.TooltipModule,
10725
+ angularComponents.LoadingStateModule,
10726
+ DataListRestModule,
10727
+ confirmdialog.ConfirmDialogModule,
10728
+ ],
10729
+ declarations: [HistoricalPixAccountListComponent],
10730
+ providers: [HistoricalPixAccountListService],
10731
+ exports: [HistoricalPixAccountListComponent],
10732
+ })
10733
+ ], HistoricalPixAccountListModule);
10734
+ return HistoricalPixAccountListModule;
10735
+ }());
10736
+
10371
10737
  exports.AdmissionDraftSummaryComponent = AdmissionDraftSummaryComponent;
10372
10738
  exports.AdmissionDraftSummaryModule = AdmissionDraftSummaryModule;
10373
10739
  exports.AdmissionDraftSummaryService = AdmissionDraftSummaryService;
@@ -10409,6 +10775,9 @@
10409
10775
  exports.HistoricalBankAccountModule = HistoricalBankAccountModule;
10410
10776
  exports.HistoricalBankAccountService = HistoricalBankAccountService;
10411
10777
  exports.HistoricalPixAccountComponent = HistoricalPixAccountComponent;
10778
+ exports.HistoricalPixAccountListComponent = HistoricalPixAccountListComponent;
10779
+ exports.HistoricalPixAccountListModule = HistoricalPixAccountListModule;
10780
+ exports.HistoricalPixAccountListService = HistoricalPixAccountListService;
10412
10781
  exports.HistoricalPixAccountModule = HistoricalPixAccountModule;
10413
10782
  exports.HistoricalPixAccountService = HistoricalPixAccountService;
10414
10783
  exports.HttpClientService = HttpClientService;