@senior-gestao-empresarial/erpx-components 4.11.0 → 4.12.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 +9 -3
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js.map +1 -1
- package/esm2015/components/rateio-editor/erp-rateio-editor.component.js +10 -4
- package/esm5/components/rateio-editor/erp-rateio-editor.component.js +10 -4
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +9 -3
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +9 -3
- package/fesm5/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -33732,8 +33732,8 @@
|
|
|
33732
33732
|
this.selectedConta = contaValue;
|
|
33733
33733
|
this.contaDialogFormGroup = this.fb.group({
|
|
33734
33734
|
contaFinanceira: [{ value: contaValue, disabled: this.editingContaIndex != null }, forms.Validators.required],
|
|
33735
|
-
percentual: [{ value: percentualValue, disabled: false }, forms.Validators.required],
|
|
33736
|
-
valor: [{ value: valorValue, disabled: false }, [forms.Validators.required, forms.Validators.max(
|
|
33735
|
+
percentual: [{ value: percentualValue, disabled: false }, [forms.Validators.required, forms.Validators.max(remainingPct)]],
|
|
33736
|
+
valor: [{ value: valorValue, disabled: false }, [forms.Validators.required, forms.Validators.max(remainingValor)]]
|
|
33737
33737
|
});
|
|
33738
33738
|
this.contaDialogFormGroup.get('contaFinanceira').valueChanges
|
|
33739
33739
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
@@ -33744,7 +33744,7 @@
|
|
|
33744
33744
|
};
|
|
33745
33745
|
ErpRateioEditorComponent.prototype.onSaveContaDialog = function () {
|
|
33746
33746
|
var _this = this;
|
|
33747
|
-
var _a, _b, _c;
|
|
33747
|
+
var _a, _b, _c, _d, _e;
|
|
33748
33748
|
if (this.contaDialogFormGroup.invalid) {
|
|
33749
33749
|
return;
|
|
33750
33750
|
}
|
|
@@ -33769,6 +33769,12 @@
|
|
|
33769
33769
|
var conta = this.contasDataSource[this.editingContaIndex];
|
|
33770
33770
|
conta.percentual = percentual;
|
|
33771
33771
|
conta.valorRateadoConta = valor;
|
|
33772
|
+
// Recalcula os valores dos CCs proporcionalmente ao novo valor da conta,
|
|
33773
|
+
// mantendo os percentuais intactos.
|
|
33774
|
+
if ((_d = conta.rateiosCCusto) === null || _d === void 0 ? void 0 : _d.length) {
|
|
33775
|
+
var currencyScale_1 = (_e = this.config.currencyScale) !== null && _e !== void 0 ? _e : 2;
|
|
33776
|
+
conta.rateiosCCusto = conta.rateiosCCusto.map(function (cc) { return (__assign(__assign({}, cc), { valor: +((cc.percentual / 100) * valor).toFixed(currencyScale_1) })); });
|
|
33777
|
+
}
|
|
33772
33778
|
this.contasDataSource = __spread(this.contasDataSource);
|
|
33773
33779
|
}
|
|
33774
33780
|
else {
|