@senior-gestao-empresarial/erpx-components 4.11.0 → 4.12.1-develop-774d30bd
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 +54 -38
- 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/components/rateio-editor/erp-rateio-editor.component.d.ts +3 -11
- package/esm2015/components/rateio-editor/erp-rateio-editor.component.js +27 -34
- package/esm2015/locale/fallback.js +28 -2
- package/esm5/components/rateio-editor/erp-rateio-editor.component.js +28 -38
- package/esm5/locale/fallback.js +28 -2
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +53 -34
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +54 -38
- package/fesm5/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/locale/fallback.d.ts +26 -0
- package/package.json +1 -1
- package/senior-gestao-empresarial-erpx-components.metadata.json +1 -1
|
@@ -33227,20 +33227,6 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33227
33227
|
enumerable: true,
|
|
33228
33228
|
configurable: true
|
|
33229
33229
|
});
|
|
33230
|
-
Object.defineProperty(ErpRateioEditorComponent.prototype, "requiresCentroCusto", {
|
|
33231
|
-
/**
|
|
33232
|
-
* Indica se o critério de rateio exige distribuição por centro de custo.
|
|
33233
|
-
* O critério 'V5' (Nenhum) não distribui por C. Custos; os demais exigem
|
|
33234
|
-
* ao menos um centro de custo por conta financeira.
|
|
33235
|
-
*/
|
|
33236
|
-
get: function () {
|
|
33237
|
-
var _a, _b;
|
|
33238
|
-
var criterio = (_b = (_a = this.loadedContext) === null || _a === void 0 ? void 0 : _a.criRat) !== null && _b !== void 0 ? _b : this.criRat;
|
|
33239
|
-
return criterio !== ErpRateioEditorComponent_1.CRITERIO_SEM_CENTRO_CUSTO;
|
|
33240
|
-
},
|
|
33241
|
-
enumerable: true,
|
|
33242
|
-
configurable: true
|
|
33243
|
-
});
|
|
33244
33230
|
Object.defineProperty(ErpRateioEditorComponent.prototype, "valorBase", {
|
|
33245
33231
|
get: function () {
|
|
33246
33232
|
var _a, _b;
|
|
@@ -33270,15 +33256,12 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33270
33256
|
Object.defineProperty(ErpRateioEditorComponent.prototype, "valorRestanteDisplay", {
|
|
33271
33257
|
/**
|
|
33272
33258
|
* Valor restante a ser exibido nos cards de resumo.
|
|
33273
|
-
*
|
|
33274
|
-
*
|
|
33275
|
-
*
|
|
33259
|
+
* Considera o total já distribuído nos centros de custo de todas as contas
|
|
33260
|
+
* (e não o total das contas financeiras), refletindo a distribuição real
|
|
33261
|
+
* ponta-a-ponta — centro de custo é sempre obrigatório.
|
|
33276
33262
|
*/
|
|
33277
33263
|
get: function () {
|
|
33278
33264
|
var _a;
|
|
33279
|
-
if (!this.requiresCentroCusto) {
|
|
33280
|
-
return this.valorRestante;
|
|
33281
|
-
}
|
|
33282
33265
|
var totalCC = this.contasDataSource.reduce(function (acc, conta) { return acc + (conta.rateiosCCusto || []).reduce(function (ccAcc, cc) { return ccAcc + (cc.valor || 0); }, 0); }, 0);
|
|
33283
33266
|
return +(this.valorBase - totalCC).toFixed((_a = this.config.currencyScale) !== null && _a !== void 0 ? _a : 2);
|
|
33284
33267
|
},
|
|
@@ -33292,9 +33275,6 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33292
33275
|
*/
|
|
33293
33276
|
get: function () {
|
|
33294
33277
|
var _a;
|
|
33295
|
-
if (!this.requiresCentroCusto) {
|
|
33296
|
-
return this.percentualRestante;
|
|
33297
|
-
}
|
|
33298
33278
|
if (!this.valorBase) {
|
|
33299
33279
|
return 0;
|
|
33300
33280
|
}
|
|
@@ -33382,7 +33362,7 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33382
33362
|
if (this.effectiveReadOnly) {
|
|
33383
33363
|
return;
|
|
33384
33364
|
}
|
|
33385
|
-
if (this.
|
|
33365
|
+
if (this.hasContaSemCentroCusto()) {
|
|
33386
33366
|
var message = this.translate.instant('erpx.rateio_editor.erro_centro_custo_obrigatorio');
|
|
33387
33367
|
this.messageService.add({
|
|
33388
33368
|
severity: 'error',
|
|
@@ -33532,8 +33512,8 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33532
33512
|
this.selectedConta = contaValue;
|
|
33533
33513
|
this.contaDialogFormGroup = this.fb.group({
|
|
33534
33514
|
contaFinanceira: [{ value: contaValue, disabled: this.editingContaIndex != null }, Validators.required],
|
|
33535
|
-
percentual: [{ value: percentualValue, disabled: false }, Validators.required],
|
|
33536
|
-
valor: [{ value: valorValue, disabled: false }, [Validators.required, Validators.max(
|
|
33515
|
+
percentual: [{ value: percentualValue, disabled: false }, [Validators.required, Validators.max(remainingPct)]],
|
|
33516
|
+
valor: [{ value: valorValue, disabled: false }, [Validators.required, Validators.max(remainingValor)]]
|
|
33537
33517
|
});
|
|
33538
33518
|
this.contaDialogFormGroup.get('contaFinanceira').valueChanges
|
|
33539
33519
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
@@ -33544,7 +33524,7 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33544
33524
|
};
|
|
33545
33525
|
ErpRateioEditorComponent.prototype.onSaveContaDialog = function () {
|
|
33546
33526
|
var _this = this;
|
|
33547
|
-
var _a, _b, _c;
|
|
33527
|
+
var _a, _b, _c, _d, _e;
|
|
33548
33528
|
if (this.contaDialogFormGroup.invalid) {
|
|
33549
33529
|
return;
|
|
33550
33530
|
}
|
|
@@ -33569,6 +33549,12 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33569
33549
|
var conta = this.contasDataSource[this.editingContaIndex];
|
|
33570
33550
|
conta.percentual = percentual;
|
|
33571
33551
|
conta.valorRateadoConta = valor;
|
|
33552
|
+
// Recalcula os valores dos CCs proporcionalmente ao novo valor da conta,
|
|
33553
|
+
// mantendo os percentuais intactos.
|
|
33554
|
+
if ((_d = conta.rateiosCCusto) === null || _d === void 0 ? void 0 : _d.length) {
|
|
33555
|
+
var currencyScale_1 = (_e = this.config.currencyScale) !== null && _e !== void 0 ? _e : 2;
|
|
33556
|
+
conta.rateiosCCusto = conta.rateiosCCusto.map(function (cc) { return (__assign(__assign({}, cc), { valor: +((cc.percentual / 100) * valor).toFixed(currencyScale_1) })); });
|
|
33557
|
+
}
|
|
33572
33558
|
this.contasDataSource = __spread(this.contasDataSource);
|
|
33573
33559
|
}
|
|
33574
33560
|
else {
|
|
@@ -33733,6 +33719,9 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33733
33719
|
this.empresaId = (_c = (_b = (_a = this.initialContext) === null || _a === void 0 ? void 0 : _a.e070fil) === null || _b === void 0 ? void 0 : _b.e070emp) === null || _c === void 0 ? void 0 : _c.id;
|
|
33734
33720
|
}
|
|
33735
33721
|
this.gridColumns = this.getGridColumns();
|
|
33722
|
+
// Emite o estado de validade já na carga inicial (sem marcar como "sujo"),
|
|
33723
|
+
// permitindo que o host conheça o isValid mesmo sem o usuário editar.
|
|
33724
|
+
this.emitChange(false);
|
|
33736
33725
|
};
|
|
33737
33726
|
ErpRateioEditorComponent.prototype.carregarRateio = function () {
|
|
33738
33727
|
var _this = this;
|
|
@@ -33747,6 +33736,8 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33747
33736
|
_this.empresaId = output.e070fil.e070emp.id;
|
|
33748
33737
|
}
|
|
33749
33738
|
_this.gridColumns = _this.getGridColumns();
|
|
33739
|
+
// Emite o estado de validade do rateio carregado (sem marcar como "sujo").
|
|
33740
|
+
_this.emitChange(false);
|
|
33750
33741
|
}, 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 }); });
|
|
33751
33742
|
};
|
|
33752
33743
|
ErpRateioEditorComponent.prototype.popularComRateios = function (rateios) {
|
|
@@ -33786,8 +33777,8 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33786
33777
|
var _a, _b;
|
|
33787
33778
|
var ccs = conta.rateiosCCusto || [];
|
|
33788
33779
|
if (ccs.length === 0) {
|
|
33789
|
-
//
|
|
33790
|
-
return
|
|
33780
|
+
// Centro de custo é sempre obrigatório: conta sem nenhum CC nunca é completa.
|
|
33781
|
+
return false;
|
|
33791
33782
|
}
|
|
33792
33783
|
var somaPct = ccs.reduce(function (acc, cc) { return acc + (cc.percentual || 0); }, 0);
|
|
33793
33784
|
var somaValor = ccs.reduce(function (acc, cc) { return acc + (cc.valor || 0); }, 0);
|
|
@@ -33904,14 +33895,15 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33904
33895
|
};
|
|
33905
33896
|
ErpRateioEditorComponent.prototype.getGridColumns = function () {
|
|
33906
33897
|
return [
|
|
33907
|
-
{ field: 'contaFinanceira', header:
|
|
33908
|
-
{ field: 'percentual', header:
|
|
33909
|
-
{ field: 'valorRateadoConta', header:
|
|
33898
|
+
{ field: 'contaFinanceira', header: 'erpx.rateio_editor.conta_financeira' },
|
|
33899
|
+
{ field: 'percentual', header: 'erpx.rateio_editor.percentual' },
|
|
33900
|
+
{ field: 'valorRateadoConta', header: 'erpx.rateio_editor.valor' }
|
|
33910
33901
|
];
|
|
33911
33902
|
};
|
|
33912
|
-
ErpRateioEditorComponent.prototype.emitChange = function () {
|
|
33903
|
+
ErpRateioEditorComponent.prototype.emitChange = function (isDirty) {
|
|
33904
|
+
if (isDirty === void 0) { isDirty = true; }
|
|
33913
33905
|
this.change.emit({
|
|
33914
|
-
isDirty:
|
|
33906
|
+
isDirty: isDirty,
|
|
33915
33907
|
isValid: this.isDistribuicaoCompleta(),
|
|
33916
33908
|
rateios: this.contasDataSource
|
|
33917
33909
|
});
|
|
@@ -33919,8 +33911,6 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33919
33911
|
var ErpRateioEditorComponent_1;
|
|
33920
33912
|
/** Valor de anaSin que indica registro sintético (não analítico). */
|
|
33921
33913
|
ErpRateioEditorComponent.ANA_SIN_SINTETICO = 'VS';
|
|
33922
|
-
/** Critério de rateio que não distribui por centro de custo (Nenhum). */
|
|
33923
|
-
ErpRateioEditorComponent.CRITERIO_SEM_CENTRO_CUSTO = 'V5';
|
|
33924
33914
|
ErpRateioEditorComponent.ctorParameters = function () { return [
|
|
33925
33915
|
{ type: FormBuilder },
|
|
33926
33916
|
{ type: ErpRateioEditorService },
|
|
@@ -34004,7 +33994,7 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
34004
33994
|
ErpRateioEditorComponent = ErpRateioEditorComponent_1 = __decorate([
|
|
34005
33995
|
Component({
|
|
34006
33996
|
selector: 'erp-rateio-editor',
|
|
34007
|
-
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]=\"percentualRestanteDisplay + '%'\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n [color]=\"distribuicaoCompleta ? '#0C9348' : '#C13018'\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_restante' | translate\"\n [value]=\"valorRestanteDisplay | 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 [showPrimaryAction]=\"!effectiveReadOnly\"\n [primaryActionLabel]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n (primaryAction)=\"openContaDialog()\"\n [showSecondaryAction]=\"!effectiveReadOnly && showSugestaoButton\"\n [secondaryActionLabel]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n (secondaryAction)=\"onSugerir()\"\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\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 || (!effectiveReadOnly && requiresCentroCusto)\" [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 iconClass=\"fa fa-pencil\"\n [label]=\"'erpx.rateio_editor.editar' | translate\"\n (onClick)=\"openContaDialog(getContaIndex(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 <div class=\"ui-g-12 rateio-cc-toolbar\" *ngIf=\"!effectiveReadOnly\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_centro_custo' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openCCDialog(getContaIndex(rowData))\"\n ></s-button>\n <s-button\n [label]=\"'erpx.rateio_editor.remover_centro_custo' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n (onClick)=\"onDeleteSelectedCC(rowData)\"\n [disabled]=\"!(ccSelection[rowData.idContaFinanceira]?.length)\"\n ></s-button>\n </div>\n <div class=\"ui-g-12\">\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 iconClass=\"fa fa-pencil\"\n [label]=\"'erpx.rateio_editor.editar' | translate\"\n (onClick)=\"openCCDialog(getContaIndex(rowData), getCCIndex(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 </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 <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_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",
|
|
33997
|
+
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]=\"percentualRestanteDisplay + '%'\"\n ></s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card\n [animateNumbers]=\"true\"\n [color]=\"distribuicaoCompleta ? '#0C9348' : '#C13018'\"\n [lightMode]=\"true\"\n [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"'erpx.rateio_editor.valor_restante' | translate\"\n [value]=\"valorRestanteDisplay | 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 [showPrimaryAction]=\"!effectiveReadOnly\"\n [primaryActionLabel]=\"'erpx.rateio_editor.adicionar_conta' | translate\"\n (primaryAction)=\"openContaDialog()\"\n [showSecondaryAction]=\"!effectiveReadOnly && showSugestaoButton\"\n [secondaryActionLabel]=\"'erpx.rateio_editor.sugerir_rateio' | translate\"\n (secondaryAction)=\"onSugerir()\"\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\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 | translate }}</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 || !effectiveReadOnly\" [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 iconClass=\"fa fa-pencil\"\n [label]=\"'erpx.rateio_editor.editar' | translate\"\n (onClick)=\"openContaDialog(getContaIndex(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 <div class=\"ui-g-12 rateio-cc-toolbar\" *ngIf=\"!effectiveReadOnly\">\n <s-button\n [label]=\"'erpx.rateio_editor.adicionar_centro_custo' | translate\"\n iconClass=\"fa fa-plus\"\n (onClick)=\"openCCDialog(getContaIndex(rowData))\"\n ></s-button>\n <s-button\n [label]=\"'erpx.rateio_editor.remover_centro_custo' | translate\"\n [priority]=\"ButtonPriority.Secondary\"\n (onClick)=\"onDeleteSelectedCC(rowData)\"\n [disabled]=\"!(ccSelection[rowData.idContaFinanceira]?.length)\"\n ></s-button>\n </div>\n <div class=\"ui-g-12\">\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 iconClass=\"fa fa-pencil\"\n [label]=\"'erpx.rateio_editor.editar' | translate\"\n (onClick)=\"openCCDialog(getContaIndex(rowData), getCCIndex(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 </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 <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_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",
|
|
34008
33998
|
styles: [":host ::ng-deep .rateio-cc-toolbar .s-button-text{overflow:visible;-ms-flex-pack:start;justify-content:flex-start}"]
|
|
34009
33999
|
})
|
|
34010
34000
|
], ErpRateioEditorComponent);
|
|
@@ -34122,6 +34112,7 @@ var fallback = {
|
|
|
34122
34112
|
"erpx.rateio_editor.remover_conta": "Remover conta",
|
|
34123
34113
|
"erpx.rateio_editor.adicionar_centro_custo": "Adicionar centro de custo",
|
|
34124
34114
|
"erpx.rateio_editor.remover_centro_custo": "Remover centro de custo",
|
|
34115
|
+
"erpx.rateio_editor.nenhum_centro_custo_selecionado": "Selecione ao menos um centro de custo para remover.",
|
|
34125
34116
|
"erpx.rateio_editor.sugerir_rateio": "Sugerir rateio",
|
|
34126
34117
|
"erpx.rateio_editor.salvar": "Salvar",
|
|
34127
34118
|
"erpx.rateio_editor.cancelar": "Cancelar",
|
|
@@ -34134,7 +34125,32 @@ var fallback = {
|
|
|
34134
34125
|
"erpx.rateio_editor.erro_salvar": "Erro ao salvar rateio",
|
|
34135
34126
|
"erpx.rateio_editor.erro_contexto_incompleto": "Não foi possível salvar: o contexto do rateio (filial e critério) não foi informado.",
|
|
34136
34127
|
"erpx.rateio_editor.erro_sugerir": "Erro ao sugerir rateio",
|
|
34137
|
-
"erpx.rateio_editor.erro_carregar": "Erro ao carregar rateio"
|
|
34128
|
+
"erpx.rateio_editor.erro_carregar": "Erro ao carregar rateio",
|
|
34129
|
+
"erpx.rateio_editor.lista_rateios": "Rateios",
|
|
34130
|
+
"erpx.rateio_editor.sem_rateios_titulo": "Nenhum rateio cadastrado",
|
|
34131
|
+
"erpx.rateio_editor.sem_rateios_descricao": "Adicione contas financeiras ou utilize a sugestão automática",
|
|
34132
|
+
"erpx.rateio_editor.erro_obrigatorio": "Campo obrigatório",
|
|
34133
|
+
"erpx.rateio_editor.acoes": "Ações",
|
|
34134
|
+
"erpx.rateio_editor.percentual": "Percentual",
|
|
34135
|
+
"erpx.rateio_editor.conta_financeira": "Conta financeira",
|
|
34136
|
+
"erpx.rateio_editor.valor": "Valor",
|
|
34137
|
+
"erpx.rateio_editor.centros_custo": "Centros de custo",
|
|
34138
|
+
"erpx.rateio_editor.centros_custo_da_conta": "Centros de custo da conta",
|
|
34139
|
+
"erpx.rateio_editor.centro_custo": "Centro de custo",
|
|
34140
|
+
"erpx.rateio_editor.sem_centros_custo": "Nenhum centro de custo vinculado",
|
|
34141
|
+
"erpx.rateio_editor.editar": "Editar",
|
|
34142
|
+
"erpx.rateio_editor.excluir": "Excluir",
|
|
34143
|
+
"erpx.rateio_editor.sem_contexto_para_sugerir": "Filial e critério de rateio são obrigatórios para sugerir.",
|
|
34144
|
+
"erpx.rateio_editor.conta_duplicada": "Esta conta financeira já foi adicionada.",
|
|
34145
|
+
"erpx.rateio_editor.centro_custo_duplicado": "Este centro de custo já foi adicionado a esta conta.",
|
|
34146
|
+
"erpx.rateio_editor.erro_conta_sintetica": "A conta financeira selecionada é sintética. Selecione uma conta analítica.",
|
|
34147
|
+
"erpx.rateio_editor.erro_centro_custo_invalido": "O centro de custo selecionado é inválido (sintético ou não aceita rateio).",
|
|
34148
|
+
"erpx.rateio_editor.erro_distribuicao_incompleta": "A distribuição do rateio está incompleta. Os percentuais e valores devem ser totalmente distribuídos.",
|
|
34149
|
+
"erpx.rateio_editor.erro_centro_custo_obrigatorio": "Cada conta financeira deve ter ao menos um centro de custo vinculado.",
|
|
34150
|
+
"erpx.rateio_editor.erro_valor_maximo_conta": "O percentual ou valor informado excede o restante disponível.",
|
|
34151
|
+
"erpx.rateio_editor.erro_valor_maximo_centro_custo": "O valor não pode ser maior que o valor rateado da conta.",
|
|
34152
|
+
"erpx.rateio_editor.erro_maximo_centro_custo": "O valor ou percentual informado excede o restante disponível para esta conta.",
|
|
34153
|
+
"erpx.rateio_editor.erro_valor_conta_inferior_soma_cc": "O valor informado é menor que a soma dos centros de custo já distribuídos nesta conta. Ajuste os centros de custo antes de reduzir o valor da conta."
|
|
34138
34154
|
};
|
|
34139
34155
|
|
|
34140
34156
|
/**
|