@senior-gestao-pessoas/payroll-core 9.3.0-fdc2ca03-c046-451a-bb4a-4d788fbde8cb → 9.4.0-02f1998a-8c51-4317-9b38-c21241fa2248

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.
@@ -8533,6 +8533,11 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8533
8533
  this.isViewMode = false;
8534
8534
  this.withSideBar = true;
8535
8535
  this.defaultCpfNumber = null;
8536
+ this.listDataReciever = [];
8537
+ this.isViewModeActive = new EventEmitter();
8538
+ this.isEditModeActive = new EventEmitter();
8539
+ this.isDeleteModeActive = new EventEmitter();
8540
+ this.listFromApp = [];
8536
8541
  this.visibleChange = new EventEmitter();
8537
8542
  this.ngUnsubscribe = new Subject();
8538
8543
  this.orderBy = {
@@ -8565,26 +8570,32 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8565
8570
  visible: this.isEditMode,
8566
8571
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
8567
8572
  command: () => {
8568
- rowData["index"] = key;
8569
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8570
- this.visible = true;
8573
+ if (this.isAllowToViewHistorical) {
8574
+ rowData["index"] = key;
8575
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8576
+ this.visible = true;
8577
+ }
8578
+ else {
8579
+ this.isViewModeActive.emit(true);
8580
+ }
8571
8581
  },
8572
8582
  },
8573
8583
  {
8574
8584
  visible: !!(!this.isEditMode && this.withSideBar),
8575
8585
  label: this.translateService.instant("hcm.payroll.edit"),
8576
8586
  command: () => {
8577
- if (this.isAllowToEditHistorical && rowData) {
8587
+ if (this.isAllowToEditHistorical) {
8578
8588
  rowData["index"] = key;
8579
8589
  this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8580
8590
  this.visible = true;
8581
8591
  }
8582
8592
  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
- });
8593
+ this.isEditModeActive.emit(true);
8594
+ if (this.listFromApp.length == 0) {
8595
+ rowData["index"] = key;
8596
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8597
+ this.visible = true;
8598
+ }
8588
8599
  }
8589
8600
  },
8590
8601
  },
@@ -8592,16 +8603,16 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8592
8603
  visible: !this.isEditMode,
8593
8604
  label: this.translateService.instant("hcm.payroll.delete"),
8594
8605
  command: () => {
8595
- if (this.isAllowToDeleteHistorical && rowData) {
8606
+ if (this.isAllowToDeleteHistorical) {
8596
8607
  this.loading = true;
8597
8608
  this.deleteAnnuityItem(key);
8598
8609
  }
8599
8610
  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
- });
8611
+ this.isDeleteModeActive.emit(true);
8612
+ if (this.listFromApp.length == 0) {
8613
+ this.loading = true;
8614
+ this.deleteAnnuityItem(key);
8615
+ }
8605
8616
  }
8606
8617
  },
8607
8618
  },
@@ -8612,6 +8623,11 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8612
8623
  ngOnInit() {
8613
8624
  this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
8614
8625
  }
