@senior-gestao-pessoas/payroll-core 9.5.0 → 9.6.0

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 (19) hide show
  1. package/bundles/senior-gestao-pessoas-payroll-core.umd.js +857 -815
  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 +4 -2
  6. package/components/historical-pix-account/historical-pix-account.component.d.ts +5 -1
  7. package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +1 -0
  8. package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +18 -3
  9. package/esm2015/components/historical-pix-account/historical-pix-account.component.js +30 -7
  10. package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +6 -2
  11. package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +19 -3
  12. package/esm5/components/historical-pix-account/historical-pix-account.component.js +30 -7
  13. package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +6 -2
  14. package/fesm2015/senior-gestao-pessoas-payroll-core.js +732 -691
  15. package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
  16. package/fesm5/senior-gestao-pessoas-payroll-core.js +857 -815
  17. package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
  18. package/package.json +1 -1
  19. package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
@@ -8521,393 +8521,6 @@ class FormatUtilsService {
8521
8521
  }
8522
8522
  }
8523
8523
 
8524
- let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
8525
- constructor(translateService, cd, formBuilder, messageService) {
8526
- this.translateService = translateService;
8527
- this.cd = cd;
8528
- this.formBuilder = formBuilder;
8529
- this.messageService = messageService;
8530
- this.recordByRow = 1;
8531
- this.showDateChange = false;
8532
- this.isEditMode = false;
8533
- this.isViewMode = false;
8534
- this.withSideBar = true;
8535
- this.defaultCpfNumber = null;
8536
- this.listDataReciever = [];
8537
- this.isViewModeActive = new EventEmitter();
8538
- this.isEditModeActive = new EventEmitter();
8539
- this.isDeleteModeActive = new EventEmitter();
8540
- this.listFromApp = [];
8541
- this.visibleChange = new EventEmitter();
8542
- this.ngUnsubscribe = new Subject();
8543
- this.orderBy = {
8544
- field: "dateChange",
8545
- direction: DirectionEnumeration.DESC,
8546
- };
8547
- this.pixAccountItemInput = {};
8548
- this.totalRecords = 0;
8549
- this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
8550
- this.loading = true;
8551
- this.listData = [];
8552
- this.listDataNoPage = [];
8553
- this.cols = [
8554
- {
8555
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
8556
- field: "pixKeyType",
8557
- },
8558
- {
8559
- label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
8560
- field: "pixKey",
8561
- },
8562
- {
8563
- label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
8564
- field: "percentage",
8565
- },
8566
- ];
8567
- this.actions = (rowData = {}, key) => {
8568
- return [
8569
- {
8570
- visible: this.isEditMode,
8571
- label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
8572
- command: () => {
8573
- if (this.isAllowToViewHistorical) {
8574
- rowData["index"] = key;
8575
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
8576
- this.visible = true;
8577
- }
8578
- else {
8579
- this.isViewModeActive.emit(true);
8580
- }
8581
- },
8582
- },
8583
- {
8584
- visible: !!(!this.isEditMode && this.withSideBar),
8585
- label: this.translateService.instant("hcm.payroll.edit"),
8586
- command: () => {
8587
- if (this.isAllowToEditHistorical) {
8588
- rowData["index"] = key;
8589
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8590
- this.visible = true;
8591
- }
8592
- else {
8593
- this.isEditModeActive.emit(true);
8594
- if (this.listFromApp.length == 0) {
8595
- rowData["index"] = key;
8596
- this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: true };
8597
- this.visible = true;
8598
- }
8599
- }
8600
- },
8601
- },
8602
- {
8603
- visible: !this.isEditMode,
8604
- label: this.translateService.instant("hcm.payroll.delete"),
8605
- command: () => {
8606
- if (this.isAllowToDeleteHistorical) {
8607
- this.loading = true;
8608
- this.deleteAnnuityItem(key);
8609
- }
8610
- else {
8611
- this.isDeleteModeActive.emit(true);
8612
- if (this.listFromApp.length == 0) {
8613
- this.loading = true;
8614
- this.deleteAnnuityItem(key);
8615
- }
8616
- }
8617
- },
8618
- },
8619
- ];
8620
- };
8621
- this.createFormGroup();
8622
- }
8623
- ngOnInit() {
8624
- this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
8625
- }
8626
- ngOnChanges(changes) {
8627
- if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
8628
- this.listFromApp = changes['listDataReciever'].currentValue;
8629
- }
8630
- }
8631
- createFormGroup() {
8632
- this.historicalPixAccountList = this.formBuilder.group({
8633
- historicalPixAccountList: this.formBuilder.control(null),
8634
- });
8635
- }
8636
- ngOnDestroy() {
8637
- this.ngUnsubscribe.next();
8638
- this.ngUnsubscribe.complete();
8639
- }
8640
- ngAfterViewInit() {
8641
- this.cd.detectChanges();
8642
- }
8643
- onLazyLoad(event) {
8644
- const first = event && event.first ? event.first : 0;
8645
- const rows = event && event.rows ? event.rows : this.recordByRow;
8646
- const arrList = this.getHistoricalPixAccountList();
8647
- this.listData = [];
8648
- this.totalRecords = null;
8649
- if (event && event.multiSortMeta && event.multiSortMeta.length) {
8650
- event.multiSortMeta.map((value) => {
8651
- this.orderBy.field = value.field;
8652
- this.orderBy.direction = value.order === 1 ? DirectionEnumeration.ASC : DirectionEnumeration.DESC;
8653
- });
8654
- }
8655
- if (arrList && arrList.length) {
8656
- this.totalRecords = arrList.length;
8657
- this.listData = arrList;
8658
- this.listDataNoPage = [...arrList];
8659
- this.listData.sort(compareValues(this.orderBy.field, this.orderBy.direction));
8660
- this.listData = this.listData.slice(first, (first + rows));
8661
- }
8662
- else {
8663
- this.listDataNoPage = [];
8664
- }
8665
- if (this.isEditMode || arrList && arrList.length === 1) {
8666
- this.refreshCssInIE11();
8667
- }
8668
- this.loading = false;
8669
- }
8670
- /**
8671
- * Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
8672
- */
8673
- refreshCssInIE11() {
8674
- if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)) {
8675
- setTimeout(() => {
8676
- const row = document.getElementsByClassName("row0");
8677
- if (row && row[0])
8678
- row[0].className = 'refresh';
8679
- }, 1);
8680
- }
8681
- }
8682
- add() {
8683
- this.pixAccountItemInput = {};
8684
- this.visible = true;
8685
- }
8686
- isNotAllowMessage() {
8687
- this.messageService.add({
8688
- severity: "error",
8689
- summary: this.translateService.instant("hcm.payroll.error"),
8690
- detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
8691
- });
8692
- }
8693
- deleteAnnuityItem(index) {
8694
- let newlist = [...this.getHistoricalPixAccountList()];
8695
- newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
8696
- delete newlist[index];
8697
- newlist = newlist.filter(val => val);
8698
- this.historicalPixAccountList.get("historicalPixAccountList").setValue(newlist);
8699
- this.verifyTotalPercentage();
8700
- this.onLazyLoad();
8701
- }
8702
- getHistoricalPixAccountList() {
8703
- if (this.historicalPixAccountList.get("historicalPixAccountList") &&
8704
- this.historicalPixAccountList.get("historicalPixAccountList").value &&
8705
- this.historicalPixAccountList.get("historicalPixAccountList").value.length)
8706
- return this.historicalPixAccountList.get("historicalPixAccountList") && this.historicalPixAccountList.get("historicalPixAccountList").value;
8707
- else
8708
- return [];
8709
- }
8710
- addItemInList($event) {
8711
- const index = $event && $event.index >= 0 ? $event.index : null;
8712
- const newDataList = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
8713
- if (index != null) {
8714
- newDataList[index] = $event;
8715
- delete $event.index;
8716
- }
8717
- else {
8718
- if (isValid($event["customFields"]) && Object.keys($event["customFields"]).length) {
8719
- const customValue = mountCustomToSave($event["customFields"]);
8720
- $event["customFields"] = [...customValue];
8721
- }
8722
- $event["dateChange"] = this.dateChange;
8723
- newDataList.push($event);
8724
- }
8725
- this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
8726
- this.verifyTotalPercentage();
8727
- this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
8728
- }
8729
- getNumberPageByIndex(index, list) {
8730
- if (index) {
8731
- const total = list.length;
8732
- const sub = this.recordByRow - 1;
8733
- return Math.ceil(total / this.recordByRow) * this.recordByRow - sub - 1;
8734
- }
8735
- return null;
8736
- }
8737
- verifyTotalPercentage() {
8738
- const list = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
8739
- const arrayPercentage = [];
8740
- if (!list.length)
8741
- return this.msgTotalLimitByPercentage = null;
8742
- list.filter((item) => arrayPercentage.push(item && item["percentage"]));
8743
- const sumPercentage = arrayPercentage.reduce((total, percentage) => {
8744
- return total + percentage;
8745
- }, 0);
8746
- if (sumPercentage === 100) {
8747
- this.msgTotalLimitByPercentage = this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage");
8748
- }
8749
- else {
8750
- this.msgTotalLimitByPercentage = null;
8751
- }
8752
- }
8753
- get scopedActions() {
8754
- return this.actions.bind(this);
8755
- }
8756
- get recordsMessage() {
8757
- return `${this.totalRecords || 0} ${this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
8758
- }
8759
- get getTooltipAndDisableButtonAdd() {
8760
- return this.dateChange ? null : this.msgTooltipAdd;
8761
- }
8762
- get dateChange() {
8763
- return this._dateChange;
8764
- }
8765
- set dateChange(value) {
8766
- this._dateChange = value;
8767
- if (this._dateChange) {
8768
- this.listData.filter((row) => row["dateChange"] = this._dateChange);
8769
- }
8770
- }
8771
- get displayDateChange() {
8772
- return this._displayDateChange;
8773
- }
8774
- set displayDateChange(value) {
8775
- this._displayDateChange = value;
8776
- if (this._displayDateChange) {
8777
- this.listData.filter((row) => row["displayDateChange"] = this._displayDateChange);
8778
- }
8779
- }
8780
- set addListData(list) {
8781
- this.loading = true;
8782
- this.historicalPixAccountList.get("historicalPixAccountList").patchValue(list);
8783
- this.verifyTotalPercentage();
8784
- this.onLazyLoad();
8785
- }
8786
- get visible() {
8787
- return this._visible;
8788
- }
8789
- set visible(value) {
8790
- this._visible = value;
8791
- this.visibleChange.emit(this.visible);
8792
- }
8793
- close() {
8794
- this.visible = false;
8795
- }
8796
- getFormattedTelephoneNumber(telephoneNumber) {
8797
- return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
8798
- }
8799
- getFormattedCpf(cpf) {
8800
- return FormatUtilsService.getFormattedCpf(cpf);
8801
- }
8802
- getFormattedCnpj(cnpj) {
8803
- return FormatUtilsService.getFormattedCnpj(cnpj);
8804
- }
8805
- getFormattedPercentage(value) {
8806
- return FormatUtilsService.getFormattedPercentage(value);
8807
- }
8808
- get isAllowToAddHistorical() {
8809
- return (this.permission["incluir"]);
8810
- }
8811
- get isAllowToDeleteHistorical() {
8812
- return (this.permission["excluir"]);
8813
- }
8814
- get isAllowToEditHistorical() {
8815
- return (this.permission["editar"]);
8816
- }
8817
- get isAllowToViewHistorical() {
8818
- return (this.permission["visualizar"]);
8819
- }
8820
- };
8821
- HistoricalPixAccountComponent.ctorParameters = () => [
8822
- { type: TranslateService },
8823
- { type: ChangeDetectorRef },
8824
- { type: FormBuilder },
8825
- { type: MessageService }
8826
- ];
8827
- __decorate([
8828
- ViewChild(CustomFieldsComponent$1, { static: false })
8829
- ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
8830
- __decorate([
8831
- Input()
8832
- ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
8833
- __decorate([
8834
- Input()
8835
- ], HistoricalPixAccountComponent.prototype, "fieldFormGroup", void 0);
8836
- __decorate([
8837
- Input()
8838
- ], HistoricalPixAccountComponent.prototype, "_dateChange", void 0);
8839
- __decorate([
8840
- Input()
8841
- ], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
8842
- __decorate([
8843
- Input()
8844
- ], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
8845
- __decorate([
8846
- Input()
8847
- ], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
8848
- __decorate([
8849
- Input()
8850
- ], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
8851
- __decorate([
8852
- Input()
8853
- ], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
8854
- __decorate([
8855
- Input()
8856
- ], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
8857
- __decorate([
8858
- Input()
8859
- ], HistoricalPixAccountComponent.prototype, "currency", void 0);
8860
- __decorate([
8861
- Input()
8862
- ], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
8863
- __decorate([
8864
- Input()
8865
- ], HistoricalPixAccountComponent.prototype, "customService", void 0);
8866
- __decorate([
8867
- Input()
8868
- ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
8869
- __decorate([
8870
- Input()
8871
- ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
8872
- __decorate([
8873
- Input()
8874
- ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
8875
- __decorate([
8876
- Input()
8877
- ], HistoricalPixAccountComponent.prototype, "permission", void 0);
8878
- __decorate([
8879
- Input()
8880
- ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
8881
- __decorate([
8882
- Output()
8883
- ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
8884
- __decorate([
8885
- Output()
8886
- ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
8887
- __decorate([
8888
- Output()
8889
- ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
8890
- __decorate([
8891
- Input()
8892
- ], HistoricalPixAccountComponent.prototype, "dateChange", null);
8893
- __decorate([
8894
- Input()
8895
- ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
8896
- __decorate([
8897
- Input()
8898
- ], HistoricalPixAccountComponent.prototype, "addListData", null);
8899
- __decorate([
8900
- Input()
8901
- ], HistoricalPixAccountComponent.prototype, "visible", null);
8902
- HistoricalPixAccountComponent = __decorate([
8903
- Component({
8904
- // tslint:disable-next-line:component-selector
8905
- selector: "c-historical-pix-account",
8906
- template: "<s-sidebar *ngIf=\"withSideBar\" [visible]=\"visible\" (visibleChange)=\"close()\"\n header=\"{{'hcm.payroll.historical_pix_account_title_form'|translate}}\">\n<pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</s-sidebar>\n\n<div *ngIf=\"!withSideBar\">\n <pix-account [(visible)]=\"visible\"\n [isEditAndViewValue]=\"pixAccountItemInput\"\n [currency]=\"currency\"\n [customEntity]=\"customEntity\"\n [customService]=\"customService\"\n [getListPixAccount]=\"listDataNoPage\"\n [withSideBar]=\"false\"\n [isViewMode]=\"isViewMode\"\n [paramsForm]=\"paramsForm\"\n (pixAccountItemToList)=\"addItemInList($event)\"\n [defaultCpfNumber]=\"defaultCpfNumber\"></pix-account>\n</div>\n\n<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode\">\n <div class=\"form-group \">\n <s-button id=\"ta-addPayAnnuity\"\n [disabled]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n (onClick)=\"add()\"\n [pTooltip]=\"getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage\"\n tooltipPosition=\"top\"\n label=\"{{'hcm.payroll.historical_pix_account_add'|translate}}\"></s-button>\n </div>\n</div>\n<div class=\"ui-g-12\">\n <p-table\n id=\"table-annuity\"\n [value]=\"listData\"\n [columns]=\"cols\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"totalRecords\"\n [sortMode]=\"'multiple'\"\n *sLoadingState=\"loading\"\n [rows]=\"recordByRow\"\n dataKey=\"id\">\n <ng-template pTemplate=\"colgroup\" let-coumns>\n <colgroup>\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-m'\">\n <col [ngClass]=\"'col-default-s'\">\n <col [ngClass]=\"'col-action'\">\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <!-- Cabe\u00E7alhos quando da table \u00E9 permitido ordenar as colunas -->\n <tr>\n <!-- Cabe\u00E7alhos das colunas da tabela -->\n <th\n [pSortableColumn]=\"'pixKeyType'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\" id=\"table-0\">\n <span\n id=\"table-annuity-s-0\">{{ 'hcm.payroll.employees_addition_pix_key_type' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key_type' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'pixKey'\"\n [pTooltip]=\"'hcm.payroll.employees_addition_pix_key' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.employees_addition_pix_key' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.employees_addition_pix_key' | translate\"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]=\"'percentage'\"\n [pTooltip]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >\n <div class=\"senior-header\">\n <span>{{ 'hcm.payroll.historical_pix_account_label_percentage' | translate }}</span>\n <p-sortIcon class=\"p-sorticon-status\"\n [field]=\"'hcm.payroll.historical_pix_account_label_percentage' | translate\"></p-sortIcon>\n </div>\n </th>\n <!-- Cabe\u00E7alho da coluna de a\u00E7\u00F5es -->\n <th id=\"col-actions\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-key=\"rowIndex\">\n\n <tr [ngClass]=\"'row'+key\" [pSelectableRow]=\"rowData\">\n <td [pTooltip]=\"rowData?.pixKeyType.value\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKeyType.value }}</span>\n </td>\n\n <ng-container [ngSwitch]=\"rowData?.pixKeyType.key\">\n <td *ngSwitchCase=\"'TELEPHONE'\"\n [pTooltip]=\"getFormattedTelephoneNumber(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedTelephoneNumber(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CPF'\"\n [pTooltip]=\"getFormattedCpf(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCpf(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchCase=\"'CNPJ'\"\n [pTooltip]=\"getFormattedCnpj(rowData?.pixKey)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedCnpj(rowData?.pixKey) }}</span>\n </td>\n <td *ngSwitchDefault\n [pTooltip]=\"rowData?.pixKey\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ rowData?.pixKey }}</span>\n </td>\n </ng-container>\n <td [pTooltip]=\"getFormattedPercentage(rowData?.percentage)\" tooltipPosition=\"top\"\n showDelay=\"500\">\n <span>{{ getFormattedPercentage(rowData?.percentage) }}</span>\n </td>\n <td id=\"col-actions-{{key}}\" class=\"col-actions \"\n *ngIf=\"actions && actions(rowData, key)?.length\">\n <s-button id=\"table-admission-btn-actions-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length > 1\" [label]=\"actionLabel\"\n priority=\"default\" [model]=\"scopedActions(rowData, key)\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n\n <s-button id=\"table-admission-btn-action-{{key}}\"\n *ngIf=\"!isViewMode && actions(rowData, key).length <= 1\"\n [label]=\"scopedActions(rowData, key)[0].label\"\n priority=\"default\"\n (click)=\"scopedActions(rowData, key)[0].command()\"\n [disabled]=\"false\" [auxiliary]=\"true\"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\" let-columns>\n <tr>\n <td [attr.colspan]=\"columns.length +2\">\n {{'hcm.payroll.admission_empty_message'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span *ngIf=\"totalRecords\">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n",
8907
- styles: [".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]
8908
- })
8909
- ], HistoricalPixAccountComponent);
8910
-
8911
8524
  class GenericValidator {
8912
8525
  constructor() { }
8913
8526
  /**
@@ -9043,386 +8656,810 @@ class GenericValidator {
9043
8656
  pos = 9;
9044
8657
  }
9045
8658
  }
9046
- result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
9047
- if (result !== Number(digits.charAt(1))) {
9048
- return { cnpjNotValid: true };
8659
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
8660
+ if (result !== Number(digits.charAt(1))) {
8661
+ return { cnpjNotValid: true };
8662
+ }
8663
+ return null;
8664
+ }
8665
+ return null;
8666
+ }
8667
+ /**
8668
+ * Válida o número de telefone da chave PIX.
8669
+ */
8670
+ static isValidPhoneNumber(control) {
8671
+ let cellPhoneKey = control.value || '';
8672
+ cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
8673
+ const regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
8674
+ const isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
8675
+ return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
8676
+ }
8677
+ /**
8678
+ * Valida o email da chave PIX.
8679
+ */
8680
+ static isValidEmail(control) {
8681
+ const emailKey = control.value;
8682
+ const regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
8683
+ const isValidEmail = regexValidEmail.test(emailKey);
8684
+ return isValidEmail ? null : { invalidEmail: true };
8685
+ }
8686
+ }
8687
+
8688
+ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent {
8689
+ constructor(formBuilder, cd) {
8690
+ this.formBuilder = formBuilder;
8691
+ this.cd = cd;
8692
+ this.withSideBar = true;
8693
+ this.isEditMode = false;
8694
+ this.paramsForm = new FormGroup({});
8695
+ this.defaultCpfNumber = null;
8696
+ this.permitsEditBankAccountForm = false;
8697
+ this.visibleChange = new EventEmitter();
8698
+ this.pixAccountItemToList = new EventEmitter();
8699
+ this.ngUnsubscribe = new Subject();
8700
+ this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
8701
+ this.labelBtnAdd = "hcm.payroll.employees_add";
8702
+ this.maxValuePercentage = 100.00;
8703
+ this.visibleBtnSave = true;
8704
+ this.isView = false;
8705
+ this.isShowPixKeyFieldValidatorMessage = false;
8706
+ this.createFormGroup();
8707
+ this.registerSubjects();
8708
+ }
8709
+ ngOnInit() {
8710
+ }
8711
+ ngDoCheck() {
8712
+ if (this.pixAccountFormGroup && this.pixKeyType === "BANK_ACCOUNT") {
8713
+ const pixKeyControl = this.pixAccountFormGroup.get("pixKey");
8714
+ if (pixKeyControl && !pixKeyControl.disabled) {
8715
+ pixKeyControl.disable();
8716
+ }
8717
+ }
8718
+ }
8719
+ ngAfterViewInit() {
8720
+ this.cd.detectChanges();
8721
+ }
8722
+ ngOnDestroy() {
8723
+ this.ngUnsubscribe.next(true);
8724
+ this.ngUnsubscribe.unsubscribe();
8725
+ }
8726
+ registerSubjects() {
8727
+ }
8728
+ createFormGroup() {
8729
+ this.pixAccountFormGroup = this.formBuilder.group({
8730
+ id: this.formBuilder.control(null),
8731
+ index: this.formBuilder.control(null),
8732
+ employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
8733
+ dateChange: this.formBuilder.control(null),
8734
+ pixKeyType: this.formBuilder.control(null, Validators.required),
8735
+ pixKey: this.formBuilder.control(null),
8736
+ percentage: this.formBuilder.control(null, Validators.compose([
8737
+ ...this.initialValidatorOfPercentage,
8738
+ Validators.max(this.maxValuePercentage),
8739
+ ])),
8740
+ externalId: this.formBuilder.control(null),
8741
+ customFields: this.formBuilder.control(null),
8742
+ });
8743
+ }
8744
+ onChangePixKeyType(item) {
8745
+ if (item.key) {
8746
+ this.pixKeyType = item.key;
8747
+ this.isShowPixKeyFieldValidatorMessage = true;
8748
+ this.pixAccountFormGroup.get("pixKey").reset();
8749
+ this.setPixKeyValidators(true);
8750
+ if (item.key === "CPF") {
8751
+ this.setDefaultCpfPixKey();
8752
+ }
8753
+ }
8754
+ }
8755
+ onClearPixKeyType() {
8756
+ this.isShowPixKeyFieldValidatorMessage = false;
8757
+ this.pixAccountFormGroup.get("pixKey").reset();
8758
+ }
8759
+ get visible() {
8760
+ return this._visible;
8761
+ }
8762
+ set visible(value) {
8763
+ this._visible = value;
8764
+ this.visibleChange.emit(this.visible);
8765
+ }
8766
+ set isEditAndViewValue(value) {
8767
+ this.resetForm();
8768
+ this.visibleBtnSave = true;
8769
+ if (value && value.permitsEditBankAccount) {
8770
+ this.permitsEditBankAccountForm = true;
8771
+ }
8772
+ if (value && value.currentItem && Object.keys(value.currentItem).length) {
8773
+ this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(Object.assign({}, value.currentItem)));
8774
+ this.labelBtnAdd = "hcm.payroll.employees_update";
8775
+ this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
8776
+ if (!this.isView) {
8777
+ this.configEnableFields(value && value["isEditMode"]);
8778
+ }
8779
+ else {
8780
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
8781
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
8782
+ this.formatPixKeyTelephoneNumber();
8783
+ }
8784
+ }
8785
+ }
8786
+ else {
8787
+ this.labelBtnAdd = "hcm.payroll.employees_add";
8788
+ }
8789
+ }
8790
+ formatPixKeyTelephoneNumber() {
8791
+ if (this.pixKeyType === "TELEPHONE") {
8792
+ this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
8793
+ }
8794
+ }
8795
+ convertDTOToShowWithCustomFields(data) {
8796
+ const obj = Object.assign({}, data);
8797
+ obj["customFields"] = mountCustomToShow(obj["customFields"]);
8798
+ return obj;
8799
+ }
8800
+ configEnableFields(isEditMode) {
8801
+ this.visibleBtnSave = isEditMode;
8802
+ if (this.pixAccountFormGroup.get("pixKeyType").value) {
8803
+ this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
8804
+ this.setPixKeyValidators(isEditMode);
8805
+ this.formatPixKeyTelephoneNumber();
8806
+ }
8807
+ configEnabledFields(this.pixAccountFormGroup, isEditMode, [
8808
+ "pixKeyType",
8809
+ "pixKey",
8810
+ "percentage",
8811
+ "customFields",
8812
+ ], []);
8813
+ }
8814
+ close() {
8815
+ this.resetForm();
8816
+ this.visible = false;
8817
+ }
8818
+ addItem() {
8819
+ this.pixAccountFormGroup.updateValueAndValidity();
8820
+ verifyValidationsForm.call(this.pixAccountFormGroup);
8821
+ if (this.pixAccountFormGroup.valid) {
8822
+ if (this.employeeId) {
8823
+ this.pixAccountFormGroup.get("employee").setValue({
8824
+ tableId: this.employeeId,
8825
+ name: "",
8826
+ });
8827
+ }
8828
+ this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
8829
+ this.visible = false;
8830
+ this.resetForm();
8831
+ }
8832
+ }
8833
+ resetForm() {
8834
+ this.pixAccountFormGroup.reset();
8835
+ this.labelBtnAdd = "hcm.payroll.employees_add";
8836
+ if (this.customFields && this.customFields.formGroup)
8837
+ this.customFields.formGroup.reset();
8838
+ }
8839
+ get percentagePlaceholder() {
8840
+ return `0${this.currency && this.currency.decimalSeparator}00`;
8841
+ }
8842
+ get optionsPercentage() {
8843
+ return Object.assign({}, this.getOptions(), { precision: 2 });
8844
+ }
8845
+ getOptions() {
8846
+ return {
8847
+ prefix: "",
8848
+ thousands: this.currency.thousandsSeparator,
8849
+ decimal: this.currency.decimalSeparator,
8850
+ };
8851
+ }
8852
+ /**
8853
+ * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
8854
+ * @param pixAccountList
8855
+ */
8856
+ set getListPixAccount(pixAccountList) {
8857
+ if (pixAccountList) {
8858
+ this.setValidatorsAccordingList(pixAccountList, null, false);
8859
+ }
8860
+ else {
8861
+ this.resetForm();
8862
+ }
8863
+ }
8864
+ /**
8865
+ * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
8866
+ * a validação dos campos "percentage" e "pixAccount".
8867
+ * Quando tem index significa que está em uma edição, os valores na posição do registro da edição (index) não serão adicionados
8868
+ * no array de comparação dos validators.
8869
+ * @param pixAccountList
8870
+ * @param index
8871
+ */
8872
+ setValidatorsAccordingList(pixAccountList, index = null, isEditMode = true) {
8873
+ this.pixAccountList = pixAccountList && pixAccountList.length ? [...pixAccountList] : [];
8874
+ const percentageIncluded = [];
8875
+ if (this.pixAccountList && this.pixAccountList.length) {
8876
+ this.pixAccountList.filter((field, key) => {
8877
+ if (field["percentage"] && key != index) {
8878
+ percentageIncluded.push(field["percentage"]);
8879
+ }
8880
+ });
8881
+ }
8882
+ this.beforeSetPixKeyTypeValidator();
8883
+ this.setPixKeyValidators(isEditMode);
8884
+ this.validatePercentageValid(percentageIncluded);
8885
+ }
8886
+ /**
8887
+ * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
8888
+ */
8889
+ setPixKeyValidators(isEditMode) {
8890
+ const genericPixKey = this.pixAccountFormGroup.get("pixKey");
8891
+ if (this.pixKeyType) {
8892
+ switch (this.pixKeyType) {
8893
+ case "TELEPHONE":
8894
+ genericPixKey.setValidators(Validators.compose([
8895
+ Validators.required, GenericValidator.isValidPhoneNumber,
8896
+ ]));
8897
+ break;
8898
+ case "EMAIL":
8899
+ genericPixKey.setValidators(Validators.compose([
8900
+ Validators.required, GenericValidator.isValidEmail,
8901
+ ]));
8902
+ break;
8903
+ case "CPF":
8904
+ genericPixKey.setValidators(Validators.compose([
8905
+ Validators.required, GenericValidator.isValidCpf,
8906
+ ]));
8907
+ break;
8908
+ case "CNPJ":
8909
+ genericPixKey.setValidators(Validators.compose([
8910
+ Validators.required, GenericValidator.isValidCnpj,
8911
+ ]));
8912
+ break;
8913
+ case "RANDOM_KEY":
8914
+ genericPixKey.setValidators(Validators.required);
8915
+ break;
8916
+ default:
8917
+ genericPixKey.setValidators(null);
8918
+ break;
8919
+ }
8920
+ if (isEditMode) {
8921
+ genericPixKey.enable();
9049
8922
  }
9050
- return null;
8923
+ genericPixKey.updateValueAndValidity();
9051
8924
  }
9052
- return null;
9053
8925
  }
9054
8926
  /**
9055
- * Válida o número de telefone da chave PIX.
8927
+ * Este método calcula as parcentagens que foram inseridas, e seta a diferença para chegar em
8928
+ * 100% na validação do campo "percentage" como um novo maxValue;
8929
+ * @param listValue
9056
8930
  */
9057
- static isValidPhoneNumber(control) {
9058
- let cellPhoneKey = control.value || '';
9059
- cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
9060
- const regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
9061
- const isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
9062
- return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
8931
+ validatePercentageValid(listValue) {
8932
+ const percentage = this.pixAccountFormGroup.get("percentage");
8933
+ this.maxValuePercentage = listValue
8934
+ .reduce((currentValue, total) => currentValue - total, 100.00);
8935
+ percentage
8936
+ .setValidators(Validators.compose([
8937
+ ...this.initialValidatorOfPercentage,
8938
+ Validators.max(this.maxValuePercentage),
8939
+ ]));
8940
+ percentage.updateValueAndValidity();
9063
8941
  }
9064
- /**
9065
- * Valida o email da chave PIX.
9066
- */
9067
- static isValidEmail(control) {
9068
- const emailKey = control.value;
9069
- const regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
9070
- const isValidEmail = regexValidEmail.test(emailKey);
9071
- return isValidEmail ? null : { invalidEmail: true };
8942
+ set isViewMode(condition) {
8943
+ this.isView = !!(condition && !this.withSideBar);
8944
+ this.configEnableFields(!this.isView);
8945
+ if (!this.isView)
8946
+ this.resetForm();
9072
8947
  }
9073
- }
8948
+ phoneMask(event) {
8949
+ FormatUtilsService.formatTelephoneInputEvent(event);
8950
+ }
8951
+ setDefaultCpfPixKey() {
8952
+ if (this.defaultCpfNumber) {
8953
+ this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
8954
+ }
8955
+ else {
8956
+ const sheetDocument = this.paramsForm.get("sheetDocument");
8957
+ if (sheetDocument) {
8958
+ const cpf = sheetDocument.get("cpfNumber").value;
8959
+ if (cpf) {
8960
+ this.pixAccountFormGroup.get("pixKey").setValue(cpf);
8961
+ }
8962
+ }
8963
+ }
8964
+ }
8965
+ beforeSetPixKeyTypeValidator() {
8966
+ const pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
8967
+ if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
8968
+ pixKeyType
8969
+ .setValidators(Validators.compose([
8970
+ Validators.required,
8971
+ this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
8972
+ ]));
8973
+ }
8974
+ else {
8975
+ pixKeyType.setValidators(Validators.required);
8976
+ }
8977
+ }
8978
+ validateDuplicatePixKeyTypeBankAccount(listCompare) {
8979
+ return (control) => {
8980
+ const value = control && control.value;
8981
+ let condition = false;
8982
+ listCompare.filter((field) => {
8983
+ if (value) {
8984
+ if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
8985
+ return condition = true;
8986
+ }
8987
+ }
8988
+ });
8989
+ if (condition && !this.permitsEditBankAccountForm) {
8990
+ return { pixKeyTypeBankAccountDuplicate: true };
8991
+ }
8992
+ else {
8993
+ return null;
8994
+ }
8995
+ };
8996
+ }
8997
+ };
8998
+ HistoricalPixAccountFormComponent.ctorParameters = () => [
8999
+ { type: FormBuilder },
9000
+ { type: ChangeDetectorRef }
9001
+ ];
9002
+ __decorate([
9003
+ ViewChild(CustomFieldsComponent$1, { static: true })
9004
+ ], HistoricalPixAccountFormComponent.prototype, "customFields", void 0);
9005
+ __decorate([
9006
+ Input()
9007
+ ], HistoricalPixAccountFormComponent.prototype, "currency", void 0);
9008
+ __decorate([
9009
+ Input()
9010
+ ], HistoricalPixAccountFormComponent.prototype, "customEntity", void 0);
9011
+ __decorate([
9012
+ Input()
9013
+ ], HistoricalPixAccountFormComponent.prototype, "customService", void 0);
9014
+ __decorate([
9015
+ Input()
9016
+ ], HistoricalPixAccountFormComponent.prototype, "withSideBar", void 0);
9017
+ __decorate([
9018
+ Input()
9019
+ ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
9020
+ __decorate([
9021
+ Input()
9022
+ ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
9023
+ __decorate([
9024
+ Input()
9025
+ ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
9026
+ __decorate([
9027
+ Input()
9028
+ ], HistoricalPixAccountFormComponent.prototype, "permitsEditBankAccountForm", void 0);
9029
+ __decorate([
9030
+ Output()
9031
+ ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
9032
+ __decorate([
9033
+ Output()
9034
+ ], HistoricalPixAccountFormComponent.prototype, "pixAccountItemToList", void 0);
9035
+ __decorate([
9036
+ Input()
9037
+ ], HistoricalPixAccountFormComponent.prototype, "visible", null);
9038
+ __decorate([
9039
+ Input()
9040
+ ], HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", null);
9041
+ __decorate([
9042
+ Input()
9043
+ ], HistoricalPixAccountFormComponent.prototype, "getListPixAccount", null);
9044
+ __decorate([
9045
+ Input()
9046
+ ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
9047
+ HistoricalPixAccountFormComponent = __decorate([
9048
+ Component({
9049
+ selector: "pix-account",
9050
+ 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",
9051
+ 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}"]
9052
+ })
9053
+ ], HistoricalPixAccountFormComponent);
9074
9054
 
9075
- let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent {
9076
- constructor(formBuilder, cd) {
9077
- this.formBuilder = formBuilder;
9055
+ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
9056
+ constructor(translateService, cd, formBuilder, messageService) {
9057
+ this.translateService = translateService;
9078
9058
  this.cd = cd;
9079
- this.withSideBar = true;
9059
+ this.formBuilder = formBuilder;
9060
+ this.messageService = messageService;
9061
+ this.recordByRow = 1;
9062
+ this.showDateChange = false;
9080
9063
  this.isEditMode = false;
9081
- this.paramsForm = new FormGroup({});
9064
+ this.isViewMode = false;
9065
+ this.withSideBar = true;
9082
9066
  this.defaultCpfNumber = null;
9067
+ this.listDataReciever = [];
9068
+ this.showButtonEdit = false;
9069
+ this.isViewModeActive = new EventEmitter();
9070
+ this.isEditModeActive = new EventEmitter();
9071
+ this.isDeleteModeActive = new EventEmitter();
9072
+ this.listFromApp = [];
9083
9073
  this.visibleChange = new EventEmitter();
9084
- this.pixAccountItemToList = new EventEmitter();
9085
9074
  this.ngUnsubscribe = new Subject();
9086
- this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
9087
- this.labelBtnAdd = "hcm.payroll.employees_add";
9088
- this.maxValuePercentage = 100.00;
9089
- this.visibleBtnSave = true;
9090
- this.isView = false;
9091
- this.isShowPixKeyFieldValidatorMessage = false;
9075
+ this.orderBy = {
9076
+ field: "dateChange",
9077
+ direction: DirectionEnumeration.DESC,
9078
+ };
9079
+ this.pixAccountItemInput = {};
9080
+ this.totalRecords = 0;
9081
+ this.actionLabel = this.translateService.instant("hcm.payroll.entries_query_actions_total_title");
9082
+ this.loading = true;
9083
+ this.listData = [];
9084
+ this.listDataNoPage = [];
9085
+ this.permitsEditBankAccount = false;
9086
+ this.cols = [
9087
+ {
9088
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
9089
+ field: "pixKeyType",
9090
+ },
9091
+ {
9092
+ label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
9093
+ field: "pixKey",
9094
+ },
9095
+ {
9096
+ label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
9097
+ field: "percentage",
9098
+ },
9099
+ ];
9100
+ this.actions = (rowData = {}, key) => {
9101
+ return [
9102
+ {
9103
+ visible: this.isEditMode,
9104
+ label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
9105
+ command: () => {
9106
+ if (this.isAllowToViewHistorical) {
9107
+ rowData["index"] = key;
9108
+ this.pixAccountItemInput = { currentItem: rowData, listData: this.listDataNoPage, isEditMode: false };
9109
+ this.visible = true;
9110
+ }
9111
+ else {
9112
+ this.isViewModeActive.emit(true);
9113
+ }
9114
+ },
9115
+ },
9116
+ {
9117
+ visible: !!((!this.isEditMode && this.withSideBar) || this.showButtonEdit),
9118
+ label: this.translateService.instant("hcm.payroll.edit"),
9119
+ command: () => {
9120
+ this.permitsEditBankAccount = true;
9121
+ if (this.isAllowToEditHistorical) {
9122
+ rowData["index"] = key;
9123
+ this.pixAccountItemInput = {
9124
+ currentItem: rowData, listData: this.listDataNoPage, isEditMode: true, permitsEditBankAccount: true
9125
+ };
9126
+ this.visible = true;
9127
+ }
9128
+ else {
9129
+ this.isEditModeActive.emit(true);
9130
+ if (this.listFromApp.length == 0) {
9131
+ rowData["index"] = key;
9132
+ this.pixAccountItemInput = {
9133
+ currentItem: rowData, listData: this.listDataNoPage, isEditMode: true, permitsEditBankAccount: true
9134
+ };
9135
+ }
9136
+ }
9137
+ },
9138
+ },
9139
+ {
9140
+ visible: !this.isEditMode,
9141
+ label: this.translateService.instant("hcm.payroll.delete"),
9142
+ command: () => {
9143
+ if (this.isAllowToDeleteHistorical) {
9144
+ this.loading = true;
9145
+ this.deleteAnnuityItem(key);
9146
+ }
9147
+ else {
9148
+ this.isDeleteModeActive.emit(true);
9149
+ if (this.listFromApp.length == 0) {
9150
+ this.loading = true;
9151
+ this.deleteAnnuityItem(key);
9152
+ }
9153
+ }
9154
+ },
9155
+ },
9156
+ ];
9157
+ };
9092
9158
  this.createFormGroup();
9093
- this.registerSubjects();
9094
9159
  }
9095
9160
  ngOnInit() {
9161
+ this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
9096
9162
  }
9097
- ngAfterViewInit() {
9098
- this.cd.detectChanges();
9099
- }
9100
- ngOnDestroy() {
9101
- this.ngUnsubscribe.next(true);
9102
- this.ngUnsubscribe.unsubscribe();
9103
- }
9104
- registerSubjects() {
9105
- }
9106
- createFormGroup() {
9107
- this.pixAccountFormGroup = this.formBuilder.group({
9108
- id: this.formBuilder.control(null),
9109
- index: this.formBuilder.control(null),
9110
- employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
9111
- dateChange: this.formBuilder.control(null),
9112
- pixKeyType: this.formBuilder.control(null, Validators.required),
9113
- pixKey: this.formBuilder.control(null),
9114
- percentage: this.formBuilder.control(null, Validators.compose([
9115
- ...this.initialValidatorOfPercentage,
9116
- Validators.max(this.maxValuePercentage),
9117
- ])),
9118
- externalId: this.formBuilder.control(null),
9119
- customFields: this.formBuilder.control(null),
9120
- });
9121
- }
9122
- onChangePixKeyType(item) {
9123
- if (item.key) {
9124
- this.pixKeyType = item.key;
9125
- this.isShowPixKeyFieldValidatorMessage = true;
9126
- this.pixAccountFormGroup.get("pixKey").reset();
9127
- this.setPixKeyValidators(true);
9128
- if (item.key === "CPF") {
9129
- this.setDefaultCpfPixKey();
9130
- }
9131
- }
9132
- }
9133
- onClearPixKeyType() {
9134
- this.isShowPixKeyFieldValidatorMessage = false;
9135
- this.pixAccountFormGroup.get("pixKey").reset();
9136
- }
9137
- get visible() {
9138
- return this._visible;
9139
- }
9140
- set visible(value) {
9141
- this._visible = value;
9142
- this.visibleChange.emit(this.visible);
9143
- }
9144
- set isEditAndViewValue(value) {
9145
- this.resetForm();
9146
- this.visibleBtnSave = true;
9147
- if (value && value.currentItem && Object.keys(value.currentItem).length) {
9148
- this.pixAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(Object.assign({}, value.currentItem)));
9149
- this.labelBtnAdd = "hcm.payroll.employees_update";
9150
- this.setValidatorsAccordingList(value.listData, value.currentItem["index"], value && value["isEditMode"]);
9151
- if (!this.isView) {
9152
- this.configEnableFields(value && value["isEditMode"]);
9153
- }
9154
- else {
9155
- if (this.pixAccountFormGroup.get("pixKeyType").value) {
9156
- this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9157
- this.formatPixKeyTelephoneNumber();
9158
- }
9159
- }
9160
- }
9161
- else {
9162
- this.labelBtnAdd = "hcm.payroll.employees_add";
9163
+ ngOnChanges(changes) {
9164
+ if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
9165
+ this.listFromApp = changes['listDataReciever'].currentValue;
9163
9166
  }
9164
- }
9165
- formatPixKeyTelephoneNumber() {
9166
- if (this.pixKeyType === "TELEPHONE") {
9167
- this.pixAccountFormGroup.get("pixKey").setValue(FormatUtilsService.getFormattedTelephoneNumber(this.pixAccountFormGroup.get("pixKey").value));
9167
+ if (changes['showButtonEdit'] && changes['showButtonEdit'].currentValue) {
9168
+ this.permitsEditBankAccount = changes['showButtonEdit'].currentValue;
9168
9169
  }
9169
9170
  }
9170
- convertDTOToShowWithCustomFields(data) {
9171
- const obj = Object.assign({}, data);
9172
- obj["customFields"] = mountCustomToShow(obj["customFields"]);
9173
- return obj;
9171
+ createFormGroup() {
9172
+ this.historicalPixAccountList = this.formBuilder.group({
9173
+ historicalPixAccountList: this.formBuilder.control(null),
9174
+ });
9174
9175
  }
9175
- configEnableFields(isEditMode) {
9176
- this.visibleBtnSave = isEditMode;
9177
- if (this.pixAccountFormGroup.get("pixKeyType").value) {
9178
- this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
9179
- this.setPixKeyValidators(isEditMode);
9180
- this.formatPixKeyTelephoneNumber();
9181
- }
9182
- configEnabledFields(this.pixAccountFormGroup, isEditMode, [
9183
- "pixKeyType",
9184
- "pixKey",
9185
- "percentage",
9186
- "customFields",
9187
- ], []);
9176
+ ngOnDestroy() {
9177
+ this.ngUnsubscribe.next();
9178
+ this.ngUnsubscribe.complete();
9188
9179
  }
9189
- close() {
9190
- this.resetForm();
9191
- this.visible = false;
9180
+ ngAfterViewInit() {
9181
+ this.cd.detectChanges();
9192
9182
  }
9193
- addItem() {
9194
- this.pixAccountFormGroup.updateValueAndValidity();
9195
- verifyValidationsForm.call(this.pixAccountFormGroup);
9196
- if (this.pixAccountFormGroup.valid) {
9197
- if (this.employeeId) {
9198
- this.pixAccountFormGroup.get("employee").setValue({
9199
- tableId: this.employeeId,
9200
- name: "",
9201
- });
9202
- }
9203
- this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
9204
- this.visible = false;
9205
- this.resetForm();
9183
+ onLazyLoad(event) {
9184
+ const first = event && event.first ? event.first : 0;
9185
+ const rows = event && event.rows ? event.rows : this.recordByRow;
9186
+ const arrList = this.getHistoricalPixAccountList();
9187
+ this.listData = [];
9188
+ this.totalRecords = null;
9189
+ if (event && event.multiSortMeta && event.multiSortMeta.length) {
9190
+ event.multiSortMeta.map((value) => {
9191
+ this.orderBy.field = value.field;
9192
+ this.orderBy.direction = value.order === 1 ? DirectionEnumeration.ASC : DirectionEnumeration.DESC;
9193
+ });
9206
9194
  }
9207
- }
9208
- resetForm() {
9209
- this.pixAccountFormGroup.reset();
9210
- this.labelBtnAdd = "hcm.payroll.employees_add";
9211
- if (this.customFields && this.customFields.formGroup)
9212
- this.customFields.formGroup.reset();
9213
- }
9214
- get percentagePlaceholder() {
9215
- return `0${this.currency && this.currency.decimalSeparator}00`;
9216
- }
9217
- get optionsPercentage() {
9218
- return Object.assign({}, this.getOptions(), { precision: 2 });
9219
- }
9220
- getOptions() {
9221
- return {
9222
- prefix: "",
9223
- thousands: this.currency.thousandsSeparator,
9224
- decimal: this.currency.decimalSeparator,
9225
- };
9226
- }
9227
- /**
9228
- * O Input que recebe a lista do component pai e chama o método de validação passando a lista recebida.
9229
- * @param pixAccountList
9230
- */
9231
- set getListPixAccount(pixAccountList) {
9232
- if (pixAccountList) {
9233
- this.setValidatorsAccordingList(pixAccountList, null, false);
9195
+ if (arrList && arrList.length) {
9196
+ this.totalRecords = arrList.length;
9197
+ this.listData = arrList;
9198
+ this.listDataNoPage = [...arrList];
9199
+ this.listData.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9200
+ this.listData = this.listData.slice(first, (first + rows));
9234
9201
  }
9235
9202
  else {
9236
- this.resetForm();
9237
- }
9238
- }
9239
- /**
9240
- * Recebe a lista de registros já inseridos na tabela adiciona em uma variável os valores que serão usados para
9241
- * a validação dos campos "percentage" e "pixAccount".
9242
- * Quando tem index significa que está em uma edição, os valores na posição do registro da edição (index) não serão adicionados
9243
- * no array de comparação dos validators.
9244
- * @param pixAccountList
9245
- * @param index
9246
- */
9247
- setValidatorsAccordingList(pixAccountList, index = null, isEditMode = true) {
9248
- this.pixAccountList = pixAccountList && pixAccountList.length ? [...pixAccountList] : [];
9249
- const percentageIncluded = [];
9250
- if (this.pixAccountList && this.pixAccountList.length) {
9251
- this.pixAccountList.filter((field, key) => {
9252
- if (field["percentage"] && key != index) {
9253
- percentageIncluded.push(field["percentage"]);
9254
- }
9255
- });
9203
+ this.listDataNoPage = [];
9256
9204
  }
9257
- this.beforeSetPixKeyTypeValidator();
9258
- this.setPixKeyValidators(isEditMode);
9259
- this.validatePercentageValid(percentageIncluded);
9260
- }
9261
- /**
9262
- * Antes de setar o validator prepara as variáveis necessária para que seja feita a validação do campo.
9263
- */
9264
- setPixKeyValidators(isEditMode) {
9265
- const genericPixKey = this.pixAccountFormGroup.get("pixKey");
9266
- if (this.pixKeyType) {
9267
- switch (this.pixKeyType) {
9268
- case "TELEPHONE":
9269
- genericPixKey.setValidators(Validators.compose([
9270
- Validators.required, GenericValidator.isValidPhoneNumber,
9271
- ]));
9272
- break;
9273
- case "EMAIL":
9274
- genericPixKey.setValidators(Validators.compose([
9275
- Validators.required, GenericValidator.isValidEmail,
9276
- ]));
9277
- break;
9278
- case "CPF":
9279
- genericPixKey.setValidators(Validators.compose([
9280
- Validators.required, GenericValidator.isValidCpf,
9281
- ]));
9282
- break;
9283
- case "CNPJ":
9284
- genericPixKey.setValidators(Validators.compose([
9285
- Validators.required, GenericValidator.isValidCnpj,
9286
- ]));
9287
- break;
9288
- case "RANDOM_KEY":
9289
- genericPixKey.setValidators(Validators.required);
9290
- break;
9291
- default:
9292
- genericPixKey.setValidators(null);
9293
- break;
9294
- }
9295
- if (isEditMode) {
9296
- genericPixKey.enable();
9297
- }
9298
- genericPixKey.updateValueAndValidity();
9205
+ if (this.isEditMode || arrList && arrList.length === 1) {
9206
+ this.refreshCssInIE11();
9299
9207
  }
9208
+ this.loading = false;
9300
9209
  }
9301
9210
  /**
9302
- * Este método calcula as parcentagens que foram inseridas, e seta a diferença para chegar em
9303
- * 100% na validação do campo "percentage" como um novo maxValue;
9304
- * @param listValue
9211
+ * Um Bug de CSS que acontece nas linhas da tabela, que resolve atualizando qualquer parte do CSS da pagina.
9305
9212
  */
9306
- validatePercentageValid(listValue) {
9307
- const percentage = this.pixAccountFormGroup.get("percentage");
9308
- this.maxValuePercentage = listValue
9309
- .reduce((currentValue, total) => currentValue - total, 100.00);
9310
- percentage
9311
- .setValidators(Validators.compose([
9312
- ...this.initialValidatorOfPercentage,
9313
- Validators.max(this.maxValuePercentage),
9314
- ]));
9315
- percentage.updateValueAndValidity();
9213
+ refreshCssInIE11() {
9214
+ if (/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)) {
9215
+ setTimeout(() => {
9216
+ const row = document.getElementsByClassName("row0");
9217
+ if (row && row[0])
9218
+ row[0].className = 'refresh';
9219
+ }, 1);
9220
+ }
9316
9221
  }
9317
- set isViewMode(condition) {
9318
- this.isView = !!(condition && !this.withSideBar);
9319
- this.configEnableFields(!this.isView);
9320
- if (!this.isView)
9321
- this.resetForm();
9222
+ add() {
9223
+ this.pixAccountItemInput = {};
9224
+ this.visible = true;
9322
9225
  }
9323
- phoneMask(event) {
9324
- FormatUtilsService.formatTelephoneInputEvent(event);
9226
+ isNotAllowMessage() {
9227
+ this.messageService.add({
9228
+ severity: "error",
9229
+ summary: this.translateService.instant("hcm.payroll.error"),
9230
+ detail: this.translateService.instant("hcm.payroll.permission_error_not_allowed"),
9231
+ });
9325
9232
  }
9326
- setDefaultCpfPixKey() {
9327
- if (this.defaultCpfNumber) {
9328
- this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
9233
+ deleteAnnuityItem(index) {
9234
+ let newlist = [...this.getHistoricalPixAccountList()];
9235
+ newlist.sort(compareValues(this.orderBy.field, this.orderBy.direction));
9236
+ delete newlist[index];
9237
+ newlist = newlist.filter(val => val);
9238
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newlist);
9239
+ this.verifyTotalPercentage();
9240
+ this.onLazyLoad();
9241
+ }
9242
+ getHistoricalPixAccountList() {
9243
+ if (this.historicalPixAccountList.get("historicalPixAccountList") &&
9244
+ this.historicalPixAccountList.get("historicalPixAccountList").value &&
9245
+ this.historicalPixAccountList.get("historicalPixAccountList").value.length)
9246
+ return this.historicalPixAccountList.get("historicalPixAccountList") && this.historicalPixAccountList.get("historicalPixAccountList").value;
9247
+ else
9248
+ return [];
9249
+ }
9250
+ addItemInList($event) {
9251
+ const index = $event && $event.index >= 0 ? $event.index : null;
9252
+ const newDataList = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9253
+ if (index != null) {
9254
+ newDataList[index] = $event;
9255
+ delete $event.index;
9329
9256
  }
9330
9257
  else {
9331
- const sheetDocument = this.paramsForm.get("sheetDocument");
9332
- if (sheetDocument) {
9333
- const cpf = sheetDocument.get("cpfNumber").value;
9334
- if (cpf) {
9335
- this.pixAccountFormGroup.get("pixKey").setValue(cpf);
9336
- }
9258
+ if (isValid($event["customFields"]) && Object.keys($event["customFields"]).length) {
9259
+ const customValue = mountCustomToSave($event["customFields"]);
9260
+ $event["customFields"] = [...customValue];
9337
9261
  }
9262
+ $event["dateChange"] = this.dateChange;
9263
+ newDataList.push($event);
9338
9264
  }
9265
+ if (this.formComponent) {
9266
+ this.formComponent.permitsEditBankAccountForm = false;
9267
+ this.cd.detectChanges();
9268
+ }
9269
+ this.historicalPixAccountList.get("historicalPixAccountList").setValue(newDataList);
9270
+ this.verifyTotalPercentage();
9271
+ this.onLazyLoad({ first: this.getNumberPageByIndex(index, newDataList) });
9339
9272
  }
9340
- beforeSetPixKeyTypeValidator() {
9341
- const pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
9342
- if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
9343
- pixKeyType
9344
- .setValidators(Validators.compose([
9345
- Validators.required,
9346
- this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
9347
- ]));
9273
+ getNumberPageByIndex(index, list) {
9274
+ if (index) {
9275
+ const total = list.length;
9276
+ const sub = this.recordByRow - 1;
9277
+ return Math.ceil(total / this.recordByRow) * this.recordByRow - sub - 1;
9278
+ }
9279
+ return null;
9280
+ }
9281
+ verifyTotalPercentage() {
9282
+ const list = this.getHistoricalPixAccountList() ? this.getHistoricalPixAccountList() : [];
9283
+ const arrayPercentage = [];
9284
+ if (!list.length)
9285
+ return this.msgTotalLimitByPercentage = null;
9286
+ list.filter((item) => arrayPercentage.push(item && item["percentage"]));
9287
+ const sumPercentage = arrayPercentage.reduce((total, percentage) => {
9288
+ return total + percentage;
9289
+ }, 0);
9290
+ if (sumPercentage === 100) {
9291
+ this.msgTotalLimitByPercentage = this.translateService.instant("hcm.payroll.historical_pix_account_msg_limit_total_by_percentage");
9348
9292
  }
9349
9293
  else {
9350
- pixKeyType.setValidators(Validators.required);
9294
+ this.msgTotalLimitByPercentage = null;
9351
9295
  }
9352
9296
  }
9353
- validateDuplicatePixKeyTypeBankAccount(listCompare) {
9354
- return (control) => {
9355
- const value = control && control.value;
9356
- let condition = false;
9357
- listCompare.filter((field) => {
9358
- if (value) {
9359
- if (field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === field["pixKeyType"].key) {
9360
- return condition = true;
9361
- }
9362
- }
9363
- });
9364
- if (condition) {
9365
- return { pixKeyTypeBankAccountDuplicate: true };
9366
- }
9367
- else {
9368
- return null;
9369
- }
9370
- };
9297
+ get scopedActions() {
9298
+ return this.actions.bind(this);
9299
+ }
9300
+ get recordsMessage() {
9301
+ return `${this.totalRecords || 0} ${this.totalRecords === 1 ? this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers")}`;
9302
+ }
9303
+ get getTooltipAndDisableButtonAdd() {
9304
+ return this.dateChange ? null : this.msgTooltipAdd;
9305
+ }
9306
+ get dateChange() {
9307
+ return this._dateChange;
9308
+ }
9309
+ set dateChange(value) {
9310
+ this._dateChange = value;
9311
+ if (this._dateChange) {
9312
+ this.listData.filter((row) => row["dateChange"] = this._dateChange);
9313
+ }
9314
+ }
9315
+ get displayDateChange() {
9316
+ return this._displayDateChange;
9317
+ }
9318
+ set displayDateChange(value) {
9319
+ this._displayDateChange = value;
9320
+ if (this._displayDateChange) {
9321
+ this.listData.filter((row) => row["displayDateChange"] = this._displayDateChange);
9322
+ }
9323
+ }
9324
+ set addListData(list) {
9325
+ this.loading = true;
9326
+ this.historicalPixAccountList.get("historicalPixAccountList").patchValue(list);
9327
+ this.verifyTotalPercentage();
9328
+ this.onLazyLoad();
9329
+ }
9330
+ get visible() {
9331
+ return this._visible;
9332
+ }
9333
+ set visible(value) {
9334
+ this._visible = value;
9335
+ this.visibleChange.emit(this.visible);
9336
+ if (!value) {
9337
+ this.pixAccountItemInput = {};
9338
+ }
9339
+ }
9340
+ close() {
9341
+ this.visible = false;
9342
+ }
9343
+ getFormattedTelephoneNumber(telephoneNumber) {
9344
+ return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
9345
+ }
9346
+ getFormattedCpf(cpf) {
9347
+ return FormatUtilsService.getFormattedCpf(cpf);
9348
+ }
9349
+ getFormattedCnpj(cnpj) {
9350
+ return FormatUtilsService.getFormattedCnpj(cnpj);
9351
+ }
9352
+ getFormattedPercentage(value) {
9353
+ return FormatUtilsService.getFormattedPercentage(value);
9354
+ }
9355
+ get isAllowToAddHistorical() {
9356
+ return (this.permission["incluir"]);
9357
+ }
9358
+ get isAllowToDeleteHistorical() {
9359
+ return (this.permission["excluir"]);
9360
+ }
9361
+ get isAllowToEditHistorical() {
9362
+ return (this.permission["editar"]);
9363
+ }
9364
+ get isAllowToViewHistorical() {
9365
+ return (this.permission["visualizar"]);
9371
9366
  }
9372
9367
  };
