@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
@@ -9422,16 +9422,18 @@
9422
9422
  }());
9423
9423
 
9424
9424
  var HistoricalPixAccountComponent = /** @class */ (function () {
9425
- function HistoricalPixAccountComponent(translateService, cd, formBuilder) {
9425
+ function HistoricalPixAccountComponent(translateService, cd, formBuilder, messageService) {
9426
9426
  var _this = this;
9427
9427
  this.translateService = translateService;
9428
9428
  this.cd = cd;
9429
9429
  this.formBuilder = formBuilder;
9430
+ this.messageService = messageService;
9430
9431
  this.recordByRow = 1;
9431
9432
  this.showDateChange = false;
9432
9433
  this.isEditMode = false;
9433
9434
  this.isViewMode = false;
9434
9435
  this.withSideBar = true;
9436
+ this.defaultCpfNumber = null;
9435
9437
  this.visibleChange = new core.EventEmitter();
9436
9438
  this.ngUnsubscribe = new rxjs.Subject();
9437
9439
  this.orderBy = {
@@ -9465,26 +9467,41 @@
9465
9467
  visible: _this.isEditMode,
9466
9468
  label: _this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9467
9469
  command: function () {
9468
- rowData["index"] = key;
9469
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9470
- _this.visible = true;
9470
+ if (_this.isAllowToViewHistorical) {
9471
+ rowData["index"] = key;
9472
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: false };
9473
+ _this.visible = true;
9474
+ }
9475
+ else {
9476
+ _this.isNotAllowMessage();
9477
+ }
9471
9478
  },
9472
9479
  },
9473
9480
  {
9474
9481
  visible: !!(!_this.isEditMode && _this.withSideBar),
9475
9482
  label: _this.translateService.instant("hcm.payroll.edit"),
9476
9483
  command: function () {
9477
- rowData["index"] = key;
9478
- _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9479
- _this.visible = true;
9484
+ if (_this.isAllowToEditHistorical) {
9485
+ rowData["index"] = key;
9486
+ _this.pixAccountItemInput = { currentItem: rowData, listData: _this.listDataNoPage, isEditMode: true };
9487
+ _this.visible = true;
9488
+ }
9489
+ else {
9490
+ _this.isNotAllowMessage();
9491
+ }
9480
9492
  },
9481
9493
  },
9482
9494
  {
9483
9495
  visible: !_this.isEditMode,
9484
9496
  label: _this.translateService.instant("hcm.payroll.delete"),
9485
9497
  command: function () {
9486
- _this.loading = true;
9487
- _this.deleteAnnuityItem(key);
9498
+ if (_this.isAllowToDeleteHistorical) {
9499
+ _this.loading = true;
9500
+ _this.deleteAnnuityItem(key);
9501
+ }
9502
+ else {
9503
+ _this.isNotAllowMessage();
9504
+ }
9488
9505
  },
9489
9506
  },
9490
9507
  ];
@@ -9550,6 +9567,13 @@
9550
9567
  this.pixAccountItemInput = {};
9551
9568
  this.visible = true;
9552
9569
  };
9570
+ HistoricalPixAccountComponent.prototype.isNotAllowMessage = function () {
9571
+ this.messageService.add({
9572
+ severity: "error",
9573
+ summary: this.translateService.instant("hcm.payroll.error"),
9574
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9575
+ });
9576
+ };
9553
9577
  HistoricalPixAccountComponent.prototype.deleteAnnuityItem = function (index) {
9554
9578
  var newlist = __spread(this.getHistoricalPixAccountList());
9555
9579
  newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
@@ -9695,10 +9719,39 @@
9695
9719
  HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
9696
9720
  return FormatUtilsService.getFormattedPercentage(value);
9697
9721
  };
9722
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
9723
+ get: function () {
9724
+ return (this.permission["incluir"]);
9725
+ },
9726
+ enumerable: true,
9727
+ configurable: true
9728
+ });
9729
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToDeleteHistorical", {
9730
+ get: function () {
9731
+ return (this.permission["excluir"]);
9732
+ },
9733
+ enumerable: true,
9734
+ configurable: true
9735
+ });
9736
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToEditHistorical", {
9737
+ get: function () {
9738
+ return (this.permission["editar"]);
9739
+ },
9740
+ enumerable: true,
9741
+ configurable: true
9742
+ });
9743
+ Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToViewHistorical", {
9744
+ get: function () {
9745
+ return (this.permission["visualizar"]);
9746
+ },
9747
+ enumerable: true,
9748
+ configurable: true
9749
+ });
9698
9750
  HistoricalPixAccountComponent.ctorParameters = function () { return [
9699
9751
  { type: core$1.TranslateService },
9700
9752
  { type: core.ChangeDetectorRef },
9701
- { type: forms.FormBuilder }
9753
+ { type: forms.FormBuilder },
9754
+ { type: api.MessageService }
9702
9755
  ]; };