8626
+ ngOnChanges(changes) {
8627
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
8628
+ this.listFromApp = changes['listDataReciever'].currentValue;
8629
+ }
8630
+ }
8615
8631
  createFormGroup() {
8616
8632
  this.historicalPixAccountList = this.formBuilder.group({
8617
8633
  historicalPixAccountList: this.formBuilder.control(null),
@@ -8667,6 +8683,13 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8667
8683
  this.pixAccountItemInput = {};
8668
8684
  this.visible = true;
8669
8685
  }
8686
+ isNotAllowMessage() {
8687
+ this.messageService.add({
8688
+ severity: "error",
8689
+ summary: this.translateService.instant("hcm.payroll.error"),
8690
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8691
+ });
8692
+ }
8670
8693
  deleteAnnuityItem(index) {
8671
8694
  let newlist = [...this.getHistoricalPixAccountList()];
8672
8695
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -8782,14 +8805,17 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8782
8805
  getFormattedPercentage(value) {
8783
8806
  return FormatUtilsService.getFormattedPercentage(value);
8784
8807
  }
8808
+ get isAllowToAddHistorical() {
8809
+ return (this.permission["incluir"]);
8810
+ }
8785
8811
  get isAllowToDeleteHistorical() {
8786
- return (this.permission["Excluir"]);
8812
+ return (this.permission["excluir"]);
8787
8813
  }
8788
8814
  get isAllowToEditHistorical() {
8789
- return (this.permission["Editar"]);
8815
+ return (this.permission["editar"]);
8790
8816
  }
8791
8817
  get isAllowToViewHistorical() {
8792
- return (this.permission["Visualizar"]);
8818
+ return (this.permission["visualizar"]);
8793
8819
  }
8794
8820
  };
8795
8821
  HistoricalPixAccountComponent.ctorParameters = () => [
@@ -8849,6 +8875,18 @@ __decorate([
8849
8875
  __decorate([
8850
8876
  Input()
8851
8877
  ], HistoricalPixAccountComponent.prototype, "permission", void 0);
8878
+ __decorate([
8879
+ Input()
8880
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
8881
+ __decorate([
8882
+ Output()
8883
+ ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
8884
+ __decorate([
8885
+ Output()
8886
+ ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
8887
+ __decorate([
8888
+ Output()
8889
+ ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
8852
8890
  __decorate([
8853
8891
  Input()
8854
8892
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -8865,7 +8903,7 @@ HistoricalPixAccountComponent = __decorate([
8865
8903
  Component({
8866
8904
  // tslint:disable-next-line:component-selector
8867
8905
  selector: "c-historical-pix-account",
8868
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n",
8906
+ template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n",
8869
8907
  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}"]
8870
8908
  })
8871
8909
  ], HistoricalPixAccountComponent);
@@ -9477,6 +9515,8 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9477
9515
  this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9478
9516
  this.keyPayload = "historicalEmployeePix";
9479
9517
  this.withSidebar = true;
9518
+ this.isOnlyView = new EventEmitter();
9519
+ this.isOnlyEdit = new EventEmitter();
9480
9520
  this.enableView = new EventEmitter();
9481
9521
  this.ngUnsubscribe = new Subject();
9482
9522
  this.loading = true;
@@ -9485,18 +9525,6 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9485
9525
  label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
9486
9526
  field: "dateChange",
9487
9527
  },
9488
- {
9489
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
9490
- field: "pixKeyType.value",
9491
- },
9492
- {
9493
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
9494
- field: "pixKey",
9495
- },
9496
- {
9497
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9498
- field: "percentage",
9499
- },
9500
9528
  {
9501
9529
  label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
9502
9530
  field: "numberOfPixAccount",
@@ -9516,40 +9544,50 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9516
9544
  onLazyLoad(payload) {
9517
9545
  payload.forEach((value) => {
9518
9546
  value.dateChange = moment$e(value.dateChange).format(this.dateFormat);
9519
- value.pixKey = this.formatPixKeyByType(value.pixKeyType, value.pixKey);
9520
- value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
9521
9547
  });
9522
9548
  this.onGridLoad(payload);
9523
9549
  this.loading = false;
9524
9550
  }
9525
- formatPixKeyByType(pixKeyType, pixKey) {
9526
- const keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
9527
- if (keyType === "TELEPHONE") {
9528
- return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
9529
- }
9530
- else if (keyType === "CPF") {
9531
- return FormatUtilsService.getFormattedCpf(pixKey);
9532
- }
9533
- else if (keyType === "CNPJ") {
9534
- return FormatUtilsService.getFormattedCnpj(pixKey);
9535
- }
9536
- else {
9537
- return pixKey;
9538
- }
9539
- }
9540
9551
  getMenuActions(rowData) {
9541
9552
  return [
9542
9553
  {
9543
9554
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9544
9555
  command: () => {
9545
- const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9546
- if (this.withSidebar) {
9547
- this.router.navigate([`historical-pix-account/${dateChange}`], {
9548
- relativeTo: this.activatedRoute,
9549
- });
9556
+ if (this.isAllowToViewHistorical) {
9557
+ const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9558
+ if (this.withSidebar) {
9559
+ this.isOnlyView.emit(true);
9560
+ this.router.navigate([`historical-pix-account/${dateChange}`], {
9561
+ relativeTo: this.activatedRoute,
9562
+ });
9563
+ }
9564
+ else {
9565
+ this.enableView.emit(dateChange);
9566
+ }
9567
+ }
9568
+ else {
9569
+ this.isNotAllowMessage();
9570
+ }
9571
+ },
9572
+ },
9573
+ {
9574
+ label: this.translateService.instant("hcm.payroll.edit"),
9575
+ command: () => {
9576
+ if (this.isAllowToEditHistorical) {
9577
+ const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9578
+ if (this.withSidebar) {
9579
+ this.isOnlyView.emit(false);
9580
+ this.isOnlyEdit.emit(true);
9581
+ this.router.navigate([`historical-pix-account/${dateChange}`], {
9582
+ relativeTo: this.activatedRoute,
9583
+ });
9584
+ }
9585
+ else {
9586
+ this.enableView.emit(dateChange);
9587
+ }
9550
9588
  }
9551
9589
  else {
9552
- this.enableView.emit(dateChange);
9590
+ this.isNotAllowMessage();
9553
9591
  }
9554
9592
  },
9555
9593
  },
@@ -9560,14 +9598,10 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9560
9598
  this.delete(rowData.id, rowData.dateChange);
9561
9599
  }
9562
9600
  else {
9563
- this.messageService.add({
9564
- severity: "error",
9565
- summary: this.translateService.instant("hcm.payroll.error"),
9566
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9567
- });
9601
+ this.isNotAllowMessage();
9568
9602
  }
9569
9603
  },
9570
- },
9604
+ }
9571
9605
  ];
9572
9606
  }
9573
9607
  delete(id, dateChange) {
@@ -9621,19 +9655,29 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9621
9655
  });
9622
9656
  }
9623
9657
  }
9658
+ isNotAllowMessage() {
9659
+ this.messageService.add({
9660
+ severity: "error",
9661
+ summary: this.translateService.instant("hcm.payroll.error"),
9662
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9663
+ });
9664
+ }
9624
9665
  onGridLoad(payload) {
9625
9666
  if (payload && payload.length) {
9626
9667
  this.lastRecord = payload[0];
9627
9668
  }
9628
9669
  }
9629
9670
  get isAllowToAddHistorical() {
9630
- return (this.permission["Incluir"]);
9671
+ return (this.permission["incluir"]);
9631
9672
  }
9632
9673
  get isAllowToDeleteHistorical() {
9633
- return (this.permission["Excluir"]);
9674
+ return (this.permission["excluir"]);
9634
9675
  }
9635
9676
  get isAllowToViewHistorical() {
9636
- return (this.permission["Visualizar"]);
9677
+ return (this.permission["visualizar"]);
9678
+ }
9679
+ get isAllowToEditHistorical() {
9680
+ return (this.permission["editar"]);
9637
9681
  }
9638
9682
  get scopedActions() {
9639
9683
  return this.getMenuActions.bind(this);
@@ -9678,6 +9722,12 @@ __decorate([
9678
9722
  __decorate([
9679
9723
  Input()
9680
9724
  ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
9725
+ __decorate([
9726
+ Output()
9727
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
9728
+ __decorate([
9729
+ Output()
9730
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyEdit", void 0);
9681
9731
  __decorate([
9682
9732
  Output()
9683
9733
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);