@senior-gestao-pessoas/payroll-core 9.4.0 → 9.5.0-71c63479-42df-4b8e-8295-7f214bdd37f5
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.
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js +950 -522
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +16 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
- package/components/historical-pix-account/historical-pix-account-base.d.ts +27 -0
- package/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.d.ts +8 -40
- package/components/historical-pix-account/historical-pix-account.component.d.ts +37 -8
- package/components/historical-pix-account/historical-pix-account.service.d.ts +1 -0
- package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +11 -2
- package/components/shared/index.d.ts +1 -0
- package/components/shared/shared-state.service.d.ts +17 -0
- package/components/utils/format-utils/format-utils.service.d.ts +30 -3
- package/esm2015/components/historical-pix-account/historical-pix-account-base.js +173 -0
- package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +29 -187
- package/esm2015/components/historical-pix-account/historical-pix-account.component.js +231 -20
- package/esm2015/components/historical-pix-account/historical-pix-account.module.js +5 -1
- package/esm2015/components/historical-pix-account/historical-pix-account.service.js +8 -1
- package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +68 -34
- package/esm2015/components/shared/index.js +2 -0
- package/esm2015/components/shared/shared-state.service.js +41 -0
- package/esm2015/components/utils/format-utils/format-utils.service.js +88 -5
- package/esm2015/public_api.js +2 -1
- package/esm2015/senior-gestao-pessoas-payroll-core.js +3 -2
- package/esm5/components/historical-pix-account/historical-pix-account-base.js +186 -0
- package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +53 -201
- package/esm5/components/historical-pix-account/historical-pix-account.component.js +273 -49
- package/esm5/components/historical-pix-account/historical-pix-account.module.js +5 -1
- package/esm5/components/historical-pix-account/historical-pix-account.service.js +8 -1
- package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +77 -34
- package/esm5/components/shared/index.js +2 -0
- package/esm5/components/shared/shared-state.service.js +42 -0
- package/esm5/components/utils/format-utils/format-utils.service.js +88 -5
- package/esm5/public_api.js +2 -1
- package/esm5/senior-gestao-pessoas-payroll-core.js +3 -2
- package/fesm2015/senior-gestao-pessoas-payroll-core.js +867 -484
- package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js +946 -519
- package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/locale/en-US.json +1 -1
- package/locale/es-ES.json +1 -1
- package/locale/pt-BR.json +1 -1
- package/package.json +2 -32
- package/public_api.d.ts +1 -0
- package/senior-gestao-pessoas-payroll-core.d.ts +2 -1
- package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
|
@@ -36,6 +36,7 @@ import { CurrencyMaskModule } from 'ng2-currency-mask';
|
|
|
36
36
|
import { FieldsetModule } from 'primeng/fieldset';
|
|
37
37
|
import { PanelModule } from 'primeng/panel';
|
|
38
38
|
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
39
|
+
import { TabViewModule } from 'primeng/tabview';
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* Created by Bruno.Curioletti on 30/05/2017.
|
|
@@ -8440,6 +8441,25 @@ class FormatUtilsService {
|
|
|
8440
8441
|
}
|
|
8441
8442
|
return null;
|
|
8442
8443
|
}
|
|
8444
|
+
/**
|
|
8445
|
+
* Retorna o CPF formatado
|
|
8446
|
+
* @param cpf CPF
|
|
8447
|
+
*/
|
|
8448
|
+
static getFormattedCpfEdited(cpf) {
|
|
8449
|
+
if (!cpf)
|
|
8450
|
+
return '';
|
|
8451
|
+
cpf = cpf.replace(/\D/g, '').slice(0, 11);
|
|
8452
|
+
if (cpf.length > 9) {
|
|
8453
|
+
cpf = cpf.replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/, "$1.$2.$3-$4");
|
|
8454
|
+
}
|
|
8455
|
+
else if (cpf.length > 6) {
|
|
8456
|
+
cpf = cpf.replace(/^(\d{3})(\d{3})(\d{0,3})$/, "$1.$2.$3");
|
|
8457
|
+
}
|
|
8458
|
+
else if (cpf.length > 3) {
|
|
8459
|
+
cpf = cpf.replace(/^(\d{3})(\d{0,3})$/, "$1.$2");
|
|
8460
|
+
}
|
|
8461
|
+
return cpf;
|
|
8462
|
+
}
|
|
8443
8463
|
/**
|
|
8444
8464
|
* Retorna o CNPJ formatado
|
|
8445
8465
|
* @param cnpj CNPJ
|
|
@@ -8455,6 +8475,28 @@ class FormatUtilsService {
|
|
|
8455
8475
|
}
|
|
8456
8476
|
return null;
|
|
8457
8477
|
}
|
|
8478
|
+
/**
|
|
8479
|
+
* Retorna o CNPJ formatado
|
|
8480
|
+
* @param cnpj CNPJ
|
|
8481
|
+
*/
|
|
8482
|
+
static getFormattedCnpjEdited(cnpj) {
|
|
8483
|
+
if (!cnpj)
|
|
8484
|
+
return '';
|
|
8485
|
+
cnpj = cnpj.replace(/\D/g, '').slice(0, 14);
|
|
8486
|
+
if (cnpj.length > 12) {
|
|
8487
|
+
cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/, "$1.$2.$3/$4-$5");
|
|
8488
|
+
}
|
|
8489
|
+
else if (cnpj.length > 8) {
|
|
8490
|
+
cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{3})(\d{0,4})$/, "$1.$2.$3/$4");
|
|
8491
|
+
}
|
|
8492
|
+
else if (cnpj.length > 5) {
|
|
8493
|
+
cnpj = cnpj.replace(/^(\d{2})(\d{3})(\d{0,3})$/, "$1.$2.$3");
|
|
8494
|
+
}
|
|
8495
|
+
else if (cnpj.length > 2) {
|
|
8496
|
+
cnpj = cnpj.replace(/^(\d{2})(\d{0,3})$/, "$1.$2");
|
|
8497
|
+
}
|
|
8498
|
+
return cnpj;
|
|
8499
|
+
}
|
|
8458
8500
|
/**
|
|
8459
8501
|
* Retorna a mascara do CPF/CNPJ
|
|
8460
8502
|
* @param key Valores possíveis são CPF ou CNPJ
|
|
@@ -8469,6 +8511,24 @@ class FormatUtilsService {
|
|
|
8469
8511
|
return "";
|
|
8470
8512
|
}
|
|
8471
8513
|
}
|
|
8514
|
+
/**
|
|
8515
|
+
* Método para formatar o número de inscrição do cliente.
|
|
8516
|
+
* @param subscriptionNumber
|
|
8517
|
+
* @param pixKeyType
|
|
8518
|
+
* @returns
|
|
8519
|
+
*/
|
|
8520
|
+
static getFormattedSubscriptionNumber(subscriptionNumber, pixKeyType) {
|
|
8521
|
+
if (!subscriptionNumber || !pixKeyType)
|
|
8522
|
+
return subscriptionNumber;
|
|
8523
|
+
switch (pixKeyType) {
|
|
8524
|
+
case 'CNPJ':
|
|
8525
|
+
return this.getFormattedCnpjEdited(subscriptionNumber);
|
|
8526
|
+
case 'CPF':
|
|
8527
|
+
return this.getFormattedCpfEdited(subscriptionNumber);
|
|
8528
|
+
default:
|
|
8529
|
+
return subscriptionNumber;
|
|
8530
|
+
}
|
|
8531
|
+
}
|
|
8472
8532
|
/**
|
|
8473
8533
|
* Metódo para formatar o número de telefone.
|
|
8474
8534
|
* @param telephoneNumber String contendo o número de telefone.
|
|
@@ -8500,6 +8560,13 @@ class FormatUtilsService {
|
|
|
8500
8560
|
}
|
|
8501
8561
|
return tel;
|
|
8502
8562
|
}
|
|
8563
|
+
/**
|
|
8564
|
+
* Metódo para formatar a porcentagem para 2 casas decimais.
|
|
8565
|
+
* @param value Número a ser formatado.
|
|
8566
|
+
*/
|
|
8567
|
+
static getFormattedPercentage(value) {
|
|
8568
|
+
return parseFloat(value).toFixed(2).replace('.', ',') + '%';
|
|
8569
|
+
}
|
|
8503
8570
|
/**
|
|
8504
8571
|
* Metódo para formatar o número de telefone de um campo Input.
|
|
8505
8572
|
* @param event Evento do Input do campo de telefone.
|
|
@@ -8513,30 +8580,443 @@ class FormatUtilsService {
|
|
|
8513
8580
|
event.target.value = FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
|
|
8514
8581
|
}
|
|
8515
8582
|
/**
|
|
8516
|
-
*
|
|
8517
|
-
* @param
|
|
8583
|
+
* Formata o campo de input de CPF em tempo real.
|
|
8584
|
+
* @param event Evento do input
|
|
8518
8585
|
*/
|
|
8519
|
-
static
|
|
8520
|
-
|
|
8586
|
+
static formatCpfInputEvent(event) {
|
|
8587
|
+
let cpf = event.target.value;
|
|
8588
|
+
// Permite apagar nos pontos sensíveis
|
|
8589
|
+
if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
|
|
8590
|
+
return;
|
|
8591
|
+
}
|
|
8592
|
+
event.target.value = FormatUtilsService.getFormattedCpfEdited(cpf);
|
|
8593
|
+
}
|
|
8594
|
+
/**
|
|
8595
|
+
* Formata o campo de input de CNPJ em tempo real.
|
|
8596
|
+
* @param event Evento do input
|
|
8597
|
+
*/
|
|
8598
|
+
static formatCnpjInputEvent(event) {
|
|
8599
|
+
let cnpj = event.target.value;
|
|
8600
|
+
// Permite apagar nos pontos sensíveis
|
|
8601
|
+
if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
|
|
8602
|
+
return;
|
|
8603
|
+
}
|
|
8604
|
+
event.target.value = FormatUtilsService.getFormattedCnpjEdited(cnpj);
|
|
8605
|
+
}
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8608
|
+
let SharedStateService = class SharedStateService {
|
|
8609
|
+
constructor() {
|
|
8610
|
+
this.hideFieldSubject = new BehaviorSubject(true);
|
|
8611
|
+
this.hideField$ = this.hideFieldSubject.asObservable();
|
|
8612
|
+
this.showButtonSubject = new BehaviorSubject(true);
|
|
8613
|
+
this.showButton$ = this.showButtonSubject.asObservable();
|
|
8614
|
+
this.saveButtonSubject = new BehaviorSubject(true);
|
|
8615
|
+
this.saveButton$ = this.saveButtonSubject.asObservable();
|
|
8616
|
+
this.showEditMode = new BehaviorSubject(true);
|
|
8617
|
+
this.showEditMode$ = this.showEditMode.asObservable();
|
|
8618
|
+
this.activeValidatorsOnEditModalOpen = new Subject();
|
|
8619
|
+
this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
|
|
8620
|
+
}
|
|
8621
|
+
setHideField(value) {
|
|
8622
|
+
this.hideFieldSubject.next(value);
|
|
8623
|
+
}
|
|
8624
|
+
setShowButton(value) {
|
|
8625
|
+
this.showButtonSubject.next(value);
|
|
8626
|
+
}
|
|
8627
|
+
setSaveButton(value) {
|
|
8628
|
+
this.saveButtonSubject.next(value);
|
|
8629
|
+
}
|
|
8630
|
+
setShowEditMode(value) {
|
|
8631
|
+
this.showEditMode.next(value);
|
|
8632
|
+
}
|
|
8633
|
+
triggerActiveValidatorsOnEditModalOpen() {
|
|
8634
|
+
this.activeValidatorsOnEditModalOpen.next();
|
|
8635
|
+
}
|
|
8636
|
+
};
|
|
8637
|
+
SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
|
|
8638
|
+
SharedStateService = __decorate([
|
|
8639
|
+
Injectable({
|
|
8640
|
+
providedIn: 'root',
|
|
8641
|
+
})
|
|
8642
|
+
], SharedStateService);
|
|
8643
|
+
|
|
8644
|
+
class GenericValidator {
|
|
8645
|
+
constructor() { }
|
|
8646
|
+
/**
|
|
8647
|
+
* Valida o CEI (Cadastro específico de INSS) digitado.
|
|
8648
|
+
*/
|
|
8649
|
+
static isValidCei(control) {
|
|
8650
|
+
const cei = control.value;
|
|
8651
|
+
if (!cei)
|
|
8652
|
+
return null;
|
|
8653
|
+
else if (cei.length != 11)
|
|
8654
|
+
return null;
|
|
8655
|
+
const multiplicadorBase = "3298765432";
|
|
8656
|
+
let total = 0;
|
|
8657
|
+
let resto = 0;
|
|
8658
|
+
let multiplicando = 0;
|
|
8659
|
+
let multiplicador = 0;
|
|
8660
|
+
if (cei.length !== 11 ||
|
|
8661
|
+
cei === "00000000000" ||
|
|
8662
|
+
cei === "11111111111" ||
|
|
8663
|
+
cei === "22222222222" ||
|
|
8664
|
+
cei === "33333333333" ||
|
|
8665
|
+
cei === "44444444444" ||
|
|
8666
|
+
cei === "55555555555" ||
|
|
8667
|
+
cei === "66666666666" ||
|
|
8668
|
+
cei === "77777777777" ||
|
|
8669
|
+
cei === "88888888888" ||
|
|
8670
|
+
cei === "99999999999")
|
|
8671
|
+
return { invalidCei: true };
|
|
8672
|
+
else {
|
|
8673
|
+
for (let i = 0; i < 10; i++) {
|
|
8674
|
+
multiplicando = parseInt(cei.substring(i, i + 1), 10);
|
|
8675
|
+
multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
|
|
8676
|
+
total += multiplicando * multiplicador;
|
|
8677
|
+
}
|
|
8678
|
+
resto = 11 - (total % 11);
|
|
8679
|
+
resto = resto === 10 || resto === 11 ? 0 : resto;
|
|
8680
|
+
const digito = parseInt("" + cei.charAt(10), 10);
|
|
8681
|
+
return resto === digito ? null : { invalidCei: true };
|
|
8682
|
+
}
|
|
8683
|
+
}
|
|
8684
|
+
/**
|
|
8685
|
+
* Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
|
|
8686
|
+
*/
|
|
8687
|
+
static isValidCpf(control) {
|
|
8688
|
+
const cpf = control.value;
|
|
8689
|
+
if (cpf) {
|
|
8690
|
+
let numbers, digits, sum, i, result, equalDigits;
|
|
8691
|
+
equalDigits = 1;
|
|
8692
|
+
if (cpf.length < 11) {
|
|
8693
|
+
return null;
|
|
8694
|
+
}
|
|
8695
|
+
for (i = 0; i < cpf.length - 1; i++) {
|
|
8696
|
+
if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
|
|
8697
|
+
equalDigits = 0;
|
|
8698
|
+
break;
|
|
8699
|
+
}
|
|
8700
|
+
}
|
|
8701
|
+
if (!equalDigits) {
|
|
8702
|
+
numbers = cpf.substring(0, 9);
|
|
8703
|
+
digits = cpf.substring(9);
|
|
8704
|
+
sum = 0;
|
|
8705
|
+
for (i = 10; i > 1; i--) {
|
|
8706
|
+
sum += numbers.charAt(10 - i) * i;
|
|
8707
|
+
}
|
|
8708
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8709
|
+
if (result !== Number(digits.charAt(0))) {
|
|
8710
|
+
return { cpfNotValid: true };
|
|
8711
|
+
}
|
|
8712
|
+
numbers = cpf.substring(0, 10);
|
|
8713
|
+
sum = 0;
|
|
8714
|
+
for (i = 11; i > 1; i--) {
|
|
8715
|
+
sum += numbers.charAt(11 - i) * i;
|
|
8716
|
+
}
|
|
8717
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8718
|
+
if (result !== Number(digits.charAt(1))) {
|
|
8719
|
+
return { cpfNotValid: true };
|
|
8720
|
+
}
|
|
8721
|
+
return null;
|
|
8722
|
+
}
|
|
8723
|
+
else {
|
|
8724
|
+
return { cpfNotValid: true };
|
|
8725
|
+
}
|
|
8726
|
+
}
|
|
8727
|
+
return null;
|
|
8728
|
+
}
|
|
8729
|
+
/**
|
|
8730
|
+
* Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
|
|
8731
|
+
*/
|
|
8732
|
+
static isValidCnpj(control) {
|
|
8733
|
+
let cnpj = control.value;
|
|
8734
|
+
if (cnpj) {
|
|
8735
|
+
let size, numbers, digits, sum, pos, result;
|
|
8736
|
+
cnpj = cnpj.replace(/[^\d]+/g, '');
|
|
8737
|
+
if (cnpj.length !== 14) {
|
|
8738
|
+
return null;
|
|
8739
|
+
}
|
|
8740
|
+
// Elimina CNPJs invalidos conhecidos
|
|
8741
|
+
if (cnpj === '00000000000000' ||
|
|
8742
|
+
cnpj === '11111111111111' ||
|
|
8743
|
+
cnpj === '22222222222222' ||
|
|
8744
|
+
cnpj === '33333333333333' ||
|
|
8745
|
+
cnpj === '44444444444444' ||
|
|
8746
|
+
cnpj === '55555555555555' ||
|
|
8747
|
+
cnpj === '66666666666666' ||
|
|
8748
|
+
cnpj === '77777777777777' ||
|
|
8749
|
+
cnpj === '88888888888888' ||
|
|
8750
|
+
cnpj === '99999999999999') {
|
|
8751
|
+
return { cnpjNotValid: true };
|
|
8752
|
+
}
|
|
8753
|
+
// Valida DVs
|
|
8754
|
+
size = cnpj.length - 2;
|
|
8755
|
+
numbers = cnpj.substring(0, size);
|
|
8756
|
+
digits = cnpj.substring(size);
|
|
8757
|
+
sum = 0;
|
|
8758
|
+
pos = size - 7;
|
|
8759
|
+
for (let i = size; i >= 1; i--) {
|
|
8760
|
+
sum += numbers.charAt(size - i) * pos--;
|
|
8761
|
+
if (pos < 2) {
|
|
8762
|
+
pos = 9;
|
|
8763
|
+
}
|
|
8764
|
+
}
|
|
8765
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8766
|
+
if (result !== Number(digits.charAt(0))) {
|
|
8767
|
+
return { cnpjNotValid: true };
|
|
8768
|
+
}
|
|
8769
|
+
size = size + 1;
|
|
8770
|
+
numbers = cnpj.substring(0, size);
|
|
8771
|
+
sum = 0;
|
|
8772
|
+
pos = size - 7;
|
|
8773
|
+
for (let i = size; i >= 1; i--) {
|
|
8774
|
+
sum += numbers.charAt(size - i) * pos--;
|
|
8775
|
+
if (pos < 2) {
|
|
8776
|
+
pos = 9;
|
|
8777
|
+
}
|
|
8778
|
+
}
|
|
8779
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8780
|
+
if (result !== Number(digits.charAt(1))) {
|
|
8781
|
+
return { cnpjNotValid: true };
|
|
8782
|
+
}
|
|
8783
|
+
return null;
|
|
8784
|
+
}
|
|
8785
|
+
return null;
|
|
8786
|
+
}
|
|
8787
|
+
/**
|
|
8788
|
+
* Válida o número de telefone da chave PIX.
|
|
8789
|
+
*/
|
|
8790
|
+
static isValidPhoneNumber(control) {
|
|
8791
|
+
let cellPhoneKey = control.value || '';
|
|
8792
|
+
cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
|
|
8793
|
+
const regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
|
|
8794
|
+
const isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
|
|
8795
|
+
return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
|
|
8796
|
+
}
|
|
8797
|
+
/**
|
|
8798
|
+
* Valida o email da chave PIX.
|
|
8799
|
+
*/
|
|
8800
|
+
static isValidEmail(control) {
|
|
8801
|
+
const emailKey = control.value;
|
|
8802
|
+
const regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
|
|
8803
|
+
const isValidEmail = regexValidEmail.test(emailKey);
|
|
8804
|
+
return isValidEmail ? null : { invalidEmail: true };
|
|
8805
|
+
}
|
|
8806
|
+
}
|
|
8807
|
+
|
|
8808
|
+
class HistoricakPixAccountBase {
|
|
8809
|
+
constructor(formBuilder) {
|
|
8810
|
+
this._paramsForm = new FormGroup({});
|
|
8811
|
+
this._defaultCpfNumber = null;
|
|
8812
|
+
this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
|
|
8813
|
+
this.pixAccountList = [];
|
|
8814
|
+
this.maxValuePercentage = 100.0;
|
|
8815
|
+
this.isShowPixKeyFieldValidatorMessage = false;
|
|
8816
|
+
this.formBuilder = formBuilder;
|
|
8817
|
+
this.createFormGroupBase();
|
|
8818
|
+
}
|
|
8819
|
+
phoneMask(event) {
|
|
8820
|
+
FormatUtilsService.formatTelephoneInputEvent(event);
|
|
8821
|
+
}
|
|
8822
|
+
cpfMask(event) {
|
|
8823
|
+
FormatUtilsService.formatCpfInputEvent(event);
|
|
8824
|
+
}
|
|
8825
|
+
cnpjMask(event) {
|
|
8826
|
+
FormatUtilsService.formatCnpjInputEvent(event);
|
|
8827
|
+
}
|
|
8828
|
+
onChangePixKeyType(item, form) {
|
|
8829
|
+
if (!item || !item.key)
|
|
8830
|
+
return;
|
|
8831
|
+
this.pixKeyType = item.key;
|
|
8832
|
+
const targetForm = (typeof form !== 'undefined' && form !== null)
|
|
8833
|
+
? form
|
|
8834
|
+
: this.pixAccountFormGroup;
|
|
8835
|
+
this.isShowPixKeyFieldValidatorMessage = true;
|
|
8836
|
+
const pixKeyControl = targetForm.get("pixKey");
|
|
8837
|
+
if (pixKeyControl) {
|
|
8838
|
+
pixKeyControl.reset();
|
|
8839
|
+
}
|
|
8840
|
+
this.setPixKeyValidators(true, targetForm);
|
|
8841
|
+
if (item.key === "CPF") {
|
|
8842
|
+
this.setDefaultCpfPixKey(targetForm);
|
|
8843
|
+
}
|
|
8844
|
+
}
|
|
8845
|
+
onClearPixKeyType(form) {
|
|
8846
|
+
var targetForm = (typeof form !== 'undefined' && form !== null)
|
|
8847
|
+
? form
|
|
8848
|
+
: this.pixAccountFormGroup;
|
|
8849
|
+
this.isShowPixKeyFieldValidatorMessage = false;
|
|
8850
|
+
if (targetForm.get("pixKey")) {
|
|
8851
|
+
targetForm.get("pixKey").reset();
|
|
8852
|
+
}
|
|
8853
|
+
}
|
|
8854
|
+
setDefaultCpfPixKey(form) {
|
|
8855
|
+
var targetForm = (typeof form !== 'undefined' && form !== null)
|
|
8856
|
+
? form
|
|
8857
|
+
: this.pixAccountFormGroup;
|
|
8858
|
+
if (this._defaultCpfNumber) {
|
|
8859
|
+
if (targetForm.get("pixKey")) {
|
|
8860
|
+
targetForm.get("pixKey").setValue(this._defaultCpfNumber);
|
|
8861
|
+
}
|
|
8862
|
+
}
|
|
8863
|
+
else {
|
|
8864
|
+
var sheetDocument = this._paramsForm.get("sheetDocument");
|
|
8865
|
+
if (sheetDocument && sheetDocument.get("cpfNumber")) {
|
|
8866
|
+
var cpf = sheetDocument.get("cpfNumber").value;
|
|
8867
|
+
if (cpf && targetForm.get("pixKey")) {
|
|
8868
|
+
targetForm.get("pixKey").setValue(cpf);
|
|
8869
|
+
}
|
|
8870
|
+
}
|
|
8871
|
+
}
|
|
8872
|
+
}
|
|
8873
|
+
createFormGroupBase() {
|
|
8874
|
+
this.pixAccountFormGroup = this.formBuilder.group({
|
|
8875
|
+
id: this.formBuilder.control(null),
|
|
8876
|
+
index: this.formBuilder.control(null),
|
|
8877
|
+
employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
|
|
8878
|
+
dateChange: this.formBuilder.control(null),
|
|
8879
|
+
pixKeyType: this.formBuilder.control(null, Validators.required),
|
|
8880
|
+
pixKey: this.formBuilder.control(null),
|
|
8881
|
+
percentage: this.formBuilder.control(null, Validators.compose([
|
|
8882
|
+
...this.initialValidatorOfPercentage,
|
|
8883
|
+
Validators.max(this.maxValuePercentage),
|
|
8884
|
+
])),
|
|
8885
|
+
externalId: this.formBuilder.control(null),
|
|
8886
|
+
customFields: this.formBuilder.control(null),
|
|
8887
|
+
});
|
|
8888
|
+
}
|
|
8889
|
+
setValidatorsAccordingList(pixAccountList, index = null, isEditMode = true, form) {
|
|
8890
|
+
var targetForm = (typeof form !== 'undefined' && form !== null)
|
|
8891
|
+
? form
|
|
8892
|
+
: this.pixAccountFormGroup;
|
|
8893
|
+
this.pixAccountList = (pixAccountList && pixAccountList.length > 0)
|
|
8894
|
+
? [].concat(pixAccountList)
|
|
8895
|
+
: [];
|
|
8896
|
+
var percentageIncluded = [];
|
|
8897
|
+
for (var i = 0; i < this.pixAccountList.length; i++) {
|
|
8898
|
+
var field = this.pixAccountList[i];
|
|
8899
|
+
if (field && field.percentage && i !== index) {
|
|
8900
|
+
percentageIncluded.push(field.percentage);
|
|
8901
|
+
}
|
|
8902
|
+
}
|
|
8903
|
+
this.beforeSetPixKeyTypeValidator(targetForm);
|
|
8904
|
+
this.setPixKeyValidators(isEditMode, targetForm);
|
|
8905
|
+
this.validatePercentageValid(percentageIncluded, targetForm);
|
|
8906
|
+
}
|
|
8907
|
+
beforeSetPixKeyTypeValidator(form) {
|
|
8908
|
+
const control = form.get("pixKeyType");
|
|
8909
|
+
if (this.pixAccountList && this.pixAccountList.length) {
|
|
8910
|
+
control.setValidators(Validators.compose([
|
|
8911
|
+
Validators.required,
|
|
8912
|
+
this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
|
|
8913
|
+
]));
|
|
8914
|
+
}
|
|
8915
|
+
else {
|
|
8916
|
+
control.setValidators(Validators.required);
|
|
8917
|
+
}
|
|
8918
|
+
control.updateValueAndValidity();
|
|
8919
|
+
}
|
|
8920
|
+
setPixKeyValidators(isEditMode, form) {
|
|
8921
|
+
const pixKey = form.get("pixKey");
|
|
8922
|
+
switch (this.pixKeyType) {
|
|
8923
|
+
case "TELEPHONE":
|
|
8924
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidPhoneNumber]));
|
|
8925
|
+
break;
|
|
8926
|
+
case "EMAIL":
|
|
8927
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidEmail]));
|
|
8928
|
+
break;
|
|
8929
|
+
case "CPF":
|
|
8930
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCpf]));
|
|
8931
|
+
break;
|
|
8932
|
+
case "CNPJ":
|
|
8933
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCnpj]));
|
|
8934
|
+
break;
|
|
8935
|
+
case "RANDOM_KEY":
|
|
8936
|
+
pixKey.setValidators(Validators.required);
|
|
8937
|
+
break;
|
|
8938
|
+
default:
|
|
8939
|
+
pixKey.clearValidators();
|
|
8940
|
+
}
|
|
8941
|
+
if (isEditMode) {
|
|
8942
|
+
pixKey.enable();
|
|
8943
|
+
}
|
|
8944
|
+
pixKey.updateValueAndValidity();
|
|
8945
|
+
}
|
|
8946
|
+
validatePercentageValid(listValue, form) {
|
|
8947
|
+
const percentage = form.get("percentage");
|
|
8948
|
+
this.maxValuePercentage = listValue.reduce((acc, val) => acc - val, 100.0);
|
|
8949
|
+
percentage.setValidators(Validators.compose([
|
|
8950
|
+
...this.initialValidatorOfPercentage,
|
|
8951
|
+
Validators.max(this.maxValuePercentage),
|
|
8952
|
+
]));
|
|
8953
|
+
percentage.updateValueAndValidity();
|
|
8954
|
+
}
|
|
8955
|
+
validateDuplicatePixKeyTypeBankAccount(listCompare) {
|
|
8956
|
+
return (control) => {
|
|
8957
|
+
const value = control.value;
|
|
8958
|
+
const isDuplicate = listCompare.some((field) => value &&
|
|
8959
|
+
field.pixKeyType.key === "BANK_ACCOUNT" &&
|
|
8960
|
+
value.key === "BANK_ACCOUNT");
|
|
8961
|
+
return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
|
|
8962
|
+
};
|
|
8963
|
+
}
|
|
8964
|
+
get paramsForm() {
|
|
8965
|
+
return this._paramsForm;
|
|
8966
|
+
}
|
|
8967
|
+
set paramsForm(value) {
|
|
8968
|
+
this._paramsForm = value;
|
|
8969
|
+
}
|
|
8970
|
+
get defaultCpfNumber() {
|
|
8971
|
+
return this._defaultCpfNumber;
|
|
8972
|
+
}
|
|
8973
|
+
set defaultCpfNumber(value) {
|
|
8974
|
+
this._defaultCpfNumber = value;
|
|
8521
8975
|
}
|
|
8522
8976
|
}
|
|
8523
8977
|
|
|
8524
|
-
let
|
|
8525
|
-
constructor(
|
|
8978
|
+
let HistoricalPixAccountService = class HistoricalPixAccountService {
|
|
8979
|
+
constructor(http) {
|
|
8980
|
+
this.http = http;
|
|
8981
|
+
}
|
|
8982
|
+
query(path, body, service = ServiceType.PAYROLL) {
|
|
8983
|
+
return this.http.query(path, body, service);
|
|
8984
|
+
}
|
|
8985
|
+
enumQuery() {
|
|
8986
|
+
const path = 'enumQuery';
|
|
8987
|
+
const body = {
|
|
8988
|
+
names: ['PixKeyType']
|
|
8989
|
+
};
|
|
8990
|
+
return this.http.query(path, body, ServiceType.PAYROLL);
|
|
8991
|
+
}
|
|
8992
|
+
};
|
|
8993
|
+
HistoricalPixAccountService.ctorParameters = () => [
|
|
8994
|
+
{ type: HttpClientService }
|
|
8995
|
+
];
|
|
8996
|
+
HistoricalPixAccountService = __decorate([
|
|
8997
|
+
Injectable()
|
|
8998
|
+
], HistoricalPixAccountService);
|
|
8999
|
+
|
|
9000
|
+
let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends HistoricakPixAccountBase {
|
|
9001
|
+
constructor(translateService, cd, formBuilder, sharedStateService, service) {
|
|
9002
|
+
super(formBuilder);
|
|
8526
9003
|
this.translateService = translateService;
|
|
8527
9004
|
this.cd = cd;
|
|
8528
|
-
this.
|
|
8529
|
-
this.
|
|
9005
|
+
this.sharedStateService = sharedStateService;
|
|
9006
|
+
this.service = service;
|
|
8530
9007
|
this.recordByRow = 1;
|
|
8531
9008
|
this.showDateChange = false;
|
|
8532
9009
|
this.isEditMode = false;
|
|
8533
9010
|
this.isViewMode = false;
|
|
8534
9011
|
this.withSideBar = true;
|
|
8535
|
-
this.defaultCpfNumber = null;
|
|
8536
9012
|
this.listDataReciever = [];
|
|
9013
|
+
this.addExistentHistoricData = [];
|
|
9014
|
+
this.getListPixAccount = [];
|
|
9015
|
+
this.isEditModeForSave = false;
|
|
8537
9016
|
this.isViewModeActive = new EventEmitter();
|
|
8538
9017
|
this.isEditModeActive = new EventEmitter();
|
|
8539
9018
|
this.isDeleteModeActive = new EventEmitter();
|
|
9019
|
+
this.isValidChangeForm = new EventEmitter();
|
|
8540
9020
|
this.listFromApp = [];
|
|
8541
9021
|
this.visibleChange = new EventEmitter();
|
|
8542
9022
|
this.ngUnsubscribe = new Subject();
|
|
@@ -8550,6 +9030,13 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8550
9030
|
this.loading = true;
|
|
8551
9031
|
this.listData = [];
|
|
8552
9032
|
this.listDataNoPage = [];
|
|
9033
|
+
this.showButtonView = true;
|
|
9034
|
+
this.showEditMode = false;
|
|
9035
|
+
this.hasRecordsPix = true;
|
|
9036
|
+
this.maxValuePercentage = 100.00;
|
|
9037
|
+
this.hideFields = this.sharedStateService.hideField$;
|
|
9038
|
+
this.suggestions = [];
|
|
9039
|
+
this.formGroupByRow = {};
|
|
8553
9040
|
this.cols = [
|
|
8554
9041
|
{
|
|
8555
9042
|
label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
|
|
@@ -8563,6 +9050,10 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8563
9050
|
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
|
|
8564
9051
|
field: "percentage",
|
|
8565
9052
|
},
|
|
9053
|
+
{
|
|
9054
|
+
label: this.translateService.instant("hcm.payroll.movimentation_generic_action"),
|
|
9055
|
+
field: "actions",
|
|
9056
|
+
}
|
|
8566
9057
|
];
|
|
8567
9058
|
this.actions = (rowData = {}, key) => {
|
|
8568
9059
|
return [
|
|
@@ -8600,7 +9091,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8600
9091
|
},
|
|
8601
9092
|
},
|
|
8602
9093
|
{
|
|
8603
|
-
visible: !this.isEditMode,
|
|
9094
|
+
visible: !this.isEditMode || this.showEditMode,
|
|
8604
9095
|
label: this.translateService.instant("hcm.payroll.delete"),
|
|
8605
9096
|
command: () => {
|
|
8606
9097
|
if (this.isAllowToDeleteHistorical) {
|
|
@@ -8622,23 +9113,137 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8622
9113
|
}
|
|
8623
9114
|
ngOnInit() {
|
|
8624
9115
|
this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
|
|
9116
|
+
this.sharedStateService.showButton$.subscribe((value) => {
|
|
9117
|
+
this.showButtonView = value;
|
|
9118
|
+
});
|
|
9119
|
+
this.sharedStateService.showEditMode$.subscribe((value) => {
|
|
9120
|
+
this.showEditMode = value;
|
|
9121
|
+
this.isEditModeForSave = value;
|
|
9122
|
+
});
|
|
9123
|
+
this.sharedStateService.activeValidatorsOnEditModalOpen$
|
|
9124
|
+
.subscribe(() => {
|
|
9125
|
+
Object.values(this.formGroupByRow).forEach(fg => {
|
|
9126
|
+
Object.values(fg.controls).forEach(control => {
|
|
9127
|
+
control.markAsTouched();
|
|
9128
|
+
control.updateValueAndValidity();
|
|
9129
|
+
});
|
|
9130
|
+
});
|
|
9131
|
+
this.emitFormValidity();
|
|
9132
|
+
});
|
|
8625
9133
|
}
|
|
8626
9134
|
ngOnChanges(changes) {
|
|
8627
9135
|
if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
|
|
8628
9136
|
this.listFromApp = changes['listDataReciever'].currentValue;
|
|
8629
9137
|
}
|
|
9138
|
+
if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
|
|
9139
|
+
this.getHistoricalPixAccountList();
|
|
9140
|
+
}
|
|
9141
|
+
if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
|
|
9142
|
+
const newData = changes['addExistentHistoricData'].currentValue;
|
|
9143
|
+
this.rebuildFormGroupMap(newData);
|
|
9144
|
+
}
|
|
8630
9145
|
}
|
|
8631
9146
|
createFormGroup() {
|
|
8632
9147
|
this.historicalPixAccountList = this.formBuilder.group({
|
|
8633
9148
|
historicalPixAccountList: this.formBuilder.control(null),
|
|
8634
9149
|
});
|
|
8635
9150
|
}
|
|
8636
|
-
ngOnDestroy() {
|
|
8637
|
-
this.ngUnsubscribe.next();
|
|
8638
|
-
this.ngUnsubscribe.complete();
|
|
9151
|
+
ngOnDestroy() {
|
|
9152
|
+
this.ngUnsubscribe.next();
|
|
9153
|
+
this.ngUnsubscribe.complete();
|
|
9154
|
+
}
|
|
9155
|
+
ngAfterViewInit() {
|
|
9156
|
+
this.cd.detectChanges();
|
|
9157
|
+
}
|
|
9158
|
+
emitFormValidity() {
|
|
9159
|
+
const allValid = Object.values(this.formGroupByRow).every(fg => {
|
|
9160
|
+
fg.updateValueAndValidity();
|
|
9161
|
+
return fg.valid;
|
|
9162
|
+
});
|
|
9163
|
+
this.isValidChangeForm.emit(allValid);
|
|
9164
|
+
}
|
|
9165
|
+
filterPixKeyType(event) {
|
|
9166
|
+
const query = event.query;
|
|
9167
|
+
this.service.enumQuery().subscribe((response) => {
|
|
9168
|
+
const pixKeyTypeEnum = response.results.find((result) => result.enumName === 'PixKeyType');
|
|
9169
|
+
if (pixKeyTypeEnum) {
|
|
9170
|
+
this.suggestions = pixKeyTypeEnum.items.filter((item) => item.value.toLowerCase().includes(query.toLowerCase()));
|
|
9171
|
+
}
|
|
9172
|
+
else {
|
|
9173
|
+
this.suggestions = [];
|
|
9174
|
+
}
|
|
9175
|
+
});
|
|
9176
|
+
}
|
|
9177
|
+
createPixRowFormGroup() {
|
|
9178
|
+
return this.formBuilder.group({
|
|
9179
|
+
pixKeyType: [null, Validators.required],
|
|
9180
|
+
pixKey: [null],
|
|
9181
|
+
percentage: [0, Validators.compose([
|
|
9182
|
+
...this.initialValidatorOfPercentage,
|
|
9183
|
+
Validators.max(this.maxValuePercentage),
|
|
9184
|
+
])]
|
|
9185
|
+
});
|
|
9186
|
+
}
|
|
9187
|
+
onPixKeyInput(event, index) {
|
|
9188
|
+
const inputValue = event.target.value;
|
|
9189
|
+
const inputRawValue = inputValue.replace(/\D/g, '');
|
|
9190
|
+
const form = this.formGroupByRow[index];
|
|
9191
|
+
const pixKeyControl = form.get('pixKey');
|
|
9192
|
+
if (pixKeyControl) {
|
|
9193
|
+
pixKeyControl.setValue(inputRawValue, { emitEvent: false });
|
|
9194
|
+
pixKeyControl.markAsDirty();
|
|
9195
|
+
pixKeyControl.updateValueAndValidity();
|
|
9196
|
+
}
|
|
9197
|
+
this.setPixKeyValidators(true, form);
|
|
9198
|
+
this.emitFormValidity();
|
|
9199
|
+
}
|
|
9200
|
+
onBlurPixCpfAndCnpj(index) {
|
|
9201
|
+
const form = this.formGroupByRow[index];
|
|
9202
|
+
const pixKeyControl = form.get('pixKey');
|
|
9203
|
+
const pixKeyTypeControl = form.get('pixKeyType');
|
|
9204
|
+
if (!pixKeyControl || !pixKeyTypeControl)
|
|
9205
|
+
return;
|
|
9206
|
+
const currentValue = pixKeyControl.value;
|
|
9207
|
+
const pixKeyType = pixKeyTypeControl.value.key;
|
|
9208
|
+
const rawValue = (currentValue || '').replace(/\D/g, '');
|
|
9209
|
+
pixKeyControl.setValue(rawValue, { emitEvent: false });
|
|
9210
|
+
if (pixKeyControl.valid) {
|
|
9211
|
+
form.patchValue({
|
|
9212
|
+
pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
|
|
9213
|
+
});
|
|
9214
|
+
}
|
|
9215
|
+
this.emitFormValidity();
|
|
9216
|
+
}
|
|
9217
|
+
getFormattedPixKey(type, value) {
|
|
9218
|
+
return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
|
|
9219
|
+
}
|
|
9220
|
+
syncPixDataToParentForm() {
|
|
9221
|
+
if (!this.isEditModeForSave)
|
|
9222
|
+
return;
|
|
9223
|
+
const values = Object.values(this.formGroupByRow).map(fg => {
|
|
9224
|
+
const value = fg.getRawValue();
|
|
9225
|
+
const pixKeyType = value.pixKeyType.key;
|
|
9226
|
+
if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
|
|
9227
|
+
value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
|
|
9228
|
+
}
|
|
9229
|
+
else if (pixKeyType === 'TELEPHONE') {
|
|
9230
|
+
value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
|
|
9231
|
+
}
|
|
9232
|
+
return value;
|
|
9233
|
+
});
|
|
9234
|
+
this.formGroup
|
|
9235
|
+
.get(this.fieldFormGroup)
|
|
9236
|
+
.get('historicalPixAccountList')
|
|
9237
|
+
.setValue(values);
|
|
9238
|
+
this.emitFormValidity();
|
|
8639
9239
|
}
|
|
8640
|
-
|
|
8641
|
-
this.
|
|
9240
|
+
syncResetPixFormToParent() {
|
|
9241
|
+
this.formGroupByRow = {};
|
|
9242
|
+
this.historicalPixAccountList.reset();
|
|
9243
|
+
this.historicalPixAccountList.get('historicalPixAccountList').setValue([]);
|
|
9244
|
+
if (this.addExistentHistoricData.length) {
|
|
9245
|
+
this.rebuildFormGroupMap(this.addExistentHistoricData);
|
|
9246
|
+
}
|
|
8642
9247
|
}
|
|
8643
9248
|
onLazyLoad(event) {
|
|
8644
9249
|
const first = event && event.first ? event.first : 0;
|
|
@@ -8666,6 +9271,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8666
9271
|
this.refreshCssInIE11();
|
|
8667
9272
|
}
|
|
8668
9273
|
this.loading = false;
|
|
9274
|
+
this.cd.detectChanges();
|
|
8669
9275
|
}
|
|
8670
9276
|
/**
|
|
8671
9277
|
* Um Bug de CSS que acontece nas linhas da tabela, que resolve só atualizando qualquer parte do CSS da pagina.
|
|
@@ -8683,12 +9289,60 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8683
9289
|
this.pixAccountItemInput = {};
|
|
8684
9290
|
this.visible = true;
|
|
8685
9291
|
}
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
9292
|
+
addPix() {
|
|
9293
|
+
const newItem = {
|
|
9294
|
+
pixKeyType: {},
|
|
9295
|
+
pixKey: '',
|
|
9296
|
+
percentage: 0
|
|
9297
|
+
};
|
|
9298
|
+
const index = this.addExistentHistoricData.length;
|
|
9299
|
+
this.addExistentHistoricData = [
|
|
9300
|
+
...this.addExistentHistoricData,
|
|
9301
|
+
newItem
|
|
9302
|
+
];
|
|
9303
|
+
this.formGroupByRow[index] = this.createPixRowFormGroup();
|
|
9304
|
+
this.setValidatorsAccordingList(this.addExistentHistoricData, index, true);
|
|
9305
|
+
this.emitFormValidity();
|
|
9306
|
+
}
|
|
9307
|
+
deletePix(index) {
|
|
9308
|
+
this.addExistentHistoricData = this.addExistentHistoricData.filter((_, i) => i !== index);
|
|
9309
|
+
this.rebuildFormGroupMap(this.addExistentHistoricData);
|
|
9310
|
+
this.emitFormValidity();
|
|
9311
|
+
}
|
|
9312
|
+
rebuildFormGroupMap(data) {
|
|
9313
|
+
this.formGroupByRow = {};
|
|
9314
|
+
data.forEach((item, index) => {
|
|
9315
|
+
const form = this.createPixRowFormGroup();
|
|
9316
|
+
const pixKeyType = item.pixKeyType.key;
|
|
9317
|
+
const pixKeyRaw = item.pixKey;
|
|
9318
|
+
if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
|
|
9319
|
+
item.pixKey = FormatUtilsService.getFormattedSubscriptionNumber(pixKeyRaw, pixKeyType);
|
|
9320
|
+
}
|
|
9321
|
+
if (pixKeyType === 'TELEPHONE') {
|
|
9322
|
+
item.pixKey = FormatUtilsService.getFormattedTelephoneNumber(pixKeyRaw);
|
|
9323
|
+
}
|
|
9324
|
+
form.patchValue(item);
|
|
9325
|
+
this.formGroupByRow[index] = form;
|
|
9326
|
+
this.pixKeyType = pixKeyType;
|
|
9327
|
+
this.setPixKeyValidators(true, form);
|
|
9328
|
+
this.setValidatorsAccordingList(data, index, this.isEditMode);
|
|
9329
|
+
});
|
|
9330
|
+
this.emitFormValidity();
|
|
9331
|
+
}
|
|
9332
|
+
onPixKeyTypeChange(item, index) {
|
|
9333
|
+
const form = this.formGroupByRow[index];
|
|
9334
|
+
this.onChangePixKeyType(item, form);
|
|
9335
|
+
this.addExistentHistoricData[index].pixKey = '';
|
|
9336
|
+
setTimeout(() => {
|
|
9337
|
+
if (this.dataListPix.editingCell) {
|
|
9338
|
+
this.dataListPix.editingCell = null;
|
|
9339
|
+
}
|
|
8691
9340
|
});
|
|
9341
|
+
this.cd.detectChanges();
|
|
9342
|
+
}
|
|
9343
|
+
onPixKeyTypeClear(index) {
|
|
9344
|
+
const form = this.formGroupByRow[index];
|
|
9345
|
+
this.onClearPixKeyType(form);
|
|
8692
9346
|
}
|
|
8693
9347
|
deleteAnnuityItem(index) {
|
|
8694
9348
|
let newlist = [...this.getHistoricalPixAccountList()];
|
|
@@ -8750,6 +9404,15 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8750
9404
|
this.msgTotalLimitByPercentage = null;
|
|
8751
9405
|
}
|
|
8752
9406
|
}
|
|
9407
|
+
onSyncValue(field, index) {
|
|
9408
|
+
if (this.formGroupByRow &&
|
|
9409
|
+
this.formGroupByRow[index] &&
|
|
9410
|
+
this.formGroupByRow[index].get(field)) {
|
|
9411
|
+
const value = this.formGroupByRow[index].get(field).value;
|
|
9412
|
+
this.addExistentHistoricData[index][field] = value;
|
|
9413
|
+
}
|
|
9414
|
+
this.emitFormValidity();
|
|
9415
|
+
}
|
|
8753
9416
|
get scopedActions() {
|
|
8754
9417
|
return this.actions.bind(this);
|
|
8755
9418
|
}
|
|
@@ -8786,6 +9449,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8786
9449
|
get visible() {
|
|
8787
9450
|
return this._visible;
|
|
8788
9451
|
}
|
|
9452
|
+
set paramsForm(value) {
|
|
9453
|
+
this._paramsForm = value;
|
|
9454
|
+
}
|
|
9455
|
+
set defaultCpfNumber(value) {
|
|
9456
|
+
this._defaultCpfNumber = value;
|
|
9457
|
+
}
|
|
8789
9458
|
set visible(value) {
|
|
8790
9459
|
this._visible = value;
|
|
8791
9460
|
this.visibleChange.emit(this.visible);
|
|
@@ -8822,11 +9491,15 @@ HistoricalPixAccountComponent.ctorParameters = () => [
|
|
|
8822
9491
|
{ type: TranslateService },
|
|
8823
9492
|
{ type: ChangeDetectorRef },
|
|
8824
9493
|
{ type: FormBuilder },
|
|
8825
|
-
{ type:
|
|
9494
|
+
{ type: SharedStateService },
|
|
9495
|
+
{ type: HistoricalPixAccountService }
|
|
8826
9496
|
];
|
|
8827
9497
|
__decorate([
|
|
8828
9498
|
ViewChild(CustomFieldsComponent$1, { static: false })
|
|
8829
9499
|
], HistoricalPixAccountComponent.prototype, "customFields", void 0);
|
|
9500
|
+
__decorate([
|
|
9501
|
+
ViewChild('dataListPix', { static: false })
|
|
9502
|
+
], HistoricalPixAccountComponent.prototype, "dataListPix", void 0);
|
|
8830
9503
|
__decorate([
|
|
8831
9504
|
Input()
|
|
8832
9505
|
], HistoricalPixAccountComponent.prototype, "formGroup", void 0);
|
|
@@ -8841,259 +9514,103 @@ __decorate([
|
|
|
8841
9514
|
], HistoricalPixAccountComponent.prototype, "_displayDateChange", void 0);
|
|
8842
9515
|
__decorate([
|
|
8843
9516
|
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, "
|
|
8872
|
-
__decorate([
|
|
8873
|
-
Input()
|
|
8874
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8875
|
-
__decorate([
|
|
8876
|
-
Input()
|
|
8877
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8878
|
-
__decorate([
|
|
8879
|
-
Input()
|
|
8880
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8881
|
-
__decorate([
|
|
8882
|
-
|
|
8883
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8884
|
-
__decorate([
|
|
8885
|
-
Output()
|
|
8886
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8887
|
-
__decorate([
|
|
8888
|
-
Output()
|
|
8889
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8890
|
-
__decorate([
|
|
8891
|
-
|
|
8892
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8893
|
-
__decorate([
|
|
8894
|
-
|
|
8895
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8896
|
-
__decorate([
|
|
8897
|
-
Input()
|
|
8898
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8899
|
-
__decorate([
|
|
8900
|
-
Input()
|
|
8901
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
if (!cei)
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
const multiplicadorBase = "3298765432";
|
|
8923
|
-
let total = 0;
|
|
8924
|
-
let resto = 0;
|
|
8925
|
-
let multiplicando = 0;
|
|
8926
|
-
let multiplicador = 0;
|
|
8927
|
-
if (cei.length !== 11 ||
|
|
8928
|
-
cei === "00000000000" ||
|
|
8929
|
-
cei === "11111111111" ||
|
|
8930
|
-
cei === "22222222222" ||
|
|
8931
|
-
cei === "33333333333" ||
|
|
8932
|
-
cei === "44444444444" ||
|
|
8933
|
-
cei === "55555555555" ||
|
|
8934
|
-
cei === "66666666666" ||
|
|
8935
|
-
cei === "77777777777" ||
|
|
8936
|
-
cei === "88888888888" ||
|
|
8937
|
-
cei === "99999999999")
|
|
8938
|
-
return { invalidCei: true };
|
|
8939
|
-
else {
|
|
8940
|
-
for (let i = 0; i < 10; i++) {
|
|
8941
|
-
multiplicando = parseInt(cei.substring(i, i + 1), 10);
|
|
8942
|
-
multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
|
|
8943
|
-
total += multiplicando * multiplicador;
|
|
8944
|
-
}
|
|
8945
|
-
resto = 11 - (total % 11);
|
|
8946
|
-
resto = resto === 10 || resto === 11 ? 0 : resto;
|
|
8947
|
-
const digito = parseInt("" + cei.charAt(10), 10);
|
|
8948
|
-
return resto === digito ? null : { invalidCei: true };
|
|
8949
|
-
}
|
|
8950
|
-
}
|
|
8951
|
-
/**
|
|
8952
|
-
* Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
|
|
8953
|
-
*/
|
|
8954
|
-
static isValidCpf(control) {
|
|
8955
|
-
const cpf = control.value;
|
|
8956
|
-
if (cpf) {
|
|
8957
|
-
let numbers, digits, sum, i, result, equalDigits;
|
|
8958
|
-
equalDigits = 1;
|
|
8959
|
-
if (cpf.length < 11) {
|
|
8960
|
-
return null;
|
|
8961
|
-
}
|
|
8962
|
-
for (i = 0; i < cpf.length - 1; i++) {
|
|
8963
|
-
if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
|
|
8964
|
-
equalDigits = 0;
|
|
8965
|
-
break;
|
|
8966
|
-
}
|
|
8967
|
-
}
|
|
8968
|
-
if (!equalDigits) {
|
|
8969
|
-
numbers = cpf.substring(0, 9);
|
|
8970
|
-
digits = cpf.substring(9);
|
|
8971
|
-
sum = 0;
|
|
8972
|
-
for (i = 10; i > 1; i--) {
|
|
8973
|
-
sum += numbers.charAt(10 - i) * i;
|
|
8974
|
-
}
|
|
8975
|
-
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8976
|
-
if (result !== Number(digits.charAt(0))) {
|
|
8977
|
-
return { cpfNotValid: true };
|
|
8978
|
-
}
|
|
8979
|
-
numbers = cpf.substring(0, 10);
|
|
8980
|
-
sum = 0;
|
|
8981
|
-
for (i = 11; i > 1; i--) {
|
|
8982
|
-
sum += numbers.charAt(11 - i) * i;
|
|
8983
|
-
}
|
|
8984
|
-
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8985
|
-
if (result !== Number(digits.charAt(1))) {
|
|
8986
|
-
return { cpfNotValid: true };
|
|
8987
|
-
}
|
|
8988
|
-
return null;
|
|
8989
|
-
}
|
|
8990
|
-
else {
|
|
8991
|
-
return { cpfNotValid: true };
|
|
8992
|
-
}
|
|
8993
|
-
}
|
|
8994
|
-
return null;
|
|
8995
|
-
}
|
|
8996
|
-
/**
|
|
8997
|
-
* Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
|
|
8998
|
-
*/
|
|
8999
|
-
static isValidCnpj(control) {
|
|
9000
|
-
let cnpj = control.value;
|
|
9001
|
-
if (cnpj) {
|
|
9002
|
-
let size, numbers, digits, sum, pos, result;
|
|
9003
|
-
cnpj = cnpj.replace(/[^\d]+/g, '');
|
|
9004
|
-
if (cnpj.length !== 14) {
|
|
9005
|
-
return null;
|
|
9006
|
-
}
|
|
9007
|
-
// Elimina CNPJs invalidos conhecidos
|
|
9008
|
-
if (cnpj === '00000000000000' ||
|
|
9009
|
-
cnpj === '11111111111111' ||
|
|
9010
|
-
cnpj === '22222222222222' ||
|
|
9011
|
-
cnpj === '33333333333333' ||
|
|
9012
|
-
cnpj === '44444444444444' ||
|
|
9013
|
-
cnpj === '55555555555555' ||
|
|
9014
|
-
cnpj === '66666666666666' ||
|
|
9015
|
-
cnpj === '77777777777777' ||
|
|
9016
|
-
cnpj === '88888888888888' ||
|
|
9017
|
-
cnpj === '99999999999999') {
|
|
9018
|
-
return { cnpjNotValid: true };
|
|
9019
|
-
}
|
|
9020
|
-
// Valida DVs
|
|
9021
|
-
size = cnpj.length - 2;
|
|
9022
|
-
numbers = cnpj.substring(0, size);
|
|
9023
|
-
digits = cnpj.substring(size);
|
|
9024
|
-
sum = 0;
|
|
9025
|
-
pos = size - 7;
|
|
9026
|
-
for (let i = size; i >= 1; i--) {
|
|
9027
|
-
sum += numbers.charAt(size - i) * pos--;
|
|
9028
|
-
if (pos < 2) {
|
|
9029
|
-
pos = 9;
|
|
9030
|
-
}
|
|
9031
|
-
}
|
|
9032
|
-
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
9033
|
-
if (result !== Number(digits.charAt(0))) {
|
|
9034
|
-
return { cnpjNotValid: true };
|
|
9035
|
-
}
|
|
9036
|
-
size = size + 1;
|
|
9037
|
-
numbers = cnpj.substring(0, size);
|
|
9038
|
-
sum = 0;
|
|
9039
|
-
pos = size - 7;
|
|
9040
|
-
for (let i = size; i >= 1; i--) {
|
|
9041
|
-
sum += numbers.charAt(size - i) * pos--;
|
|
9042
|
-
if (pos < 2) {
|
|
9043
|
-
pos = 9;
|
|
9044
|
-
}
|
|
9045
|
-
}
|
|
9046
|
-
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
9047
|
-
if (result !== Number(digits.charAt(1))) {
|
|
9048
|
-
return { cnpjNotValid: true };
|
|
9049
|
-
}
|
|
9050
|
-
return null;
|
|
9051
|
-
}
|
|
9052
|
-
return null;
|
|
9053
|
-
}
|
|
9054
|
-
/**
|
|
9055
|
-
* Válida o número de telefone da chave PIX.
|
|
9056
|
-
*/
|
|
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 };
|
|
9063
|
-
}
|
|
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 };
|
|
9072
|
-
}
|
|
9073
|
-
}
|
|
9517
|
+
], HistoricalPixAccountComponent.prototype, "recordByRow", void 0);
|
|
9518
|
+
__decorate([
|
|
9519
|
+
Input()
|
|
9520
|
+
], HistoricalPixAccountComponent.prototype, "showDateChange", void 0);
|
|
9521
|
+
__decorate([
|
|
9522
|
+
Input()
|
|
9523
|
+
], HistoricalPixAccountComponent.prototype, "msgTooltipAdd", void 0);
|
|
9524
|
+
__decorate([
|
|
9525
|
+
Input()
|
|
9526
|
+
], HistoricalPixAccountComponent.prototype, "isEditMode", void 0);
|
|
9527
|
+
__decorate([
|
|
9528
|
+
Input()
|
|
9529
|
+
], HistoricalPixAccountComponent.prototype, "isViewMode", void 0);
|
|
9530
|
+
__decorate([
|
|
9531
|
+
Input()
|
|
9532
|
+
], HistoricalPixAccountComponent.prototype, "currency", void 0);
|
|
9533
|
+
__decorate([
|
|
9534
|
+
Input()
|
|
9535
|
+
], HistoricalPixAccountComponent.prototype, "customEntity", void 0);
|
|
9536
|
+
__decorate([
|
|
9537
|
+
Input()
|
|
9538
|
+
], HistoricalPixAccountComponent.prototype, "customService", void 0);
|
|
9539
|
+
__decorate([
|
|
9540
|
+
Input()
|
|
9541
|
+
], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
|
|
9542
|
+
__decorate([
|
|
9543
|
+
Input()
|
|
9544
|
+
], HistoricalPixAccountComponent.prototype, "permission", void 0);
|
|
9545
|
+
__decorate([
|
|
9546
|
+
Input()
|
|
9547
|
+
], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
|
|
9548
|
+
__decorate([
|
|
9549
|
+
Input()
|
|
9550
|
+
], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
|
|
9551
|
+
__decorate([
|
|
9552
|
+
Input()
|
|
9553
|
+
], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
|
|
9554
|
+
__decorate([
|
|
9555
|
+
Input()
|
|
9556
|
+
], HistoricalPixAccountComponent.prototype, "isEditModeForSave", void 0);
|
|
9557
|
+
__decorate([
|
|
9558
|
+
Output()
|
|
9559
|
+
], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
|
|
9560
|
+
__decorate([
|
|
9561
|
+
Output()
|
|
9562
|
+
], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
|
|
9563
|
+
__decorate([
|
|
9564
|
+
Output()
|
|
9565
|
+
], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
|
|
9566
|
+
__decorate([
|
|
9567
|
+
Output()
|
|
9568
|
+
], HistoricalPixAccountComponent.prototype, "isValidChangeForm", void 0);
|
|
9569
|
+
__decorate([
|
|
9570
|
+
Input()
|
|
9571
|
+
], HistoricalPixAccountComponent.prototype, "dateChange", null);
|
|
9572
|
+
__decorate([
|
|
9573
|
+
Input()
|
|
9574
|
+
], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
|
|
9575
|
+
__decorate([
|
|
9576
|
+
Input()
|
|
9577
|
+
], HistoricalPixAccountComponent.prototype, "addListData", null);
|
|
9578
|
+
__decorate([
|
|
9579
|
+
Input()
|
|
9580
|
+
], HistoricalPixAccountComponent.prototype, "visible", null);
|
|
9581
|
+
__decorate([
|
|
9582
|
+
Input()
|
|
9583
|
+
], HistoricalPixAccountComponent.prototype, "paramsForm", null);
|
|
9584
|
+
__decorate([
|
|
9585
|
+
Input()
|
|
9586
|
+
], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
|
|
9587
|
+
HistoricalPixAccountComponent = __decorate([
|
|
9588
|
+
Component({
|
|
9589
|
+
// tslint:disable-next-line:component-selector
|
|
9590
|
+
selector: "c-historical-pix-account",
|
|
9591
|
+
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 *ngIf=\"!showEditMode || !(hideFields | async)\" 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=\"showButtonView\" [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=\"showButtonView\" 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 && showButtonView\">\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\n<!-- Template exlusivo para edi\u00E7\u00E3o de pix via modal-->\n<div *ngIf=\"showEditMode && (hideFields | async)\" class=\"ui-g-12\">\n <!-- Bot\u00E3o Adicionar -->\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n id=\"btn-save\"\n label=\"{{ 'hcm.payroll.historical_pix_account_add' | translate}}\"\n priority=\"primary\"\n (onClick)=\"addPix()\">\n </s-button>\n </div>\n </div>\n\n <!-- Tabela -->\n <p-table #dataListPix sortField=\"percentage\"\n [columns]=\"cols\"\n [value]=\"addExistentHistoricData\"\n [pageLinks]=\"3\"\n [paginator]=\"true\"\n [responsive]=\"true\"\n [rows]=\"10\"\n [resetPageOnSort]=\"false\"\n [tableStyle]=\"{'margin-top': '2rem'}\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\">\n {{ col.label }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"rowIndex\">\n <ng-container *ngIf=\"formGroupByRow[rowIndex]\" [formGroup]=\"formGroupByRow[rowIndex]\">\n <tr>\n <!-- Tipo de Chave -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKeyType\" pEditableColumnField=\"pixKeyType\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div style=\"width: 100%; position: relative;\">\n <p-autoComplete\n [suggestions]=\"suggestions\"\n (completeMethod)=\"filterPixKeyType($event)\"\n formControlName=\"pixKeyType\"\n [dropdown]=\"true\"\n (onSelect)=\"onPixKeyTypeChange($event, rowIndex)\"\n (onClear)=\"onPixKeyTypeClear(rowIndex)\"\n (ngModelChange)=\"onSyncValue('pixKeyType', rowIndex)\"\n field=\"value\"\n placeholder=\"{{'hcm.payroll.select' | translate}}\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n ></p-autoComplete>\n\n <s-control-errors [control]=\"formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.pixKeyType?.value }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Chave Pix -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT',\n 'disabled': item.pixKeyType && item.pixKeyType.key === 'BANK_ACCOUNT'\n }\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (keyup)=\"phoneMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\" />\n\n <input *ngSwitchCase=\"'CPF'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"14\"\n placeholder=\"___.___.___-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cpfMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'CNPJ'\"\n type=\"text\"\n pInputText\n formControlName=\"pixKey\"\n maxlength=\"18\"\n placeholder=\"___.___.___/____-__\"\n (input)=\"onPixKeyInput($event, rowIndex)\"\n (blur)=\"onBlurPixCpfAndCnpj(rowIndex)\"\n (keyup)=\"cnpjMask($event)\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\" />\n\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n placeholder=\"{{ 'hcm.payroll.employees_addition_email' | translate }}\" />\n\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n [disabled]=\"true\" />\n\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n formControlName=\"pixKey\"\n (ngModelChange)=\"onSyncValue('pixKey', rowIndex)\"\n maxlength=\"100\" />\n </ng-container>\n\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\n [control]=\"formGroupByRow[rowIndex]?.get('pixKey')\"\n [errorMessages]=\"{\n required: 'hcm.payroll.required' | translate,\n invalidPhoneNumber: 'hcm.payroll.employees_addition_invalid_phone_number' | translate: { value: formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ getFormattedPixKey(item.pixKeyType?.key, item.pixKey) }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\"\n [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText type=\"number\"\n formControlName=\"percentage\"\n (ngModelChange)=\"onSyncValue('percentage', rowIndex)\"\n >\n <s-control-errors\n [control]=\"formGroupByRow[rowIndex]?.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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage?.toFixed(2).replace('.', ',') }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button\n id=\"btn-delete\"\n label=\"{{ 'hcm.payroll.delete' | translate }}\"\n priority=\"default\"\n (onClick)=\"deletePix(rowIndex)\">\n </s-button>\n </td>\n </tr>\n </ng-container>\n </ng-template>\n </p-table>\n</div>\n",
|
|
9592
|
+
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}"]
|
|
9593
|
+
})
|
|
9594
|
+
], HistoricalPixAccountComponent);
|
|
9074
9595
|
|
|
9075
|
-
let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent {
|
|
9076
|
-
constructor(formBuilder, cd) {
|
|
9077
|
-
|
|
9596
|
+
let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent extends HistoricakPixAccountBase {
|
|
9597
|
+
constructor(formBuilder, cd, sharedStateService) {
|
|
9598
|
+
super(formBuilder);
|
|
9078
9599
|
this.cd = cd;
|
|
9600
|
+
this.sharedStateService = sharedStateService;
|
|
9079
9601
|
this.withSideBar = true;
|
|
9080
9602
|
this.isEditMode = false;
|
|
9081
|
-
this.paramsForm = new FormGroup({});
|
|
9082
|
-
this.defaultCpfNumber = null;
|
|
9083
9603
|
this.visibleChange = new EventEmitter();
|
|
9084
9604
|
this.pixAccountItemToList = new EventEmitter();
|
|
9085
9605
|
this.ngUnsubscribe = new Subject();
|
|
9086
|
-
this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
|
|
9087
9606
|
this.labelBtnAdd = "hcm.payroll.employees_add";
|
|
9088
|
-
this.maxValuePercentage = 100.00;
|
|
9089
9607
|
this.visibleBtnSave = true;
|
|
9090
9608
|
this.isView = false;
|
|
9091
9609
|
this.isShowPixKeyFieldValidatorMessage = false;
|
|
9092
|
-
this.
|
|
9610
|
+
this.hideFields = this.sharedStateService.hideField$;
|
|
9093
9611
|
this.registerSubjects();
|
|
9094
9612
|
}
|
|
9095
|
-
ngOnInit() {
|
|
9096
|
-
}
|
|
9613
|
+
ngOnInit() { }
|
|
9097
9614
|
ngAfterViewInit() {
|
|
9098
9615
|
this.cd.detectChanges();
|
|
9099
9616
|
}
|
|
@@ -9101,39 +9618,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9101
9618
|
this.ngUnsubscribe.next(true);
|
|
9102
9619
|
this.ngUnsubscribe.unsubscribe();
|
|
9103
9620
|
}
|
|
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
|
-
}
|
|
9621
|
+
registerSubjects() { }
|
|
9137
9622
|
get visible() {
|
|
9138
9623
|
return this._visible;
|
|
9139
9624
|
}
|
|
@@ -9164,7 +9649,8 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9164
9649
|
}
|
|
9165
9650
|
formatPixKeyTelephoneNumber() {
|
|
9166
9651
|
if (this.pixKeyType === "TELEPHONE") {
|
|
9167
|
-
this.pixAccountFormGroup.get("pixKey")
|
|
9652
|
+
const pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
|
|
9653
|
+
pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
|
|
9168
9654
|
}
|
|
9169
9655
|
}
|
|
9170
9656
|
convertDTOToShowWithCustomFields(data) {
|
|
@@ -9176,14 +9662,14 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9176
9662
|
this.visibleBtnSave = isEditMode;
|
|
9177
9663
|
if (this.pixAccountFormGroup.get("pixKeyType").value) {
|
|
9178
9664
|
this.pixKeyType = this.pixAccountFormGroup.get("pixKeyType").value.key;
|
|
9179
|
-
this.setPixKeyValidators(isEditMode);
|
|
9665
|
+
this.setPixKeyValidators(isEditMode, this.pixAccountFormGroup);
|
|
9180
9666
|
this.formatPixKeyTelephoneNumber();
|
|
9181
9667
|
}
|
|
9182
9668
|
configEnabledFields(this.pixAccountFormGroup, isEditMode, [
|
|
9183
9669
|
"pixKeyType",
|
|
9184
9670
|
"pixKey",
|
|
9185
9671
|
"percentage",
|
|
9186
|
-
"customFields"
|
|
9672
|
+
"customFields"
|
|
9187
9673
|
], []);
|
|
9188
9674
|
}
|
|
9189
9675
|
close() {
|
|
@@ -9197,7 +9683,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9197
9683
|
if (this.employeeId) {
|
|
9198
9684
|
this.pixAccountFormGroup.get("employee").setValue({
|
|
9199
9685
|
tableId: this.employeeId,
|
|
9200
|
-
name: ""
|
|
9686
|
+
name: ""
|
|
9201
9687
|
});
|
|
9202
9688
|
}
|
|
9203
9689
|
this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
|
|
@@ -9221,13 +9707,9 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9221
9707
|
return {
|
|
9222
9708
|
prefix: "",
|
|
9223
9709
|
thousands: this.currency.thousandsSeparator,
|
|
9224
|
-
decimal: this.currency.decimalSeparator
|
|
9710
|
+
decimal: this.currency.decimalSeparator
|
|
9225
9711
|
};
|
|
9226
9712
|
}
|
|
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
9713
|
set getListPixAccount(pixAccountList) {
|
|
9232
9714
|
if (pixAccountList) {
|
|
9233
9715
|
this.setValidatorsAccordingList(pixAccountList, null, false);
|
|
@@ -9236,143 +9718,23 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9236
9718
|
this.resetForm();
|
|
9237
9719
|
}
|
|
9238
9720
|
}
|
|
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
|
-
});
|
|
9256
|
-
}
|
|
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();
|
|
9299
|
-
}
|
|
9300
|
-
}
|
|
9301
|
-
/**
|
|
9302
|
-
* Este método calcula as parcentagens que já 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
|
|
9305
|
-
*/
|
|
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();
|
|
9316
|
-
}
|
|
9317
9721
|
set isViewMode(condition) {
|
|
9318
9722
|
this.isView = !!(condition && !this.withSideBar);
|
|
9319
9723
|
this.configEnableFields(!this.isView);
|
|
9320
9724
|
if (!this.isView)
|
|
9321
9725
|
this.resetForm();
|
|
9322
9726
|
}
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
}
|
|
9326
|
-
setDefaultCpfPixKey() {
|
|
9327
|
-
if (this.defaultCpfNumber) {
|
|
9328
|
-
this.pixAccountFormGroup.get("pixKey").setValue(this.defaultCpfNumber);
|
|
9329
|
-
}
|
|
9330
|
-
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
|
-
}
|
|
9337
|
-
}
|
|
9338
|
-
}
|
|
9339
|
-
}
|
|
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
|
-
]));
|
|
9348
|
-
}
|
|
9349
|
-
else {
|
|
9350
|
-
pixKeyType.setValidators(Validators.required);
|
|
9351
|
-
}
|
|
9727
|
+
set paramsForm(value) {
|
|
9728
|
+
this._paramsForm = value;
|
|
9352
9729
|
}
|
|
9353
|
-
|
|
9354
|
-
|
|
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
|
-
};
|
|
9730
|
+
set defaultCpfNumber(value) {
|
|
9731
|
+
this._defaultCpfNumber = value;
|
|
9371
9732
|
}
|
|
9372
9733
|
};
|
|
9373
9734
|
HistoricalPixAccountFormComponent.ctorParameters = () => [
|
|
9374
9735
|
{ type: FormBuilder },
|
|
9375
|
-
{ type: ChangeDetectorRef }
|
|
9736
|
+
{ type: ChangeDetectorRef },
|
|
9737
|
+
{ type: SharedStateService }
|
|
9376
9738
|
];
|
|
9377
9739
|
__decorate([
|
|
9378
9740
|
ViewChild(CustomFieldsComponent$1, { static: true })
|
|
@@ -9392,12 +9754,6 @@ __decorate([
|
|
|
9392
9754
|
__decorate([
|
|
9393
9755
|
Input()
|
|
9394
9756
|
], HistoricalPixAccountFormComponent.prototype, "isEditMode", void 0);
|
|
9395
|
-
__decorate([
|
|
9396
|
-
Input()
|
|
9397
|
-
], HistoricalPixAccountFormComponent.prototype, "paramsForm", void 0);
|
|
9398
|
-
__decorate([
|
|
9399
|
-
Input()
|
|
9400
|
-
], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", void 0);
|
|
9401
9757
|
__decorate([
|
|
9402
9758
|
Output()
|
|
9403
9759
|
], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
|
|
@@ -9416,29 +9772,20 @@ __decorate([
|
|
|
9416
9772
|
__decorate([
|
|
9417
9773
|
Input()
|
|
9418
9774
|
], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
|
|
9775
|
+
__decorate([
|
|
9776
|
+
Input()
|
|
9777
|
+
], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
|
|
9778
|
+
__decorate([
|
|
9779
|
+
Input()
|
|
9780
|
+
], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
|
|
9419
9781
|
HistoricalPixAccountFormComponent = __decorate([
|
|
9420
9782
|
Component({
|
|
9421
9783
|
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",
|
|
9784
|
+
template: "<div id=\"main\">\n <form *ngIf=\"!(hideFields | async)\" [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",
|
|
9423
9785
|
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
9786
|
})
|
|
9425
9787
|
], HistoricalPixAccountFormComponent);
|
|
9426
9788
|
|
|
9427
|
-
let HistoricalPixAccountService = class HistoricalPixAccountService {
|
|
9428
|
-
constructor(http) {
|
|
9429
|
-
this.http = http;
|
|
9430
|
-
}
|
|
9431
|
-
query(path, body, service = ServiceType.PAYROLL) {
|
|
9432
|
-
return this.http.query(path, body, service);
|
|
9433
|
-
}
|
|
9434
|
-
};
|
|
9435
|
-
HistoricalPixAccountService.ctorParameters = () => [
|
|
9436
|
-
{ type: HttpClientService }
|
|
9437
|
-
];
|
|
9438
|
-
HistoricalPixAccountService = __decorate([
|
|
9439
|
-
Injectable()
|
|
9440
|
-
], HistoricalPixAccountService);
|
|
9441
|
-
|
|
9442
9789
|
let HistoricalPixAccountModule = class HistoricalPixAccountModule {
|
|
9443
9790
|
};
|
|
9444
9791
|
HistoricalPixAccountModule = __decorate([
|
|
@@ -9466,6 +9813,8 @@ HistoricalPixAccountModule = __decorate([
|
|
|
9466
9813
|
CustomFieldsModule$1,
|
|
9467
9814
|
PanelModule,
|
|
9468
9815
|
InputMaskModule,
|
|
9816
|
+
DropdownModule,
|
|
9817
|
+
TabViewModule,
|
|
9469
9818
|
],
|
|
9470
9819
|
declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
|
|
9471
9820
|
providers: [HistoricalPixAccountService, ConfirmationService],
|
|
@@ -9504,7 +9853,7 @@ HistoricalPixAccountListService = __decorate([
|
|
|
9504
9853
|
|
|
9505
9854
|
const moment$e = moment_;
|
|
9506
9855
|
let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent {
|
|
9507
|
-
constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
|
|
9856
|
+
constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
|
|
9508
9857
|
this.confirmationService = confirmationService;
|
|
9509
9858
|
this.translateService = translateService;
|
|
9510
9859
|
this.activatedRoute = activatedRoute;
|
|
@@ -9512,11 +9861,14 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9512
9861
|
this.router = router;
|
|
9513
9862
|
this.messageService = messageService;
|
|
9514
9863
|
this.historicalPixAccountListService = historicalPixAccountListService;
|
|
9864
|
+
this.sharedStateService = sharedStateService;
|
|
9515
9865
|
this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
|
|
9516
9866
|
this.keyPayload = "historicalEmployeePix";
|
|
9517
9867
|
this.withSidebar = true;
|
|
9518
9868
|
this.isOnlyView = new EventEmitter();
|
|
9869
|
+
this.isOnlyEdit = new EventEmitter();
|
|
9519
9870
|
this.enableView = new EventEmitter();
|
|
9871
|
+
this.isEditJudicialDependentPix = new EventEmitter();
|
|
9520
9872
|
this.ngUnsubscribe = new Subject();
|
|
9521
9873
|
this.loading = true;
|
|
9522
9874
|
this.columns = [
|
|
@@ -9524,18 +9876,6 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9524
9876
|
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
|
|
9525
9877
|
field: "dateChange",
|
|
9526
9878
|
},
|
|
9527
|
-
{
|
|
9528
|
-
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key_type"),
|
|
9529
|
-
field: "pixKeyType.value",
|
|
9530
|
-
},
|
|
9531
|
-
{
|
|
9532
|
-
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_pix_key"),
|
|
9533
|
-
field: "pixKey",
|
|
9534
|
-
},
|
|
9535
|
-
{
|
|
9536
|
-
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
|
|
9537
|
-
field: "percentage",
|
|
9538
|
-
},
|
|
9539
9879
|
{
|
|
9540
9880
|
label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
|
|
9541
9881
|
field: "numberOfPixAccount",
|
|
@@ -9548,6 +9888,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9548
9888
|
ngOnDestroy() {
|
|
9549
9889
|
this.ngUnsubscribe.next();
|
|
9550
9890
|
this.ngUnsubscribe.complete();
|
|
9891
|
+
this.unsubscribe();
|
|
9551
9892
|
}
|
|
9552
9893
|
ngAfterViewInit() {
|
|
9553
9894
|
this.cd.detectChanges();
|
|
@@ -9555,33 +9896,19 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9555
9896
|
onLazyLoad(payload) {
|
|
9556
9897
|
payload.forEach((value) => {
|
|
9557
9898
|
value.dateChange = moment$e(value.dateChange).format(this.dateFormat);
|
|
9558
|
-
value.pixKey = this.formatPixKeyByType(value.pixKeyType, value.pixKey);
|
|
9559
|
-
value.percentage = FormatUtilsService.getFormattedPercentage(value.percentage);
|
|
9560
9899
|
});
|
|
9561
9900
|
this.onGridLoad(payload);
|
|
9562
9901
|
this.loading = false;
|
|
9563
9902
|
}
|
|
9564
|
-
formatPixKeyByType(pixKeyType, pixKey) {
|
|
9565
|
-
const keyType = pixKeyType ? pixKeyType.key.toUpperCase() : "";
|
|
9566
|
-
if (keyType === "TELEPHONE") {
|
|
9567
|
-
return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
|
|
9568
|
-
}
|
|
9569
|
-
else if (keyType === "CPF") {
|
|
9570
|
-
return FormatUtilsService.getFormattedCpf(pixKey);
|
|
9571
|
-
}
|
|
9572
|
-
else if (keyType === "CNPJ") {
|
|
9573
|
-
return FormatUtilsService.getFormattedCnpj(pixKey);
|
|
9574
|
-
}
|
|
9575
|
-
else {
|
|
9576
|
-
return pixKey;
|
|
9577
|
-
}
|
|
9578
|
-
}
|
|
9579
9903
|
getMenuActions(rowData) {
|
|
9580
9904
|
return [
|
|
9581
9905
|
{
|
|
9582
9906
|
label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
|
|
9583
9907
|
command: () => {
|
|
9584
9908
|
if (this.isAllowToViewHistorical) {
|
|
9909
|
+
this.sharedStateService.setHideField(true);
|
|
9910
|
+
this.sharedStateService.setShowButton(false);
|
|
9911
|
+
this.sharedStateService.setShowEditMode(false);
|
|
9585
9912
|
const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
|
|
9586
9913
|
if (this.withSidebar) {
|
|
9587
9914
|
this.isOnlyView.emit(true);
|
|
@@ -9590,6 +9917,33 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9590
9917
|
});
|
|
9591
9918
|
}
|
|
9592
9919
|
else {
|
|
9920
|
+
this.sharedStateService.setSaveButton(false);
|
|
9921
|
+
this.enableView.emit(dateChange);
|
|
9922
|
+
}
|
|
9923
|
+
}
|
|
9924
|
+
else {
|
|
9925
|
+
this.isNotAllowMessage();
|
|
9926
|
+
}
|
|
9927
|
+
},
|
|
9928
|
+
},
|
|
9929
|
+
{
|
|
9930
|
+
label: this.translateService.instant("hcm.payroll.edit"),
|
|
9931
|
+
command: () => {
|
|
9932
|
+
if (this.isAllowToEditHistorical) {
|
|
9933
|
+
this.sharedStateService.setHideField(true);
|
|
9934
|
+
this.sharedStateService.setShowButton(false);
|
|
9935
|
+
this.sharedStateService.setShowEditMode(true);
|
|
9936
|
+
const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
|
|
9937
|
+
if (this.withSidebar) {
|
|
9938
|
+
this.router.navigate([`historical-pix-account/${dateChange}`], {
|
|
9939
|
+
relativeTo: this.activatedRoute,
|
|
9940
|
+
});
|
|
9941
|
+
}
|
|
9942
|
+
else {
|
|
9943
|
+
setTimeout(() => {
|
|
9944
|
+
this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
|
|
9945
|
+
});
|
|
9946
|
+
this.sharedStateService.setSaveButton(true);
|
|
9593
9947
|
this.enableView.emit(dateChange);
|
|
9594
9948
|
}
|
|
9595
9949
|
}
|
|
@@ -9608,7 +9962,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9608
9962
|
this.isNotAllowMessage();
|
|
9609
9963
|
}
|
|
9610
9964
|
},
|
|
9611
|
-
}
|
|
9965
|
+
}
|
|
9612
9966
|
];
|
|
9613
9967
|
}
|
|
9614
9968
|
delete(id, dateChange) {
|
|
@@ -9674,6 +10028,19 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9674
10028
|
this.lastRecord = payload[0];
|
|
9675
10029
|
}
|
|
9676
10030
|
}
|
|
10031
|
+
unsubscribe() {
|
|
10032
|
+
if (this._subscription) {
|
|
10033
|
+
this._subscription.unsubscribe();
|
|
10034
|
+
}
|
|
10035
|
+
}
|
|
10036
|
+
set hideFieldsOnAdd$(subject) {
|
|
10037
|
+
this.unsubscribe();
|
|
10038
|
+
if (subject) {
|
|
10039
|
+
this._subscription = subject.subscribe((value) => {
|
|
10040
|
+
this.sharedStateService.setHideField(value);
|
|
10041
|
+
});
|
|
10042
|
+
}
|
|
10043
|
+
}
|
|
9677
10044
|
get isAllowToAddHistorical() {
|
|
9678
10045
|
return (this.permission["incluir"]);
|
|
9679
10046
|
}
|
|
@@ -9683,6 +10050,9 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9683
10050
|
get isAllowToViewHistorical() {
|
|
9684
10051
|
return (this.permission["visualizar"]);
|
|
9685
10052
|
}
|
|
10053
|
+
get isAllowToEditHistorical() {
|
|
10054
|
+
return (this.permission["editar"]);
|
|
10055
|
+
}
|
|
9686
10056
|
get scopedActions() {
|
|
9687
10057
|
return this.getMenuActions.bind(this);
|
|
9688
10058
|
}
|
|
@@ -9700,7 +10070,8 @@ HistoricalPixAccountListComponent.ctorParameters = () => [
|
|
|
9700
10070
|
{ type: ChangeDetectorRef },
|
|
9701
10071
|
{ type: Router },
|
|
9702
10072
|
{ type: MessageService },
|
|
9703
|
-
{ type: HistoricalPixAccountListService }
|
|
10073
|
+
{ type: HistoricalPixAccountListService },
|
|
10074
|
+
{ type: SharedStateService }
|
|
9704
10075
|
];
|
|
9705
10076
|
__decorate([
|
|
9706
10077
|
ViewChild(CustomFieldsComponent$1, { static: false })
|
|
@@ -9726,12 +10097,24 @@ __decorate([
|
|
|
9726
10097
|
__decorate([
|
|
9727
10098
|
Input()
|
|
9728
10099
|
], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
|
|
10100
|
+
__decorate([
|
|
10101
|
+
Input()
|
|
10102
|
+
], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
|
|
9729
10103
|
__decorate([
|
|
9730
10104
|
Output()
|
|
9731
10105
|
], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
|
|
10106
|
+
__decorate([
|
|
10107
|
+
Output()
|
|
10108
|
+
], HistoricalPixAccountListComponent.prototype, "isOnlyEdit", void 0);
|
|
9732
10109
|
__decorate([
|
|
9733
10110
|
Output()
|
|
9734
10111
|
], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
|
|
10112
|
+
__decorate([
|
|
10113
|
+
Output()
|
|
10114
|
+
], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
|
|
10115
|
+
__decorate([
|
|
10116
|
+
Input()
|
|
10117
|
+
], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
|
|
9735
10118
|
__decorate([
|
|
9736
10119
|
Input()
|
|
9737
10120
|
], HistoricalPixAccountListComponent.prototype, "reloadList", null);
|
|
@@ -9776,5 +10159,5 @@ HistoricalPixAccountListModule = __decorate([
|
|
|
9776
10159
|
* Generated bundle index. Do not edit.
|
|
9777
10160
|
*/
|
|
9778
10161
|
|
|
9779
|
-
export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq,
|
|
10162
|
+
export { AdmissionDraftSummaryComponent, AdmissionDraftSummaryModule, AdmissionDraftSummaryService, AutocompleteParametersService, BlockUiComponent, BlockUiModule, BreadcrumbComponent, BreadcrumbSDSModule, CNPJValidator, CPFValidator, CompanyIndicationType, CompanyIndicationsService, CompareType, ControlMessagesErrorComponent, ControlMessagesErrorModule, CoreDirectives, CoreFieldType, CustomFieldsComponent, CustomFieldsModule, DataListModule, DataListRestModule, DateValidator, DirectionEnumeration, EmployeeSelectorComponent, EmployeeSelectorModule, EmployeeSummaryComponent, EmployeeSummaryModule, EmployeeSummaryService, EntityODataParameter, ErrorPageComponent, ErrorPageModule, FieldValidatorComponent, FieldValidatorModule, FileUploadComponent, FileUploadCoreModule, FormComparatorService, FromToComponent, FromToModule, HistoricalBankAccountComponent, HistoricalBankAccountListComponent, HistoricalBankAccountListModule, HistoricalBankAccountListService, HistoricalBankAccountModule, HistoricalBankAccountService, HistoricalPixAccountComponent, HistoricalPixAccountListComponent, HistoricalPixAccountListModule, HistoricalPixAccountListService, HistoricalPixAccountModule, HistoricalPixAccountService, HttpClientService, HttpRequestType, ImageCropComponent, ImageCropModule, ImageCropService, InputDateComponent, InputDateModelComponent, InputDateModelModule, InputDateModule, InputRestAutoCompleteComponent, InputRestAutoCompleteEmployeeModelModule, InputRestAutoCompleteEmployeeModelService, InputRestAutoCompleteEmployeeModule, InputRestAutoCompleteEmployeeService, InputRestAutoCompleteEnumComponent, InputRestAutoCompleteEnumModule, InputRestAutoCompleteEnumService, InputRestAutoCompleteJobpositionComponent, InputRestAutoCompleteJobpositionModule, InputRestAutoCompleteJobpositionService, InputRestAutoCompleteModelEnumModule, InputRestAutoCompleteModelEnumService, InputRestAutoCompleteModelModule, InputRestAutoCompleteModelService, InputRestAutoCompleteModule, InputRestAutoCompleteService, IntegrationService, ListRestComponent, ListRestModule, LookupModule, LookupParametersService, MenuType, ModuleType, NameNotSpacesDirective, OnlyNumberDirective, Operators, ParameterType, PermissionService, ReportFormat, ReportService, ReportStage, ServiceType, ServicesModule, SharedStateService, SpinnerLoaderComponent, SpinnerLoaderModule, StringMethods, ToastComponent, ToastModule, ToastService, TypeAdmissionModule, TypeAdmissionServices, UsingType, WorkflowDataService, WorkflowIntegrator, WorkstationgroupLookupDto, WorkstationgroupLookupModule, _moment, assign, autoCompleteObjectForIdObject, clearValues, cnpjValidator, compareValues, configEnabledFields, containsMoreThanOneConsecutiveAbbreviation, containsMoreThanOneConsecutiveBlankSpace, containsMoreThanTwoRepeatedCharacters, containsSpecialCharacters, convertBooleanString, convertStringToBoolean, cpfValidator, firstNameIsValid, firstNameLengthIsValid, formatMoney, fullNameLengthIsValid, getAddWeekDaysBusiness, getFormat, getFormatDate, getMoment, getNowDate, getObjValids, getQueryParams, getWeekDaysBusiness, getYears, invertFieldDate, isBirthDayValid, isDateCompare, isDateExpirationBeforeExpeditionDate, isDateField, isDateSameOrAfterCurrentDate, isFullDate, isMax, isNumber, isObject, isRequired, isShallow, isValid, isValidDate, isValidPIS, mountCustomForSave, mountCustomForShow, mountCustomToSave, mountCustomToShow, mountGeneratedCustomToSave, ngCalendarFormat, notEmpty, numberOrZero, removeCharacteresSpecials, removeEmpty, removeWhiteSpaces, setCustonFields, setDisableField, setErrors, setRequired, setRequiredFields, setValidator, setValidatorsAndDisableFields, setValueCustom, stringMethods, sun, uiid, validateBirthDate, verifyValidationsForm, SharedModule as ɵa, DataListRestComponent as ɵb, DataListRestService as ɵc, FileUploadService as ɵd, InputRestAutoCompleteEmployeeComponent as ɵe, InputRestAutoCompleteEmployeeModelComponent as ɵf, InputRestAutoCompleteModelComponent as ɵg, InputRestAutoCompleteModelEnumComponent as ɵh, ListRestService as ɵi, DataListComponent as ɵj, DataListService as ɵk, LookupComponent as ɵl, LookupService as ɵm, WorkstationgroupLookupComponent as ɵn, AutocompleteService as ɵo, LookupService$1 as ɵp, HistoricalBankAccountFormComponent as ɵq, HistoricakPixAccountBase as ɵr, HistoricalPixAccountFormComponent as ɵs };
|
|
9780
10163
|
//# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map
|