@senior-gestao-pessoas/payroll-core 9.2.0 → 9.3.0-3956a1cf-41cb-4c73-952b-4f96be631787

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