@senior-gestao-empresarial/erpx-components 4.12.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 +45 -35
- 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 +18 -31
- package/esm2015/locale/fallback.js +28 -2
- package/esm5/components/rateio-editor/erp-rateio-editor.component.js +19 -35
- package/esm5/locale/fallback.js +28 -2
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +44 -31
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +45 -35
- 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',
|
|
@@ -33739,6 +33719,9 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33739
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;
|
|
33740
33720
|
}
|
|
33741
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);
|
|
33742
33725
|
};
|
|
33743
33726
|
ErpRateioEditorComponent.prototype.carregarRateio = function () {
|
|
33744
33727
|
var _this = this;
|
|
@@ -33753,6 +33736,8 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33753
33736
|
_this.empresaId = output.e070fil.e070emp.id;
|
|
33754
33737
|
}
|
|
33755
33738
|
_this.gridColumns = _this.getGridColumns();
|
|
33739
|
+
// Emite o estado de validade do rateio carregado (sem marcar como "sujo").
|
|
33740
|
+
_this.emitChange(false);
|
|
33756
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 }); });
|
|
33757
33742
|
};
|
|
33758
33743
|
ErpRateioEditorComponent.prototype.popularComRateios = function (rateios) {
|
|
@@ -33792,8 +33777,8 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33792
33777
|
var _a, _b;
|
|
33793
33778
|
var ccs = conta.rateiosCCusto || [];
|
|
33794
33779
|
if (ccs.length === 0) {
|
|
33795
|
-
//
|
|
33796
|
-
return
|
|
33780
|
+
// Centro de custo é sempre obrigatório: conta sem nenhum CC nunca é completa.
|
|
33781
|
+
return false;
|
|
33797
33782
|
}
|
|
33798
33783
|
var somaPct = ccs.reduce(function (acc, cc) { return acc + (cc.percentual || 0); }, 0);
|
|
33799
33784
|
var somaValor = ccs.reduce(function (acc, cc) { return acc + (cc.valor || 0); }, 0);
|
|
@@ -33910,14 +33895,15 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33910
33895
|
};
|
|
33911
33896
|
ErpRateioEditorComponent.prototype.getGridColumns = function () {
|
|
33912
33897
|
return [
|
|
33913
|
-
{ field: 'contaFinanceira', header:
|
|
33914
|
-
{ field: 'percentual', header:
|
|
33915
|
-
{ 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' }
|
|
33916
33901
|
];
|
|
33917
33902
|
};
|
|
33918
|
-
ErpRateioEditorComponent.prototype.emitChange = function () {
|
|
33903
|
+
ErpRateioEditorComponent.prototype.emitChange = function (isDirty) {
|
|
33904
|
+
if (isDirty === void 0) { isDirty = true; }
|
|
33919
33905
|
this.change.emit({
|
|
33920
|
-
isDirty:
|
|
33906
|
+
isDirty: isDirty,
|
|
33921
33907
|
isValid: this.isDistribuicaoCompleta(),
|
|
33922
33908
|
rateios: this.contasDataSource
|
|
33923
33909
|
});
|
|
@@ -33925,8 +33911,6 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
33925
33911
|
var ErpRateioEditorComponent_1;
|
|
33926
33912
|
/** Valor de anaSin que indica registro sintético (não analítico). */
|
|
33927
33913
|
ErpRateioEditorComponent.ANA_SIN_SINTETICO = 'VS';
|
|
33928
|
-
/** Critério de rateio que não distribui por centro de custo (Nenhum). */
|
|
33929
|
-
ErpRateioEditorComponent.CRITERIO_SEM_CENTRO_CUSTO = 'V5';
|
|
33930
33914
|
ErpRateioEditorComponent.ctorParameters = function () { return [
|
|
33931
33915
|
{ type: FormBuilder },
|
|
33932
33916
|
{ type: ErpRateioEditorService },
|
|
@@ -34010,7 +33994,7 @@ var ErpRateioEditorComponent = /** @class */ (function () {
|
|
|
34010
33994
|
ErpRateioEditorComponent = ErpRateioEditorComponent_1 = __decorate([
|
|
34011
33995
|
Component({
|
|
34012
33996
|
selector: 'erp-rateio-editor',
|
|
34013
|
-
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",
|
|
34014
33998
|
styles: [":host ::ng-deep .rateio-cc-toolbar .s-button-text{overflow:visible;-ms-flex-pack:start;justify-content:flex-start}"]
|
|
34015
33999
|
})
|
|
34016
34000
|
], ErpRateioEditorComponent);
|
|
@@ -34128,6 +34112,7 @@ var fallback = {
|
|
|
34128
34112
|
"erpx.rateio_editor.remover_conta": "Remover conta",
|
|
34129
34113
|
"erpx.rateio_editor.adicionar_centro_custo": "Adicionar centro de custo",
|
|
34130
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.",
|
|
34131
34116
|
"erpx.rateio_editor.sugerir_rateio": "Sugerir rateio",
|
|
34132
34117
|
"erpx.rateio_editor.salvar": "Salvar",
|
|
34133
34118
|
"erpx.rateio_editor.cancelar": "Cancelar",
|
|
@@ -34140,7 +34125,32 @@ var fallback = {
|
|
|
34140
34125
|
"erpx.rateio_editor.erro_salvar": "Erro ao salvar rateio",
|
|
34141
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.",
|
|
34142
34127
|
"erpx.rateio_editor.erro_sugerir": "Erro ao sugerir rateio",
|
|
34143
|
-
"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."
|
|
34144
34154
|
};
|
|
34145
34155
|
|
|
34146
34156
|
/**
|