@senior-gestao-pessoas/payroll-core 9.2.0 → 9.3.0-06538e11-08fa-4c6f-9e67-58f132131fe8

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 (34) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +436 -28
  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 +3 -1
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +10 -1
  7. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +53 -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 +39 -18
  12. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +56 -12
  13. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +255 -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 +40 -18
  19. package/esm5/components/historical-pix-account/historical-pix-account.component.js +72 -12
  20. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +279 -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 +388 -29
  26. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  27. package/fesm5/senior-gestao-pessoas-payroll-core.js +434 -29
  28. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  29. package/locale/en-US.json +8 -1
  30. package/locale/es-ES.json +8 -1
  31. package/locale/pt-BR.json +8 -1
  32. package/package.json +1 -1
  33. package/public_api.d.ts +1 -0
  34. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -8522,15 +8522,17 @@ 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;
8532
8533
  this.isViewMode = false;
8533
8534
  this.withSideBar = true;
8535
+ this.defaultCpfNumber = null;
8534
8536
  this.visibleChange = new EventEmitter();
8535
8537
  this.ngUnsubscribe = new Subject();
8536
8538
  this.orderBy = {
@@ -8563,26 +8565,41 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8563
8565
  visible: this.isEditMode,
8564
8566
  label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
8565
8567
  command: () => {
8566
- rowData["index"] = key;
8567
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8568
- this.visible = true;
8568
+ if (this.isAllowToViewHistorical) {
8569
+ rowData["index"] = key;
8570
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8571
+ this.visible = true;
8572
+ }
8573
+ else {
8574
+ this.isNotAllowMessage();
8575
+ }
8569
8576
  },
8570
8577
  },
8571
8578
  {
8572
8579
  visible: !!(!this.isEditMode && this.withSideBar),
8573
8580
  label: this.translateService.instant("hcm.payroll.edit"),
8574
8581
  command: () => {
8575
- rowData["index"] = key;
8576
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8577
- this.visible = true;
8582
+ if (this.isAllowToEditHistorical) {
8583
+ rowData["index"] = key;
8584
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8585
+ this.visible = true;
8586
+ }
8587
+ else {
8588
+ this.isNotAllowMessage();
8589
+ }
8578
8590
  },
8579
8591
  },
8580
8592
  {
8581
8593
  visible: !this.isEditMode,
8582
8594
  label: this.translateService.instant("hcm.payroll.delete"),
8583
8595
  command: () => {
8584
- this.loading = true;
8585
- this.deleteAnnuityItem(key);
8596
+ if (this.isAllowToDeleteHistorical) {
8597
+ this.loading = true;
8598
+ this.deleteAnnuityItem(key);
8599
+ }
8600
+ else {
8601
+ this.isNotAllowMessage();
8602
+ }
8586
8603
  },
8587
8604
  },
8588
8605
  ];
@@ -8647,6 +8664,13 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8647
8664
  this.pixAccountItemInput = {};
8648
8665
  this.visible = true;
8649
8666
  }
8667
+ isNotAllowMessage() {
8668
+ this.messageService.add({
8669
+ severity: "error",
8670
+ summary: this.translateService.instant("hcm.payroll.error"),
8671
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8672
+ });
8673
+ }
8650
8674
  deleteAnnuityItem(index) {
8651
8675
  let newlist = [...this.getHistoricalPixAccountList()];
8652
8676
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -8762,11 +8786,24 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8762
8786
  getFormattedPercentage(value) {
8763
8787
  return FormatUtilsService.getFormattedPercentage(value);
8764
8788
  }
8789
+ get isAllowToAddHistorical() {
8790
+ return (this.permission["incluir"]);
8791
+ }
8792
+ get isAllowToDeleteHistorical() {
8793
+ return (this.permission["excluir"]);
8794
+ }
8795
+ get isAllowToEditHistorical() {
8796
+ return (this.permission["editar"]);
8797
+ }
8798
+ get isAllowToViewHistorical() {
8799
+ return (this.permission["visualizar"]);
8800
+ }
8765
8801
  };
8766
8802
  HistoricalPixAccountComponent.ctorParameters = () => [
8767
8803
  { type: TranslateService },
8768
8804
  { type: ChangeDetectorRef },
8769
- { type: FormBuilder }
8805
+ { type: FormBuilder },
8806
+ { type: MessageService }
8770
8807
  ];