9373
- HistoricalPixAccountFormComponent.ctorParameters = () => [
9368
+ HistoricalPixAccountComponent.ctorParameters = () => [
9369
+ { type: TranslateService },
9370
+ { type: ChangeDetectorRef },
9374
9371
  { type: FormBuilder },
9375
- { type: ChangeDetectorRef }
9372
+ { type: MessageService }
9376
9373
  ];
9377
9374
  __decorate([
9378
- ViewChild(CustomFieldsComponent$1, { static: true })
9379
- ], HistoricalPixAccountFormComponent.prototype, "customFields", void 0);
9375
+ ViewChild(CustomFieldsComponent$1, { static: false })
9376
+ ], HistoricalPixAccountComponent.prototype, "customFields", void 0);
9377
+ __decorate([
9378
+ ViewChild(HistoricalPixAccountFormComponent, { static: false })
9379
+ ], HistoricalPixAccountComponent.prototype, "formComponent", void 0);
9380
9380
  __decorate([
9381
9381
  Input()
9382
- ], HistoricalPixAccountFormComponent.prototype, "currency", void 0);
9382
+ ], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
9383
9383
  __decorate([
9384
9384
  Input()
9385
- ], HistoricalPixAccountFormComponent.prototype, "customEntity", void 0);
9385
+ ], HistoricalPixAccountComponent.prototype, "fieldFormGroup", void 0);
9386
9386
  __decorate([
9387
9387
  Input()
9388
- ], HistoricalPixAccountFormComponent.prototype, "customService", void 0);
9388
+ ], HistoricalPixAccountComponent.prototype, "_dateChange", void 0);
9389
9389
  __decorate([
9390
9390
  Input()
9391
- ], HistoricalPixAccountFormComponent.prototype, "withSideBar", void 0);
9391
+ ], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
9392
9392
  __decorate([
9393
9393
  Input()
9394
- ], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
9394
+ ], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
9395
9395
  __decorate([
9396
9396
  Input()
9397
- ], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
9397
+ ], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
9398
9398
  __decorate([
9399
9399
  Input()
9400
- ], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
9400
+ ], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
9401
+ __decorate([
9402
+ Input()
9403
+ ], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
9404
+ __decorate([
9405
+ Input()
9406
+ ], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
9407
+ __decorate([
9408
+ Input()
9409
+ ], HistoricalPixAccountComponent.prototype, "currency", void 0);
9410
+ __decorate([
9411
+ Input()
9412
+ ], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
9413
+ __decorate([
9414
+ Input()
9415
+ ], HistoricalPixAccountComponent.prototype, "customService", void 0);
9416
+ __decorate([
9417
+ Input()
9418
+ ], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
9419
+ __decorate([
9420
+ Input()
9421
+ ], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
9422
+ __decorate([
9423
+ Input()
9424
+ ], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
9425
+ __decorate([
9426
+ Input()
9427
+ ], HistoricalPixAccountComponent.prototype, "permission", void 0);
9428
+ __decorate([
9429
+ Input()
9430
+ ], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
9431
+ __decorate([
9432
+ Input()
9433
+ ], HistoricalPixAccountComponent.prototype, "showButtonEdit", void 0);
9401
9434
  __decorate([
9402
9435
  Output()
9403
- ], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
9436
+ ], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
9404
9437
  __decorate([
9405
9438
  Output()
9406
- ], HistoricalPixAccountFormComponent.prototype, "pixAccountItemToList", void 0);
9439
+ ], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
9440
+ __decorate([
9441
+ Output()
9442
+ ], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
9407
9443
  __decorate([
9408
9444
  Input()
9409
- ], HistoricalPixAccountFormComponent.prototype, "visible", null);
9445
+ ], HistoricalPixAccountComponent.prototype, "dateChange", null);
9410
9446
  __decorate([
9411
9447
  Input()
9412
- ], HistoricalPixAccountFormComponent.prototype, "isEditAndViewValue", null);
9448
+ ], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
9413
9449
  __decorate([
9414
9450
  Input()
9415
- ], HistoricalPixAccountFormComponent.prototype, "getListPixAccount", null);
9451
+ ], HistoricalPixAccountComponent.prototype, "addListData", null);
9416
9452
  __decorate([
9417
9453
  Input()
9418
- ], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
9419
- HistoricalPixAccountFormComponent = __decorate([
9454
+ ], HistoricalPixAccountComponent.prototype, "visible", null);
9455
+ HistoricalPixAccountComponent = __decorate([
9420
9456
  Component({
9421
- selector: "pix-account",
9422
- 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",
9457
+ // tslint:disable-next-line:component-selector
9458
+ selector: "c-historical-pix-account",
9459
+ 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 && !isViewMode\">\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 [permitsEditBankAccountForm]=\"permitsEditBankAccount\"\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 *ngIf=\"!isViewMode\" [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 *ngIf=\"!isViewMode\" 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 && !isViewMode\">\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",
9423
9460
  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}"]
9424
9461
  })
9425
- ], HistoricalPixAccountFormComponent);
9462
+ ], HistoricalPixAccountComponent);
9426
9463
 
9427
9464
  let HistoricalPixAccountService = class HistoricalPixAccountService {
9428
9465
  constructor(http) {
@@ -9518,6 +9555,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9518
9555
  this.isOnlyView = new EventEmitter();
9519
9556
  this.isOnlyEdit = new EventEmitter();
9520
9557
  this.enableView = new EventEmitter();
9558
+ this.enableEdit = new EventEmitter();
9521
9559
  this.ngUnsubscribe = new Subject();
9522
9560
  this.loading = true;
9523
9561
  this.columns = [
@@ -9583,7 +9621,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
9583
9621
  });
9584
9622
  }
9585
9623
  else {
9586
- this.enableView.emit(dateChange);
9624
+ this.enableEdit.emit(dateChange);
9587
9625
  }
9588
9626
  }
9589
9627
  else {
@@ -9731,6 +9769,9 @@ __decorate([
9731
9769
  __decorate([
9732
9770
  Output()
9733
9771
  ], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
9772
+ __decorate([
9773
+ Output()
9774
+ ], HistoricalPixAccountListComponent.prototype, "enableEdit", void 0);
9734
9775
  __decorate([
9735
9776
  Input()
9736
9777
  ], HistoricalPixAccountListComponent.prototype, "reloadList", null);