@senior-gestao-pessoas/payroll-core 9.2.0-f1576e5d-10f9-432e-b073-1aa58ae3cbc8 → 9.3.0-4d39b464-875a-426e-94a5-e9a89ba0079c

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 +372 -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 +6 -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 +38 -8
  13. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +251 -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 +46 -8
  20. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +275 -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 +333 -12
  26. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  27. package/fesm5/senior-gestao-pessoas-payroll-core.js +370 -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,25 @@
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
+ });
9699
9732
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9700
9733
  { type: core$1.TranslateService },
9701
9734
  { type: core.ChangeDetectorRef },
9702
- { type: forms.FormBuilder }
9735
+ { type: forms.FormBuilder },
9736
+ { type: api.MessageService }
9703
9737
  ]; };
9704
9738
  __decorate([
9705
9739
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9749,6 +9783,9 @@
9749
9783
  __decorate([
9750
9784
  core.Input()
9751
9785
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9786
+ __decorate([
9787
+ core.Input()
9788
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9752
9789
  __decorate([
9753
9790
  core.Input()
9754
9791
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -9980,6 +10017,7 @@
9980
10017
  percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9981
10018
  forms.Validators.max(this.maxValuePercentage),
9982
10019
  ]))),
10020
+ externalId: this.formBuilder.control(null),
9983
10021
  customFields: this.formBuilder.control(null),
9984
10022
  });
9985
10023
  };
@@ -10023,7 +10061,7 @@
10023
10061
  else {
10024
10062
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10025
10063
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10026
- this.formatPixKeyTelehponeNumber();
10064
+ this.formatPixKeyTelephoneNumber();
10027
10065
  }
10028
10066
  }
10029
10067
  }
@@ -10034,7 +10072,7 @@
10034
10072
  enumerable: true,
10035
10073
  configurable: true
10036
10074
  });
10037
- HistoricalPixAccountFormComponent.prototype.formatPixKeyTelehponeNumber = function () {
10075
+ HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10038
10076
  if (this.pixKeyType === "TELEPHONE") {
10039
10077
  this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10040
10078
  }
@@ -10049,7 +10087,7 @@
10049
10087
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10050
10088
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10051
10089
  this.setPixKeyValidators(isEditMode);
10052
- this.formatPixKeyTelehponeNumber();
10090
+ this.formatPixKeyTelephoneNumber();
10053
10091
  }
10054
10092
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10055
10093
  "pixKeyType",
@@ -10307,7 +10345,7 @@
10307
10345
  HistoricalPixAccountFormComponent = __decorate([
10308
10346
  core.Component({
10309
10347
  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",
10348
+ 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
10349
  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
10350
  })
10313
10351
  ], HistoricalPixAccountFormComponent);
@@ -10368,6 +10406,326 @@
10368
10406
  return HistoricalPixAccountModule;
10369
10407
  }());
10370
10408
 