9703
9756
  __decorate([
9704
9757
  core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
@@ -9745,6 +9798,12 @@
9745
9798
  __decorate([
9746
9799
  core.Input()
9747
9800
  ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
9801
+ __decorate([
9802
+ core.Input()
9803
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9804
+ __decorate([
9805
+ core.Input()
9806
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9748
9807
  __decorate([
9749
9808
  core.Input()
9750
9809
  ], HistoricalPixAccountComponent.prototype, "dateChange", null);
@@ -9761,7 +9820,7 @@
9761
9820
  core.Component({
9762
9821
  // tslint:disable-next-line:component-selector
9763
9822
  selector: "c-historical-pix-account",
9764
- 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",
9823
+ 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",
9765
9824
  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}"]
9766
9825
  })
9767
9826
  ], HistoricalPixAccountComponent);
@@ -9941,6 +10000,7 @@
9941
10000
  this.withSideBar = true;
9942
10001
  this.isEditMode = false;
9943
10002
  this.paramsForm = new forms.FormGroup({});
10003
+ this.defaultCpfNumber = null;
9944
10004
  this.visibleChange = new core.EventEmitter();
9945
10005
  this.pixAccountItemToList = new core.EventEmitter();
9946
10006
  this.ngUnsubscribe = new rxjs.Subject();
@@ -9975,6 +10035,7 @@
9975
10035
  percentage: this.formBuilder.control(null, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
9976
10036
  forms.Validators.max(this.maxValuePercentage),
9977
10037
  ]))),
10038
+ externalId: this.formBuilder.control(null),
9978
10039
  customFields: this.formBuilder.control(null),
9979
10040
  });
9980
10041
  };
@@ -9983,7 +10044,7 @@
9983
10044
  this.pixKeyType = item.key;
9984
10045
  this.isShowPixKeyFieldValidatorMessage = true;
9985
10046
  this.pixAccountFormGroup.get("pixKey").reset();
9986
- this.setPixKeyValidators();
10047
+ this.setPixKeyValidators(true);
9987
10048
  if (item.key === "CPF") {
9988
10049
  this.setDefaultCpfPixKey();
9989
10050
  }
@@ -10011,10 +10072,16 @@
10011
10072
  if (value && value.currentItem && Object.keys(value.currentItem).length) {
10012
10073
  this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(__assign({}, value.currentItem)));
10013
10074
  this.labelBtnAdd = "hcm.payroll.employees_update";
10014
- this.setValidatorsAccordingList(value.listData, value.currentItem["index"]);
10075
+ this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
10015
10076
  if (!this.isView) {
10016
10077
  this.configEnableFields(value && value["isEditMode"]);
10017
10078
  }
10079
+ else {
10080
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
10081
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10082
+ this.formatPixKeyTelephoneNumber();
10083
+ }
10084
+ }
10018
10085
  }
