@senior-gestao-empresarial/erpx-components 3.35.0 → 3.35.2

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.
@@ -9484,14 +9484,6 @@ var ErpTributosComponent = /** @class */ (function () {
9484
9484
  configurable: true
9485
9485
  });
9486
9486
  ErpTributosComponent.prototype.ngOnInit = function () {
9487
- this.menuItemPis = false;
9488
- this.menuItemCofins = false;
9489
- this.menuItemIpi = false;
9490
- this.menuItemIss = false;
9491
- this.menuItemImportacoes = false;
9492
- this.menuItemRetencoes = false;
9493
- this.menuItemIcms = false;
9494
- this.menuItemCideTecnologia = false;
9495
9487
  this.dominio = this.dominio ? this.dominio : 'erpx_cpl_imp';
9496
9488
  this.servico = this.servico ? this.servico : 'cadastros';
9497
9489
  this.prefixLabel = this.dominio + "." + this.servico;
@@ -9878,10 +9870,10 @@ var ErpTributosComponent = /** @class */ (function () {
9878
9870
  return grupo.item.map(function (item) {
9879
9871
  _this.tributosValue.map(function (it) {
9880
9872
  if (item.name === it.tipoImposto) {
9873
+ item.formGroup.patchValue(it, { emitEvent: false });
9881
9874
  if (!isTaxFromTaxReform(it.tipoImposto)) {
9882
9875
  _this.setValidators(it.tipoImposto);
9883
9876
  }
9884
- item.formGroup.patchValue(it, { emitEvent: false });
9885
9877
  }
9886
9878
  });
9887
9879
  });
@@ -9925,16 +9917,14 @@ var ErpTributosComponent = /** @class */ (function () {
9925
9917
  grupo.item
9926
9918
  .filter(function (it) { return it.name == tributo; })
9927
9919
  .map(function (it) {
9928
- var hasValue = false;
9929
- Object.keys(it.formGroup.value).forEach(function (item) {
9930
- if (item !== 'impostoManual' && item !== EnumCampoTributo.TipoCalculoImposto) {
9931
- if (it.formGroup.get(item).touched &&
9932
- it.formGroup.value[item] != undefined &&
9933
- it.formGroup.value[item] !== '') {
9934
- hasValue = true;
9935
- return;
9936
- }
9937
- }
9920
+ var hasValue = Object.keys(it.formGroup.value)
9921
+ .filter(function (key) {
9922
+ return key !== 'impostoManual' &&
9923
+ key !== EnumCampoTributo.TipoCalculoImposto;
9924
+ })
9925
+ .some(function (key) {
9926
+ return it.formGroup.get(key).value !== null &&
9927
+ it.formGroup.get(key).value !== undefined;
9938
9928
  });
9939
9929
  if (hasValue)
9940
9930
  Object.keys(it.formGroup.value).forEach(function (item) {
@@ -9951,6 +9941,15 @@ var ErpTributosComponent = /** @class */ (function () {
9951
9941
  it.formGroup.controls[item].updateValueAndValidity({ emitEvent: false });
9952
9942
  _this.setRequired(tributo, true);
9953
9943
  }
9944
+ else if (item === 'situacaoTributaria') {
9945
+ it.formGroup.controls[item].setValidators(Validators.compose([
9946
+ Validators.required
9947
+ ]));
9948
+ it.formGroup.controls[item].updateValueAndValidity({
9949
+ emitEvent: false
9950
+ });
9951
+ _this.setRequired(tributo, true);
9952
+ }
9954
9953
  else if (item === 'observacao') {
9955
9954
  it.formGroup.controls[item].setValidators(Validators.compose([Validators.maxLength(120)]));
9956
9955
  it.formGroup.controls[item].updateValueAndValidity({ emitEvent: false });