@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
@@ -8522,10 +8522,11 @@ class FormatUtilsService {
8522
8522
  }
8523
8523
 
8524
8524
  let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8525
- constructor(translateService, cd, formBuilder) {
8525
+ constructor(translateService, cd, formBuilder, messageService) {
8526
8526
  this.translateService = translateService;
8527
8527
  this.cd = cd;
8528
8528
  this.formBuilder = formBuilder;
8529
+ this.messageService = messageService;
8529
8530
  this.recordByRow = 1;
8530
8531
  this.showDateChange = false;
8531
8532
  this.isEditMode = false;
@@ -8573,17 +8574,35 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8573
8574
  visible: !!(!this.isEditMode && this.withSideBar),
8574
8575
  label: this.translateService.instant("hcm.payroll.edit"),
8575
8576
  command: () => {
8576
- rowData["index"] = key;
8577
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8578
- this.visible = true;
8577
+ if (this.isAllowToEditHistorical && rowData) {
8578
+ rowData["index"] = key;
8579
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8580
+ this.visible = true;
8581
+ }
8582
+ else {
8583
+ this.messageService.add({
8584
+ severity: "error",
8585
+ summary: this.translateService.instant("hcm.payroll.error"),
8586
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8587
+ });
8588
+ }
8579
8589
  },
8580
8590
  },
8581
8591
  {
8582
8592
  visible: !this.isEditMode,
8583
8593
  label: this.translateService.instant("hcm.payroll.delete"),
8584
8594
  command: () => {
8585
- this.loading = true;
8586
- this.deleteAnnuityItem(key);
8595
+ if (this.isAllowToDeleteHistorical && rowData) {
8596
+ this.loading = true;
8597
+ this.deleteAnnuityItem(key);
8598
+ }
8599
+ else {
8600
+ this.messageService.add({
8601
+ severity: "error",
8602
+ summary: this.translateService.instant("hcm.payroll.error"),
8603
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8604
+ });
8605
+ }
8587
8606
  },
8588
8607
  },
8589
8608
  ];
@@ -8763,11 +8782,18 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8763
8782
  getFormattedPercentage(value) {
8764
8783
  return FormatUtilsService.getFormattedPercentage(value);
8765
8784
  }
8785
+ get isAllowToDeleteHistorical() {
8786
+ return (this.permission["Excluir"]);
8787
+ }
8788
+ get isAllowToEditHistorical() {
8789
+ return (this.permission["Editar"]);
8790
+ }
8766
8791
  };
8767
8792
  HistoricalPixAccountComponent.ctorParameters = () => [
8768
8793
  { type: TranslateService },
8769
8794
  { type: ChangeDetectorRef },
8770
- { type: FormBuilder }
8795
+ { type: FormBuilder },
8796
+ { type: MessageService }
8771
8797
  ];
8772
8798
  __decorate([
8773
8799
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -8817,6 +8843,9 @@ __decorate([
8817
8843
  __decorate([
8818
8844
  Input()
8819
8845
  ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
8846
+ __decorate([
8847
+ Input()
8848
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
8820
8849
  __decorate([
8821
8850
  Input()
8822
8851
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -9045,6 +9074,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9045
9074
  ...this.initialValidatorOfPercentage,
9046
9075
  Validators.max(this.maxValuePercentage),
9047
9076
  ])),
9077
+ externalId: this.formBuilder.control(null),
9048
9078
  customFields: this.formBuilder.control(null),
9049
9079
  });
9050
9080
  }
@@ -9083,7 +9113,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9083
9113
  else {
9084
9114
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
9085
9115
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9086
- this.formatPixKeyTelehponeNumber();
9116
+ this.formatPixKeyTelephoneNumber();
9087
9117
  }
9088
9118
  }
9089
9119
  }
@@ -9091,7 +9121,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9091
9121
  this.labelBtnAdd = "hcm.payroll.employees_add";
9092
9122
  }
9093
9123
  }