10019
10086
  else {
10020
10087
  this.labelBtnAdd = "hcm.payroll.employees_add";
@@ -10023,6 +10090,11 @@
10023
10090
  enumerable: true,
10024
10091
  configurable: true
10025
10092
  });
10093
+ HistoricalPixAccountFormComponent.prototype.formatPixKeyTelephoneNumber = function () {
10094
+ if (this.pixKeyType === "TELEPHONE") {
10095
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10096
+ }
10097
+ };
10026
10098
  HistoricalPixAccountFormComponent.prototype.convertDTOToShowWithCustomFields = function (data) {
10027
10099
  var obj = __assign({}, data);
10028
10100
  obj["customFields"] = mountCustomToShow(obj["customFields"]);
@@ -10032,10 +10104,8 @@
10032
10104
  this.visibleBtnSave = isEditMode;
10033
10105
  if (this.pixAccountFormGroup.get("pixKeyType").value) {
10034
10106
  this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
10035
- this.setPixKeyValidators();
10036
- if (this.pixKeyType === "TELEPHONE") {
10037
- this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
10038
- }
10107
+ this.setPixKeyValidators(isEditMode);
10108
+ this.formatPixKeyTelephoneNumber();
10039
10109
  }
10040
10110
  configEnabledFields(this.pixAccountFormGroup, isEditMode, [
10041
10111
  "pixKeyType",
@@ -10097,7 +10167,7 @@
10097
10167
  */
10098
10168
  set: function (pixAccountList) {
10099
10169
  if (pixAccountList) {
10100
- this.setValidatorsAccordingList(pixAccountList);
10170
+ this.setValidatorsAccordingList(pixAccountList, null, false);
10101
10171
  }
10102
10172
  else {
10103
10173
  this.resetForm();
@@ -10114,8 +10184,9 @@
10114
10184
  * @param pixAccountList
10115
10185
  * @param index
10116
10186
  */
10117
- HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index) {
10187
+ HistoricalPixAccountFormComponent.prototype.setValidatorsAccordingList = function (pixAccountList, index, isEditMode) {
10118
10188
  if (index === void 0) { index = null; }
10189
+ if (isEditMode === void 0) { isEditMode = true; }
10119
10190
  this.pixAccountList = pixAccountList && pixAccountList.length ? __spread(pixAccountList) : [];
10120
10191
  var percentageIncluded = [];
10121
10192
  if (this.pixAccountList && this.pixAccountList.length) {
@@ -10126,13 +10197,13 @@
10126
10197
  });
10127
10198
  }
10128
10199
  this.beforeSetPixKeyTypeValidator();
10129
- this.setPixKeyValidators();
10200
+ this.setPixKeyValidators(isEditMode);
10130
10201
  this.validatePercentageValid(percentageIncluded);
10131
10202
  };
10132
10203
  /**
10133
10204
  * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
10134
10205
  */
10135
- HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function () {
10206
+ HistoricalPixAccountFormComponent.prototype.setPixKeyValidators = function (isEditMode) {
10136
10207
  var genericPixKey = this.pixAccountFormGroup.get("pixKey");
10137
10208
  if (this.pixKeyType) {
10138
10209
  switch (this.pixKeyType) {
@@ -10163,7 +10234,9 @@
10163
10234
  genericPixKey.setValidators(null);
10164
10235
  break;
10165
10236
  }
10166
- genericPixKey.enable();
10237
+ if (isEditMode) {
10238
+ genericPixKey.enable();
10239
+ }
10167
10240
  genericPixKey.updateValueAndValidity();
10168
10241
  }
10169
10242
  };
@@ -10196,11 +10269,16 @@
10196
10269
  FormatUtilsService.formatTelephoneInputEvent(event);
10197
10270
  };
10198
10271
  HistoricalPixAccountFormComponent.prototype.setDefaultCpfPixKey = function () {
10199
- var sheetDocument = this.paramsForm.get("sheetDocument");
10200
- if (sheetDocument) {
10201
- var cpf = sheetDocument.get("cpfNumber").value;
10202
- if (cpf) {
10203
- this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10272
+ if (this.defaultCpfNumber) {
10273
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
10274
+ }
10275
+ else {
10276
+ var sheetDocument = this.paramsForm.get("sheetDocument");
10277
+ if (sheetDocument) {
10278
+ var cpf = sheetDocument.get("cpfNumber").value;
10279
+ if (cpf) {
10280
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
10281
+ }
10204
10282
  }
10205
10283
  }
10206
10284
  };
@@ -10261,6 +10339,9 @@
10261
10339
  __decorate([
10262
10340
  core.Input()
10263
10341
  ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
10342
+ __decorate([
10343
+ core.Input()
10344
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
10264
10345
  __decorate([
10265
10346
  core.Output()
10266
10347
  ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
@@ -10282,7 +10363,7 @@
10282
10363
  HistoricalPixAccountFormComponent = __decorate([
10283
10364
  core.Component({
10284
10365
  selector: "pix-account",
10285
- 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",
10366
+ 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",
10286
10367
  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}"]
10287
10368
  })
10288
10369
  ], HistoricalPixAccountFormComponent);
@@ -10343,6 +10424,330 @@
10343
10424
  return HistoricalPixAccountModule;
10344
10425
  }());
10345
10426
 
10427
+ var HistoricalPixAccountListService = /** @class */ (function () {
10428
+ function HistoricalPixAccountListService(http, httpClient) {
10429
+ this.http = http;
10430
+ this.httpClient = httpClient;
10431
+ }
10432
+ HistoricalPixAccountListService.prototype.remove = function (id, dateWhen, service, dependentId) {
10433
+ if (service === void 0) { service = exports.ServiceType.PAYROLL; }
10434
+ if (service === exports.ServiceType.DEPENDENT) {
10435
+ return this.httpClient
10436
+ .post("hcm/dependent/queries/historicalDependentJudicialPensionPixDelete", {
10437
+ dependentId: dependentId,
10438
+ dateWhen: dateWhen,
10439
+ });
10440
+ }
10441
+ else {
10442
+ return this.http.post("actions/historicalEmployeePixDelete", {
10443
+ employeeId: id,
10444
+ dateWhen: dateWhen
10445
+ });
10446
+ }
10447
+ };
10448
+ HistoricalPixAccountListService.ctorParameters = function () { return [
10449
+ { type: HttpClientService },
10450
+ { type: http.HttpClient }
10451
+ ]; };
10452
+ HistoricalPixAccountListService = __decorate([
10453
+ core.Injectable()
10454
+ ], HistoricalPixAccountListService);
10455
+ return HistoricalPixAccountListService;
10456
+ }());
10457
+
10458
+ var moment$e = moment_;
10459
+ var HistoricalPixAccountListComponent = /** @class */ (function () {
10460
+ function HistoricalPixAccountListComponent(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
10461
+ this.confirmationService = confirmationService;
10462
+ this.translateService = translateService;
10463
+ this.activatedRoute = activatedRoute;
10464
+ this.cd = cd;
10465
+ this.router = router;
10466
+ this.messageService = messageService;
10467
+ this.historicalPixAccountListService = historicalPixAccountListService;
10468
+ this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
10469
+ this.keyPayload = "historicalEmployeePix";
10470
+ this.withSidebar = true;
10471
+ this.isOnlyView = new core.EventEmitter();
10472
+ this.enableView = new core.EventEmitter();
10473
+ this.ngUnsubscribe = new rxjs.Subject();
10474
+ this.loading = true;
10475
+ this.columns = [
10476
+ {
10477
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
10478
+ field: "dateChange",
10479
+ },
10480
+ {
10481
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
10482
+ field: "pixKeyType.value",
10483
+ },
10484
+ {
10485
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
10486
+ field: "pixKey",
10487
+ },
10488
+ {
10489
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
10490
+ field: "percentage",
10491
+ },
10492
+ {
10493
+ label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
10494
+ field: "numberOfPixAccount",
10495
+ },
10496
+ ];
10497
+ }
10498
+ HistoricalPixAccountListComponent.prototype.ngOnInit = function () {
10499
+ this.initParameters = { employeeId: this.employeeId, dependentId: this.dependentId };
10500
+ };
10501
+ HistoricalPixAccountListComponent.prototype.ngOnDestroy = function () {
10502
+ this.ngUnsubscribe.next();
10503
+ this.ngUnsubscribe.complete();
10504
+ };
10505
+ HistoricalPixAccountListComponent.prototype.ngAfterViewInit = function () {
10506
+ this.cd.detectChanges();
10507
+ };
10508
+ HistoricalPixAccountListComponent.prototype.onLazyLoad = function (payload) {
10509
+ var _this = this;
10510
+ payload.forEach(function (value) {
10511
+ value.dateChange = moment$e(value.dateChange).format(_this.dateFormat);
10512
+ value.pixKey = _this.formatPixKeyByType(value.pixKeyType, value.pixKey);
10513
+ value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
10514
+ });
10515
+ this.onGridLoad(payload);
10516
+ this.loading = false;
10517
+ };
10518
+ HistoricalPixAccountListComponent.prototype.formatPixKeyByType = function (pixKeyType, pixKey) {
10519
+ var keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
10520
+ if (keyType === "TELEPHONE") {
10521
+ return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
10522
+ }
10523
+ else if (keyType === "CPF") {
10524
+ return FormatUtilsService.getFormattedCpf(pixKey);
10525
+ }
10526
+ else if (keyType === "CNPJ") {
10527
+ return FormatUtilsService.getFormattedCnpj(pixKey);
10528
+ }
10529
+ else {
10530
+ return pixKey;
10531
+ }
10532
+ };
10533
+ HistoricalPixAccountListComponent.prototype.getMenuActions = function (rowData) {
10534
+ var _this = this;
10535
+ return [
10536
+ {
10537
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
10538
+ command: function () {
10539
+ if (_this.isAllowToViewHistorical) {
10540
+ var dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, _this.dateFormat).format("YYYY-MM-DD");
10541
+ if (_this.withSidebar) {
10542
+ _this.router.navigate(["historical-pix-account/" + dateChange], {
10543
+ relativeTo: _this.activatedRoute,
10544
+ });
10545
+ }
10546
+ else {
10547
+ _this.isOnlyView.emit(true);
10548
+ _this.enableView.emit(dateChange);
10549
+ }
10550
+ }
10551
+ else {
10552
+ _this.isNotAllowMessage();
10553
+ }
10554
+ },
10555
+ },
10556
+ {
10557
+ label: this.translateService.instant("hcm.payroll.delete"),
10558
+ command: function () {
10559
+ if (_this.isAllowToDeleteHistorical && rowData) {
10560
+ _this.delete(rowData.id, rowData.dateChange);
10561
+ }
10562
+ else {
10563
+ _this.isNotAllowMessage();
10564
+ }
10565
+ },
10566
+ },
10567
+ ];
10568
+ };
10569
+ HistoricalPixAccountListComponent.prototype.delete = function (id, dateChange) {
10570
+ var _this = this;
10571
+ if (id === this.lastRecord.id) {
10572
+ var dateChangeToDto_1 = moment$e(dateChange, this.dateFormat).format("YYYY-MM-DD");
10573
+ this.confirmationService.confirm({
10574
+ message: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_question_confirm_delete") + "?",
10575
+ accept: function () {
10576
+ _this.loading = true;
10577
+ var service = _this.withSidebar ? exports.ServiceType.PAYROLL : exports.ServiceType.DEPENDENT;
10578
+ _this.historicalPixAccountListService
10579
+ .remove(_this.employeeId, dateChangeToDto_1, service, _this.dependentId)
10580
+ .pipe(operators.takeUntil(_this.ngUnsubscribe))
10581
+ .subscribe(function () {
10582
+ _this.messageService.add({
10583
+ severity: "success",
10584
+ summary: _this.translateService.instant("hcm.payroll.success"),
10585
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_remove"),
10586
+ });
10587
+ _this.parameters = (_this.parameters && __assign({}, _this.parameters)) || {};
10588
+ }, function () {
10589
+ _this.messageService.add({
10590
+ severity: "error",
10591
+ summary: _this.translateService.instant("hcm.payroll.error"),
10592
+ detail: _this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_error_remove"),
10593
+ });
10594
+ _this.loading = false;
10595
+ });
10596
+ },
10597
+ });
10598
+ }
10599
+ else {
10600
+ this.messageService.add({
10601
+ severity: "error",
10602
+ summary: this.translateService.instant("hcm.payroll.error"),
10603
+ detail: this.translateService.instant("hcm.payroll.not_allowed_delete_last"),
10604
+ });
10605
+ }
10606
+ };
10607
+ HistoricalPixAccountListComponent.prototype.add = function () {
10608
+ if (this.isAllowToAddHistorical) {
10609
+ this.router.navigate(["historical-pix-account-new"], {
10610
+ relativeTo: this.activatedRoute,
10611
+ });
10612
+ }
10613
+ else {
10614
+ this.messageService.add({
10615
+ severity: "error",
10616
+ summary: this.translateService.instant("hcm.payroll.error"),
10617
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10618
+ });
10619
+ }
10620
+ };
10621
+ HistoricalPixAccountListComponent.prototype.isNotAllowMessage = function () {
10622
+ this.messageService.add({
10623
+ severity: "error",
10624
+ summary: this.translateService.instant("hcm.payroll.error"),
10625
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
10626
+ });
10627
+ };
10628
+ HistoricalPixAccountListComponent.prototype.onGridLoad = function (payload) {
10629
+ if (payload && payload.length) {
10630
+ this.lastRecord = payload[0];
10631
+ }
10632
+ };
10633
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToAddHistorical", {
10634
+ get: function () {
10635
+ return (this.permission["incluir"]);
10636
+ },
10637
+ enumerable: true,
10638
+ configurable: true
10639
+ });
10640
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToDeleteHistorical", {
10641
+ get: function () {
10642
+ return (this.permission["excluir"]);
10643
+ },
10644
+ enumerable: true,
10645
+ configurable: true
10646
+ });
10647
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "isAllowToViewHistorical", {
10648
+ get: function () {
10649
+ return (this.permission["visualizar"]);
10650
+ },
10651
+ enumerable: true,
10652
+ configurable: true
10653
+ });
10654
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "scopedActions", {
10655
+ get: function () {
10656
+ return this.getMenuActions.bind(this);
10657
+ },
10658
+ enumerable: true,
10659
+ configurable: true
10660
+ });
10661
+ Object.defineProperty(HistoricalPixAccountListComponent.prototype, "reloadList", {
10662
+ set: function (condition) {
10663
+ if (condition) {
10664
+ this.loading = true;
10665
+ this.parameters = (this.parameters && __assign({}, this.parameters)) || {};
10666
+ }
10667
+ },
10668
+ enumerable: true,
10669
+ configurable: true
10670
+ });
10671
+ HistoricalPixAccountListComponent.ctorParameters = function () { return [
10672
+ { type: api.ConfirmationService },
10673
+ { type: core$1.TranslateService },
10674
+ { type: router.ActivatedRoute },
10675
+ { type: core.ChangeDetectorRef },
10676
+ { type: router.Router },
10677
+ { type: api.MessageService },
10678
+ { type: HistoricalPixAccountListService }
10679
+ ]; };
10680
+ __decorate([
10681
+ core.ViewChild(angularComponents.CustomFieldsComponent, { static: false })
10682
+ ], HistoricalPixAccountListComponent.prototype, "customFields", void 0);
10683
+ __decorate([
10684
+ core.Input()
10685
+ ], HistoricalPixAccountListComponent.prototype, "permission", void 0);
10686
+ __decorate([
10687
+ core.Input()
10688
+ ], HistoricalPixAccountListComponent.prototype, "employeeId", void 0);
10689
+ __decorate([
10690
+ core.Input()
10691
+ ], HistoricalPixAccountListComponent.prototype, "dependentId", void 0);
10692
+ __decorate([
10693
+ core.Input()
10694
+ ], HistoricalPixAccountListComponent.prototype, "dateFormat", void 0);
10695
+ __decorate([
10696
+ core.Input()
10697
+ ], HistoricalPixAccountListComponent.prototype, "endPoint", void 0);
10698
+ __decorate([
10699
+ core.Input()
10700
+ ], HistoricalPixAccountListComponent.prototype, "keyPayload", void 0);
10701
+ __decorate([
10702
+ core.Input()
10703
+ ], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
10704
+ __decorate([
10705
+ core.Output()
10706
+ ], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
10707
+ __decorate([
10708
+ core.Output()
10709
+ ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
10710
+ __decorate([
10711
+ core.Input()
10712
+ ], HistoricalPixAccountListComponent.prototype, "reloadList", null);
10713
+ HistoricalPixAccountListComponent = __decorate([
10714
+ core.Component({
10715
+ // tslint:disable-next-line:component-selector
10716
+ selector: "c-historical-pix-account-list",
10717
+ 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",
10718
+ styles: [""]
10719
+ })
10720
+ ], HistoricalPixAccountListComponent);
10721
+ return HistoricalPixAccountListComponent;
10722
+ }());
10723
+
10724
+ var HistoricalPixAccountListModule = /** @class */ (function () {
10725
+ function HistoricalPixAccountListModule() {
10726
+ }
10727
+ HistoricalPixAccountListModule = __decorate([
10728
+ core.NgModule({
10729
+ imports: [
10730
+ common.CommonModule,
10731
+ forms.FormsModule,
10732
+ http.HttpClientModule,
10733
+ autocomplete.AutoCompleteModule,
10734
+ SharedModule,
10735
+ forms.ReactiveFormsModule,
10736
+ table.TableModule,
10737
+ angularComponents.ButtonModule,
10738
+ tooltip.TooltipModule,
10739
+ angularComponents.LoadingStateModule,
10740
+ DataListRestModule,
10741
+ confirmdialog.ConfirmDialogModule,
10742
+ ],
10743
+ declarations: [HistoricalPixAccountListComponent],
10744
+ providers: [HistoricalPixAccountListService],
10745
+ exports: [HistoricalPixAccountListComponent],
10746
+ })
10747
+ ], HistoricalPixAccountListModule);
10748
+ return HistoricalPixAccountListModule;
10749
+ }());
10750
+
10346
10751
  exports.AdmissionDraftSummaryComponent = AdmissionDraftSummaryComponent;
10347
10752
  exports.AdmissionDraftSummaryModule = AdmissionDraftSummaryModule;
10348
10753
  exports.AdmissionDraftSummaryService = AdmissionDraftSummaryService;
@@ -10384,6 +10789,9 @@
10384
10789
  exports.HistoricalBankAccountModule = HistoricalBankAccountModule;
10385
10790
  exports.HistoricalBankAccountService = HistoricalBankAccountService;
10386
10791
  exports.HistoricalPixAccountComponent = HistoricalPixAccountComponent;
10792
+ exports.HistoricalPixAccountListComponent = HistoricalPixAccountListComponent;
10793
+ exports.HistoricalPixAccountListModule = HistoricalPixAccountListModule;
10794
+ exports.HistoricalPixAccountListService = HistoricalPixAccountListService;
10387
10795
  exports.HistoricalPixAccountModule = HistoricalPixAccountModule;
10388
10796
  exports.HistoricalPixAccountService = HistoricalPixAccountService;
10389
10797
  exports.HttpClientService = HttpClientService;