@senior-gestao-pessoas/payroll-core 9.5.0-3888ac21-edb9-4553-82f4-3a69943e1d42 → 9.5.0-77209b41-a4ab-43cd-89d7-40623b664fa9
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 +480 -77
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +2 -2
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
- package/components/historical-pix-account/historical-pix-account.component.d.ts +67 -9
- package/components/historical-pix-account-list/historical-pix-account-list.component.d.ts +1 -0
- package/components/shared/shared-state.service.d.ts +4 -0
- package/esm2015/components/historical-pix-account/historical-pix-account-base.js +9 -2
- package/esm2015/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
- package/esm2015/components/historical-pix-account/historical-pix-account.component.js +446 -77
- package/esm2015/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
- package/esm2015/components/shared/shared-state.service.js +9 -1
- package/esm2015/components/utils/format-utils/format-utils.service.js +3 -1
- package/esm5/components/historical-pix-account/historical-pix-account-base.js +9 -2
- package/esm5/components/historical-pix-account/historical-pix-account-form/historical-pix-account-form.component.js +1 -1
- package/esm5/components/historical-pix-account/historical-pix-account.component.js +456 -77
- package/esm5/components/historical-pix-account-list/historical-pix-account-list.component.js +9 -1
- package/esm5/components/shared/shared-state.service.js +9 -1
- package/esm5/components/utils/format-utils/format-utils.service.js +3 -1
- package/fesm2015/senior-gestao-pessoas-payroll-core.js +470 -77
- package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js +480 -77
- package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
|
@@ -9483,6 +9483,7 @@
|
|
|
9483
9483
|
*/
|
|
9484
9484
|
FormatUtilsService.formatCpfInputEvent = function (event) {
|
|
9485
9485
|
var cpf = event.target.value;
|
|
9486
|
+
console.log("FormatUtilsService.formatCpfInputEvent.cpf: " + cpf);
|
|
9486
9487
|
// Permite apagar nos pontos sensíveis
|
|
9487
9488
|
if (event.keyCode === 8 && (cpf.length === 4 || cpf.length === 8 || cpf.length === 12)) {
|
|
9488
9489
|
return;
|
|
@@ -9495,6 +9496,7 @@
|
|
|
9495
9496
|
*/
|
|
9496
9497
|
FormatUtilsService.formatCnpjInputEvent = function (event) {
|
|
9497
9498
|
var cnpj = event.target.value;
|
|
9499
|
+
console.log("FormatUtilsService.formatCnpjInputEvent.cnpj: " + cnpj);
|
|
9498
9500
|
// Permite apagar nos pontos sensíveis
|
|
9499
9501
|
if (event.keyCode === 8 && (cnpj.length === 3 || cnpj.length === 7 || cnpj.length === 11 || cnpj.length === 16)) {
|
|
9500
9502
|
return;
|
|
@@ -9518,6 +9520,8 @@
|
|
|
9518
9520
|
this.activeValidatorsOnEditModalOpen$ = this.activeValidatorsOnEditModalOpen.asObservable();
|
|
9519
9521
|
this.hideBtnAddForViewMode = new rxjs.BehaviorSubject(false);
|
|
9520
9522
|
this.hideBtnAddForViewMode$ = this.hideBtnAddForViewMode.asObservable();
|
|
9523
|
+
this.activeHideOptionsOnView = new rxjs.BehaviorSubject(true);
|
|
9524
|
+
this.activeHideOptionsOnView$ = this.activeHideOptionsOnView.asObservable();
|
|
9521
9525
|
}
|
|
9522
9526
|
SharedStateService.prototype.setHideField = function (value) {
|
|
9523
9527
|
this.hideFieldSubject.next(value);
|
|
@@ -9540,6 +9544,12 @@
|
|
|
9540
9544
|
SharedStateService.prototype.resetHideField = function () {
|
|
9541
9545
|
this.hideFieldSubject.next(true);
|
|
9542
9546
|
};
|
|
9547
|
+
SharedStateService.prototype.setActiveHideOptionsOnView = function (value) {
|
|
9548
|
+
this.activeHideOptionsOnView.next(value);
|
|
9549
|
+
};
|
|
9550
|
+
SharedStateService.prototype.getActiveHideOptionsOnView = function () {
|
|
9551
|
+
return this.activeHideOptionsOnView.getValue();
|
|
9552
|
+
};
|
|
9543
9553
|
SharedStateService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function SharedStateService_Factory() { return new SharedStateService(); }, token: SharedStateService, providedIn: "root" });
|
|
9544
9554
|
SharedStateService = __decorate([
|
|
9545
9555
|
core.Injectable({
|
|
@@ -9846,10 +9856,17 @@
|
|
|
9846
9856
|
case "RANDOM_KEY":
|
|
9847
9857
|
pixKey.setValidators(forms.Validators.required);
|
|
9848
9858
|
break;
|
|
9859
|
+
case "BANK_ACCOUNT":
|
|
9860
|
+
pixKey.clearValidators();
|
|
9861
|
+
pixKey.setValue('');
|
|
9862
|
+
break;
|
|
9849
9863
|
default:
|
|
9850
9864
|
pixKey.clearValidators();
|
|
9851
9865
|
}
|
|
9852
|
-
if (
|
|
9866
|
+
if (this.pixKeyType === "BANK_ACCOUNT") {
|
|
9867
|
+
pixKey.disable();
|
|
9868
|
+
}
|
|
9869
|
+
else if (isEditMode) {
|
|
9853
9870
|
pixKey.enable();
|
|
9854
9871
|
}
|
|
9855
9872
|
pixKey.updateValueAndValidity();
|
|
@@ -9962,6 +9979,7 @@
|
|
|
9962
9979
|
_this.hideFields = _this.sharedStateService.hideField$;
|
|
9963
9980
|
_this.suggestions = [];
|
|
9964
9981
|
_this.formGroupByRow = {};
|
|
9982
|
+
_this.isSyncingPercentage = false;
|
|
9965
9983
|
_this.cols = [
|
|
9966
9984
|
{
|
|
9967
9985
|
label: _this.translateService.instant("hcm.payroll.employees_addition_pix_key_type"),
|
|
@@ -10046,6 +10064,11 @@
|
|
|
10046
10064
|
_this.showEditMode = value;
|
|
10047
10065
|
_this.isEditModeForSave = value;
|
|
10048
10066
|
});
|
|
10067
|
+
this.sharedStateService.activeHideOptionsOnView$.subscribe(function (value) {
|
|
10068
|
+
if (value) {
|
|
10069
|
+
_this.showButtonView = false;
|
|
10070
|
+
}
|
|
10071
|
+
});
|
|
10049
10072
|
this.sharedStateService.activeValidatorsOnEditModalOpen$
|
|
10050
10073
|
.subscribe(function () {
|
|
10051
10074
|
Object.values(_this.formGroupByRow).forEach(function (fg) {
|
|
@@ -10056,6 +10079,7 @@
|
|
|
10056
10079
|
});
|
|
10057
10080
|
_this.emitFormValidity();
|
|
10058
10081
|
});
|
|
10082
|
+
this.resetFormState();
|
|
10059
10083
|
};
|
|
10060
10084
|
HistoricalPixAccountComponent.prototype.ngOnChanges = function (changes) {
|
|
10061
10085
|
if (changes['listDataReciever'] && changes['listDataReciever'].currentValue) {
|
|
@@ -10086,9 +10110,31 @@
|
|
|
10086
10110
|
this.cd.detectChanges();
|
|
10087
10111
|
};
|
|
10088
10112
|
HistoricalPixAccountComponent.prototype.emitFormValidity = function () {
|
|
10089
|
-
|
|
10113
|
+
if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
|
|
10114
|
+
this.isValidChangeForm.emit(false);
|
|
10115
|
+
return;
|
|
10116
|
+
}
|
|
10117
|
+
var allValid = true;
|
|
10118
|
+
Object.values(this.formGroupByRow).forEach(function (fg) {
|
|
10119
|
+
// Verifica cada controle individualmente
|
|
10120
|
+
Object.keys(fg.controls).forEach(function (key) {
|
|
10121
|
+
var control = fg.get(key);
|
|
10122
|
+
// Verifica se o controle é obrigatório e está vazio
|
|
10123
|
+
if (control.validator && control.validator({})) {
|
|
10124
|
+
var validatorFn = control.validator({});
|
|
10125
|
+
if (validatorFn && validatorFn.required && !control.value) {
|
|
10126
|
+
allValid = false;
|
|
10127
|
+
}
|
|
10128
|
+
}
|
|
10129
|
+
// Verifica se o controle tem erros
|
|
10130
|
+
if (control.errors) {
|
|
10131
|
+
allValid = false;
|
|
10132
|
+
}
|
|
10133
|
+
});
|
|
10090
10134
|
fg.updateValueAndValidity();
|
|
10091
|
-
|
|
10135
|
+
if (!fg.valid) {
|
|
10136
|
+
allValid = false;
|
|
10137
|
+
}
|
|
10092
10138
|
});
|
|
10093
10139
|
this.isValidChangeForm.emit(allValid);
|
|
10094
10140
|
};
|
|
@@ -10114,61 +10160,22 @@
|
|
|
10114
10160
|
pixKey: [null],
|
|
10115
10161
|
percentage: [0, forms.Validators.compose(__spread(this.initialValidatorOfPercentage, [
|
|
10116
10162
|
forms.Validators.max(this.maxValuePercentage),
|
|
10117
|
-
]))]
|
|
10163
|
+
]))],
|
|
10164
|
+
externalId: [null],
|
|
10118
10165
|
});
|
|
10119
10166
|
};
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
this.setPixKeyValidators(true, form);
|
|
10131
|
-
this.emitFormValidity();
|
|
10132
|
-
};
|
|
10133
|
-
HistoricalPixAccountComponent.prototype.onBlurPixCpfAndCnpj = function (index) {
|
|
10134
|
-
var form = this.formGroupByRow[index];
|
|
10135
|
-
var pixKeyControl = form.get('pixKey');
|
|
10136
|
-
var pixKeyTypeControl = form.get('pixKeyType');
|
|
10137
|
-
if (!pixKeyControl || !pixKeyTypeControl)
|
|
10138
|
-
return;
|
|
10139
|
-
var currentValue = pixKeyControl.value;
|
|
10140
|
-
var pixKeyType = pixKeyTypeControl.value.key;
|
|
10141
|
-
var rawValue = (currentValue || '').replace(/\D/g, '');
|
|
10142
|
-
pixKeyControl.setValue(rawValue, { emitEvent: false });
|
|
10143
|
-
if (pixKeyControl.valid) {
|
|
10144
|
-
form.patchValue({
|
|
10145
|
-
pixKeyFormatted: FormatUtilsService.getFormattedSubscriptionNumber(rawValue, pixKeyType)
|
|
10167
|
+
/**
|
|
10168
|
+
* Sincroniza todos os dados do NgModel para os FormGroups antes de enviar ao componente pai
|
|
10169
|
+
*/
|
|
10170
|
+
HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
|
|
10171
|
+
this.syncAllModelToForm();
|
|
10172
|
+
var historicalPix = __spread(this.addExistentHistoricData);
|
|
10173
|
+
this.historicalPixAccountList.get("historicalPixAccountList").setValue(historicalPix);
|
|
10174
|
+
if (this.formGroup) {
|
|
10175
|
+
this.formGroup.get(this.fieldFormGroup).patchValue({
|
|
10176
|
+
historicalPixAccountList: historicalPix
|
|
10146
10177
|
});
|
|
10147
10178
|
}
|
|
10148
|
-
this.emitFormValidity();
|
|
10149
|
-
};
|
|
10150
|
-
HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (type, value) {
|
|
10151
|
-
return FormatUtilsService.getFormattedSubscriptionNumber(value, type);
|
|
10152
|
-
};
|
|
10153
|
-
HistoricalPixAccountComponent.prototype.syncPixDataToParentForm = function () {
|
|
10154
|
-
if (!this.isEditModeForSave)
|
|
10155
|
-
return;
|
|
10156
|
-
var values = Object.values(this.formGroupByRow).map(function (fg) {
|
|
10157
|
-
var value = fg.getRawValue();
|
|
10158
|
-
var pixKeyType = value.pixKeyType.key;
|
|
10159
|
-
if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ') {
|
|
10160
|
-
value.pixKey = (value.pixKey || '').replace(/[.\-\/]/g, '');
|
|
10161
|
-
}
|
|
10162
|
-
else if (pixKeyType === 'TELEPHONE') {
|
|
10163
|
-
value.pixKey = (value.pixKey || '').replace(/[()\s\-]/g, '');
|
|
10164
|
-
}
|
|
10165
|
-
return value;
|
|
10166
|
-
});
|
|
10167
|
-
this.formGroup
|
|
10168
|
-
.get(this.fieldFormGroup)
|
|
10169
|
-
.get('historicalPixAccountList')
|
|
10170
|
-
.setValue(values);
|
|
10171
|
-
this.emitFormValidity();
|
|
10172
10179
|
};
|
|
10173
10180
|
HistoricalPixAccountComponent.prototype.syncResetPixFormToParent = function () {
|
|
10174
10181
|
this.formGroupByRow = {};
|
|
@@ -10178,6 +10185,46 @@
|
|
|
10178
10185
|
this.rebuildFormGroupMap(this.addExistentHistoricData);
|
|
10179
10186
|
}
|
|
10180
10187
|
};
|
|
10188
|
+
/**
|
|
10189
|
+
* Valida todos os formulários
|
|
10190
|
+
*/
|
|
10191
|
+
HistoricalPixAccountComponent.prototype.validateAllForms = function () {
|
|
10192
|
+
var _this = this;
|
|
10193
|
+
this.forceCloseAllCellEditors();
|
|
10194
|
+
this.syncAllModelToForm();
|
|
10195
|
+
if (!this.formGroupByRow || Object.keys(this.formGroupByRow).length === 0) {
|
|
10196
|
+
return true;
|
|
10197
|
+
}
|
|
10198
|
+
var isAllValid = true;
|
|
10199
|
+
Object.keys(this.formGroupByRow).forEach(function (indexKey) {
|
|
10200
|
+
var index = Number(indexKey);
|
|
10201
|
+
var form = _this.formGroupByRow[index];
|
|
10202
|
+
if (form) {
|
|
10203
|
+
Object.keys(form.controls).forEach(function (controlName) {
|
|
10204
|
+
var control = form.get(controlName);
|
|
10205
|
+
control.markAsTouched();
|
|
10206
|
+
if (controlName === 'pixKey') {
|
|
10207
|
+
var pixKeyTypeControl = form.get('pixKeyType');
|
|
10208
|
+
if (pixKeyTypeControl.value) {
|
|
10209
|
+
_this.validateDocumentField(index, pixKeyTypeControl.value.key);
|
|
10210
|
+
}
|
|
10211
|
+
}
|
|
10212
|
+
});
|
|
10213
|
+
form.updateValueAndValidity();
|
|
10214
|
+
if (form.invalid) {
|
|
10215
|
+
isAllValid = false;
|
|
10216
|
+
}
|
|
10217
|
+
}
|
|
10218
|
+
});
|
|
10219
|
+
if (isAllValid && this.addExistentHistoricData && this.addExistentHistoricData.length > 0) {
|
|
10220
|
+
var totalPercentage = this.addExistentHistoricData.reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
|
|
10221
|
+
if (Math.abs(totalPercentage - 100) > 0.01) {
|
|
10222
|
+
isAllValid = false;
|
|
10223
|
+
}
|
|
10224
|
+
}
|
|
10225
|
+
this.isValidChangeForm.emit(isAllValid);
|
|
10226
|
+
return isAllValid;
|
|
10227
|
+
};
|
|
10181
10228
|
HistoricalPixAccountComponent.prototype.onLazyLoad = function (event) {
|
|
10182
10229
|
var _this = this;
|
|
10183
10230
|
var first = event && event.first ? event.first : 0;
|
|
@@ -10228,7 +10275,8 @@
|
|
|
10228
10275
|
id: null,
|
|
10229
10276
|
pixKeyType: {},
|
|
10230
10277
|
pixKey: '',
|
|
10231
|
-
percentage:
|
|
10278
|
+
percentage: '',
|
|
10279
|
+
externalId: '',
|
|
10232
10280
|
};
|
|
10233
10281
|
var index = this.addExistentHistoricData.length;
|
|
10234
10282
|
this.addExistentHistoricData = __spread(this.addExistentHistoricData, [
|
|
@@ -10239,11 +10287,27 @@
|
|
|
10239
10287
|
this.emitFormValidity();
|
|
10240
10288
|
};
|
|
10241
10289
|
HistoricalPixAccountComponent.prototype.deletePix = function (index) {
|
|
10290
|
+
var _this = this;
|
|
10242
10291
|
if (this.dataListPix.editingCell) {
|
|
10243
10292
|
this.dataListPix.editingCell = null;
|
|
10244
10293
|
}
|
|
10245
10294
|
this.addExistentHistoricData = this.addExistentHistoricData.filter(function (_, i) { return i !== index; });
|
|
10295
|
+
var currentList = this.historicalPixAccountList.get("historicalPixAccountList").value || [];
|
|
10296
|
+
var updatedList = currentList.filter(function (_, i) { return i !== index; });
|
|
10297
|
+
this.historicalPixAccountList.get("historicalPixAccountList").setValue(updatedList);
|
|
10298
|
+
if (this.formGroup) {
|
|
10299
|
+
this.formGroup.get(this.fieldFormGroup).patchValue({
|
|
10300
|
+
historicalPixAccountList: updatedList
|
|
10301
|
+
});
|
|
10302
|
+
}
|
|
10246
10303
|
this.rebuildFormGroupMap(this.addExistentHistoricData);
|
|
10304
|
+
this.addExistentHistoricData.forEach(function (_, i) {
|
|
10305
|
+
if (_this.formGroupByRow[i]) {
|
|
10306
|
+
var allValues = _this.addExistentHistoricData
|
|
10307
|
+
.map(function (item, idx) { return idx === i ? 0 : (parseFloat(item.percentage) || 0); });
|
|
10308
|
+
_this.validatePercentageValid(allValues, _this.formGroupByRow[i]);
|
|
10309
|
+
}
|
|
10310
|
+
});
|
|
10247
10311
|
this.emitFormValidity();
|
|
10248
10312
|
};
|
|
10249
10313
|
HistoricalPixAccountComponent.prototype.rebuildFormGroupMap = function (data) {
|
|
@@ -10347,7 +10411,14 @@
|
|
|
10347
10411
|
this.msgTotalLimitByPercentage = null;
|
|
10348
10412
|
}
|
|
10349
10413
|
};
|
|
10414
|
+
HistoricalPixAccountComponent.prototype.formatPercentage = function (value) {
|
|
10415
|
+
if (value == null || value === '' || isNaN(Number(value))) {
|
|
10416
|
+
return '0.00';
|
|
10417
|
+
}
|
|
10418
|
+
return Number(value).toFixed(2);
|
|
10419
|
+
};
|
|
10350
10420
|
HistoricalPixAccountComponent.prototype.onSyncValue = function (field, index) {
|
|
10421
|
+
var _this = this;
|
|
10351
10422
|
if (this.formGroupByRow &&
|
|
10352
10423
|
this.formGroupByRow[index] &&
|
|
10353
10424
|
this.formGroupByRow[index].get(field)) {
|
|
@@ -10356,14 +10427,352 @@
|
|
|
10356
10427
|
this.addExistentHistoricData[index][field] = value;
|
|
10357
10428
|
control.markAsDirty();
|
|
10358
10429
|
control.markAsTouched();
|
|
10430
|
+
if (field === 'percentage') {
|
|
10431
|
+
var currentList = this.addExistentHistoricData
|
|
10432
|
+
.map(function (item, i) { return i === index ? 0 : (parseFloat(item.percentage) || 0); });
|
|
10433
|
+
this.validatePercentageValid(currentList, this.formGroupByRow[index]);
|
|
10434
|
+
if (!this.isSyncingPercentage) {
|
|
10435
|
+
this.isSyncingPercentage = true;
|
|
10436
|
+
setTimeout(function () {
|
|
10437
|
+
_this.syncPixDataToParentForm();
|
|
10438
|
+
_this.isSyncingPercentage = false;
|
|
10439
|
+
}, 0);
|
|
10440
|
+
}
|
|
10441
|
+
}
|
|
10359
10442
|
control.updateValueAndValidity();
|
|
10360
|
-
|
|
10361
|
-
|
|
10443
|
+
this.formGroupByRow[index].updateValueAndValidity();
|
|
10444
|
+
this.emitFormValidity();
|
|
10445
|
+
}
|
|
10446
|
+
};
|
|
10447
|
+
HistoricalPixAccountComponent.prototype.close = function () {
|
|
10448
|
+
this.visible = false;
|
|
10449
|
+
};
|
|
10450
|
+
HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
|
|
10451
|
+
return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
|
|
10452
|
+
};
|
|
10453
|
+
HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
|
|
10454
|
+
return FormatUtilsService.getFormattedCpf(cpf);
|
|
10455
|
+
};
|
|
10456
|
+
HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
|
|
10457
|
+
return FormatUtilsService.getFormattedCnpj(cnpj);
|
|
10458
|
+
};
|
|
10459
|
+
HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
|
|
10460
|
+
return FormatUtilsService.getFormattedPercentage(value);
|
|
10461
|
+
};
|
|
10462
|
+
/**
|
|
10463
|
+
* Reseta completamente o estado do formulário e controles
|
|
10464
|
+
*/
|
|
10465
|
+
HistoricalPixAccountComponent.prototype.resetFormState = function () {
|
|
10466
|
+
if (this.formGroupByRow) {
|
|
10467
|
+
Object.values(this.formGroupByRow).forEach(function (form) {
|
|
10468
|
+
if (form) {
|
|
10469
|
+
Object.keys(form.controls).forEach(function (controlName) {
|
|
10470
|
+
var control = form.get(controlName);
|
|
10471
|
+
if (control) {
|
|
10472
|
+
control.setErrors(null);
|
|
10473
|
+
control.markAsUntouched();
|
|
10474
|
+
control.markAsPristine();
|
|
10475
|
+
}
|
|
10476
|
+
});
|
|
10477
|
+
form.updateValueAndValidity();
|
|
10478
|
+
}
|
|
10362
10479
|
});
|
|
10363
|
-
|
|
10480
|
+
}
|
|
10481
|
+
if (this.dataListPix) {
|
|
10482
|
+
if (typeof this.dataListPix.closeAllCellEditors === 'function') {
|
|
10483
|
+
try {
|
|
10484
|
+
this.dataListPix.closeAllCellEditors();
|
|
10485
|
+
}
|
|
10486
|
+
catch (e) {
|
|
10487
|
+
console.error('Erro ao tentar fechar cell editors:', e);
|
|
10488
|
+
}
|
|
10489
|
+
}
|
|
10490
|
+
else if (this.dataListPix.editingCell) {
|
|
10491
|
+
this.dataListPix.editingCell = null;
|
|
10492
|
+
}
|
|
10493
|
+
if (this.dataListPix.editing !== undefined) {
|
|
10494
|
+
this.dataListPix.editing = false;
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10497
|
+
this.cd.detectChanges();
|
|
10498
|
+
};
|
|
10499
|
+
/**
|
|
10500
|
+
* Formata a chave PIX para exibição baseada no tipo
|
|
10501
|
+
*/
|
|
10502
|
+
HistoricalPixAccountComponent.prototype.getFormattedPixKey = function (pixKeyType, pixKey) {
|
|
10503
|
+
if (!pixKey)
|
|
10504
|
+
return '';
|
|
10505
|
+
switch (pixKeyType) {
|
|
10506
|
+
case 'CPF':
|
|
10507
|
+
return FormatUtilsService.getFormattedCpf(pixKey);
|
|
10508
|
+
case 'CNPJ':
|
|
10509
|
+
return FormatUtilsService.getFormattedCnpj(pixKey);
|
|
10510
|
+
case 'TELEPHONE':
|
|
10511
|
+
return FormatUtilsService.getFormattedTelephoneNumber(pixKey);
|
|
10512
|
+
case 'EMAIL':
|
|
10513
|
+
case 'RANDOM_KEY':
|
|
10514
|
+
default:
|
|
10515
|
+
return pixKey;
|
|
10516
|
+
}
|
|
10517
|
+
};
|
|
10518
|
+
/**
|
|
10519
|
+
* Obtém o tipo de chave PIX do item atual
|
|
10520
|
+
*/
|
|
10521
|
+
HistoricalPixAccountComponent.prototype.getPixKeyType = function (item) {
|
|
10522
|
+
return item && item.pixKeyType && item.pixKeyType.key || '';
|
|
10523
|
+
};
|
|
10524
|
+
/**
|
|
10525
|
+
* Verifica se um controle está inválido para os campos editáveis
|
|
10526
|
+
*/
|
|
10527
|
+
HistoricalPixAccountComponent.prototype.isInvalid = function (index, controlName) {
|
|
10528
|
+
var form = this.formGroupByRow[index];
|
|
10529
|
+
if (!form)
|
|
10530
|
+
return false;
|
|
10531
|
+
var control = form.get(controlName);
|
|
10532
|
+
if (!control)
|
|
10533
|
+
return false;
|
|
10534
|
+
return control.invalid && (control.touched || control.dirty);
|
|
10535
|
+
};
|
|
10536
|
+
/**
|
|
10537
|
+
* Método chamado quando uma célula entra no modo de edição
|
|
10538
|
+
*/
|
|
10539
|
+
HistoricalPixAccountComponent.prototype.onCellEditInit = function (event) {
|
|
10540
|
+
var rowIndex = this.addExistentHistoricData.findIndex(function (item) { return item === event.data; });
|
|
10541
|
+
if (rowIndex < 0)
|
|
10542
|
+
return;
|
|
10543
|
+
var form = this.formGroupByRow[rowIndex];
|
|
10544
|
+
if (form && form.get('pixKey')) {
|
|
10545
|
+
var pixKeyControl = form.get('pixKey');
|
|
10546
|
+
var currentValue = this.addExistentHistoricData[rowIndex].pixKey;
|
|
10547
|
+
pixKeyControl.setValue(currentValue);
|
|
10548
|
+
}
|
|
10549
|
+
};
|
|
10550
|
+
/**
|
|
10551
|
+
* Recupera o FormControl específico para um campo em determinado índice
|
|
10552
|
+
*/
|
|
10553
|
+
HistoricalPixAccountComponent.prototype.getFormControl = function (index, controlName) {
|
|
10554
|
+
var form = this.formGroupByRow[index];
|
|
10555
|
+
if (!form)
|
|
10556
|
+
return null;
|
|
10557
|
+
return form.get(controlName);
|
|
10558
|
+
};
|
|
10559
|
+
/**
|
|
10560
|
+
* Valida campos de documento (CPF, CNPJ) quando o usuário termina de digitar no form de edição
|
|
10561
|
+
*/
|
|
10562
|
+
HistoricalPixAccountComponent.prototype.validateDocumentField = function (index, fieldType) {
|
|
10563
|
+
var _a;
|
|
10564
|
+
var form = this.formGroupByRow[index];
|
|
10565
|
+
var item = this.addExistentHistoricData[index];
|
|
10566
|
+
if (!form || !item)
|
|
10567
|
+
return;
|
|
10568
|
+
var pixKeyControl = form.get('pixKey');
|
|
10569
|
+
if (!pixKeyControl)
|
|
10570
|
+
return;
|
|
10571
|
+
var value = item.pixKey;
|
|
10572
|
+
pixKeyControl.setValue(value);
|
|
10573
|
+
if (fieldType === 'CPF' || fieldType === 'CNPJ' || fieldType === 'TELEPHONE') {
|
|
10574
|
+
value = value ? value.toString().replace(/\D/g, '') : '';
|
|
10575
|
+
item.pixKey = value;
|
|
10576
|
+
pixKeyControl.setValue(value);
|
|
10577
|
+
}
|
|
10578
|
+
if (!value || value.toString().trim() === '') {
|
|
10579
|
+
pixKeyControl.setErrors({ required: true });
|
|
10580
|
+
pixKeyControl.markAsTouched();
|
|
10581
|
+
form.updateValueAndValidity();
|
|
10364
10582
|
this.emitFormValidity();
|
|
10583
|
+
return;
|
|
10584
|
+
}
|
|
10585
|
+
var cleanValue = value;
|
|
10586
|
+
if (fieldType === 'CPF' || fieldType === 'CNPJ') {
|
|
10587
|
+
cleanValue = value.toString().replace(/\D/g, '');
|
|
10588
|
+
item.pixKey = cleanValue;
|
|
10589
|
+
pixKeyControl.setValue(cleanValue);
|
|
10590
|
+
}
|
|
10591
|
+
var isValid = false;
|
|
10592
|
+
switch (fieldType) {
|
|
10593
|
+
case 'CPF':
|
|
10594
|
+
isValid = cleanValue.length === 11 && GenericValidator.isValidCpf({ value: cleanValue }) === null;
|
|
10595
|
+
break;
|
|
10596
|
+
case 'CNPJ':
|
|
10597
|
+
isValid = cleanValue.length === 14 && GenericValidator.isValidCnpj({ value: cleanValue }) === null;
|
|
10598
|
+
break;
|
|
10599
|
+
case 'TELEPHONE':
|
|
10600
|
+
cleanValue = value.toString().replace(/\D/g, '');
|
|
10601
|
+
isValid = GenericValidator.isValidPhoneNumber({ value: cleanValue }) === null;
|
|
10602
|
+
break;
|
|
10603
|
+
case 'EMAIL':
|
|
10604
|
+
isValid = GenericValidator.isValidEmail({ value: value }) === null;
|
|
10605
|
+
break;
|
|
10606
|
+
case 'RANDOM_KEY':
|
|
10607
|
+
isValid = true;
|
|
10608
|
+
break;
|
|
10609
|
+
default:
|
|
10610
|
+
isValid = true;
|
|
10611
|
+
}
|
|
10612
|
+
pixKeyControl.markAsTouched();
|
|
10613
|
+
if (isValid) {
|
|
10614
|
+
pixKeyControl.setErrors(null);
|
|
10615
|
+
}
|
|
10616
|
+
else {
|
|
10617
|
+
var errorType = this.getErrorTypeForField(fieldType);
|
|
10618
|
+
pixKeyControl.setErrors((_a = {}, _a[errorType] = true, _a));
|
|
10619
|
+
}
|
|
10620
|
+
form.updateValueAndValidity();
|
|
10621
|
+
this.emitFormValidity();
|
|
10622
|
+
this.cd.detectChanges();
|
|
10623
|
+
};
|
|
10624
|
+
/**
|
|
10625
|
+
* Obtém o tipo de erro para cada tipo de campo editável
|
|
10626
|
+
*/
|
|
10627
|
+
HistoricalPixAccountComponent.prototype.getErrorTypeForField = function (fieldType) {
|
|
10628
|
+
switch (fieldType) {
|
|
10629
|
+
case 'CPF': return 'invalidCpf';
|
|
10630
|
+
case 'CNPJ': return 'invalidCnpj';
|
|
10631
|
+
case 'TELEPHONE': return 'invalidPhoneNumber';
|
|
10632
|
+
case 'EMAIL': return 'invalidEmail';
|
|
10633
|
+
default: return 'required';
|
|
10634
|
+
}
|
|
10635
|
+
};
|
|
10636
|
+
/**
|
|
10637
|
+
* Retorna a mensagem de erro apropriada para um campo
|
|
10638
|
+
*/
|
|
10639
|
+
HistoricalPixAccountComponent.prototype.getErrorMessage = function (index, controlName) {
|
|
10640
|
+
var form = this.formGroupByRow[index];
|
|
10641
|
+
if (!form)
|
|
10642
|
+
return '';
|
|
10643
|
+
var control = form.get(controlName);
|
|
10644
|
+
if (!control || !control.errors)
|
|
10645
|
+
return '';
|
|
10646
|
+
var fieldValue = control.value || '';
|
|
10647
|
+
if (control.hasError('required')) {
|
|
10648
|
+
return this.translateService.instant('hcm.payroll.required');
|
|
10649
|
+
}
|
|
10650
|
+
if (control.hasError('invalidCpf')) {
|
|
10651
|
+
return this.translateService.instant('hcm.payroll.employees_addition_cpf_error');
|
|
10652
|
+
}
|
|
10653
|
+
else if (control.hasError('invalidCnpj')) {
|
|
10654
|
+
return this.translateService.instant('hcm.payroll.employees_addition_cnpj_error');
|
|
10655
|
+
}
|
|
10656
|
+
else if (control.hasError('invalidEmail')) {
|
|
10657
|
+
return this.translateService.instant('hcm.payroll.employees_addition_email_invalid');
|
|
10658
|
+
}
|
|
10659
|
+
else if (control.hasError('invalidPhoneNumber')) {
|
|
10660
|
+
return this.translateService.instant('hcm.payroll.employees_addition_invalid_phone_number', { value: fieldValue });
|
|
10661
|
+
}
|
|
10662
|
+
return '';
|
|
10663
|
+
};
|
|
10664
|
+
/**
|
|
10665
|
+
* Tratamento ao perder o foco em campos de documento
|
|
10666
|
+
*/
|
|
10667
|
+
HistoricalPixAccountComponent.prototype.onDocumentBlur = function (index) {
|
|
10668
|
+
var form = this.formGroupByRow[index];
|
|
10669
|
+
var item = this.addExistentHistoricData[index];
|
|
10670
|
+
if (!form || !item)
|
|
10671
|
+
return;
|
|
10672
|
+
var pixKeyControl = form.get('pixKey');
|
|
10673
|
+
var pixKeyTypeControl = form.get('pixKeyType');
|
|
10674
|
+
if (!pixKeyControl || !pixKeyTypeControl.value)
|
|
10675
|
+
return;
|
|
10676
|
+
var pixKeyType = pixKeyTypeControl.value.key;
|
|
10677
|
+
var value = item.pixKey;
|
|
10678
|
+
if (pixKeyType === 'CPF' || pixKeyType === 'CNPJ' || pixKeyType === 'TELEPHONE') {
|
|
10679
|
+
value = value ? value.toString().replace(/\D/g, '') : '';
|
|
10680
|
+
item.pixKey = value;
|
|
10681
|
+
}
|
|
10682
|
+
pixKeyControl.setValue(value);
|
|
10683
|
+
this.validateDocumentField(index, pixKeyType);
|
|
10684
|
+
if (value) {
|
|
10685
|
+
if (pixKeyType === 'CPF') {
|
|
10686
|
+
item.pixKeyFormatted = FormatUtilsService.getFormattedCpf(value);
|
|
10687
|
+
}
|
|
10688
|
+
else if (pixKeyType === 'CNPJ') {
|
|
10689
|
+
item.pixKeyFormatted = FormatUtilsService.getFormattedCnpj(value);
|
|
10690
|
+
}
|
|
10691
|
+
else if (pixKeyType === 'TELEPHONE') {
|
|
10692
|
+
item.pixKeyFormatted = FormatUtilsService.getFormattedTelephoneNumber(value);
|
|
10693
|
+
}
|
|
10694
|
+
else {
|
|
10695
|
+
item.pixKeyFormatted = value;
|
|
10696
|
+
}
|
|
10697
|
+
}
|
|
10698
|
+
this.finishEditing();
|
|
10699
|
+
};
|
|
10700
|
+
HistoricalPixAccountComponent.prototype.finishEditing = function () {
|
|
10701
|
+
this.syncAllModelToForm();
|
|
10702
|
+
this.cd.detectChanges();
|
|
10703
|
+
};
|
|
10704
|
+
HistoricalPixAccountComponent.prototype.clearErrorsTemporarily = function (rowIndex) {
|
|
10705
|
+
var form = this.formGroupByRow[rowIndex];
|
|
10706
|
+
if (form && form.get('pixKey')) {
|
|
10707
|
+
var currentValue = form.get('pixKey').value;
|
|
10708
|
+
form.get('pixKey').setErrors(null);
|
|
10709
|
+
form.get('pixKey').setValue(currentValue);
|
|
10710
|
+
}
|
|
10711
|
+
};
|
|
10712
|
+
HistoricalPixAccountComponent.prototype.closeEditModeManually = function () {
|
|
10713
|
+
var _this = this;
|
|
10714
|
+
setTimeout(function () {
|
|
10715
|
+
if (_this.dataListPix) {
|
|
10716
|
+
if (typeof _this.dataListPix.closeAllCellEditors === 'function') {
|
|
10717
|
+
_this.dataListPix.closeAllCellEditors();
|
|
10718
|
+
}
|
|
10719
|
+
else if (_this.dataListPix.editingCell) {
|
|
10720
|
+
_this.dataListPix.editingCell = null;
|
|
10721
|
+
}
|
|
10722
|
+
_this.cd.detectChanges();
|
|
10723
|
+
}
|
|
10724
|
+
}, 100);
|
|
10725
|
+
};
|
|
10726
|
+
HistoricalPixAccountComponent.prototype.syncAllModelToForm = function () {
|
|
10727
|
+
var _this = this;
|
|
10728
|
+
if (!this.addExistentHistoricData || !this.formGroupByRow)
|
|
10729
|
+
return;
|
|
10730
|
+
this.addExistentHistoricData.forEach(function (item, index) {
|
|
10731
|
+
var form = _this.formGroupByRow[index];
|
|
10732
|
+
if (form) {
|
|
10733
|
+
Object.keys(form.controls).forEach(function (controlName) {
|
|
10734
|
+
var control = form.get(controlName);
|
|
10735
|
+
if (control && item[controlName] !== undefined) {
|
|
10736
|
+
control.setValue(item[controlName]);
|
|
10737
|
+
}
|
|
10738
|
+
});
|
|
10739
|
+
var pixKeyTypeControl = form.get('pixKeyType');
|
|
10740
|
+
if (pixKeyTypeControl.value) {
|
|
10741
|
+
_this.validateDocumentField(index, pixKeyTypeControl.value.key);
|
|
10742
|
+
}
|
|
10743
|
+
}
|
|
10744
|
+
});
|
|
10745
|
+
};
|
|
10746
|
+
/**
|
|
10747
|
+
* Método para forçar o fechamento de todas as células em edição
|
|
10748
|
+
*/
|
|
10749
|
+
HistoricalPixAccountComponent.prototype.forceCloseAllCellEditors = function () {
|
|
10750
|
+
this.finishEditing();
|
|
10751
|
+
this.syncAllModelToForm();
|
|
10752
|
+
};
|
|
10753
|
+
HistoricalPixAccountComponent.prototype.isPixKeyType = function (item, type) {
|
|
10754
|
+
return item && item.pixKeyType && item.pixKeyType.key === type;
|
|
10755
|
+
};
|
|
10756
|
+
HistoricalPixAccountComponent.prototype.getPixKey = function (rowData) {
|
|
10757
|
+
return rowData ? rowData.pixKey : null;
|
|
10758
|
+
};
|
|
10759
|
+
HistoricalPixAccountComponent.prototype.setPixKey = function (rowData, value) {
|
|
10760
|
+
if (rowData) {
|
|
10761
|
+
rowData.pixKey = value;
|
|
10365
10762
|
}
|
|
10366
10763
|
};
|
|
10764
|
+
Object.defineProperty(HistoricalPixAccountComponent.prototype, "isTotalPercentage100", {
|
|
10765
|
+
get: function () {
|
|
10766
|
+
if (!this.addExistentHistoricData || this.addExistentHistoricData.length === 0) {
|
|
10767
|
+
return false;
|
|
10768
|
+
}
|
|
10769
|
+
var totalPercentage = this.addExistentHistoricData
|
|
10770
|
+
.reduce(function (sum, item) { return sum + (parseFloat(item.percentage) || 0); }, 0);
|
|
10771
|
+
return totalPercentage >= 100;
|
|
10772
|
+
},
|
|
10773
|
+
enumerable: true,
|
|
10774
|
+
configurable: true
|
|
10775
|
+
});
|
|
10367
10776
|
Object.defineProperty(HistoricalPixAccountComponent.prototype, "scopedActions", {
|
|
10368
10777
|
get: function () {
|
|
10369
10778
|
return this.actions.bind(this);
|
|
@@ -10373,7 +10782,8 @@
|
|
|
10373
10782
|
});
|
|
10374
10783
|
Object.defineProperty(HistoricalPixAccountComponent.prototype, "recordsMessage", {
|
|
10375
10784
|
get: function () {
|
|
10376
|
-
return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ?
|
|
10785
|
+
return (this.totalRecords || 0) + " " + (this.totalRecords === 1 ?
|
|
10786
|
+
this.translateService.instant("hcm.payroll.admission_register") : this.translateService.instant("hcm.payroll.admission_registers"));
|
|
10377
10787
|
},
|
|
10378
10788
|
enumerable: true,
|
|
10379
10789
|
configurable: true
|
|
@@ -10448,21 +10858,6 @@
|
|
|
10448
10858
|
enumerable: true,
|
|
10449
10859
|
configurable: true
|
|
10450
10860
|
});
|
|
10451
|
-
HistoricalPixAccountComponent.prototype.close = function () {
|
|
10452
|
-
this.visible = false;
|
|
10453
|
-
};
|
|
10454
|
-
HistoricalPixAccountComponent.prototype.getFormattedTelephoneNumber = function (telephoneNumber) {
|
|
10455
|
-
return FormatUtilsService.getFormattedTelephoneNumber(telephoneNumber);
|
|
10456
|
-
};
|
|
10457
|
-
HistoricalPixAccountComponent.prototype.getFormattedCpf = function (cpf) {
|
|
10458
|
-
return FormatUtilsService.getFormattedCpf(cpf);
|
|
10459
|
-
};
|
|
10460
|
-
HistoricalPixAccountComponent.prototype.getFormattedCnpj = function (cnpj) {
|
|
10461
|
-
return FormatUtilsService.getFormattedCnpj(cnpj);
|
|
10462
|
-
};
|
|
10463
|
-
HistoricalPixAccountComponent.prototype.getFormattedPercentage = function (value) {
|
|
10464
|
-
return FormatUtilsService.getFormattedPercentage(value);
|
|
10465
|
-
};
|
|
10466
10861
|
Object.defineProperty(HistoricalPixAccountComponent.prototype, "isAllowToAddHistorical", {
|
|
10467
10862
|
get: function () {
|
|
10468
10863
|
return (this.permission["incluir"]);
|
|
@@ -10601,8 +10996,8 @@
|
|
|
10601
10996
|
core.Component({
|
|
10602
10997
|
// tslint:disable-next-line:component-selector
|
|
10603
10998
|
selector: "c-historical-pix-account",
|
|
10604
|
-
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 [showField]=\"showFields\"\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<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\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=\"showFields || !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=\"!withSideBar && 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 [customSort]=\"true\">\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",
|
|
10605
|
-
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}"]
|
|
10999
|
+
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 [showField]=\"showFields\"\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<div class=\"ui-g-1\" *ngIf=\"withSideBar && !isEditMode && !hideBtnAddForViewMode\">\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=\"showFields || !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=\"!withSideBar && 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 [disabled]=\"isTotalPercentage100\"\n [pTooltip]=\"isTotalPercentage100 ? ('hcm.payroll.historical_pix_account_msg_limit_total_by_percentage' | translate) : ''\"\n tooltipPosition=\"top\"\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 [customSort]=\"true\"\n (onEditInit)=\"onCellEditInit($event)\">\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 <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div class=\"ui-fluid\">\n <!-- \u00C1rea de inputs din\u00E2micos -->\n <div [ngSwitch]=\"getPixKeyType(item)\" class=\"ui-fluid\">\n <!-- CPF -->\n <p-inputMask *ngSwitchCase=\"'CPF'\"\n mask=\"999.999.999-99\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'CPF')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- CNPJ -->\n <p-inputMask *ngSwitchCase=\"'CNPJ'\"\n mask=\"99.999.999/9999-99\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'CNPJ')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- TELEPHONE -->\n <p-inputMask *ngSwitchCase=\"'TELEPHONE'\"\n mask=\"(99) 99999-9999\"\n unmask=\"true\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n styleClass=\"full-width-input\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (onComplete)=\"validateDocumentField(rowIndex, 'TELEPHONE')\"\n (onBlur)=\"onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n </p-inputMask>\n\n <!-- EMAIL -->\n <input *ngSwitchCase=\"'EMAIL'\"\n type=\"email\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (blur)=\"validateDocumentField(rowIndex, 'EMAIL'); onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n\n <!-- RANDOM_KEY -->\n <input *ngSwitchCase=\"'RANDOM_KEY'\"\n type=\"text\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [(ngModel)]=\"item.pixKey\"\n [ngModelOptions]=\"{standalone: true}\"\n [ngClass]=\"{'ng-invalid': isInvalid(rowIndex, 'pixKey')}\"\n (blur)=\"validateDocumentField(rowIndex, 'RANDOM_KEY'); onDocumentBlur(rowIndex)\"\n (keydown.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.tab)=\"onDocumentBlur(rowIndex)\"\n (keydown.enter)=\"onDocumentBlur(rowIndex)\"\n (keydown.esc)=\"onDocumentBlur(rowIndex)\"\n (keydown.shift.esc)=\"onDocumentBlur(rowIndex)\">\n\n <!-- BANK_ACCOUNT -->\n <input *ngSwitchCase=\"'BANK_ACCOUNT'\"\n type=\"text\"\n pInputText\n class=\"p-inputtext p-component full-width-input\"\n [disabled]=\"true\">\n </div>\n\n <!-- \u00DAnico s-control-errors para todos os tipos -->\n <small *ngIf=\"isInvalid(rowIndex, 'pixKey')\" class=\"p-error error-text\">\n {{getErrorMessage(rowIndex, 'pixKey')}}\n </small>\n </div>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{getFormattedPixKey(getPixKeyType(item), 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 {{ formatPercentage(item.percentage) }}%\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",
|
|
11000
|
+
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}:host ::ng-deep .p-cell-editing{padding:0!important}:host ::ng-deep .full-width-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep .p-inputtext{width:100%;min-height:34px;padding:6px 12px}:host ::ng-deep .p-inputmask{width:100%;display:block}:host ::ng-deep .p-inputmask .p-inputmask-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep p-celleditor{width:100%}:host ::ng-deep p-celleditor .ui-fluid{width:100%;display:block;padding:0}:host ::ng-deep .p-error{margin-top:4px;font-size:12px}:host ::ng-deep .error-text{color:#f44336;display:block;margin-top:4px;font-size:.875em}"]
|
|
10606
11001
|
})
|
|
10607
11002
|
], HistoricalPixAccountComponent);
|
|
10608
11003
|
return HistoricalPixAccountComponent;
|
|
@@ -10832,7 +11227,7 @@
|
|
|
10832
11227
|
core.Component({
|
|
10833
11228
|
selector: "pix-account",
|
|
10834
11229
|
template: "<div id=\"main\">\n <form *ngIf=\"showField || !(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",
|
|
10835
|
-
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}"]
|
|
11230
|
+
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}:host ::ng-deep .p-cell-editing{padding:0!important}:host ::ng-deep .full-width-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep .p-inputtext{width:100%;min-height:34px;padding:6px 12px}:host ::ng-deep .p-inputmask{width:100%;display:block}:host ::ng-deep .p-inputmask .p-inputmask-input{width:100%!important;min-height:34px!important;padding:6px 12px!important}:host ::ng-deep p-celleditor{width:100%}:host ::ng-deep p-celleditor .ui-fluid{width:100%;display:block;padding:0}:host ::ng-deep .p-error{margin-top:4px;font-size:12px}:host ::ng-deep .error-text{color:#f44336;display:block;margin-top:4px;font-size:.875em}"]
|
|
10836
11231
|
})
|
|
10837
11232
|
], HistoricalPixAccountFormComponent);
|
|
10838
11233
|
return HistoricalPixAccountFormComponent;
|
|
@@ -10922,6 +11317,7 @@
|
|
|
10922
11317
|
this.endPoint = "hcm/payroll/queries/historicalEmployeePixQuery";
|
|
10923
11318
|
this.keyPayload = "historicalEmployeePix";
|
|
10924
11319
|
this.withSidebar = true;
|
|
11320
|
+
this.showActionsButtonOnAdd = false;
|
|
10925
11321
|
this.isOnlyView = new core.EventEmitter();
|
|
10926
11322
|
this.isOnlyEdit = new core.EventEmitter();
|
|
10927
11323
|
this.enableView = new core.EventEmitter();
|
|
@@ -10976,11 +11372,13 @@
|
|
|
10976
11372
|
_this.isOnlyEdit.emit(false);
|
|
10977
11373
|
_this.isHideBtnAddForViewMode.emit(true);
|
|
10978
11374
|
_this.sharedStateService.setHideBtnAddForViewMode(true);
|
|
11375
|
+
_this.sharedStateService.setActiveHideOptionsOnView(true);
|
|
10979
11376
|
_this.router.navigate(["historical-pix-account/" + dateChange], {
|
|
10980
11377
|
relativeTo: _this.activatedRoute,
|
|
10981
11378
|
});
|
|
10982
11379
|
}
|
|
10983
11380
|
else {
|
|
11381
|
+
_this.sharedStateService.setActiveHideOptionsOnView(true);
|
|
10984
11382
|
_this.sharedStateService.setSaveButton(false);
|
|
10985
11383
|
_this.enableView.emit(dateChange);
|
|
10986
11384
|
}
|
|
@@ -11003,11 +11401,13 @@
|
|
|
11003
11401
|
_this.isOnlyEdit.emit(true);
|
|
11004
11402
|
_this.isHideBtnAddForViewMode.emit(false);
|
|
11005
11403
|
_this.sharedStateService.setHideBtnAddForViewMode(false);
|
|
11404
|
+
_this.sharedStateService.setActiveHideOptionsOnView(false);
|
|
11006
11405
|
_this.router.navigate(["historical-pix-account/" + dateChange], {
|
|
11007
11406
|
relativeTo: _this.activatedRoute,
|
|
11008
11407
|
});
|
|
11009
11408
|
}
|
|
11010
11409
|
else {
|
|
11410
|
+
_this.sharedStateService.setActiveHideOptionsOnView(false);
|
|
11011
11411
|
setTimeout(function () {
|
|
11012
11412
|
_this.sharedStateService.triggerActiveValidatorsOnEditModalOpen();
|
|
11013
11413
|
});
|
|
@@ -11197,6 +11597,9 @@
|
|
|
11197
11597
|
__decorate([
|
|
11198
11598
|
core.Input()
|
|
11199
11599
|
], HistoricalPixAccountListComponent.prototype, "hideField", void 0);
|
|
11600
|
+
__decorate([
|
|
11601
|
+
core.Input()
|
|
11602
|
+
], HistoricalPixAccountListComponent.prototype, "showActionsButtonOnAdd", void 0);
|
|
11200
11603
|
__decorate([
|
|
11201
11604
|
core.Output()
|
|
11202
11605
|
], HistoricalPixAccountListComponent.prototype, "isOnlyView", void 0);
|