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