@senior-gestao-empresarial/erpx-components 4.9.2 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js +194 -34
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js.map +1 -1
- package/components/rateio-editor/erp-rateio-editor.component.d.ts +55 -3
- package/components/rateio-editor/erp-rateio-editor.types.d.ts +22 -0
- package/components/rateio-editor/index.d.ts +1 -1
- package/esm2015/components/rateio-editor/erp-rateio-editor.component.js +189 -35
- package/esm2015/components/rateio-editor/erp-rateio-editor.types.js +1 -1
- package/esm2015/components/rateio-editor/index.js +1 -1
- package/esm5/components/rateio-editor/erp-rateio-editor.component.js +195 -35
- package/esm5/components/rateio-editor/erp-rateio-editor.types.js +1 -1
- package/esm5/components/rateio-editor/index.js +1 -1
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +188 -34
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +194 -34
- package/fesm5/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-erpx-components.metadata.json +1 -1
|
@@ -33386,9 +33386,15 @@
|
|
|
33386
33386
|
this.ButtonSize = angularComponents$1.ButtonSize;
|
|
33387
33387
|
this.loading = false;
|
|
33388
33388
|
this.selection = [];
|
|
33389
|
+
/** Seleção de centros de custo por conta financeira (keyed por idContaFinanceira). */
|
|
33390
|
+
this.ccSelection = {};
|
|
33389
33391
|
this.contasDataSource = [];
|
|
33390
33392
|
this.editingRowBackup = null;
|
|
33391
33393
|
this.editingCCBackup = null;
|
|
33394
|
+
/** Último valor selecionado no lookup de conta (carrega anaSin para validação). */
|
|
33395
|
+
this.selectedConta = null;
|
|
33396
|
+
/** Último valor selecionado no lookup de centro de custo (carrega anaSin/aceRat). */
|
|
33397
|
+
this.selectedCC = null;
|
|
33392
33398
|
// === MODAL CONTA FINANCEIRA ===
|
|
33393
33399
|
this.displayContaDialog = false;
|
|
33394
33400
|
this.editingContaIndex = null;
|
|
@@ -33397,10 +33403,15 @@
|
|
|
33397
33403
|
this.editingCCContaIndex = null;
|
|
33398
33404
|
this.editingCCIndex = null;
|
|
33399
33405
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
33406
|
+
/** Cache de opções de menu por conta (referência estável evita loop de change detection). */
|
|
33407
|
+
this.contaMenuOptionsCache = new Map();
|
|
33408
|
+
/** Cache de opções de menu por centro de custo (referência estável). */
|
|
33409
|
+
this.ccMenuOptionsCache = new Map();
|
|
33400
33410
|
this.formGroup = this.fb.group({
|
|
33401
33411
|
contas: this.fb.array([])
|
|
33402
33412
|
});
|
|
33403
33413
|
}
|
|
33414
|
+
ErpRateioEditorComponent_1 = ErpRateioEditorComponent;
|
|
33404
33415
|
Object.defineProperty(ErpRateioEditorComponent.prototype, "effectiveReadOnly", {
|
|
33405
33416
|
get: function () {
|
|
33406
33417
|
var _a;
|
|
@@ -33525,6 +33536,16 @@
|
|
|
33525
33536
|
if (this.effectiveReadOnly) {
|
|
33526
33537
|
return;
|
|
33527
33538
|
}
|
|
33539
|
+
if (!this.isDistribuicaoCompleta()) {
|
|
33540
|
+
var message = this.translate.instant('erpx.rateio_editor.erro_distribuicao_incompleta');
|
|
33541
|
+
this.messageService.add({
|
|
33542
|
+
severity: 'error',
|
|
33543
|
+
summary: this.translate.instant('erpx.rateio_editor.erro_titulo'),
|
|
33544
|
+
detail: message
|
|
33545
|
+
});
|
|
33546
|
+
this.error.emit({ operacao: 'save', message: message });
|
|
33547
|
+
return;
|
|
33548
|
+
}
|
|
33528
33549
|
var ctx = this.loadedContext;
|
|
33529
33550
|
if (!((_a = ctx === null || ctx === void 0 ? void 0 : ctx.e070fil) === null || _a === void 0 ? void 0 : _a.id) || !(ctx === null || ctx === void 0 ? void 0 : ctx.criRat)) {
|
|
33530
33551
|
var message = this.translate.instant('erpx.rateio_editor.erro_contexto_incompleto');
|
|
@@ -33590,6 +33611,27 @@
|
|
|
33590
33611
|
if (this.idMovimento) {
|
|
33591
33612
|
parametro.idMovimento = this.idMovimento;
|
|
33592
33613
|
}
|
|
33614
|
+
if (this.e091plfId) {
|
|
33615
|
+
parametro.e091plf_id = this.e091plfId;
|
|
33616
|
+
}
|
|
33617
|
+
if (this.e044ccuId) {
|
|
33618
|
+
parametro.e044ccu_id = this.e044ccuId;
|
|
33619
|
+
}
|
|
33620
|
+
if (this.idTransacao) {
|
|
33621
|
+
parametro.idTransacao = this.idTransacao;
|
|
33622
|
+
}
|
|
33623
|
+
if (this.idFamilia) {
|
|
33624
|
+
parametro.idFamilia = this.idFamilia;
|
|
33625
|
+
}
|
|
33626
|
+
if (this.idDerivacao) {
|
|
33627
|
+
parametro.idDerivacao = this.idDerivacao;
|
|
33628
|
+
}
|
|
33629
|
+
if (this.idServico) {
|
|
33630
|
+
parametro.idServico = this.idServico;
|
|
33631
|
+
}
|
|
33632
|
+
if (this.valorExcedente != null) {
|
|
33633
|
+
parametro.valorExcedente = this.valorExcedente;
|
|
33634
|
+
}
|
|
33593
33635
|
var input = {
|
|
33594
33636
|
tipo: this.tipoMovimento,
|
|
33595
33637
|
parametros: [parametro]
|
|
@@ -33628,24 +33670,42 @@
|
|
|
33628
33670
|
percentualValue = conta.percentual;
|
|
33629
33671
|
valorValue = conta.valorRateadoConta;
|
|
33630
33672
|
}
|
|
33673
|
+
this.selectedConta = contaValue;
|
|
33631
33674
|
this.contaDialogFormGroup = this.fb.group({
|
|
33632
33675
|
contaFinanceira: [{ value: contaValue, disabled: this.editingContaIndex != null }, forms.Validators.required],
|
|
33633
33676
|
percentual: [{ value: percentualValue, disabled: false }, forms.Validators.required],
|
|
33634
|
-
valor: [{ value: valorValue, disabled: false }, forms.Validators.required]
|
|
33677
|
+
valor: [{ value: valorValue, disabled: false }, [forms.Validators.required, forms.Validators.max(this.valorBase)]]
|
|
33635
33678
|
});
|
|
33679
|
+
this.contaDialogFormGroup.get('contaFinanceira').valueChanges
|
|
33680
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
33681
|
+
.subscribe(function (value) { return (_this.selectedConta = value || null); });
|
|
33636
33682
|
this.setupPercentualValorSync(this.contaDialogFormGroup, function () { return _this.valorBase; });
|
|
33637
33683
|
this.contaDialogFields = this.getContaDialogFields();
|
|
33638
33684
|
this.displayContaDialog = true;
|
|
33639
33685
|
};
|
|
33640
33686
|
ErpRateioEditorComponent.prototype.onSaveContaDialog = function () {
|
|
33641
|
-
var
|
|
33687
|
+
var _this = this;
|
|
33688
|
+
var _a, _b, _c;
|
|
33642
33689
|
if (this.contaDialogFormGroup.invalid) {
|
|
33643
33690
|
return;
|
|
33644
33691
|
}
|
|
33692
|
+
var contaControl = this.contaDialogFormGroup.get('contaFinanceira');
|
|
33645
33693
|
var data = this.contaDialogFormGroup.getRawValue();
|
|
33646
33694
|
var contaFinanceira = data.contaFinanceira;
|
|
33647
33695
|
var percentual = Number(data.percentual) || 0;
|
|
33648
33696
|
var valor = +(Number(data.valor) || 0).toFixed((_a = this.config.currencyScale) !== null && _a !== void 0 ? _a : 2);
|
|
33697
|
+
var idContaFinanceira = ((_b = this.selectedConta) === null || _b === void 0 ? void 0 : _b.id) || (contaFinanceira === null || contaFinanceira === void 0 ? void 0 : contaFinanceira.id) || '';
|
|
33698
|
+
// Validação analítica: conta sintética não pode ser usada no rateio
|
|
33699
|
+
if (((_c = this.selectedConta) === null || _c === void 0 ? void 0 : _c.anaSin) === ErpRateioEditorComponent_1.ANA_SIN_SINTETICO) {
|
|
33700
|
+
contaControl.setErrors({ contaSintetica: true });
|
|
33701
|
+
return;
|
|
33702
|
+
}
|
|
33703
|
+
// Validação de duplicidade (adição e edição, ignorando o item em edição)
|
|
33704
|
+
var duplicada = this.contasDataSource.some(function (c, i) { return i !== _this.editingContaIndex && c.idContaFinanceira === idContaFinanceira; });
|
|
33705
|
+
if (duplicada) {
|
|
33706
|
+
contaControl.setErrors({ duplicate: true });
|
|
33707
|
+
return;
|
|
33708
|
+
}
|
|
33649
33709
|
if (this.editingContaIndex != null) {
|
|
33650
33710
|
var conta = this.contasDataSource[this.editingContaIndex];
|
|
33651
33711
|
conta.percentual = percentual;
|
|
@@ -33653,22 +33713,16 @@
|
|
|
33653
33713
|
this.contasDataSource = __spread(this.contasDataSource);
|
|
33654
33714
|
}
|
|
33655
33715
|
else {
|
|
33656
|
-
var idContaFinanceira_1 = (contaFinanceira === null || contaFinanceira === void 0 ? void 0 : contaFinanceira.id) || '';
|
|
33657
33716
|
var labelConta = (contaFinanceira === null || contaFinanceira === void 0 ? void 0 : contaFinanceira.label) || '';
|
|
33658
|
-
// Validação extra: bloqueia duplicidade
|
|
33659
|
-
var jaExiste = this.contasDataSource.some(function (c) { return c.idContaFinanceira === idContaFinanceira_1; });
|
|
33660
|
-
if (jaExiste) {
|
|
33661
|
-
this.contaDialogFormGroup.get('contaFinanceira').setErrors({ duplicate: true });
|
|
33662
|
-
return;
|
|
33663
|
-
}
|
|
33664
33717
|
var novaConta = {
|
|
33665
|
-
idContaFinanceira:
|
|
33718
|
+
idContaFinanceira: idContaFinanceira,
|
|
33666
33719
|
contaFinanceira: labelConta,
|
|
33667
33720
|
percentual: percentual,
|
|
33668
33721
|
valorRateadoConta: valor,
|
|
33669
33722
|
rateiosCCusto: []
|
|
33670
33723
|
};
|
|
33671
33724
|
this.contasDataSource = __spread(this.contasDataSource, [novaConta]);
|
|
33725
|
+
this.ccSelection[novaConta.idContaFinanceira] = [];
|
|
33672
33726
|
}
|
|
33673
33727
|
this.displayContaDialog = false;
|
|
33674
33728
|
this.emitChange();
|
|
@@ -33698,41 +33752,54 @@
|
|
|
33698
33752
|
percentualValue = cc.percentual;
|
|
33699
33753
|
valorValue = cc.valor;
|
|
33700
33754
|
}
|
|
33755
|
+
this.selectedCC = ccValue;
|
|
33701
33756
|
this.ccDialogFormGroup = this.fb.group({
|
|
33702
33757
|
centroCusto: [{ value: ccValue, disabled: this.editingCCIndex != null }, forms.Validators.required],
|
|
33703
33758
|
percentual: [{ value: percentualValue, disabled: false }, forms.Validators.required],
|
|
33704
|
-
valor: [{ value: valorValue, disabled: false }, forms.Validators.required]
|
|
33759
|
+
valor: [{ value: valorValue, disabled: false }, [forms.Validators.required, forms.Validators.max(valorBaseCC)]]
|
|
33705
33760
|
});
|
|
33761
|
+
this.ccDialogFormGroup.get('centroCusto').valueChanges
|
|
33762
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
33763
|
+
.subscribe(function (value) { return (_this.selectedCC = value || null); });
|
|
33706
33764
|
this.setupPercentualValorSync(this.ccDialogFormGroup, function () { return valorBaseCC; });
|
|
33707
33765
|
this.ccDialogFields = this.getCCDialogFields();
|
|
33708
33766
|
this.displayCCDialog = true;
|
|
33709
33767
|
};
|
|
33710
33768
|
ErpRateioEditorComponent.prototype.onSaveCCDialog = function () {
|
|
33711
|
-
var
|
|
33769
|
+
var _this = this;
|
|
33770
|
+
var _a, _b, _c, _d;
|
|
33712
33771
|
if (this.ccDialogFormGroup.invalid) {
|
|
33713
33772
|
return;
|
|
33714
33773
|
}
|
|
33774
|
+
var ccControl = this.ccDialogFormGroup.get('centroCusto');
|
|
33715
33775
|
var data = this.ccDialogFormGroup.getRawValue();
|
|
33716
33776
|
var centroCusto = data.centroCusto;
|
|
33717
33777
|
var percentual = Number(data.percentual) || 0;
|
|
33718
33778
|
var valor = +(Number(data.valor) || 0).toFixed((_a = this.config.currencyScale) !== null && _a !== void 0 ? _a : 2);
|
|
33719
33779
|
var conta = this.contasDataSource[this.editingCCContaIndex];
|
|
33780
|
+
var idCentroCusto = ((_b = this.selectedCC) === null || _b === void 0 ? void 0 : _b.id) || (centroCusto === null || centroCusto === void 0 ? void 0 : centroCusto.id) || '';
|
|
33781
|
+
// Validação analítica: CC sintético ou que não aceita rateio é inválido
|
|
33782
|
+
var ccInvalido = ((_c = this.selectedCC) === null || _c === void 0 ? void 0 : _c.aceRat) === false
|
|
33783
|
+
|| ((_d = this.selectedCC) === null || _d === void 0 ? void 0 : _d.anaSin) === ErpRateioEditorComponent_1.ANA_SIN_SINTETICO;
|
|
33784
|
+
if (ccInvalido) {
|
|
33785
|
+
ccControl.setErrors({ centroCustoInvalido: true });
|
|
33786
|
+
return;
|
|
33787
|
+
}
|
|
33788
|
+
// Validação de duplicidade na mesma conta (adição e edição, ignorando o item em edição)
|
|
33789
|
+
var ccList = conta.rateiosCCusto || [];
|
|
33790
|
+
var duplicado = ccList.some(function (cc, i) { return i !== _this.editingCCIndex && cc.idCentroCusto === idCentroCusto; });
|
|
33791
|
+
if (duplicado) {
|
|
33792
|
+
ccControl.setErrors({ duplicate: true });
|
|
33793
|
+
return;
|
|
33794
|
+
}
|
|
33720
33795
|
if (this.editingCCIndex != null) {
|
|
33721
33796
|
var cc = conta.rateiosCCusto[this.editingCCIndex];
|
|
33722
33797
|
cc.percentual = percentual;
|
|
33723
33798
|
cc.valor = valor;
|
|
33724
33799
|
}
|
|
33725
33800
|
else {
|
|
33726
|
-
var idCentroCusto_1 = (centroCusto === null || centroCusto === void 0 ? void 0 : centroCusto.id) || '';
|
|
33727
33801
|
var labelCCusto = (centroCusto === null || centroCusto === void 0 ? void 0 : centroCusto.label) || '';
|
|
33728
|
-
|
|
33729
|
-
var ccList = conta.rateiosCCusto || [];
|
|
33730
|
-
var jaExiste = ccList.some(function (cc) { return cc.idCentroCusto === idCentroCusto_1; });
|
|
33731
|
-
if (jaExiste) {
|
|
33732
|
-
this.ccDialogFormGroup.get('centroCusto').setErrors({ duplicate: true });
|
|
33733
|
-
return;
|
|
33734
|
-
}
|
|
33735
|
-
conta.rateiosCCusto = __spread(ccList, [{ idCentroCusto: idCentroCusto_1, descCCusto: labelCCusto, percentual: percentual, valor: valor }]);
|
|
33802
|
+
conta.rateiosCCusto = __spread(ccList, [{ idCentroCusto: idCentroCusto, descCCusto: labelCCusto, percentual: percentual, valor: valor }]);
|
|
33736
33803
|
}
|
|
33737
33804
|
this.contasDataSource = __spread(this.contasDataSource);
|
|
33738
33805
|
this.displayCCDialog = false;
|
|
@@ -33743,15 +33810,38 @@
|
|
|
33743
33810
|
};
|
|
33744
33811
|
// === AÇÕES DA TABELA ===
|
|
33745
33812
|
ErpRateioEditorComponent.prototype.onDeleteSelected = function () {
|
|
33813
|
+
var _this = this;
|
|
33746
33814
|
if (!this.selection.length) {
|
|
33747
33815
|
return;
|
|
33748
33816
|
}
|
|
33749
33817
|
var idsToRemove = new Set(this.selection.map(function (s) { return s.idContaFinanceira; }));
|
|
33750
33818
|
this.contasDataSource = this.contasDataSource.filter(function (c) { return !idsToRemove.has(c.idContaFinanceira); });
|
|
33819
|
+
idsToRemove.forEach(function (id) { return delete _this.ccSelection[id]; });
|
|
33751
33820
|
this.selection = [];
|
|
33752
33821
|
this.emitChange();
|
|
33753
33822
|
};
|
|
33823
|
+
/** Remove os centros de custo selecionados de uma conta financeira. */
|
|
33824
|
+
ErpRateioEditorComponent.prototype.onDeleteSelectedCC = function (conta) {
|
|
33825
|
+
var selecionados = this.ccSelection[conta.idContaFinanceira] || [];
|
|
33826
|
+
if (!selecionados.length) {
|
|
33827
|
+
this.messageService.add({
|
|
33828
|
+
severity: 'warn',
|
|
33829
|
+
summary: this.translate.instant('erpx.rateio_editor.erro_titulo'),
|
|
33830
|
+
detail: this.translate.instant('erpx.rateio_editor.nenhum_centro_custo_selecionado')
|
|
33831
|
+
});
|
|
33832
|
+
return;
|
|
33833
|
+
}
|
|
33834
|
+
var idsToRemove = new Set(selecionados.map(function (cc) { return cc.idCentroCusto; }));
|
|
33835
|
+
conta.rateiosCCusto = conta.rateiosCCusto.filter(function (cc) { return !idsToRemove.has(cc.idCentroCusto); });
|
|
33836
|
+
this.ccSelection[conta.idContaFinanceira] = [];
|
|
33837
|
+
this.contasDataSource = __spread(this.contasDataSource);
|
|
33838
|
+
this.emitChange();
|
|
33839
|
+
};
|
|
33754
33840
|
ErpRateioEditorComponent.prototype.removerConta = function (index) {
|
|
33841
|
+
var removida = this.contasDataSource[index];
|
|
33842
|
+
if (removida) {
|
|
33843
|
+
delete this.ccSelection[removida.idContaFinanceira];
|
|
33844
|
+
}
|
|
33755
33845
|
this.contasDataSource = this.contasDataSource.filter(function (_, i) { return i !== index; });
|
|
33756
33846
|
this.emitChange();
|
|
33757
33847
|
};
|
|
@@ -33761,24 +33851,40 @@
|
|
|
33761
33851
|
this.contasDataSource = __spread(this.contasDataSource);
|
|
33762
33852
|
this.emitChange();
|
|
33763
33853
|
};
|
|
33764
|
-
ErpRateioEditorComponent.prototype.getMenuOptionsPerRow = function (rowData
|
|
33854
|
+
ErpRateioEditorComponent.prototype.getMenuOptionsPerRow = function (rowData) {
|
|
33765
33855
|
var _this = this;
|
|
33766
|
-
|
|
33767
|
-
|
|
33768
|
-
|
|
33769
|
-
|
|
33770
|
-
|
|
33856
|
+
var id = rowData.idContaFinanceira;
|
|
33857
|
+
var options = this.contaMenuOptionsCache.get(id);
|
|
33858
|
+
if (!options) {
|
|
33859
|
+
options = [
|
|
33860
|
+
{ label: this.translate.instant('erpx.rateio_editor.editar'), command: function () { return _this.openContaDialog(_this.getContaIndex(rowData)); } },
|
|
33861
|
+
{ label: this.translate.instant('erpx.rateio_editor.adicionar_centro_custo'), command: function () { return _this.openCCDialog(_this.getContaIndex(rowData)); } },
|
|
33862
|
+
{ label: this.translate.instant('erpx.rateio_editor.remover_centro_custo'), command: function () { return _this.onDeleteSelectedCC(rowData); } },
|
|
33863
|
+
{ label: this.translate.instant('erpx.rateio_editor.excluir'), command: function () { return _this.removerConta(_this.getContaIndex(rowData)); } }
|
|
33864
|
+
];
|
|
33865
|
+
this.contaMenuOptionsCache.set(id, options);
|
|
33866
|
+
}
|
|
33867
|
+
return options;
|
|
33771
33868
|
};
|
|
33772
|
-
ErpRateioEditorComponent.prototype.getCCMenuOptions = function (
|
|
33869
|
+
ErpRateioEditorComponent.prototype.getCCMenuOptions = function (conta, cc) {
|
|
33773
33870
|
var _this = this;
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33871
|
+
var key = conta.idContaFinanceira + "::" + cc.idCentroCusto;
|
|
33872
|
+
var options = this.ccMenuOptionsCache.get(key);
|
|
33873
|
+
if (!options) {
|
|
33874
|
+
options = [
|
|
33875
|
+
{ label: this.translate.instant('erpx.rateio_editor.editar'), command: function () { return _this.openCCDialog(_this.getContaIndex(conta), _this.getCCIndex(conta, cc)); } },
|
|
33876
|
+
{ label: this.translate.instant('erpx.rateio_editor.excluir'), command: function () { return _this.removerCentroCusto(_this.getContaIndex(conta), _this.getCCIndex(conta, cc)); } }
|
|
33877
|
+
];
|
|
33878
|
+
this.ccMenuOptionsCache.set(key, options);
|
|
33879
|
+
}
|
|
33880
|
+
return options;
|
|
33778
33881
|
};
|
|
33779
33882
|
ErpRateioEditorComponent.prototype.getContaIndex = function (rowData) {
|
|
33780
33883
|
return this.contasDataSource.indexOf(rowData);
|
|
33781
33884
|
};
|
|
33885
|
+
ErpRateioEditorComponent.prototype.getCCIndex = function (conta, cc) {
|
|
33886
|
+
return (conta.rateiosCCusto || []).indexOf(cc);
|
|
33887
|
+
};
|
|
33782
33888
|
// === PRIVADOS ===
|
|
33783
33889
|
/** Inicializa o componente a partir dos inputs (sem chamada à API de carga). */
|
|
33784
33890
|
ErpRateioEditorComponent.prototype.inicializarPorInputs = function () {
|
|
@@ -33806,7 +33912,35 @@
|
|
|
33806
33912
|
}, function (err) { var _a; return _this.error.emit({ operacao: 'load', message: ((_a = err === null || err === void 0 ? void 0 : err.error) === null || _a === void 0 ? void 0 : _a.message) || (err === null || err === void 0 ? void 0 : err.message) || _this.translate.instant('erpx.rateio_editor.erro_carregar'), originalError: err }); });
|
|
33807
33913
|
};
|
|
33808
33914
|
ErpRateioEditorComponent.prototype.popularComRateios = function (rateios) {
|
|
33915
|
+
var _this = this;
|
|
33809
33916
|
this.contasDataSource = __spread(rateios);
|
|
33917
|
+
this.ccSelection = {};
|
|
33918
|
+
this.contaMenuOptionsCache.clear();
|
|
33919
|
+
this.ccMenuOptionsCache.clear();
|
|
33920
|
+
this.contasDataSource.forEach(function (conta) {
|
|
33921
|
+
_this.ccSelection[conta.idContaFinanceira] = [];
|
|
33922
|
+
});
|
|
33923
|
+
};
|
|
33924
|
+
/** Distribuição completa: restantes globais e de cada conta iguais a zero. */
|
|
33925
|
+
ErpRateioEditorComponent.prototype.isDistribuicaoCompleta = function () {
|
|
33926
|
+
var _this = this;
|
|
33927
|
+
if (this.percentualRestante !== 0 || this.valorRestante !== 0) {
|
|
33928
|
+
return false;
|
|
33929
|
+
}
|
|
33930
|
+
return this.contasDataSource.every(function (conta) { return _this.isContaCCCompleta(conta); });
|
|
33931
|
+
};
|
|
33932
|
+
/** Restante de % e de valor dos centros de custo de uma conta igual a zero. */
|
|
33933
|
+
ErpRateioEditorComponent.prototype.isContaCCCompleta = function (conta) {
|
|
33934
|
+
var _a, _b;
|
|
33935
|
+
var ccs = conta.rateiosCCusto || [];
|
|
33936
|
+
if (ccs.length === 0) {
|
|
33937
|
+
return true;
|
|
33938
|
+
}
|
|
33939
|
+
var somaPct = ccs.reduce(function (acc, cc) { return acc + (cc.percentual || 0); }, 0);
|
|
33940
|
+
var somaValor = ccs.reduce(function (acc, cc) { return acc + (cc.valor || 0); }, 0);
|
|
33941
|
+
var pctRestante = +(100 - somaPct).toFixed((_a = this.config.percentageScale) !== null && _a !== void 0 ? _a : 4);
|
|
33942
|
+
var valorRestante = +((conta.valorRateadoConta || 0) - somaValor).toFixed((_b = this.config.currencyScale) !== null && _b !== void 0 ? _b : 2);
|
|
33943
|
+
return pctRestante === 0 && valorRestante === 0;
|
|
33810
33944
|
};
|
|
33811
33945
|
ErpRateioEditorComponent.prototype.getContaDialogFields = function () {
|
|
33812
33946
|
var _this = this;
|
|
@@ -33815,6 +33949,7 @@
|
|
|
33815
33949
|
new angularComponents$1.FormField(__assign(__assign({}, this.e091PlfLookup.mountOptions({
|
|
33816
33950
|
multiple: false,
|
|
33817
33951
|
formGroup: 'contaFinanceira',
|
|
33952
|
+
queryFields: ['anaSin'],
|
|
33818
33953
|
defaultFilter: [
|
|
33819
33954
|
{ field: 'excluido', operator: angularComponents.EnumLogicalOperator.Eq, values: ['false'] },
|
|
33820
33955
|
{ field: 'sitFin', operator: angularComponents.EnumLogicalOperator.Eq, values: ['VA'] },
|
|
@@ -33850,6 +33985,7 @@
|
|
|
33850
33985
|
new angularComponents$1.FormField(__assign(__assign({}, this.e044CcuLookup.mountOptions({
|
|
33851
33986
|
multiple: false,
|
|
33852
33987
|
formGroup: 'centroCusto',
|
|
33988
|
+
queryFields: ['anaSin', 'aceRat'],
|
|
33853
33989
|
defaultFilter: [
|
|
33854
33990
|
{ field: 'excluido', operator: angularComponents.EnumLogicalOperator.Eq, values: ['false'] },
|
|
33855
33991
|
{ field: 'sitCcu', operator: angularComponents.EnumLogicalOperator.Eq, values: ['VA'] },
|
|
@@ -33927,6 +34063,9 @@
|
|
|
33927
34063
|
rateios: this.contasDataSource
|
|
33928
34064
|
});
|
|
33929
34065
|
};
|
|
34066
|
+
var ErpRateioEditorComponent_1;
|
|
34067
|
+
/** Valor de anaSin que indica registro sintético (não analítico). */
|
|
34068
|
+
ErpRateioEditorComponent.ANA_SIN_SINTETICO = 'VS';
|
|
33930
34069
|
ErpRateioEditorComponent.ctorParameters = function () { return [
|
|
33931
34070
|
{ type: forms.FormBuilder },
|
|
33932
34071
|
{ type: ErpRateioEditorService },
|
|
@@ -33968,6 +34107,27 @@
|
|
|
33968
34107
|
__decorate([
|
|
33969
34108
|
core.Input()
|
|
33970
34109
|
], ErpRateioEditorComponent.prototype, "criRat", void 0);
|
|
34110
|
+
__decorate([
|
|
34111
|
+
core.Input()
|
|
34112
|
+
], ErpRateioEditorComponent.prototype, "e091plfId", void 0);
|
|
34113
|
+
__decorate([
|
|
34114
|
+
core.Input()
|
|
34115
|
+
], ErpRateioEditorComponent.prototype, "e044ccuId", void 0);
|
|
34116
|
+
__decorate([
|
|
34117
|
+
core.Input()
|
|
34118
|
+
], ErpRateioEditorComponent.prototype, "idTransacao", void 0);
|
|
34119
|
+
__decorate([
|
|
34120
|
+
core.Input()
|
|
34121
|
+
], ErpRateioEditorComponent.prototype, "idFamilia", void 0);
|
|
34122
|
+
__decorate([
|
|
34123
|
+
core.Input()
|
|
34124
|
+
], ErpRateioEditorComponent.prototype, "idDerivacao", void 0);
|
|
34125
|
+
__decorate([
|
|
34126
|
+
core.Input()
|
|
34127
|
+
], ErpRateioEditorComponent.prototype, "idServico", void 0);
|
|
34128
|
+
__decorate([
|
|
34129
|
+
core.Input()
|
|
34130
|
+
], ErpRateioEditorComponent.prototype, "valorExcedente", void 0);
|
|
33971
34131
|
__decorate([
|
|
33972
34132
|
core.Input()
|
|
33973
34133
|
], ErpRateioEditorComponent.prototype, "currencyCode", void 0);
|
|
@@ -33986,10 +34146,10 @@
|
|
|
33986
34146
|
__decorate([
|
|
33987
34147
|
core.ViewChild('tableRateio')
|
|
33988
34148
|
], ErpRateioEditorComponent.prototype, "table", void 0);
|
|
33989
|
-
ErpRateioEditorComponent = __decorate([
|
|
34149
|
+
ErpRateioEditorComponent = ErpRateioEditorComponent_1 = __decorate([
|
|
33990
34150
|
core.Component({
|
|
33991
34151
|
selector: 'erp-rateio-editor',
|
|
33992
|
-
template: "<s-loading-state [loading]=\"loading\" [blockWindow]=\"true\">\n <!-- Se\u00E7\u00E3o 1: Informa\u00E7\u00F5es do movimento -->\n <div class=\"sds-section-title\" *ngIf=\"isReady\">\n {{ 'erpx.rateio_editor.titulo' | translate }}\n </div>\n\n <div class=\"ui-g custom-stats\" *ngIf=\"isReady\">\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n color=\"#0C9348\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_base' | translate\"\n [value]=\"valorBase | numeric:numberFormatOptions | async\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n color=\"#428BCA\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-percent\"\n [label]=\"'erpx.rateio_editor.percentual_restante' | translate\"\n [value]=\"percentualRestante + '%'\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n [color]=\"valorRestante === 0 ? '#0C9348' : '#C13018'\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_restante' | translate\"\n [value]=\"valorRestante | numeric:numberFormatOptions | async\"\n ></s-stats-card>\n </div>\n </div>\n\n <!-- Se\u00E7\u00E3o 2: Tabela de rateios -->\n <div class=\"sds-section-title\" *ngIf=\"isReady\">\n {{ 'erpx.rateio_editor.lista_rateios' | translate }}\n </div>\n\n <s-empty-state\n *ngIf=\"isReady && contasDataSource?.length === 0\"\n iconClass=\"far fa-dollar-sign\"\n [title]=\"'erpx.rateio_editor.sem_rateios_titulo' | translate\"\n [description]=\"'erpx.rateio_editor.sem_rateios_descricao' | translate\"\n ></s-empty-state>\n\n <div class=\"ui-g\" *ngIf=\"isReady && contasDataSource?.length > 0\">\n <div class=\"ui-g-12\" *ngIf=\"!effectiveReadOnly\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openContaDialog()\"\n ></s-button>\n <s-button\n *ngIf=\"showSugestaoButton\"\n [label]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n iconClass=\"fa fa-magic\"\n (onClick)=\"onSugerir()\"\n ></s-button>\n <s-button\n [label]=\"'erpx.rateio_editor.remover_conta' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n (onClick)=\"onDeleteSelected()\"\n [disabled]=\"!selection.length\"\n ></s-button>\n </div>\n <div class=\"ui-g-12\">\n <p-table\n #tableRateio\n [value]=\"contasDataSource\"\n [columns]=\"gridColumns\"\n dataKey=\"idContaFinanceira\"\n [resizableColumns]=\"true\"\n [totalRecords]=\"contasDataSource.length\"\n [(selection)]=\"selection\"\n [paginator]=\"false\"\n [rows]=\"10\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th scope=\"col\" style=\"width: 3em\"></th>\n <th scope=\"col\" class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableHeaderCheckbox *ngIf=\"!effectiveReadOnly\"></p-tableHeaderCheckbox>\n </th>\n <th *ngFor=\"let col of columns\" scope=\"col\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n <th scope=\"col\" *ngIf=\"!effectiveReadOnly\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ 'erpx.rateio_editor.acoes' | translate }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\n <tr>\n <td style=\"width: 3em; text-align: center\">\n <a *ngIf=\"rowData.rateiosCCusto?.length\" [pRowToggler]=\"rowData\" role=\"button\" tabindex=\"0\">\n <i [class]=\"expanded ? 'fa fa-minus' : 'fa fa-plus'\"></i>\n </a>\n </td>\n <td class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableCheckbox *ngIf=\"!effectiveReadOnly\" [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td>{{ rowData.contaFinanceira || rowData.idContaFinanceira }}</td>\n <td style=\"text-align: right\">{{ rowData.percentual }}</td>\n <td style=\"text-align: right\">{{ rowData.valorRateadoConta | numeric:numberFormatOptions | async }}</td>\n <td *ngIf=\"!effectiveReadOnly\">\n <s-button\n [auxiliary]=\"true\"\n [priority]=\"ButtonPriority.Default\"\n [size]=\"ButtonSize.Small\"\n [label]=\"'erpx.rateio_editor.acoes' | translate\"\n [menuOptions]=\"getMenuOptionsPerRow(rowData, rowIndex)\"\n ></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"rowexpansion\" let-rowData let-rowIndex=\"rowIndex\">\n <tr>\n <td [attr.colspan]=\"effectiveReadOnly ? gridColumns.length + 2 : gridColumns.length + 3\">\n <div class=\"ui-g\" style=\"padding: 8px 16px\">\n <p-table [value]=\"rowData.rateiosCCusto\" [responsive]=\"true\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th scope=\"col\">{{ 'erpx.rateio_editor.centro_custo' | translate }}</th>\n <th scope=\"col\">{{ 'erpx.rateio_editor.percentual' | translate }}</th>\n <th scope=\"col\">{{ 'erpx.rateio_editor.valor' | translate }}</th>\n <th scope=\"col\" *ngIf=\"!effectiveReadOnly\">{{ 'erpx.rateio_editor.acoes' | translate }}</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-cc let-ccIndex=\"rowIndex\">\n <tr>\n <td>{{ cc.descCCusto || cc.idCentroCusto }}</td>\n <td style=\"text-align: right\">{{ cc.percentual }}</td>\n <td style=\"text-align: right\">{{ cc.valor | numeric:numberFormatOptions | async }}</td>\n <td *ngIf=\"!effectiveReadOnly\">\n <s-button\n [auxiliary]=\"true\"\n [priority]=\"ButtonPriority.Default\"\n [size]=\"ButtonSize.Small\"\n [label]=\"'erpx.rateio_editor.acoes' | translate\"\n [menuOptions]=\"getCCMenuOptions(getContaIndex(rowData), ccIndex)\"\n ></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"effectiveReadOnly ? 3 : 4\">\n {{ 'erpx.rateio_editor.sem_centros_custo' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n\n <!-- Bot\u00F5es de a\u00E7\u00E3o -->\n <div *ngIf=\"isReady\" class=\"ui-g rateio-editor-actions\">\n <div class=\"ui-g-12\">\n <div *ngIf=\"!effectiveReadOnly && contasDataSource?.length === 0\" style=\"margin-bottom: 8px\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openContaDialog()\"\n ></s-button>\n <s-button\n *ngIf=\"showSugestaoButton\"\n [label]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n iconClass=\"fa fa-magic\"\n (onClick)=\"onSugerir()\"\n ></s-button>\n </div>\n <s-button\n *ngIf=\"!effectiveReadOnly && !isStandalone\"\n priority=\"primary\"\n iconClass=\"fa fa-check\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSalvar()\"\n ></s-button>\n </div>\n </div>\n</s-loading-state>\n\n<!-- Modal: Adicionar/Editar Conta Financeira -->\n<p-dialog\n [header]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n appendTo=\"body\"\n [modal]=\"true\"\n [(visible)]=\"displayContaDialog\"\n (onHide)=\"onHideContaDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"false\"\n styleClass=\"custom-dialog\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [style]=\"{width: '40%'}\"\n>\n <form *ngIf=\"contaDialogFormGroup\" [formGroup]=\"contaDialogFormGroup\" (ngSubmit)=\"onSaveContaDialog()\">\n <div class=\"ui-fluid\">\n <s-dynamic-form\n [fields]=\"contaDialogFields\"\n [form]=\"contaDialogFormGroup\"\n [errorMessages]=\"{\n required: ('erpx.rateio_editor.erro_obrigatorio' | translate),\n duplicate: ('erpx.rateio_editor.conta_duplicada' | translate)\n }\"\n ></s-dynamic-form>\n </div>\n </form>\n <p-footer>\n <s-button\n id=\"dialog-conta-save\"\n type=\"button\"\n priority=\"primary\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSaveContaDialog()\"\n ></s-button>\n <s-button\n id=\"dialog-conta-cancel\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"'erpx.rateio_editor.cancelar' | translate\"\n (onClick)=\"onHideContaDialog()\"\n ></s-button>\n </p-footer>\n</p-dialog>\n\n<!-- Modal: Adicionar/Editar Centro de Custo -->\n<p-dialog\n [header]=\"'erpx.rateio_editor.adicionar_centro_custo' | translate\"\n appendTo=\"body\"\n [modal]=\"true\"\n [(visible)]=\"displayCCDialog\"\n (onHide)=\"onHideCCDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"false\"\n styleClass=\"custom-dialog\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [style]=\"{width: '40%'}\"\n>\n <form *ngIf=\"ccDialogFormGroup\" [formGroup]=\"ccDialogFormGroup\" (ngSubmit)=\"onSaveCCDialog()\">\n <div class=\"ui-fluid\">\n <s-dynamic-form\n [fields]=\"ccDialogFields\"\n [form]=\"ccDialogFormGroup\"\n [errorMessages]=\"{\n required: ('erpx.rateio_editor.erro_obrigatorio' | translate),\n duplicate: ('erpx.rateio_editor.centro_custo_duplicado' | translate)\n }\"\n ></s-dynamic-form>\n </div>\n </form>\n <p-footer>\n <s-button\n id=\"dialog-cc-save\"\n type=\"button\"\n priority=\"primary\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSaveCCDialog()\"\n ></s-button>\n <s-button\n id=\"dialog-cc-cancel\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"'erpx.rateio_editor.cancelar' | translate\"\n (onClick)=\"onHideCCDialog()\"\n ></s-button>\n </p-footer>\n</p-dialog>\n"
|
|
34152
|
+
template: "<s-loading-state [loading]=\"loading\" [blockWindow]=\"true\">\n <!-- Se\u00E7\u00E3o 1: Informa\u00E7\u00F5es do movimento -->\n <div class=\"sds-section-title\" *ngIf=\"isReady\">\n {{ 'erpx.rateio_editor.titulo' | translate }}\n </div>\n\n <div class=\"ui-g custom-stats\" *ngIf=\"isReady\">\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n color=\"#0C9348\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_base' | translate\"\n [value]=\"valorBase | numeric:numberFormatOptions | async\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n color=\"#428BCA\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-percent\"\n [label]=\"'erpx.rateio_editor.percentual_restante' | translate\"\n [value]=\"percentualRestante + '%'\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n [color]=\"valorRestante === 0 ? '#0C9348' : '#C13018'\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_restante' | translate\"\n [value]=\"valorRestante | numeric:numberFormatOptions | async\"\n ></s-stats-card>\n </div>\n </div>\n\n <!-- Se\u00E7\u00E3o 2: Tabela de rateios -->\n <div class=\"sds-section-title\" *ngIf=\"isReady\">\n {{ 'erpx.rateio_editor.lista_rateios' | translate }}\n </div>\n\n <s-empty-state\n *ngIf=\"isReady && contasDataSource?.length === 0\"\n iconClass=\"far fa-dollar-sign\"\n [title]=\"'erpx.rateio_editor.sem_rateios_titulo' | translate\"\n [description]=\"'erpx.rateio_editor.sem_rateios_descricao' | translate\"\n ></s-empty-state>\n\n <div class=\"ui-g\" *ngIf=\"isReady && contasDataSource?.length > 0\">\n <div class=\"ui-g-12\" *ngIf=\"!effectiveReadOnly\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openContaDialog()\"\n ></s-button>\n <s-button\n *ngIf=\"showSugestaoButton\"\n [label]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n iconClass=\"fa fa-magic\"\n (onClick)=\"onSugerir()\"\n ></s-button>\n <s-button\n [label]=\"'erpx.rateio_editor.remover_conta' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n (onClick)=\"onDeleteSelected()\"\n [disabled]=\"!selection.length\"\n ></s-button>\n </div>\n <div class=\"ui-g-12\">\n <p-table\n #tableRateio\n [value]=\"contasDataSource\"\n [columns]=\"gridColumns\"\n dataKey=\"idContaFinanceira\"\n [resizableColumns]=\"true\"\n [totalRecords]=\"contasDataSource.length\"\n [(selection)]=\"selection\"\n [paginator]=\"false\"\n [rows]=\"10\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th scope=\"col\" style=\"width: 3em\"></th>\n <th scope=\"col\" class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableHeaderCheckbox *ngIf=\"!effectiveReadOnly\"></p-tableHeaderCheckbox>\n </th>\n <th *ngFor=\"let col of columns\" scope=\"col\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n <th scope=\"col\" *ngIf=\"!effectiveReadOnly\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ 'erpx.rateio_editor.acoes' | translate }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\">\n <tr>\n <td style=\"width: 3em; text-align: center\">\n <a *ngIf=\"rowData.rateiosCCusto?.length\" [pRowToggler]=\"rowData\" role=\"button\" tabindex=\"0\">\n <i [class]=\"expanded ? 'fa fa-minus' : 'fa fa-plus'\"></i>\n </a>\n </td>\n <td class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableCheckbox *ngIf=\"!effectiveReadOnly\" [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td>{{ rowData.contaFinanceira || rowData.idContaFinanceira }}</td>\n <td style=\"text-align: right\">{{ rowData.percentual }}</td>\n <td style=\"text-align: right\">{{ rowData.valorRateadoConta | numeric:numberFormatOptions | async }}</td>\n <td *ngIf=\"!effectiveReadOnly\">\n <s-button\n [auxiliary]=\"true\"\n [priority]=\"ButtonPriority.Default\"\n [size]=\"ButtonSize.Small\"\n [label]=\"'erpx.rateio_editor.acoes' | translate\"\n [menuOptions]=\"getMenuOptionsPerRow(rowData)\"\n ></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"rowexpansion\" let-rowData let-rowIndex=\"rowIndex\">\n <tr>\n <td [attr.colspan]=\"effectiveReadOnly ? gridColumns.length + 2 : gridColumns.length + 3\">\n <div class=\"ui-g\" style=\"padding: 8px 16px\">\n <p-table\n [value]=\"rowData.rateiosCCusto\"\n dataKey=\"idCentroCusto\"\n [(selection)]=\"ccSelection[rowData.idContaFinanceira]\"\n [responsive]=\"true\"\n >\n <ng-template pTemplate=\"header\">\n <tr>\n <th scope=\"col\" class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableHeaderCheckbox *ngIf=\"!effectiveReadOnly\"></p-tableHeaderCheckbox>\n </th>\n <th scope=\"col\">{{ 'erpx.rateio_editor.centro_custo' | translate }}</th>\n <th scope=\"col\">{{ 'erpx.rateio_editor.percentual' | translate }}</th>\n <th scope=\"col\">{{ 'erpx.rateio_editor.valor' | translate }}</th>\n <th scope=\"col\" *ngIf=\"!effectiveReadOnly\">{{ 'erpx.rateio_editor.acoes' | translate }}</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-cc let-ccIndex=\"rowIndex\">\n <tr>\n <td class=\"col-checkbox\" style=\"width: 50px\">\n <p-tableCheckbox *ngIf=\"!effectiveReadOnly\" [value]=\"cc\"></p-tableCheckbox>\n </td>\n <td>{{ cc.descCCusto || cc.idCentroCusto }}</td>\n <td style=\"text-align: right\">{{ cc.percentual }}</td>\n <td style=\"text-align: right\">{{ cc.valor | numeric:numberFormatOptions | async }}</td>\n <td *ngIf=\"!effectiveReadOnly\">\n <s-button\n [auxiliary]=\"true\"\n [priority]=\"ButtonPriority.Default\"\n [size]=\"ButtonSize.Small\"\n [label]=\"'erpx.rateio_editor.acoes' | translate\"\n [menuOptions]=\"getCCMenuOptions(rowData, cc)\"\n ></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"effectiveReadOnly ? 3 : 5\">\n {{ 'erpx.rateio_editor.sem_centros_custo' | translate }}\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n\n <!-- Bot\u00F5es de a\u00E7\u00E3o -->\n <div *ngIf=\"isReady\" class=\"ui-g rateio-editor-actions\">\n <div class=\"ui-g-12\">\n <div *ngIf=\"!effectiveReadOnly && contasDataSource?.length === 0\" style=\"margin-bottom: 8px\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openContaDialog()\"\n ></s-button>\n <s-button\n *ngIf=\"showSugestaoButton\"\n [label]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n iconClass=\"fa fa-magic\"\n (onClick)=\"onSugerir()\"\n ></s-button>\n </div>\n <s-button\n *ngIf=\"!effectiveReadOnly && !isStandalone\"\n priority=\"primary\"\n iconClass=\"fa fa-check\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSalvar()\"\n ></s-button>\n </div>\n </div>\n</s-loading-state>\n\n<!-- Modal: Adicionar/Editar Conta Financeira -->\n<p-dialog\n [header]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n appendTo=\"body\"\n [modal]=\"true\"\n [(visible)]=\"displayContaDialog\"\n (onHide)=\"onHideContaDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"false\"\n styleClass=\"custom-dialog\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [style]=\"{width: '40%'}\"\n>\n <form *ngIf=\"contaDialogFormGroup\" [formGroup]=\"contaDialogFormGroup\" (ngSubmit)=\"onSaveContaDialog()\">\n <div class=\"ui-fluid\">\n <s-dynamic-form\n [fields]=\"contaDialogFields\"\n [form]=\"contaDialogFormGroup\"\n [errorMessages]=\"{\n required: ('erpx.rateio_editor.erro_obrigatorio' | translate),\n duplicate: ('erpx.rateio_editor.conta_duplicada' | translate),\n contaSintetica: ('erpx.rateio_editor.erro_conta_sintetica' | translate),\n max: ('erpx.rateio_editor.erro_valor_maximo_conta' | translate)\n }\"\n ></s-dynamic-form>\n </div>\n </form>\n <p-footer>\n <s-button\n id=\"dialog-conta-save\"\n type=\"button\"\n priority=\"primary\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSaveContaDialog()\"\n ></s-button>\n <s-button\n id=\"dialog-conta-cancel\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"'erpx.rateio_editor.cancelar' | translate\"\n (onClick)=\"onHideContaDialog()\"\n ></s-button>\n </p-footer>\n</p-dialog>\n\n<!-- Modal: Adicionar/Editar Centro de Custo -->\n<p-dialog\n [header]=\"'erpx.rateio_editor.adicionar_centro_custo' | translate\"\n appendTo=\"body\"\n [modal]=\"true\"\n [(visible)]=\"displayCCDialog\"\n (onHide)=\"onHideCCDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"false\"\n styleClass=\"custom-dialog\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n [style]=\"{width: '40%'}\"\n>\n <form *ngIf=\"ccDialogFormGroup\" [formGroup]=\"ccDialogFormGroup\" (ngSubmit)=\"onSaveCCDialog()\">\n <div class=\"ui-fluid\">\n <s-dynamic-form\n [fields]=\"ccDialogFields\"\n [form]=\"ccDialogFormGroup\"\n [errorMessages]=\"{\n required: ('erpx.rateio_editor.erro_obrigatorio' | translate),\n duplicate: ('erpx.rateio_editor.centro_custo_duplicado' | translate),\n centroCustoInvalido: ('erpx.rateio_editor.erro_centro_custo_invalido' | translate),\n max: ('erpx.rateio_editor.erro_valor_maximo_centro_custo' | translate)\n }\"\n ></s-dynamic-form>\n </div>\n </form>\n <p-footer>\n <s-button\n id=\"dialog-cc-save\"\n type=\"button\"\n priority=\"primary\"\n [label]=\"'erpx.rateio_editor.salvar' | translate\"\n (onClick)=\"onSaveCCDialog()\"\n ></s-button>\n <s-button\n id=\"dialog-cc-cancel\"\n type=\"button\"\n priority=\"secondary\"\n [label]=\"'erpx.rateio_editor.cancelar' | translate\"\n (onClick)=\"onHideCCDialog()\"\n ></s-button>\n </p-footer>\n</p-dialog>\n"
|
|
33993
34153
|
})
|
|
33994
34154
|
], ErpRateioEditorComponent);
|
|
33995
34155
|
return ErpRateioEditorComponent;
|