@senior-gestao-pessoas/payroll-core 9.4.0-da523d13-bda8-40be-a1f7-c0d945546f1c → 9.4.0-db1d034b-8b09-472f-9726-7fd71af961f4
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 +662 -499
- 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 +25 -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 +23 -6
- 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 +14 -0
- package/esm2015/components/historical-pix-account/historical-pix-account-base.js +150 -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 +79 -18
- 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 +65 -34
- package/esm2015/components/shared/index.js +2 -0
- package/esm2015/components/shared/shared-state.service.js +36 -0
- 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 +163 -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 +122 -48
- 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 +74 -34
- package/esm5/components/shared/index.js +2 -0
- package/esm5/components/shared/shared-state.service.js +37 -0
- 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 +564 -446
- package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js +658 -496
- 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 +1 -1
- 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.
|
|
@@ -8521,19 +8522,386 @@ class FormatUtilsService {
|
|
|
8521
8522
|
}
|
|
8522
8523
|
}
|
|
8523
8524
|
|
|
8524
|
-
let
|
|
8525
|
-
constructor(
|
|
8525
|
+
let SharedStateService = class SharedStateService {
|
|
8526
|
+
constructor() {
|
|
8527
|
+
this.hideFieldSubject = new BehaviorSubject(true);
|
|
8528
|
+
this.hideField$ = this.hideFieldSubject.asObservable();
|
|
8529
|
+
this.showButtonSubject = new BehaviorSubject(true);
|
|
8530
|
+
this.showButton$ = this.showButtonSubject.asObservable();
|
|
8531
|
+
this.saveButtonSubject = new BehaviorSubject(true);
|
|
8532
|
+
this.saveButton$ = this.saveButtonSubject.asObservable();
|
|
8533
|
+
this.showEditMode = new BehaviorSubject(true);
|
|
8534
|
+
this.showEditMode$ = this.showEditMode.asObservable();
|
|
8535
|
+
}
|
|
8536
|
+
setHideField(value) {
|
|
8537
|
+
this.hideFieldSubject.next(value);
|
|
8538
|
+
}
|
|
8539
|
+
setShowButton(value) {
|
|
8540
|
+
this.showButtonSubject.next(value);
|
|
8541
|
+
}
|
|
8542
|
+
setSaveButton(value) {
|
|
8543
|
+
this.saveButtonSubject.next(value);
|
|
8544
|
+
}
|
|
8545
|
+
setShowEditMode(value) {
|
|
8546
|
+
this.showEditMode.next(value);
|
|
8547
|
+
}
|
|
8548
|
+
};
|
|
8549
|
+
SharedStateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
|
|
8550
|
+
SharedStateService = __decorate([
|
|
8551
|
+
Injectable({
|
|
8552
|
+
providedIn: 'root',
|
|
8553
|
+
})
|
|
8554
|
+
], SharedStateService);
|
|
8555
|
+
|
|
8556
|
+
class GenericValidator {
|
|
8557
|
+
constructor() { }
|
|
8558
|
+
/**
|
|
8559
|
+
* Valida o CEI (Cadastro específico de INSS) digitado.
|
|
8560
|
+
*/
|
|
8561
|
+
static isValidCei(control) {
|
|
8562
|
+
const cei = control.value;
|
|
8563
|
+
if (!cei)
|
|
8564
|
+
return null;
|
|
8565
|
+
else if (cei.length != 11)
|
|
8566
|
+
return null;
|
|
8567
|
+
const multiplicadorBase = "3298765432";
|
|
8568
|
+
let total = 0;
|
|
8569
|
+
let resto = 0;
|
|
8570
|
+
let multiplicando = 0;
|
|
8571
|
+
let multiplicador = 0;
|
|
8572
|
+
if (cei.length !== 11 ||
|
|
8573
|
+
cei === "00000000000" ||
|
|
8574
|
+
cei === "11111111111" ||
|
|
8575
|
+
cei === "22222222222" ||
|
|
8576
|
+
cei === "33333333333" ||
|
|
8577
|
+
cei === "44444444444" ||
|
|
8578
|
+
cei === "55555555555" ||
|
|
8579
|
+
cei === "66666666666" ||
|
|
8580
|
+
cei === "77777777777" ||
|
|
8581
|
+
cei === "88888888888" ||
|
|
8582
|
+
cei === "99999999999")
|
|
8583
|
+
return { invalidCei: true };
|
|
8584
|
+
else {
|
|
8585
|
+
for (let i = 0; i < 10; i++) {
|
|
8586
|
+
multiplicando = parseInt(cei.substring(i, i + 1), 10);
|
|
8587
|
+
multiplicador = parseInt(multiplicadorBase.substring(i, i + 1), 10);
|
|
8588
|
+
total += multiplicando * multiplicador;
|
|
8589
|
+
}
|
|
8590
|
+
resto = 11 - (total % 11);
|
|
8591
|
+
resto = resto === 10 || resto === 11 ? 0 : resto;
|
|
8592
|
+
const digito = parseInt("" + cei.charAt(10), 10);
|
|
8593
|
+
return resto === digito ? null : { invalidCei: true };
|
|
8594
|
+
}
|
|
8595
|
+
}
|
|
8596
|
+
/**
|
|
8597
|
+
* Valida se o CPF é valido. Deve-se ser informado o cpf sem máscara.
|
|
8598
|
+
*/
|
|
8599
|
+
static isValidCpf(control) {
|
|
8600
|
+
const cpf = control.value;
|
|
8601
|
+
if (cpf) {
|
|
8602
|
+
let numbers, digits, sum, i, result, equalDigits;
|
|
8603
|
+
equalDigits = 1;
|
|
8604
|
+
if (cpf.length < 11) {
|
|
8605
|
+
return null;
|
|
8606
|
+
}
|
|
8607
|
+
for (i = 0; i < cpf.length - 1; i++) {
|
|
8608
|
+
if (cpf.charAt(i) !== cpf.charAt(i + 1)) {
|
|
8609
|
+
equalDigits = 0;
|
|
8610
|
+
break;
|
|
8611
|
+
}
|
|
8612
|
+
}
|
|
8613
|
+
if (!equalDigits) {
|
|
8614
|
+
numbers = cpf.substring(0, 9);
|
|
8615
|
+
digits = cpf.substring(9);
|
|
8616
|
+
sum = 0;
|
|
8617
|
+
for (i = 10; i > 1; i--) {
|
|
8618
|
+
sum += numbers.charAt(10 - i) * i;
|
|
8619
|
+
}
|
|
8620
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8621
|
+
if (result !== Number(digits.charAt(0))) {
|
|
8622
|
+
return { cpfNotValid: true };
|
|
8623
|
+
}
|
|
8624
|
+
numbers = cpf.substring(0, 10);
|
|
8625
|
+
sum = 0;
|
|
8626
|
+
for (i = 11; i > 1; i--) {
|
|
8627
|
+
sum += numbers.charAt(11 - i) * i;
|
|
8628
|
+
}
|
|
8629
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8630
|
+
if (result !== Number(digits.charAt(1))) {
|
|
8631
|
+
return { cpfNotValid: true };
|
|
8632
|
+
}
|
|
8633
|
+
return null;
|
|
8634
|
+
}
|
|
8635
|
+
else {
|
|
8636
|
+
return { cpfNotValid: true };
|
|
8637
|
+
}
|
|
8638
|
+
}
|
|
8639
|
+
return null;
|
|
8640
|
+
}
|
|
8641
|
+
/**
|
|
8642
|
+
* Valida se o CNPJ é valido. Deve-se ser informado o cpf sem máscara.
|
|
8643
|
+
*/
|
|
8644
|
+
static isValidCnpj(control) {
|
|
8645
|
+
let cnpj = control.value;
|
|
8646
|
+
if (cnpj) {
|
|
8647
|
+
let size, numbers, digits, sum, pos, result;
|
|
8648
|
+
cnpj = cnpj.replace(/[^\d]+/g, '');
|
|
8649
|
+
if (cnpj.length !== 14) {
|
|
8650
|
+
return null;
|
|
8651
|
+
}
|
|
8652
|
+
// Elimina CNPJs invalidos conhecidos
|
|
8653
|
+
if (cnpj === '00000000000000' ||
|
|
8654
|
+
cnpj === '11111111111111' ||
|
|
8655
|
+
cnpj === '22222222222222' ||
|
|
8656
|
+
cnpj === '33333333333333' ||
|
|
8657
|
+
cnpj === '44444444444444' ||
|
|
8658
|
+
cnpj === '55555555555555' ||
|
|
8659
|
+
cnpj === '66666666666666' ||
|
|
8660
|
+
cnpj === '77777777777777' ||
|
|
8661
|
+
cnpj === '88888888888888' ||
|
|
8662
|
+
cnpj === '99999999999999') {
|
|
8663
|
+
return { cnpjNotValid: true };
|
|
8664
|
+
}
|
|
8665
|
+
// Valida DVs
|
|
8666
|
+
size = cnpj.length - 2;
|
|
8667
|
+
numbers = cnpj.substring(0, size);
|
|
8668
|
+
digits = cnpj.substring(size);
|
|
8669
|
+
sum = 0;
|
|
8670
|
+
pos = size - 7;
|
|
8671
|
+
for (let i = size; i >= 1; i--) {
|
|
8672
|
+
sum += numbers.charAt(size - i) * pos--;
|
|
8673
|
+
if (pos < 2) {
|
|
8674
|
+
pos = 9;
|
|
8675
|
+
}
|
|
8676
|
+
}
|
|
8677
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8678
|
+
if (result !== Number(digits.charAt(0))) {
|
|
8679
|
+
return { cnpjNotValid: true };
|
|
8680
|
+
}
|
|
8681
|
+
size = size + 1;
|
|
8682
|
+
numbers = cnpj.substring(0, size);
|
|
8683
|
+
sum = 0;
|
|
8684
|
+
pos = size - 7;
|
|
8685
|
+
for (let i = size; i >= 1; i--) {
|
|
8686
|
+
sum += numbers.charAt(size - i) * pos--;
|
|
8687
|
+
if (pos < 2) {
|
|
8688
|
+
pos = 9;
|
|
8689
|
+
}
|
|
8690
|
+
}
|
|
8691
|
+
result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
8692
|
+
if (result !== Number(digits.charAt(1))) {
|
|
8693
|
+
return { cnpjNotValid: true };
|
|
8694
|
+
}
|
|
8695
|
+
return null;
|
|
8696
|
+
}
|
|
8697
|
+
return null;
|
|
8698
|
+
}
|
|
8699
|
+
/**
|
|
8700
|
+
* Válida o número de telefone da chave PIX.
|
|
8701
|
+
*/
|
|
8702
|
+
static isValidPhoneNumber(control) {
|
|
8703
|
+
let cellPhoneKey = control.value || '';
|
|
8704
|
+
cellPhoneKey = cellPhoneKey.replace(/[\s()-]/g, '');
|
|
8705
|
+
const regexNumberTelephone = /^[1-9][\d]{1,2}\d{8,10}$/;
|
|
8706
|
+
const isValidNumberTelephone = regexNumberTelephone.test(cellPhoneKey);
|
|
8707
|
+
return isValidNumberTelephone ? null : { invalidPhoneNumber: true };
|
|
8708
|
+
}
|
|
8709
|
+
/**
|
|
8710
|
+
* Valida o email da chave PIX.
|
|
8711
|
+
*/
|
|
8712
|
+
static isValidEmail(control) {
|
|
8713
|
+
const emailKey = control.value;
|
|
8714
|
+
const regexValidEmail = /^[\w-\.]+@[\w-]+(\.[\w-]{2,4}){1,2}$/;
|
|
8715
|
+
const isValidEmail = regexValidEmail.test(emailKey);
|
|
8716
|
+
return isValidEmail ? null : { invalidEmail: true };
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8719
|
+
|
|
8720
|
+
class HistoricakPixAccountBase {
|
|
8721
|
+
constructor(formBuilder) {
|
|
8722
|
+
this._paramsForm = new FormGroup({});
|
|
8723
|
+
this._defaultCpfNumber = null;
|
|
8724
|
+
this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
|
|
8725
|
+
this.pixAccountList = [];
|
|
8726
|
+
this.maxValuePercentage = 100.00;
|
|
8727
|
+
this.isShowPixKeyFieldValidatorMessage = false;
|
|
8728
|
+
this.formBuilder = formBuilder;
|
|
8729
|
+
this.createFormGroupBase();
|
|
8730
|
+
}
|
|
8731
|
+
phoneMask(event) {
|
|
8732
|
+
console.log("phoneMaskEvent", event);
|
|
8733
|
+
FormatUtilsService.formatTelephoneInputEvent(event);
|
|
8734
|
+
}
|
|
8735
|
+
onChangePixKeyType(item) {
|
|
8736
|
+
console.log("onChangePixKeyType", item);
|
|
8737
|
+
if (item.key) {
|
|
8738
|
+
this.pixKeyType = item.key;
|
|
8739
|
+
this.isShowPixKeyFieldValidatorMessage = true;
|
|
8740
|
+
this.pixAccountFormGroup.get("pixKey").reset();
|
|
8741
|
+
this.setPixKeyValidators(true);
|
|
8742
|
+
if (item.key === "CPF") {
|
|
8743
|
+
this.setDefaultCpfPixKey();
|
|
8744
|
+
}
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8747
|
+
onClearPixKeyType() {
|
|
8748
|
+
this.isShowPixKeyFieldValidatorMessage = false;
|
|
8749
|
+
this.pixAccountFormGroup.get("pixKey").reset();
|
|
8750
|
+
}
|
|
8751
|
+
setDefaultCpfPixKey() {
|
|
8752
|
+
if (this._defaultCpfNumber) {
|
|
8753
|
+
this.pixAccountFormGroup.get("pixKey").setValue(this._defaultCpfNumber);
|
|
8754
|
+
}
|
|
8755
|
+
else {
|
|
8756
|
+
const sheetDocument = this._paramsForm.get("sheetDocument");
|
|
8757
|
+
if (sheetDocument) {
|
|
8758
|
+
const cpf = sheetDocument.get("cpfNumber").value;
|
|
8759
|
+
if (cpf) {
|
|
8760
|
+
this.pixAccountFormGroup.get("pixKey").setValue(cpf);
|
|
8761
|
+
}
|
|
8762
|
+
}
|
|
8763
|
+
}
|
|
8764
|
+
}
|
|
8765
|
+
createFormGroupBase() {
|
|
8766
|
+
this.pixAccountFormGroup = this.formBuilder.group({
|
|
8767
|
+
id: this.formBuilder.control(null),
|
|
8768
|
+
index: this.formBuilder.control(null),
|
|
8769
|
+
employee: this.formBuilder.control({ value: { tableId: null }, disabled: true }),
|
|
8770
|
+
dateChange: this.formBuilder.control(null),
|
|
8771
|
+
pixKeyType: this.formBuilder.control(null, Validators.required),
|
|
8772
|
+
pixKey: this.formBuilder.control(null),
|
|
8773
|
+
percentage: this.formBuilder.control(null, Validators.compose([
|
|
8774
|
+
...this.initialValidatorOfPercentage,
|
|
8775
|
+
Validators.max(this.maxValuePercentage),
|
|
8776
|
+
])),
|
|
8777
|
+
externalId: this.formBuilder.control(null),
|
|
8778
|
+
customFields: this.formBuilder.control(null),
|
|
8779
|
+
});
|
|
8780
|
+
}
|
|
8781
|
+
setValidatorsAccordingList(pixAccountList, index = null, isEditMode = true) {
|
|
8782
|
+
console.log("setValidatorsAccordingList", pixAccountList, index, isEditMode);
|
|
8783
|
+
this.pixAccountList = pixAccountList && pixAccountList.length ? [...pixAccountList] : [];
|
|
8784
|
+
const percentageIncluded = [];
|
|
8785
|
+
this.pixAccountList.forEach((field, key) => {
|
|
8786
|
+
if (field["percentage"] && key !== index) {
|
|
8787
|
+
percentageIncluded.push(field["percentage"]);
|
|
8788
|
+
}
|
|
8789
|
+
});
|
|
8790
|
+
this.beforeSetPixKeyTypeValidator();
|
|
8791
|
+
this.setPixKeyValidators(isEditMode);
|
|
8792
|
+
this.validatePercentageValid(percentageIncluded);
|
|
8793
|
+
}
|
|
8794
|
+
beforeSetPixKeyTypeValidator() {
|
|
8795
|
+
const pixKeyType = this.pixAccountFormGroup.get("pixKeyType");
|
|
8796
|
+
console.log("beforeSetPixKeyTypeValidator", this.pixAccountList, pixKeyType);
|
|
8797
|
+
if (this.pixAccountList && this.pixAccountList.length && pixKeyType) {
|
|
8798
|
+
pixKeyType.setValidators(Validators.compose([
|
|
8799
|
+
Validators.required,
|
|
8800
|
+
this.validateDuplicatePixKeyTypeBankAccount(this.pixAccountList),
|
|
8801
|
+
]));
|
|
8802
|
+
}
|
|
8803
|
+
else {
|
|
8804
|
+
pixKeyType.setValidators(Validators.required);
|
|
8805
|
+
}
|
|
8806
|
+
}
|
|
8807
|
+
setPixKeyValidators(isEditMode) {
|
|
8808
|
+
const pixKey = this.pixAccountFormGroup.get("pixKey");
|
|
8809
|
+
console.log("setPixKeyValidators", this.pixKeyType, isEditMode);
|
|
8810
|
+
if (this.pixKeyType) {
|
|
8811
|
+
switch (this.pixKeyType) {
|
|
8812
|
+
case "TELEPHONE":
|
|
8813
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidPhoneNumber]));
|
|
8814
|
+
break;
|
|
8815
|
+
case "EMAIL":
|
|
8816
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidEmail]));
|
|
8817
|
+
break;
|
|
8818
|
+
case "CPF":
|
|
8819
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCpf]));
|
|
8820
|
+
break;
|
|
8821
|
+
case "CNPJ":
|
|
8822
|
+
pixKey.setValidators(Validators.compose([Validators.required, GenericValidator.isValidCnpj]));
|
|
8823
|
+
break;
|
|
8824
|
+
case "RANDOM_KEY":
|
|
8825
|
+
pixKey.setValidators(Validators.required);
|
|
8826
|
+
break;
|
|
8827
|
+
default:
|
|
8828
|
+
pixKey.setValidators(null);
|
|
8829
|
+
}
|
|
8830
|
+
if (isEditMode) {
|
|
8831
|
+
pixKey.enable();
|
|
8832
|
+
}
|
|
8833
|
+
pixKey.updateValueAndValidity();
|
|
8834
|
+
}
|
|
8835
|
+
}
|
|
8836
|
+
validatePercentageValid(listValue) {
|
|
8837
|
+
const percentage = this.pixAccountFormGroup.get("percentage");
|
|
8838
|
+
this.maxValuePercentage = listValue.reduce((acc, val) => acc - val, 100.00);
|
|
8839
|
+
console.log("validatePercentageValid", this.maxValuePercentage);
|
|
8840
|
+
percentage.setValidators(Validators.compose([
|
|
8841
|
+
...this.initialValidatorOfPercentage,
|
|
8842
|
+
Validators.max(this.maxValuePercentage),
|
|
8843
|
+
]));
|
|
8844
|
+
percentage.updateValueAndValidity();
|
|
8845
|
+
}
|
|
8846
|
+
validateDuplicatePixKeyTypeBankAccount(listCompare) {
|
|
8847
|
+
return (control) => {
|
|
8848
|
+
const value = control && control.value;
|
|
8849
|
+
const isDuplicate = listCompare.some(field => value && field["pixKeyType"].key === 'BANK_ACCOUNT' && value.key === 'BANK_ACCOUNT');
|
|
8850
|
+
return isDuplicate ? { pixKeyTypeBankAccountDuplicate: true } : null;
|
|
8851
|
+
};
|
|
8852
|
+
}
|
|
8853
|
+
get paramsForm() {
|
|
8854
|
+
return this._paramsForm;
|
|
8855
|
+
}
|
|
8856
|
+
set paramsForm(value) {
|
|
8857
|
+
this._paramsForm = value;
|
|
8858
|
+
}
|
|
8859
|
+
get defaultCpfNumber() {
|
|
8860
|
+
return this._defaultCpfNumber;
|
|
8861
|
+
}
|
|
8862
|
+
set defaultCpfNumber(value) {
|
|
8863
|
+
this._defaultCpfNumber = value;
|
|
8864
|
+
}
|
|
8865
|
+
}
|
|
8866
|
+
|
|
8867
|
+
let HistoricalPixAccountService = class HistoricalPixAccountService {
|
|
8868
|
+
constructor(http) {
|
|
8869
|
+
this.http = http;
|
|
8870
|
+
}
|
|
8871
|
+
query(path, body, service = ServiceType.PAYROLL) {
|
|
8872
|
+
return this.http.query(path, body, service);
|
|
8873
|
+
}
|
|
8874
|
+
enumQuery() {
|
|
8875
|
+
const path = 'enumQuery';
|
|
8876
|
+
const body = {
|
|
8877
|
+
names: ['PixKeyType']
|
|
8878
|
+
};
|
|
8879
|
+
return this.http.query(path, body, ServiceType.PAYROLL);
|
|
8880
|
+
}
|
|
8881
|
+
};
|
|
8882
|
+
HistoricalPixAccountService.ctorParameters = () => [
|
|
8883
|
+
{ type: HttpClientService }
|
|
8884
|
+
];
|
|
8885
|
+
HistoricalPixAccountService = __decorate([
|
|
8886
|
+
Injectable()
|
|
8887
|
+
], HistoricalPixAccountService);
|
|
8888
|
+
|
|
8889
|
+
let HistoricalPixAccountComponent = class HistoricalPixAccountComponent extends HistoricakPixAccountBase {
|
|
8890
|
+
constructor(translateService, cd, formBuilder, messageService, sharedStateService, service) {
|
|
8891
|
+
super(formBuilder);
|
|
8526
8892
|
this.translateService = translateService;
|
|
8527
8893
|
this.cd = cd;
|
|
8528
|
-
this.formBuilder = formBuilder;
|
|
8529
8894
|
this.messageService = messageService;
|
|
8895
|
+
this.sharedStateService = sharedStateService;
|
|
8896
|
+
this.service = service;
|
|
8530
8897
|
this.recordByRow = 1;
|
|
8531
8898
|
this.showDateChange = false;
|
|
8532
8899
|
this.isEditMode = false;
|
|
8533
8900
|
this.isViewMode = false;
|
|
8534
8901
|
this.withSideBar = true;
|
|
8535
|
-
this.defaultCpfNumber = null;
|
|
8536
8902
|
this.listDataReciever = [];
|
|
8903
|
+
this.addExistentHistoricData = [];
|
|
8904
|
+
this.getListPixAccount = [];
|
|
8537
8905
|
this.isViewModeActive = new EventEmitter();
|
|
8538
8906
|
this.isEditModeActive = new EventEmitter();
|
|
8539
8907
|
this.isDeleteModeActive = new EventEmitter();
|
|
@@ -8550,19 +8918,35 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8550
8918
|
this.loading = true;
|
|
8551
8919
|
this.listData = [];
|
|
8552
8920
|
this.listDataNoPage = [];
|
|
8921
|
+
this.showButtonView = true;
|
|
8922
|
+
this.showEditMode = false;
|
|
8923
|
+
this.activeIndex = 0;
|
|
8924
|
+
this.hasRecordsPix = true;
|
|
8925
|
+
this.firstPix = 0;
|
|
8926
|
+
this.maxValuePercentage = 100.00;
|
|
8927
|
+
this.hideFields = this.sharedStateService.hideField$;
|
|
8928
|
+
this.suggestions = [];
|
|
8553
8929
|
this.cols = [
|
|
8554
8930
|
{
|
|
8555
8931
|
label: this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
|
|
8556
8932
|
field: "pixKeyType",
|
|
8933
|
+
orderBy: 'pixKeyType.key',
|
|
8557
8934
|
},
|
|
8558
8935
|
{
|
|
8559
8936
|
label: this.translateService.instant("hcm.payroll.employees_addition_pix_key"),
|
|
8560
8937
|
field: "pixKey",
|
|
8938
|
+
orderBy: 'pixKey',
|
|
8561
8939
|
},
|
|
8562
8940
|
{
|
|
8563
8941
|
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_percentage"),
|
|
8564
8942
|
field: "percentage",
|
|
8943
|
+
orderBy: 'percentage',
|
|
8565
8944
|
},
|
|
8945
|
+
{
|
|
8946
|
+
label: this.translateService.instant("hcm.payroll.movimentation_generic_action"),
|
|
8947
|
+
field: "actions",
|
|
8948
|
+
orderBy: null,
|
|
8949
|
+
}
|
|
8566
8950
|
];
|
|
8567
8951
|
this.actions = (rowData = {}, key) => {
|
|
8568
8952
|
return [
|
|
@@ -8600,7 +8984,7 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8600
8984
|
},
|
|
8601
8985
|
},
|
|
8602
8986
|
{
|
|
8603
|
-
visible: !this.isEditMode,
|
|
8987
|
+
visible: !this.isEditMode || this.showEditMode,
|
|
8604
8988
|
label: this.translateService.instant("hcm.payroll.delete"),
|
|
8605
8989
|
command: () => {
|
|
8606
8990
|
if (this.isAllowToDeleteHistorical) {
|
|
@@ -8622,11 +9006,20 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8622
9006
|
}
|
|
8623
9007
|
ngOnInit() {
|
|
8624
9008
|
this.formGroup.setControl(this.fieldFormGroup, this.historicalPixAccountList);
|
|
9009
|
+
this.sharedStateService.showButton$.subscribe((value) => {
|
|
9010
|
+
this.showButtonView = value;
|
|
9011
|
+
});
|
|
9012
|
+
this.sharedStateService.showEditMode$.subscribe((value) => {
|
|
9013
|
+
this.showEditMode = value;
|
|
9014
|
+
});
|
|
8625
9015
|
}
|
|
8626
9016
|
ngOnChanges(changes) {
|
|
8627
9017
|
if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
|
|
8628
9018
|
this.listFromApp = changes['listDataReciever'].currentValue;
|
|
8629
9019
|
}
|
|
9020
|
+
if (changes['addExistentHistoricData'] && changes['addExistentHistoricData'].currentValue) {
|
|
9021
|
+
this.getHistoricalPixAccountList();
|
|
9022
|
+
}
|
|
8630
9023
|
}
|
|
8631
9024
|
createFormGroup() {
|
|
8632
9025
|
this.historicalPixAccountList = this.formBuilder.group({
|
|
@@ -8640,6 +9033,18 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8640
9033
|
ngAfterViewInit() {
|
|
8641
9034
|
this.cd.detectChanges();
|
|
8642
9035
|
}
|
|
9036
|
+
filterPixKeyType(event) {
|
|
9037
|
+
const query = event.query;
|
|
9038
|
+
this.service.enumQuery().subscribe((response) => {
|
|
9039
|
+
const pixKeyTypeEnum = response.results.find((result) => result.enumName === 'PixKeyType');
|
|
9040
|
+
if (pixKeyTypeEnum) {
|
|
9041
|
+
this.suggestions = pixKeyTypeEnum.items.filter((item) => item.value.toLowerCase().includes(query.toLowerCase()));
|
|
9042
|
+
}
|
|
9043
|
+
else {
|
|
9044
|
+
this.suggestions = [];
|
|
9045
|
+
}
|
|
9046
|
+
});
|
|
9047
|
+
}
|
|
8643
9048
|
onLazyLoad(event) {
|
|
8644
9049
|
const first = event && event.first ? event.first : 0;
|
|
8645
9050
|
const rows = event && event.rows ? event.rows : this.recordByRow;
|
|
@@ -8683,12 +9088,16 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8683
9088
|
this.pixAccountItemInput = {};
|
|
8684
9089
|
this.visible = true;
|
|
8685
9090
|
}
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
}
|
|
9091
|
+
addPix() {
|
|
9092
|
+
const newItem = {
|
|
9093
|
+
pixKeyType: {},
|
|
9094
|
+
pixKey: '',
|
|
9095
|
+
percentage: 0
|
|
9096
|
+
};
|
|
9097
|
+
this.addExistentHistoricData = [...this.addExistentHistoricData, newItem];
|
|
9098
|
+
}
|
|
9099
|
+
deletePix(index) {
|
|
9100
|
+
this.addExistentHistoricData = this.addExistentHistoricData.filter((_, i) => i !== index);
|
|
8692
9101
|
}
|
|
8693
9102
|
deleteAnnuityItem(index) {
|
|
8694
9103
|
let newlist = [...this.getHistoricalPixAccountList()];
|
|
@@ -8786,6 +9195,12 @@ let HistoricalPixAccountComponent = class HistoricalPixAccountComponent {
|
|
|
8786
9195
|
get visible() {
|
|
8787
9196
|
return this._visible;
|
|
8788
9197
|
}
|
|
9198
|
+
set paramsForm(value) {
|
|
9199
|
+
this._paramsForm = value;
|
|
9200
|
+
}
|
|
9201
|
+
set defaultCpfNumber(value) {
|
|
9202
|
+
this._defaultCpfNumber = value;
|
|
9203
|
+
}
|
|
8789
9204
|
set visible(value) {
|
|
8790
9205
|
this._visible = value;
|
|
8791
9206
|
this.visibleChange.emit(this.visible);
|
|
@@ -8822,7 +9237,9 @@ HistoricalPixAccountComponent.ctorParameters = () => [
|
|
|
8822
9237
|
{ type: TranslateService },
|
|
8823
9238
|
{ type: ChangeDetectorRef },
|
|
8824
9239
|
{ type: FormBuilder },
|
|
8825
|
-
{ type: MessageService }
|
|
9240
|
+
{ type: MessageService },
|
|
9241
|
+
{ type: SharedStateService },
|
|
9242
|
+
{ type: HistoricalPixAccountService }
|
|
8826
9243
|
];
|
|
8827
9244
|
__decorate([
|
|
8828
9245
|
ViewChild(CustomFieldsComponent$1, { static: false })
|
|
@@ -8866,234 +9283,72 @@ __decorate([
|
|
|
8866
9283
|
__decorate([
|
|
8867
9284
|
Input()
|
|
8868
9285
|
], HistoricalPixAccountComponent.prototype, "withSideBar", void 0);
|
|
8869
|
-
__decorate([
|
|
8870
|
-
Input()
|
|
8871
|
-
], HistoricalPixAccountComponent.prototype, "paramsForm", void 0);
|
|
8872
|
-
__decorate([
|
|
8873
|
-
Input()
|
|
8874
|
-
], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", void 0);
|
|
8875
9286
|
__decorate([
|
|
8876
9287
|
Input()
|
|
8877
9288
|
], HistoricalPixAccountComponent.prototype, "permission", void 0);
|
|
8878
|
-
__decorate([
|
|
8879
|
-
Input()
|
|
8880
|
-
], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
|
|
8881
|
-
__decorate([
|
|
8882
|
-
|
|
8883
|
-
], HistoricalPixAccountComponent.prototype, "
|
|
8884
|
-
__decorate([
|
|
8885
|
-
|
|
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
|
-
}
|
|
9289
|
+
__decorate([
|
|
9290
|
+
Input()
|
|
9291
|
+
], HistoricalPixAccountComponent.prototype, "listDataReciever", void 0);
|
|
9292
|
+
__decorate([
|
|
9293
|
+
Input()
|
|
9294
|
+
], HistoricalPixAccountComponent.prototype, "addExistentHistoricData", void 0);
|
|
9295
|
+
__decorate([
|
|
9296
|
+
Input()
|
|
9297
|
+
], HistoricalPixAccountComponent.prototype, "getListPixAccount", void 0);
|
|
9298
|
+
__decorate([
|
|
9299
|
+
Output()
|
|
9300
|
+
], HistoricalPixAccountComponent.prototype, "isViewModeActive", void 0);
|
|
9301
|
+
__decorate([
|
|
9302
|
+
Output()
|
|
9303
|
+
], HistoricalPixAccountComponent.prototype, "isEditModeActive", void 0);
|
|
9304
|
+
__decorate([
|
|
9305
|
+
Output()
|
|
9306
|
+
], HistoricalPixAccountComponent.prototype, "isDeleteModeActive", void 0);
|
|
9307
|
+
__decorate([
|
|
9308
|
+
Input()
|
|
9309
|
+
], HistoricalPixAccountComponent.prototype, "dateChange", null);
|
|
9310
|
+
__decorate([
|
|
9311
|
+
Input()
|
|
9312
|
+
], HistoricalPixAccountComponent.prototype, "displayDateChange", null);
|
|
9313
|
+
__decorate([
|
|
9314
|
+
Input()
|
|
9315
|
+
], HistoricalPixAccountComponent.prototype, "addListData", null);
|
|
9316
|
+
__decorate([
|
|
9317
|
+
Input()
|
|
9318
|
+
], HistoricalPixAccountComponent.prototype, "visible", null);
|
|
9319
|
+
__decorate([
|
|
9320
|
+
Input()
|
|
9321
|
+
], HistoricalPixAccountComponent.prototype, "paramsForm", null);
|
|
9322
|
+
__decorate([
|
|
9323
|
+
Input()
|
|
9324
|
+
], HistoricalPixAccountComponent.prototype, "defaultCpfNumber", null);
|
|
9325
|
+
HistoricalPixAccountComponent = __decorate([
|
|
9326
|
+
Component({
|
|
9327
|
+
// tslint:disable-next-line:component-selector
|
|
9328
|
+
selector: "c-historical-pix-account",
|
|
9329
|
+
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<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 id=\"btn-save\" label=\"Adicionar\" priority=\"primary\" (onClick)=\"addPix()\"></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 [customSort]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of cols\" [pSortableColumn]=\"col.orderBy\">\n {{ col.label }}\n <p-sortIcon *ngIf=\"col.orderBy\" [field]=\"col.orderBy\"></p-sortIcon>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-item let-rowIndex=\"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 [(ngModel)]=\"item.pixKeyType\"\n [formControl]=\"pixAccountFormGroup.get('pixKeyType')\"\n [dropdown]=\"true\"\n field=\"value\"\n placeholder=\"Selecione o tipo de chave\"\n appendTo=\"body\"\n [panelStyle]=\"{ maxWidth: '300px', width: '100%' }\"\n [inputStyle]=\"{ width: '100%' }\"\n >\n </p-autoComplete>\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 </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\" [pEditableColumn]=\"item.pixKey\" pEditableColumnField=\"pixKey\"\n [ngClass]=\"{'required': item.pixKeyType.key !== 'BANK_ACCOUNT'}\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <ng-container [ngSwitch]=\"item.pixKeyType.key\">\n <!-- TELEPHONE -->\n <input *ngSwitchCase=\"'TELEPHONE'\"\n only-number\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n (keyup)=\"phoneMask($event)\"\n maxlength=\"15\"\n placeholder=\"(__) ____-____\"/>\n\n <!-- CPF -->\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"___.___.___-__\"\n mask=\"999.999.999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- CNPJ -->\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"__.___.___/____-__\"\n mask=\"99.999.999/9999-99\"\n [unmask]=\"true\">\n </p-inputMask>\n\n <!-- EMAIL -->\n <input *ngSwitchCase=\"'EMAIL'\"\n pInputText\n type=\"email\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n placeholder=\"{{'hcm.payroll.employees_addition_email' | translate}}\"/>\n\n <!-- BANK_ACCOUNT -->\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n pInputText\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n [disabled]=\"true\"/>\n\n <!-- DEFAULT -->\n <input *ngSwitchDefault\n pInputText\n type=\"text\"\n [(ngModel)]=\"item.pixKey\"\n [formControl]=\"pixAccountFormGroup.get('pixKey')\"\n maxlength=\"100\"/>\n </ng-container>\n\n <!-- Error messages -->\n <s-control-errors *ngIf=\"isShowPixKeyFieldValidatorMessage\"\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 </ng-template>\n\n <ng-template pTemplate=\"output\">\n {{ item.pixKey }}\n </ng-template>\n </p-cellEditor>\n </td>\n\n\n <!-- Percentual -->\n <td class=\"ui-md-6 ui-sm-12 required\" [pEditableColumn]=\"item.percentage\" pEditableColumnField=\"percentage\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input pInputText type=\"number\" [(ngModel)]=\"item.percentage\" [formControl]=\"pixAccountFormGroup.get('percentage')\">\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 </ng-template>\n <ng-template pTemplate=\"output\">\n {{ item.percentage }}%\n </ng-template>\n </p-cellEditor>\n </td>\n\n <!-- Bot\u00E3o de excluir -->\n <td>\n <s-button id=\"btn-delete\" label=\"Excluir\" priority=\"default\" (onClick)=\"deletePix(rowIndex)\"></s-button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n",
|
|
9330
|
+
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}"]
|
|
9331
|
+
})
|
|
9332
|
+
], HistoricalPixAccountComponent);
|
|
9074
9333
|
|
|
9075
|
-
let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent {
|
|
9076
|
-
constructor(formBuilder, cd) {
|
|
9077
|
-
|
|
9334
|
+
let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent extends HistoricakPixAccountBase {
|
|
9335
|
+
constructor(formBuilder, cd, sharedStateService) {
|
|
9336
|
+
super(formBuilder);
|
|
9078
9337
|
this.cd = cd;
|
|
9338
|
+
this.sharedStateService = sharedStateService;
|
|
9079
9339
|
this.withSideBar = true;
|
|
9080
9340
|
this.isEditMode = false;
|
|
9081
|
-
this.paramsForm = new FormGroup({});
|
|
9082
|
-
this.defaultCpfNumber = null;
|
|
9083
9341
|
this.visibleChange = new EventEmitter();
|
|
9084
9342
|
this.pixAccountItemToList = new EventEmitter();
|
|
9085
9343
|
this.ngUnsubscribe = new Subject();
|
|
9086
|
-
this.initialValidatorOfPercentage = [Validators.required, Validators.min(0.01)];
|
|
9087
9344
|
this.labelBtnAdd = "hcm.payroll.employees_add";
|
|
9088
|
-
this.maxValuePercentage = 100.00;
|
|
9089
9345
|
this.visibleBtnSave = true;
|
|
9090
9346
|
this.isView = false;
|
|
9091
9347
|
this.isShowPixKeyFieldValidatorMessage = false;
|
|
9092
|
-
this.
|
|
9348
|
+
this.hideFields = this.sharedStateService.hideField$;
|
|
9093
9349
|
this.registerSubjects();
|
|
9094
9350
|
}
|
|
9095
|
-
ngOnInit() {
|
|
9096
|
-
}
|
|
9351
|
+
ngOnInit() { }
|
|
9097
9352
|
ngAfterViewInit() {
|
|
9098
9353
|
this.cd.detectChanges();
|
|
9099
9354
|
}
|
|
@@ -9101,39 +9356,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9101
9356
|
this.ngUnsubscribe.next(true);
|
|
9102
9357
|
this.ngUnsubscribe.unsubscribe();
|
|
9103
9358
|
}
|
|
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
|
-
}
|
|
9359
|
+
registerSubjects() { }
|
|
9137
9360
|
get visible() {
|
|
9138
9361
|
return this._visible;
|
|
9139
9362
|
}
|
|
@@ -9164,7 +9387,8 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9164
9387
|
}
|
|
9165
9388
|
formatPixKeyTelephoneNumber() {
|
|
9166
9389
|
if (this.pixKeyType === "TELEPHONE") {
|
|
9167
|
-
this.pixAccountFormGroup.get("pixKey")
|
|
9390
|
+
const pixKeyCtrl = this.pixAccountFormGroup.get("pixKey");
|
|
9391
|
+
pixKeyCtrl.setValue(FormatUtilsService.getFormattedTelephoneNumber(pixKeyCtrl.value));
|
|
9168
9392
|
}
|
|
9169
9393
|
}
|
|
9170
9394
|
convertDTOToShowWithCustomFields(data) {
|
|
@@ -9183,7 +9407,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9183
9407
|
"pixKeyType",
|
|
9184
9408
|
"pixKey",
|
|
9185
9409
|
"percentage",
|
|
9186
|
-
"customFields"
|
|
9410
|
+
"customFields"
|
|
9187
9411
|
], []);
|
|
9188
9412
|
}
|
|
9189
9413
|
close() {
|
|
@@ -9197,7 +9421,7 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9197
9421
|
if (this.employeeId) {
|
|
9198
9422
|
this.pixAccountFormGroup.get("employee").setValue({
|
|
9199
9423
|
tableId: this.employeeId,
|
|
9200
|
-
name: ""
|
|
9424
|
+
name: ""
|
|
9201
9425
|
});
|
|
9202
9426
|
}
|
|
9203
9427
|
this.pixAccountItemToList.emit(this.pixAccountFormGroup.getRawValue());
|
|
@@ -9221,13 +9445,9 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9221
9445
|
return {
|
|
9222
9446
|
prefix: "",
|
|
9223
9447
|
thousands: this.currency.thousandsSeparator,
|
|
9224
|
-
decimal: this.currency.decimalSeparator
|
|
9448
|
+
decimal: this.currency.decimalSeparator
|
|
9225
9449
|
};
|
|
9226
9450
|
}
|
|
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
9451
|
set getListPixAccount(pixAccountList) {
|
|
9232
9452
|
if (pixAccountList) {
|
|
9233
9453
|
this.setValidatorsAccordingList(pixAccountList, null, false);
|
|
@@ -9236,143 +9456,23 @@ let HistoricalPixAccountFormComponent = class HistoricalPixAccountFormComponent
|
|
|
9236
9456
|
this.resetForm();
|
|
9237
9457
|
}
|
|
9238
9458
|
}
|
|
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
9459
|
set isViewMode(condition) {
|
|
9318
9460
|
this.isView = !!(condition && !this.withSideBar);
|
|
9319
9461
|
this.configEnableFields(!this.isView);
|
|
9320
9462
|
if (!this.isView)
|
|
9321
9463
|
this.resetForm();
|
|
9322
9464
|
}
|
|
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
|
-
}
|
|
9465
|
+
set paramsForm(value) {
|
|
9466
|
+
this._paramsForm = value;
|
|
9352
9467
|
}
|
|
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
|
-
};
|
|
9468
|
+
set defaultCpfNumber(value) {
|
|
9469
|
+
this._defaultCpfNumber = value;
|
|
9371
9470
|
}
|
|
9372
9471
|
};
|
|
9373
9472
|
HistoricalPixAccountFormComponent.ctorParameters = () => [
|
|
9374
9473
|
{ type: FormBuilder },
|
|
9375
|
-
{ type: ChangeDetectorRef }
|
|
9474
|
+
{ type: ChangeDetectorRef },
|
|
9475
|
+
{ type: SharedStateService }
|
|
9376
9476
|
];
|
|
9377
9477
|
__decorate([
|
|
9378
9478
|
ViewChild(CustomFieldsComponent$1, { static: true })
|
|
@@ -9392,12 +9492,6 @@ __decorate([
|
|
|
9392
9492
|
__decorate([
|
|
9393
9493
|
Input()
|
|
9394
9494
|
], 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
9495
|
__decorate([
|
|
9402
9496
|
Output()
|
|
9403
9497
|
], HistoricalPixAccountFormComponent.prototype, "visibleChange", void 0);
|
|
@@ -9416,29 +9510,20 @@ __decorate([
|
|
|
9416
9510
|
__decorate([
|
|
9417
9511
|
Input()
|
|
9418
9512
|
], HistoricalPixAccountFormComponent.prototype, "isViewMode", null);
|
|
9513
|
+
__decorate([
|
|
9514
|
+
Input()
|
|
9515
|
+
], HistoricalPixAccountFormComponent.prototype, "paramsForm", null);
|
|
9516
|
+
__decorate([
|
|
9517
|
+
Input()
|
|
9518
|
+
], HistoricalPixAccountFormComponent.prototype, "defaultCpfNumber", null);
|
|
9419
9519
|
HistoricalPixAccountFormComponent = __decorate([
|
|
9420
9520
|
Component({
|
|
9421
9521
|
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",
|
|
9522
|
+
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
9523
|
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
9524
|
})
|
|
9425
9525
|
], HistoricalPixAccountFormComponent);
|
|
9426
9526
|
|
|
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
9527
|
let HistoricalPixAccountModule = class HistoricalPixAccountModule {
|
|
9443
9528
|
};
|
|
9444
9529
|
HistoricalPixAccountModule = __decorate([
|
|
@@ -9466,6 +9551,8 @@ HistoricalPixAccountModule = __decorate([
|
|
|
9466
9551
|
CustomFieldsModule$1,
|
|
9467
9552
|
PanelModule,
|
|
9468
9553
|
InputMaskModule,
|
|
9554
|
+
DropdownModule,
|
|
9555
|
+
TabViewModule,
|
|
9469
9556
|
],
|
|
9470
9557
|
declarations: [HistoricalPixAccountComponent, HistoricalPixAccountFormComponent],
|
|
9471
9558
|
providers: [HistoricalPixAccountService, ConfirmationService],
|
|
@@ -9504,7 +9591,7 @@ HistoricalPixAccountListService = __decorate([
|
|
|
9504
9591
|
|
|
9505
9592
|
const moment$e = moment_;
|
|
9506
9593
|
let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent {
|
|
9507
|
-
constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService) {
|
|
9594
|
+
constructor(confirmationService, translateService, activatedRoute, cd, router, messageService, historicalPixAccountListService, sharedStateService) {
|
|
9508
9595
|
this.confirmationService = confirmationService;
|
|
9509
9596
|
this.translateService = translateService;
|
|
9510
9597
|
this.activatedRoute = activatedRoute;
|
|
@@ -9512,11 +9599,14 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9512
9599
|
this.router = router;
|
|
9513
9600
|
this.messageService = messageService;
|
|
9514
9601
|
this.historicalPixAccountListService = historicalPixAccountListService;
|
|
9602
|
+
this.sharedStateService = sharedStateService;
|
|
9515
9603
|
this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
|
|
9516
9604
|
this.keyPayload = "historicalEmployeePix";
|
|
9517
9605
|
this.withSidebar = true;
|
|
9518
9606
|
this.isOnlyView = new EventEmitter();
|
|
9607
|
+
this.isOnlyEdit = new EventEmitter();
|
|
9519
9608
|
this.enableView = new EventEmitter();
|
|
9609
|
+
this.isEditJudicialDependentPix = new EventEmitter();
|
|
9520
9610
|
this.ngUnsubscribe = new Subject();
|
|
9521
9611
|
this.loading = true;
|
|
9522
9612
|
this.columns = [
|
|
@@ -9524,18 +9614,6 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9524
9614
|
label: this.translateService.instant("hcm.payroll.historical_pix_account_label_date_change"),
|
|
9525
9615
|
field: "dateChange",
|
|
9526
9616
|
},
|
|
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
9617
|
{
|
|
9540
9618
|
label: this.translateService.instant("hcm.payroll.employees_movimentation_historical_pix_account_label_qtd_account"),
|
|
9541
9619
|
field: "numberOfPixAccount",
|
|
@@ -9548,6 +9626,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9548
9626
|
ngOnDestroy() {
|
|
9549
9627
|
this.ngUnsubscribe.next();
|
|
9550
9628
|
this.ngUnsubscribe.complete();
|
|
9629
|
+
this.unsubscribe();
|
|
9551
9630
|
}
|
|
9552
9631
|
ngAfterViewInit() {
|
|
9553
9632
|
this.cd.detectChanges();
|
|
@@ -9555,33 +9634,19 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9555
9634
|
onLazyLoad(payload) {
|
|
9556
9635
|
payload.forEach((value) => {
|
|
9557
9636
|
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
9637
|
});
|
|
9561
9638
|
this.onGridLoad(payload);
|
|
9562
9639
|
this.loading = false;
|
|
9563
9640
|
}
|
|
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
9641
|
getMenuActions(rowData) {
|
|
9580
9642
|
return [
|
|
9581
9643
|
{
|
|
9582
9644
|
label: this.translateService.instant("hcm.payroll.employees_image_cropper_view"),
|
|
9583
9645
|
command: () => {
|
|
9584
9646
|
if (this.isAllowToViewHistorical) {
|
|
9647
|
+
this.sharedStateService.setHideField(true);
|
|
9648
|
+
this.sharedStateService.setShowButton(false);
|
|
9649
|
+
this.sharedStateService.setShowEditMode(false);
|
|
9585
9650
|
const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
|
|
9586
9651
|
if (this.withSidebar) {
|
|
9587
9652
|
this.isOnlyView.emit(true);
|
|
@@ -9590,6 +9655,30 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9590
9655
|
});
|
|
9591
9656
|
}
|
|
9592
9657
|
else {
|
|
9658
|
+
this.sharedStateService.setSaveButton(false);
|
|
9659
|
+
this.enableView.emit(dateChange);
|
|
9660
|
+
}
|
|
9661
|
+
}
|
|
9662
|
+
else {
|
|
9663
|
+
this.isNotAllowMessage();
|
|
9664
|
+
}
|
|
9665
|
+
},
|
|
9666
|
+
},
|
|
9667
|
+
{
|
|
9668
|
+
label: this.translateService.instant("hcm.payroll.edit"),
|
|
9669
|
+
command: () => {
|
|
9670
|
+
if (this.isAllowToEditHistorical) {
|
|
9671
|
+
this.sharedStateService.setHideField(true);
|
|
9672
|
+
this.sharedStateService.setShowButton(false);
|
|
9673
|
+
this.sharedStateService.setShowEditMode(true);
|
|
9674
|
+
const dateChange = rowData && rowData.dateChange && moment$e(rowData.dateChange, this.dateFormat).format("YYYY-MM-DD");
|
|
9675
|
+
if (this.withSidebar) {
|
|
9676
|
+
this.router.navigate([`historical-pix-account/${dateChange}`], {
|
|
9677
|
+
relativeTo: this.activatedRoute,
|
|
9678
|
+
});
|
|
9679
|
+
}
|
|
9680
|
+
else {
|
|
9681
|
+
this.sharedStateService.setSaveButton(true);
|
|
9593
9682
|
this.enableView.emit(dateChange);
|
|
9594
9683
|
}
|
|
9595
9684
|
}
|
|
@@ -9608,7 +9697,7 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9608
9697
|
this.isNotAllowMessage();
|
|
9609
9698
|
}
|
|
9610
9699
|
},
|
|
9611
|
-
}
|
|
9700
|
+
}
|
|
9612
9701
|
];
|
|
9613
9702
|
}
|
|
9614
9703
|
delete(id, dateChange) {
|
|
@@ -9674,6 +9763,19 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9674
9763
|
this.lastRecord = payload[0];
|
|
9675
9764
|
}
|
|
9676
9765
|
}
|
|
9766
|
+
unsubscribe() {
|
|
9767
|
+
if (this._subscription) {
|
|
9768
|
+
this._subscription.unsubscribe();
|
|
9769
|
+
}
|
|
9770
|
+
}
|
|
9771
|
+
set hideFieldsOnAdd$(subject) {
|
|
9772
|
+
this.unsubscribe();
|
|
9773
|
+
if (subject) {
|
|
9774
|
+
this._subscription = subject.subscribe((value) => {
|
|
9775
|
+
this.sharedStateService.setHideField(value);
|
|
9776
|
+
});
|
|
9777
|
+
}
|
|
9778
|
+
}
|
|
9677
9779
|
get isAllowToAddHistorical() {
|
|
9678
9780
|
return (this.permission["incluir"]);
|
|
9679
9781
|
}
|
|
@@ -9683,6 +9785,9 @@ let HistoricalPixAccountListComponent = class HistoricalPixAccountListComponent
|
|
|
9683
9785
|
get isAllowToViewHistorical() {
|
|
9684
9786
|
return (this.permission["visualizar"]);
|
|
9685
9787
|
}
|
|
9788
|
+
get isAllowToEditHistorical() {
|
|
9789
|
+
return (this.permission["editar"]);
|
|
9790
|
+
}
|
|
9686
9791
|
get scopedActions() {
|
|
9687
9792
|
return this.getMenuActions.bind(this);
|
|
9688
9793
|
}
|
|
@@ -9700,7 +9805,8 @@ HistoricalPixAccountListComponent.ctorParameters = () => [
|
|
|
9700
9805
|
{ type: ChangeDetectorRef },
|
|
9701
9806
|
{ type: Router },
|
|
9702
9807
|
{ type: MessageService },
|
|
9703
|
-
{ type: HistoricalPixAccountListService }
|
|
9808
|
+
{ type: HistoricalPixAccountListService },
|
|
9809
|
+
{ type: SharedStateService }
|
|
9704
9810
|
];
|
|
9705
9811
|
__decorate([
|
|
9706
9812
|
ViewChild(CustomFieldsComponent$1, { static: false })
|
|
@@ -9726,12 +9832,24 @@ __decorate([
|
|
|
9726
9832
|
__decorate([
|
|
9727
9833
|
Input()
|
|
9728
9834
|
], HistoricalPixAccountListComponent.prototype, "withSidebar", void 0);
|
|
9835
|
+
__decorate([
|
|
9836
|
+
Input()
|
|
9837
|
+
], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
|
|
9729
9838
|
__decorate([
|
|
9730
9839
|
Output()
|
|
9731
9840
|
], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
|
|
9841
|
+
__decorate([
|
|
9842
|
+
Output()
|
|
9843
|
+
], HistoricalPixAccountListComponent.prototype, "isOnlyEdit", void 0);
|
|
9732
9844
|
__decorate([
|
|
9733
9845
|
Output()
|
|
9734
9846
|
], HistoricalPixAccountListComponent.prototype, "enableView", void 0);
|
|
9847
|
+
__decorate([
|
|
9848
|
+
Output()
|
|
9849
|
+
], HistoricalPixAccountListComponent.prototype, "isEditJudicialDependentPix", void 0);
|
|
9850
|
+
__decorate([
|
|
9851
|
+
Input()
|
|
9852
|
+
], HistoricalPixAccountListComponent.prototype, "hideFieldsOnAdd$", null);
|
|
9735
9853
|
__decorate([
|
|
9736
9854
|
Input()
|
|
9737
9855
|
], HistoricalPixAccountListComponent.prototype, "reloadList", null);
|
|
@@ -9776,5 +9894,5 @@ HistoricalPixAccountListModule = __decorate([
|
|
|
9776
9894
|
* Generated bundle index. Do not edit.
|
|
9777
9895
|
*/
|
|
9778
9896
|
|
|
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,
|
|
9897
|
+
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
9898
|
//# sourceMappingURL=senior-gestao-pessoas-payroll-core.js.map
|