9094
- formatPixKeyTelehponeNumber() {
9124
+ formatPixKeyTelephoneNumber() {
9095
9125
  if (this.pixKeyType === "TELEPHONE") {
9096
9126
  this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9097
9127
  }
@@ -9106,7 +9136,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9106
9136
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
9107
9137
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9108
9138
  this.setPixKeyValidators(isEditMode);
9109
- this.formatPixKeyTelehponeNumber();
9139
+ this.formatPixKeyTelephoneNumber();
9110
9140
  }
9111
9141
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
9112
9142
  "pixKeyType",
@@ -9348,7 +9378,7 @@ __decorate([
9348
9378
  HistoricalPixAccountFormComponent = __decorate([
9349
9379
  Component({
9350
9380
  selector: "pix-account",
9351
- 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",
9381
+ 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",
9352
9382
  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}"]
9353
9383
  })
9354
9384
  ], HistoricalPixAccountFormComponent);
@@ -9402,6 +9432,297 @@ HistoricalPixAccountModule = __decorate([
9402
9432
  })
9403
9433
  ], HistoricalPixAccountModule);
9404
9434
 
9435
+ let HistoricalPixAccountListService = class HistoricalPixAccountListService {
9436
+ constructor(http, httpClient) {
9437
+ this.http = http;
9438
+ this.httpClient = httpClient;
9439
+ }
9440
+ remove(id, dateWhen, service = ServiceType.PAYROLL, dependentId) {
9441
+ if (service === ServiceType.DEPENDENT) {
9442
+ return this.httpClient
9443
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
9444
+ dependentId: dependentId,
9445
+ dateWhen: dateWhen,
9446
+ });
9447
+ }
9448
+ else {
9449
+ return this.http.post("actions/historicalEmployeePixDelete", {
9450
+ employeeId: id,
9451
+ dateWhen: dateWhen
9452
+ });
9453
+ }
9454
+ }
9455
+ };
9456
+ HistoricalPixAccountListService.ctorParameters = () => [
9457
+ { type: HttpClientService },
9458
+ { type: HttpClient }
9459
+ ];
9460
+ HistoricalPixAccountListService = __decorate([
9461
+ Injectable()
9462
+ ], HistoricalPixAccountListService);
9463
+
9464
+ const moment$e = moment_;
9465
+ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent {
9466
+ constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
9467
+ this.confirmationService = confirmationService;
9468
+ this.translateService = translateService;
9469
+ this.activatedRoute = activatedRoute;
9470
+ this.cd = cd;
9471
+ this.router = router;
9472
+ this.messageService = messageService;
9473
+ this.historicalPixAccountListService = historicalPixAccountListService;
9474
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9475
+ this.keyPayload = "historicalEmployeePix";
9476
+ this.withSidebar = true;
9477
+ this.enableView = new EventEmitter();
9478
+ this.ngUnsubscribe = new Subject();
9479
+ this.loading = true;
9480
+ this.columns = [
9481
+ {
9482
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
9483
+ field: "dateChange",
9484
+ },
9485
+ {
9486
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
9487
+ field: "pixKeyType.value",
9488
+ },
9489
+ {
9490
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
9491
+ field: "pixKey",
9492
+ },
9493
+ {
9494
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9495
+ field: "percentage",
9496
+ },
9497
+ {
9498
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
9499
+ field: "numberOfPixAccount",
9500
+ },
9501
+ ];
9502
+ }
9503
+ ngOnInit() {
9504
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
9505
+ }
9506
+ ngOnDestroy() {
9507
+ this.ngUnsubscribe.next();
9508
+ this.ngUnsubscribe.complete();
9509
+ }
9510
+ ngAfterViewInit() {
9511
+ this.cd.detectChanges();
9512
+ }
9513
+ onLazyLoad(payload) {
9514
+ payload.forEach((value) => {
9515
+ value.dateChange = moment$e(value.dateChange).format(this.dateFormat);
9516
+ value.pixKey = this.formatPixKeyByType(value.pixKeyType, value.pixKey);
9517
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
9518
+ });
9519
+ this.onGridLoad(payload);
9520
+ this.loading = false;
9521
+ }
9522
+ formatPixKeyByType(pixKeyType, pixKey) {
9523
+ const keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
9524
+ if (keyType === "TELEPHONE") {
9525
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
9526
+ }
9527
+ else if (keyType === "CPF") {
9528
+ return FormatUtilsService.getFormattedCpf(pixKey);
9529
+ }
9530
+ else if (keyType === "CNPJ") {
9531
+ return FormatUtilsService.getFormattedCnpj(pixKey);
9532
+ }
9533
+ else {
9534
+ return pixKey;
9535
+ }
9536
+ }
9537
+ getMenuActions(rowData) {
9538
+ return [
9539
+ {
9540
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9541
+ command: () => {
9542
+ if (this.isAllowToViewHistorical && rowData) {
9543
+ const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9544
+ if (this.withSidebar) {
9545
+ this.router.navigate([`historical-pix-account/${dateChange}`], {
9546
+ relativeTo: this.activatedRoute,
9547
+ });
9548
+ }
9549
+ else {
9550
+ this.enableView.emit(dateChange);
9551
+ }
9552
+ }
9553
+ else {
9554
+ this.messageService.add({
9555
+ severity: "error",
9556
+ summary: this.translateService.instant("hcm.payroll.error"),
9557
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9558
+ });
9559
+ }
9560
+ },
9561
+ },
9562
+ {
9563
+ label: this.translateService.instant("hcm.payroll.delete"),
9564
+ command: () => {
9565
+ if (this.isAllowToDeleteHistorical && rowData) {
9566
+ this.delete(rowData.id, rowData.dateChange);
9567
+ }
9568
+ else {
9569
+ this.messageService.add({
9570
+ severity: "error",
9571
+ summary: this.translateService.instant("hcm.payroll.error"),
9572
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9573
+ });
9574
+ }
9575
+ },
9576
+ },
9577
+ ];
9578
+ }
9579
+ delete(id, dateChange) {
9580
+ if (id === this.lastRecord.id) {
9581
+ const dateChangeToDto = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
9582
+ this.confirmationService.confirm({
9583
+ message: `${this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete")}?`,
9584
+ accept: () => {
9585
+ this.loading = true;
9586
+ const service = this.withSidebar ? ServiceType.PAYROLL : ServiceType.DEPENDENT;
9587
+ this.historicalPixAccountListService
9588
+ .remove(this.employeeId, dateChangeToDto, service, this.dependentId)
9589
+ .pipe(takeUntil(this.ngUnsubscribe))
9590
+ .subscribe(() => {
9591
+ this.messageService.add({
9592
+ severity: "success",
9593
+ summary: this.translateService.instant("hcm.payroll.success"),
9594
+ detail: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
9595
+ });
9596
+ this.parameters = (this.parameters && Object.assign({}, this.parameters)) || {};
9597
+ }, () => {
9598
+ this.messageService.add({
9599
+ severity: "error",
9600
+ summary: this.translateService.instant("hcm.payroll.error"),
9601
+ detail: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
9602
+ });
9603
+ this.loading = false;
9604
+ });
9605
+ },
9606
+ });
9607
+ }
9608
+ else {
9609
+ this.messageService.add({
9610
+ severity: "error",
9611
+ summary: this.translateService.instant("hcm.payroll.error"),
9612
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
9613
+ });
9614
+ }
9615
+ }
9616
+ add() {
9617
+ if (this.isAllowToAddHistorical) {
9618
+ this.router.navigate(["historical-pix-account-new"], {
9619
+ relativeTo: this.activatedRoute,
9620
+ });
9621
+ }
9622
+ else {
9623
+ this.messageService.add({
9624
+ severity: "error",
9625
+ summary: this.translateService.instant("hcm.payroll.error"),
9626
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9627
+ });
9628
+ }
9629
+ }
9630
+ onGridLoad(payload) {
9631
+ if (payload && payload.length) {
9632
+ this.lastRecord = payload[0];
9633
+ }
9634
+ }
9635
+ get isAllowToAddHistorical() {
9636
+ return (this.permission["Incluir"]);
9637
+ }
9638
+ get isAllowToDeleteHistorical() {
9639
+ return (this.permission["Excluir"]);
9640
+ }
9641
+ get isAllowToViewHistorical() {
9642
+ return (this.permission["Visaulizar"]);
9643
+ }
9644
+ get scopedActions() {
9645
+ return this.getMenuActions.bind(this);
9646
+ }
9647
+ set reloadList(condition) {
9648
+ if (condition) {
9649
+ this.loading = true;
9650
+ this.parameters = (this.parameters && Object.assign({}, this.parameters)) || {};
9651
+ }
9652
+ }
9653
+ };
9654
+ HistoricalPixAccountListComponent.ctorParameters = () => [
9655
+ { type: ConfirmationService },
9656
+ { type: TranslateService },
9657
+ { type: ActivatedRoute },
9658
+ { type: ChangeDetectorRef },
9659
+ { type: Router },
9660
+ { type: MessageService },
9661
+ { type: HistoricalPixAccountListService }
9662
+ ];
9663
+ __decorate([
9664
+ ViewChild(CustomFieldsComponent$1, { static: false })
9665
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
9666
+ __decorate([
9667
+ Input()
9668
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
9669
+ __decorate([
9670
+ Input()
9671
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
9672
+ __decorate([
9673
+ Input()
9674
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
9675
+ __decorate([
9676
+ Input()
9677
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
9678
+ __decorate([
9679
+ Input()
9680
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
9681
+ __decorate([
9682
+ Input()
9683
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
9684
+ __decorate([
9685
+ Input()
9686
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
9687
+ __decorate([
9688
+ Output()
9689
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
9690
+ __decorate([
9691
+ Input()
9692
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
9693
+ HistoricalPixAccountListComponent = __decorate([
9694
+ Component({
9695
+ // tslint:disable-next-line:component-selector
9696
+ selector: "c-historical-pix-account-list",
9697
+ 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",
9698
+ styles: [""]
9699
+ })
9700
+ ], HistoricalPixAccountListComponent);
9701
+
9702
+ let HistoricalPixAccountListModule = class HistoricalPixAccountListModule {
9703
+ };
9704
+ HistoricalPixAccountListModule = __decorate([
9705
+ NgModule({
9706
+ imports: [
9707
+ CommonModule,
9708
+ FormsModule,
9709
+ HttpClientModule,
9710
+ AutoCompleteModule,
9711
+ SharedModule,
9712
+ ReactiveFormsModule,
9713
+ TableModule,
9714
+ ButtonModule,
9715
+ TooltipModule,
9716
+ LoadingStateModule,
9717
+ DataListRestModule,
9718
+ ConfirmDialogModule,
9719
+ ],
9720
+ declarations: [HistoricalPixAccountListComponent],
9721
+ providers: [HistoricalPixAccountListService],
9722
+ exports: [HistoricalPixAccountListComponent],
9723
+ })
9724
+ ], HistoricalPixAccountListModule);
9725
+
9405
9726
  /*
9406
9727
  * Public API Surface of core
9407
9728
  */
@@ -9410,5 +9731,5 @@ HistoricalPixAccountModule = __decorate([
9410
9731
  * Generated bundle index. Do not edit.
9411
9732
  */
9412
9733
 
9413
- export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricalPixAccountFormComponent as ɵr };
9734
+ export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricalPixAccountFormComponent as ɵr };
9414
9735
  //# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map