8771
8808
  __decorate([
8772
8809
  ViewChild(CustomFieldsComponent$1, { static: false })
@@ -8813,6 +8850,12 @@ __decorate([
8813
8850
  __decorate([
8814
8851
  Input()
8815
8852
  ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
8853
+ __decorate([
8854
+ Input()
8855
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
8856
+ __decorate([
8857
+ Input()
8858
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
8816
8859
  __decorate([
8817
8860
  Input()
8818
8861
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -8829,7 +8872,7 @@ HistoricalPixAccountComponent = __decorate([
8829
8872
  Component({
8830
8873
  // tslint:disable-next-line:component-selector
8831
8874
  selector: "c-historical-pix-account",
8832
- 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)\"></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)\"></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",
8875
+ 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",
8833
8876
  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}"]
8834
8877
  })
8835
8878
  ], HistoricalPixAccountComponent);
@@ -9005,6 +9048,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9005
9048
  this.withSideBar = true;
9006
9049
  this.isEditMode = false;
9007
9050
  this.paramsForm = new FormGroup({});
9051
+ this.defaultCpfNumber = null;
9008
9052
  this.visibleChange = new EventEmitter();
9009
9053
  this.pixAccountItemToList = new EventEmitter();
9010
9054
  this.ngUnsubscribe = new Subject();
@@ -9040,6 +9084,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9040
9084
  ...this.initialValidatorOfPercentage,
9041
9085
  Validators.max(this.maxValuePercentage),
9042
9086
  ])),
9087
+ externalId: this.formBuilder.control(null),
9043
9088
  customFields: this.formBuilder.control(null),
9044
9089
  });
9045
9090
  }
@@ -9048,7 +9093,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9048
9093
  this.pixKeyType = item.key;
9049
9094
  this.isShowPixKeyFieldValidatorMessage = true;
9050
9095
  this.pixAccountFormGroup.get("pixKey").reset();
9051
- this.setPixKeyValidators();
9096
+ this.setPixKeyValidators(true);
9052
9097
  if (item.key === "CPF") {
9053
9098
  this.setDefaultCpfPixKey();
9054
9099
  }
@@ -9071,15 +9116,26 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9071
9116
  if (value && value.currentItem && Object.keys(value.currentItem).length) {
9072
9117
  this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(Object.assign({}, value.currentItem)));
9073
9118
  this.labelBtnAdd = "hcm.payroll.employees_update";
9074
- this.setValidatorsAccordingList(value.listData, value.currentItem["index"]);
9119
+ this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
9075
9120
  if (!this.isView) {
9076
9121
  this.configEnableFields(value && value["isEditMode"]);
9077
9122
  }
9123
+ else {
9124
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
9125
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9126
+ this.formatPixKeyTelephoneNumber();
9127
+ }
9128
+ }
9078
9129
  }
9079
9130
  else {
9080
9131
  this.labelBtnAdd = "hcm.payroll.employees_add";
9081
9132
  }
9082
9133
  }
9134
+ formatPixKeyTelephoneNumber() {
9135
+ if (this.pixKeyType === "TELEPHONE") {
9136
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9137
+ }
9138
+ }
9083
9139
  convertDTOToShowWithCustomFields(data) {
9084
9140
  const obj = Object.assign({}, data);
9085
9141
  obj["customFields"] = mountCustomToShow(obj["customFields"]);
@@ -9089,10 +9145,8 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9089
9145
  this.visibleBtnSave = isEditMode;
9090
9146
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
9091
9147
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9092
- this.setPixKeyValidators();
9093
- if (this.pixKeyType === "TELEPHONE") {
9094
- this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9095
- }
9148
+ this.setPixKeyValidators(isEditMode);
9149
+ this.formatPixKeyTelephoneNumber();
9096
9150
  }
9097
9151
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
9098
9152
  "pixKeyType",
@@ -9145,7 +9199,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9145
9199
  */
9146
9200
  set getListPixAccount(pixAccountList) {
9147
9201
  if (pixAccountList) {
9148
- this.setValidatorsAccordingList(pixAccountList);
9202
+ this.setValidatorsAccordingList(pixAccountList, null, false);
9149
9203
  }
9150
9204
  else {
9151
9205
  this.resetForm();
@@ -9159,7 +9213,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9159
9213
  * @param pixAccountList
9160
9214
  * @param index
9161
9215
  */
9162
- setValidatorsAccordingList(pixAccountList, index = null) {
9216
+ setValidatorsAccordingList(pixAccountList, index = null, isEditMode = true) {
9163
9217
  this.pixAccountList = pixAccountList && pixAccountList.length ? [...pixAccountList] : [];
9164
9218
  const percentageIncluded = [];
9165
9219
  if (this.pixAccountList && this.pixAccountList.length) {
@@ -9170,13 +9224,13 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9170
9224
  });
9171
9225
  }
9172
9226
  this.beforeSetPixKeyTypeValidator();
9173
- this.setPixKeyValidators();
9227
+ this.setPixKeyValidators(isEditMode);
9174
9228
  this.validatePercentageValid(percentageIncluded);
9175
9229
  }
9176
9230
  /**
9177
9231
  * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
9178
9232
  */
9179
- setPixKeyValidators() {
9233
+ setPixKeyValidators(isEditMode) {
9180
9234
  const genericPixKey = this.pixAccountFormGroup.get("pixKey");
9181
9235
  if (this.pixKeyType) {
9182
9236
  switch (this.pixKeyType) {
@@ -9207,7 +9261,9 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9207
9261
  genericPixKey.setValidators(null);
9208
9262
  break;
9209
9263
  }
9210
- genericPixKey.enable();
9264
+ if (isEditMode) {
9265
+ genericPixKey.enable();
9266
+ }
9211
9267
  genericPixKey.updateValueAndValidity();
9212
9268
  }
9213
9269
  }
@@ -9237,11 +9293,16 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
9237
9293
  FormatUtilsService.formatTelephoneInputEvent(event);
9238
9294
  }
9239
9295
  setDefaultCpfPixKey() {
9240
- const sheetDocument = this.paramsForm.get("sheetDocument");
9241
- if (sheetDocument) {
9242
- const cpf = sheetDocument.get("cpfNumber").value;
9243
- if (cpf) {
9244
- this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9296
+ if (this.defaultCpfNumber) {
9297
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
9298
+ }
9299
+ else {
9300
+ const sheetDocument = this.paramsForm.get("sheetDocument");
9301
+ if (sheetDocument) {
9302
+ const cpf = sheetDocument.get("cpfNumber").value;
9303
+ if (cpf) {
9304
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9305
+ }
9245
9306
  }
9246
9307
  }
9247
9308
  }
@@ -9303,6 +9364,9 @@ __decorate([
9303
9364
  __decorate([
9304
9365
  Input()
9305
9366
  ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
9367
+ __decorate([
9368
+ Input()
9369
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
9306
9370
  __decorate([
9307
9371
  Output()
9308
9372
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -9324,7 +9388,7 @@ __decorate([
9324
9388
  HistoricalPixAccountFormComponent = __decorate([
9325
9389
  Component({
9326
9390
  selector: "pix-account",
9327
- 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",
9391
+ 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",
9328
9392
  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}"]
9329
9393
  })
9330
9394
  ], HistoricalPixAccountFormComponent);
@@ -9378,6 +9442,301 @@ HistoricalPixAccountModule = __decorate([
9378
9442
  })
9379
9443
  ], HistoricalPixAccountModule);
9380
9444
 
9445
+ let HistoricalPixAccountListService = class HistoricalPixAccountListService {
9446
+ constructor(http, httpClient) {
9447
+ this.http = http;
9448
+ this.httpClient = httpClient;
9449
+ }
9450
+ remove(id, dateWhen, service = ServiceType.PAYROLL, dependentId) {
9451
+ if (service === ServiceType.DEPENDENT) {
9452
+ return this.httpClient
9453
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
9454
+ dependentId: dependentId,
9455
+ dateWhen: dateWhen,
9456
+ });
9457
+ }
9458
+ else {
9459
+ return this.http.post("actions/historicalEmployeePixDelete", {
9460
+ employeeId: id,
9461
+ dateWhen: dateWhen
9462
+ });
9463
+ }
9464
+ }
9465
+ };
9466
+ HistoricalPixAccountListService.ctorParameters = () => [
9467
+ { type: HttpClientService },
9468
+ { type: HttpClient }
9469
+ ];
9470
+ HistoricalPixAccountListService = __decorate([
9471
+ Injectable()
9472
+ ], HistoricalPixAccountListService);
9473
+
9474
+ const moment$e = moment_;
9475
+ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent {
9476
+ constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
9477
+ this.confirmationService = confirmationService;
9478
+ this.translateService = translateService;
9479
+ this.activatedRoute = activatedRoute;
9480
+ this.cd = cd;
9481
+ this.router = router;
9482
+ this.messageService = messageService;
9483
+ this.historicalPixAccountListService = historicalPixAccountListService;
9484
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
9485
+ this.keyPayload = "historicalEmployeePix";
9486
+ this.withSidebar = true;
9487
+ this.isOnlyView = new EventEmitter();
9488
+ this.enableView = new EventEmitter();
9489
+ this.ngUnsubscribe = new Subject();
9490
+ this.loading = true;
9491
+ this.columns = [
9492
+ {
9493
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
9494
+ field: "dateChange",
9495
+ },
9496
+ {
9497
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
9498
+ field: "pixKeyType.value",
9499
+ },
9500
+ {
9501
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
9502
+ field: "pixKey",
9503
+ },
9504
+ {
9505
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9506
+ field: "percentage",
9507
+ },
9508
+ {
9509
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
9510
+ field: "numberOfPixAccount",
9511
+ },
9512
+ ];
9513
+ }
9514
+ ngOnInit() {
9515
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
9516
+ }
9517
+ ngOnDestroy() {
9518
+ this.ngUnsubscribe.next();
9519
+ this.ngUnsubscribe.complete();
9520
+ }
9521
+ ngAfterViewInit() {
9522
+ this.cd.detectChanges();
9523
+ }
9524
+ onLazyLoad(payload) {
9525
+ payload.forEach((value) => {
9526
+ value.dateChange = moment$e(value.dateChange).format(this.dateFormat);
9527
+ value.pixKey = this.formatPixKeyByType(value.pixKeyType, value.pixKey);
9528
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
9529
+ });
9530
+ this.onGridLoad(payload);
9531
+ this.loading = false;
9532
+ }
9533
+ formatPixKeyByType(pixKeyType, pixKey) {
9534
+ const keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
9535
+ if (keyType === "TELEPHONE") {
9536
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
9537
+ }
9538
+ else if (keyType === "CPF") {
9539
+ return FormatUtilsService.getFormattedCpf(pixKey);
9540
+ }
9541
+ else if (keyType === "CNPJ") {
9542
+ return FormatUtilsService.getFormattedCnpj(pixKey);
9543
+ }
9544
+ else {
9545
+ return pixKey;
9546
+ }
9547
+ }
9548
+ getMenuActions(rowData) {
9549
+ return [
9550
+ {
9551
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9552
+ command: () => {
9553
+ if (this.isAllowToViewHistorical) {
9554
+ const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
9555
+ if (this.withSidebar) {
9556
+ this.router.navigate([`historical-pix-account/${dateChange}`], {
9557
+ relativeTo: this.activatedRoute,
9558
+ });
9559
+ }
9560
+ else {
9561
+ this.isOnlyView.emit(true);
9562
+ this.enableView.emit(dateChange);
9563
+ }
9564
+ }
9565
+ else {
9566
+ this.isNotAllowMessage();
9567
+ }
9568
+ },
9569
+ },
9570
+ {
9571
+ label: this.translateService.instant("hcm.payroll.delete"),
9572
+ command: () => {
9573
+ if (this.isAllowToDeleteHistorical && rowData) {
9574
+ this.delete(rowData.id, rowData.dateChange);
9575
+ }
9576
+ else {
9577
+ this.isNotAllowMessage();
9578
+ }
9579
+ },
9580
+ },
9581
+ ];
9582
+ }
9583
+ delete(id, dateChange) {
9584
+ if (id === this.lastRecord.id) {
9585
+ const dateChangeToDto = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
9586
+ this.confirmationService.confirm({
9587
+ message: `${this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete")}?`,
9588
+ accept: () => {
9589
+ this.loading = true;
9590
+ const service = this.withSidebar ? ServiceType.PAYROLL : ServiceType.DEPENDENT;
9591
+ this.historicalPixAccountListService
9592
+ .remove(this.employeeId, dateChangeToDto, service, this.dependentId)
9593
+ .pipe(takeUntil(this.ngUnsubscribe))
9594
+ .subscribe(() => {
9595
+ this.messageService.add({
9596
+ severity: "success",
9597
+ summary: this.translateService.instant("hcm.payroll.success"),
9598
+ detail: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
9599
+ });
9600
+ this.parameters = (this.parameters && Object.assign({}, this.parameters)) || {};
9601
+ }, () => {
9602
+ this.messageService.add({
9603
+ severity: "error",
9604
+ summary: this.translateService.instant("hcm.payroll.error"),
9605
+ detail: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
9606
+ });
9607
+ this.loading = false;
9608
+ });
9609
+ },
9610
+ });
9611
+ }
9612
+ else {
9613
+ this.messageService.add({
9614
+ severity: "error",
9615
+ summary: this.translateService.instant("hcm.payroll.error"),
9616
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
9617
+ });
9618
+ }
9619
+ }
9620
+ add() {
9621
+ if (this.isAllowToAddHistorical) {
9622
+ this.router.navigate(["historical-pix-account-new"], {
9623
+ relativeTo: this.activatedRoute,
9624
+ });
9625
+ }
9626
+ else {
9627
+ this.messageService.add({
9628
+ severity: "error",
9629
+ summary: this.translateService.instant("hcm.payroll.error"),
9630
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9631
+ });
9632
+ }
9633
+ }
9634
+ isNotAllowMessage() {
9635
+ this.messageService.add({
9636
+ severity: "error",
9637
+ summary: this.translateService.instant("hcm.payroll.error"),
9638
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9639
+ });
9640
+ }
9641
+ onGridLoad(payload) {
9642
+ if (payload && payload.length) {
9643
+ this.lastRecord = payload[0];
9644
+ }
9645
+ }
9646
+ get isAllowToAddHistorical() {
9647
+ return (this.permission["incluir"]);
9648
+ }
9649
+ get isAllowToDeleteHistorical() {
9650
+ return (this.permission["excluir"]);
9651
+ }
9652
+ get isAllowToViewHistorical() {
9653
+ return (this.permission["visualizar"]);
9654
+ }
9655
+ get scopedActions() {
9656
+ return this.getMenuActions.bind(this);
9657
+ }
9658
+ set reloadList(condition) {
9659
+ if (condition) {
9660
+ this.loading = true;
9661
+ this.parameters = (this.parameters && Object.assign({}, this.parameters)) || {};
9662
+ }
9663
+ }
9664
+ };
9665
+ HistoricalPixAccountListComponent.ctorParameters = () => [
9666
+ { type: ConfirmationService },
9667
+ { type: TranslateService },
9668
+ { type: ActivatedRoute },
9669
+ { type: ChangeDetectorRef },
9670
+ { type: Router },
9671
+ { type: MessageService },
9672
+ { type: HistoricalPixAccountListService }
9673
+ ];
9674
+ __decorate([
9675
+ ViewChild(CustomFieldsComponent$1, { static: false })
9676
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
9677
+ __decorate([
9678
+ Input()
9679
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
9680
+ __decorate([
9681
+ Input()
9682
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
9683
+ __decorate([
9684
+ Input()
9685
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
9686
+ __decorate([
9687
+ Input()
9688
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
9689
+ __decorate([
9690
+ Input()
9691
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
9692
+ __decorate([
9693
+ Input()
9694
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
9695
+ __decorate([
9696
+ Input()
9697
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
9698
+ __decorate([
9699
+ Output()
9700
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
9701
+ __decorate([
9702
+ Output()
9703
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
9704
+ __decorate([
9705
+ Input()
9706
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
9707
+ HistoricalPixAccountListComponent = __decorate([
9708
+ Component({
9709
+ // tslint:disable-next-line:component-selector
9710
+ selector: "c-historical-pix-account-list",
9711
+ 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",
9712
+ styles: [""]
9713
+ })
9714
+ ], HistoricalPixAccountListComponent);
9715
+
9716
+ let HistoricalPixAccountListModule = class HistoricalPixAccountListModule {
9717
+ };
9718
+ HistoricalPixAccountListModule = __decorate([
9719
+ NgModule({
9720
+ imports: [
9721
+ CommonModule,
9722
+ FormsModule,
9723
+ HttpClientModule,
9724
+ AutoCompleteModule,
9725
+ SharedModule,
9726
+ ReactiveFormsModule,
9727
+ TableModule,
9728
+ ButtonModule,
9729
+ TooltipModule,
9730
+ LoadingStateModule,
9731
+ DataListRestModule,
9732
+ ConfirmDialogModule,
9733
+ ],
9734
+ declarations: [HistoricalPixAccountListComponent],
9735
+ providers: [HistoricalPixAccountListService],
9736
+ exports: [HistoricalPixAccountListComponent],
9737
+ })
9738
+ ], HistoricalPixAccountListModule);
9739
+
9381
9740
  /*
9382
9741
  * Public API Surface of core
9383
9742
  */
@@ -9386,5 +9745,5 @@ HistoricalPixAccountModule = __decorate([
9386
9745
  * Generated bundle index. Do not edit.
9387
9746
  */
9388
9747
 
9389
- 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 };
9748
+ 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 };
9390
9749
  //# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map