10409
+ var HistoricalPixAccountListService = /** @class */ (function () {
10410
+ function HistoricalPixAccountListService(http, httpClient) {
10411
+ this.http = http;
10412
+ this.httpClient = httpClient;
10413
+ }
10414
+ HistoricalPixAccountListService.prototype.remove = function (id, dateWhen, service, dependentId) {
10415
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10416
+ if (service === exports.ServiceType.DEPENDENT) {
10417
+ return this.httpClient
10418
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
10419
+ dependentId: dependentId,
10420
+ dateWhen: dateWhen,
10421
+ });
10422
+ }
10423
+ else {
10424
+ return this.http.post("actions/historicalEmployeePixDelete", {
10425
+ employeeId: id,
10426
+ dateWhen: dateWhen
10427
+ });
10428
+ }
10429
+ };
10430
+ HistoricalPixAccountListService.ctorParameters = function () { return [
10431
+ { type: HttpClientService },
10432
+ { type: http.HttpClient }
10433
+ ]; };
10434
+ HistoricalPixAccountListService = __decorate([
10435
+ core.Injectable()
10436
+ ], HistoricalPixAccountListService);
10437
+ return HistoricalPixAccountListService;
10438
+ }());
10439
+
10440
+ var moment$e = moment_;
10441
+ var HistoricalPixAccountListComponent = /** @class */ (function () {
10442
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10443
+ this.confirmationService = confirmationService;
10444
+ this.translateService = translateService;
10445
+ this.activatedRoute = activatedRoute;
10446
+ this.cd = cd;
10447
+ this.router = router;
10448
+ this.messageService = messageService;
10449
+ this.historicalPixAccountListService = historicalPixAccountListService;
10450
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10451
+ this.keyPayload = "historicalEmployeePix";
10452
+ this.withSidebar = true;
10453
+ this.enableView = new core.EventEmitter();
10454
+ this.ngUnsubscribe = new rxjs.Subject();
10455
+ this.loading = true;
10456
+ this.columns = [
10457
+ {
10458
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10459
+ field: "dateChange",
10460
+ },
10461
+ {
10462
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10463
+ field: "pixKeyType.value",
10464
+ },
10465
+ {
10466
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10467
+ field: "pixKey",
10468
+ },
10469
+ {
10470
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10471
+ field: "percentage",
10472
+ },
10473
+ {
10474
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10475
+ field: "numberOfPixAccount",
10476
+ },
10477
+ ];
10478
+ }
10479
+ HistoricalPixAccountListComponent.prototype.ngOnInit = function () {
10480
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
10481
+ };
10482
+ HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10483
+ this.ngUnsubscribe.next();
10484
+ this.ngUnsubscribe.complete();
10485
+ };
10486
+ HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10487
+ this.cd.detectChanges();
10488
+ };
10489
+ HistoricalPixAccountListComponent.prototype.onLazyLoad = function (payload) {
10490
+ var _this = this;
10491
+ payload.forEach(function (value) {
10492
+ value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10493
+ value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10494
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10495
+ });
10496
+ this.onGridLoad(payload);
10497
+ this.loading = false;
10498
+ };
10499
+ HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10500
+ var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10501
+ if (keyType === "TELEPHONE") {
10502
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10503
+ }
10504
+ else if (keyType === "CPF") {
10505
+ return FormatUtilsService.getFormattedCpf(pixKey);
10506
+ }
10507
+ else if (keyType === "CNPJ") {
10508
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10509
+ }
10510
+ else {
10511
+ return pixKey;
10512
+ }
10513
+ };
10514
+ HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10515
+ var _this = this;
10516
+ return [
10517
+ {
10518
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10519
+ command: function () {
10520
+ if (_this.isAllowToViewHistorical && rowData) {
10521
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10522
+ if (_this.withSidebar) {
10523
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10524
+ relativeTo: _this.activatedRoute,
10525
+ });
10526
+ }
10527
+ else {
10528
+ _this.enableView.emit(dateChange);
10529
+ }
10530
+ }
10531
+ else {
10532
+ _this.messageService.add({
10533
+ severity: "error",
10534
+ summary: _this.translateService.instant("hcm.payroll.error"),
10535
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10536
+ });
10537
+ }
10538
+ },
10539
+ },
10540
+ {
10541
+ label: this.translateService.instant("hcm.payroll.delete"),
10542
+ command: function () {
10543
+ if (_this.isAllowToDeleteHistorical && rowData) {
10544
+ _this.delete(rowData.id, rowData.dateChange);
10545
+ }
10546
+ else {
10547
+ _this.messageService.add({
10548
+ severity: "error",
10549
+ summary: _this.translateService.instant("hcm.payroll.error"),
10550
+ detail: _this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10551
+ });
10552
+ }
10553
+ },
10554
+ },
10555
+ ];
10556
+ };
10557
+ HistoricalPixAccountListComponent.prototype.delete = function (id, dateChange) {
10558
+ var _this = this;
10559
+ if (id === this.lastRecord.id) {
10560
+ var dateChangeToDto_1 = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
10561
+ this.confirmationService.confirm({
10562
+ message: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete") + "?",
10563
+ accept: function () {
10564
+ _this.loading = true;
10565
+ var service = _this.withSidebar ? exports.ServiceType.PAYROLL : exports.ServiceType.DEPENDENT;
10566
+ _this.historicalPixAccountListService
10567
+ .remove(_this.employeeId, dateChangeToDto_1, service, _this.dependentId)
10568
+ .pipe(operators.takeUntil(_this.ngUnsubscribe))
10569
+ .subscribe(function () {
10570
+ _this.messageService.add({
10571
+ severity: "success",
10572
+ summary: _this.translateService.instant("hcm.payroll.success"),
10573
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
10574
+ });
10575
+ _this.parameters = (_this.parameters && __assign({}, _this.parameters)) || {};
10576
+ }, function () {
10577
+ _this.messageService.add({
10578
+ severity: "error",
10579
+ summary: _this.translateService.instant("hcm.payroll.error"),
10580
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
10581
+ });
10582
+ _this.loading = false;
10583
+ });
10584
+ },
10585
+ });
10586
+ }
10587
+ else {
10588
+ this.messageService.add({
10589
+ severity: "error",
10590
+ summary: this.translateService.instant("hcm.payroll.error"),
10591
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
10592
+ });
10593
+ }
10594
+ };
10595
+ HistoricalPixAccountListComponent.prototype.add = function () {
10596
+ if (this.isAllowToAddHistorical) {
10597
+ this.router.navigate(["historical-pix-account-new"], {
10598
+ relativeTo: this.activatedRoute,
10599
+ });
10600
+ }
10601
+ else {
10602
+ this.messageService.add({
10603
+ severity: "error",
10604
+ summary: this.translateService.instant("hcm.payroll.error"),
10605
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10606
+ });
10607
+ }
10608
+ };
10609
+ HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10610
+ if (payload && payload.length) {
10611
+ this.lastRecord = payload[0];
10612
+ }
10613
+ };
10614
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10615
+ get: function () {
10616
+ return (this.permission["Incluir"]);
10617
+ },
10618
+ enumerable: true,
10619
+ configurable: true
10620
+ });
10621
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10622
+ get: function () {
10623
+ return (this.permission["Excluir"]);
10624
+ },
10625
+ enumerable: true,
10626
+ configurable: true
10627
+ });
10628
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10629
+ get: function () {
10630
+ return (this.permission["Visaulizar"]);
10631
+ },
10632
+ enumerable: true,
10633
+ configurable: true
10634
+ });
10635
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10636
+ get: function () {
10637
+ return this.getMenuActions.bind(this);
10638
+ },
10639
+ enumerable: true,
10640
+ configurable: true
10641
+ });
10642
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "reloadList", {
10643
+ set: function (condition) {
10644
+ if (condition) {
10645
+ this.loading = true;
10646
+ this.parameters = (this.parameters && __assign({}, this.parameters)) || {};
10647
+ }
10648
+ },
10649
+ enumerable: true,
10650
+ configurable: true
10651
+ });
10652
+ HistoricalPixAccountListComponent.ctorParameters = function () { return [
10653
+ { type: api.ConfirmationService },
10654
+ { type: core$1.TranslateService },
10655
+ { type: router.ActivatedRoute },
10656
+ { type: core.ChangeDetectorRef },
10657
+ { type: router.Router },
10658
+ { type: api.MessageService },
10659
+ { type: HistoricalPixAccountListService }
10660
+ ]; };
10661
+ __decorate([
10662
+ core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10663
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
10664
+ __decorate([
10665
+ core.Input()
10666
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
10667
+ __decorate([
10668
+ core.Input()
10669
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
10670
+ __decorate([
10671
+ core.Input()
10672
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
10673
+ __decorate([
10674
+ core.Input()
10675
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
10676
+ __decorate([
10677
+ core.Input()
10678
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
10679
+ __decorate([
10680
+ core.Input()
10681
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
10682
+ __decorate([
10683
+ core.Input()
10684
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10685
+ __decorate([
10686
+ core.Output()
10687
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10688
+ __decorate([
10689
+ core.Input()
10690
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
10691
+ HistoricalPixAccountListComponent = __decorate([
10692
+ core.Component({
10693
+ // tslint:disable-next-line:component-selector
10694
+ selector: "c-historical-pix-account-list",
10695
+ 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",
10696
+ styles: [""]
10697
+ })
10698
+ ], HistoricalPixAccountListComponent);
10699
+ return HistoricalPixAccountListComponent;
10700
+ }());
10701
+
10702
+ var HistoricalPixAccountListModule = /** @class */ (function () {
10703
+ function HistoricalPixAccountListModule() {
10704
+ }
10705
+ HistoricalPixAccountListModule = __decorate([
10706
+ core.NgModule({
10707
+ imports: [
10708
+ common.CommonModule,
10709
+ forms.FormsModule,
10710
+ http.HttpClientModule,
10711
+ autocomplete.AutoCompleteModule,
10712
+ SharedModule,
10713
+ forms.ReactiveFormsModule,
10714
+ table.TableModule,
10715
+ angularComponents.ButtonModule,
10716
+ tooltip.TooltipModule,
10717
+ angularComponents.LoadingStateModule,
10718
+ DataListRestModule,
10719
+ confirmdialog.ConfirmDialogModule,
10720
+ ],
10721
+ declarations: [HistoricalPixAccountListComponent],
10722
+ providers: [HistoricalPixAccountListService],
10723
+ exports: [HistoricalPixAccountListComponent],
10724
+ })
10725
+ ], HistoricalPixAccountListModule);
10726
+ return HistoricalPixAccountListModule;
10727
+ }());
10728
+
10371
10729
  exports.AdmissionDraftSummaryComponent = AdmissionDraftSummaryComponent;
10372
10730
  exports.AdmissionDraftSummaryModule = AdmissionDraftSummaryModule;
10373
10731
  exports.AdmissionDraftSummaryService = AdmissionDraftSummaryService;
@@ -10409,6 +10767,9 @@
10409
10767
  exports.HistoricalBankAccountModule = HistoricalBankAccountModule;
10410
10768
  exports.HistoricalBankAccountService = HistoricalBankAccountService;
10411
10769
  exports.HistoricalPixAccountComponent = HistoricalPixAccountComponent;
10770
+ exports.HistoricalPixAccountListComponent = HistoricalPixAccountListComponent;
10771
+ exports.HistoricalPixAccountListModule = HistoricalPixAccountListModule;
10772
+ exports.HistoricalPixAccountListService = HistoricalPixAccountListService;
10412
10773
  exports.HistoricalPixAccountModule = HistoricalPixAccountModule;
10413
10774
  exports.HistoricalPixAccountService = HistoricalPixAccountService;
10414
10775
  exports.HttpClientService = HttpClientService;