@senior-gestao-empresarial/erpx-components 4.3.0 → 4.4.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.
@@ -30501,7 +30501,7 @@
30501
30501
  };
30502
30502
  ErpTributosComponent.prototype.initializeValueChanges = function (_a) {
30503
30503
  var _this = this;
30504
- var item = _a.item;
30504
+ var item = _a.item, group = _a.group;
30505
30505
  item.formGroup.valueChanges
30506
30506
  .pipe(operators.startWith(item.formGroup.getRawValue()),
30507
30507
  // We are using debounceTime here because our Lookup Component is emitting two events unfortunately.
@@ -30537,6 +30537,7 @@
30537
30537
  item.formGroup
30538
30538
  .get('impostoManual')
30539
30539
  .setValue(true, { emitEvent: false });
30540
+ _this.markICMSSimplesAsManual(item.name, group, exports.EnumCampoTributo.ImpostoManual);
30540
30541
  }
30541
30542
  }
30542
30543
  if (startingValue[exports.EnumCampoTributo.TipoCalculoImposto] !==
@@ -30565,6 +30566,7 @@
30565
30566
  .setValue(EnumTipoCalculoImposto.MANUAL, {
30566
30567
  emitEvent: false
30567
30568
  });
30569
+ _this.markICMSSimplesAsManual(item.name, group, exports.EnumCampoTributo.TipoCalculoImposto);
30568
30570
  }
30569
30571
  }
30570
30572
  _this.updateTwoWayDataBinding();
@@ -30659,6 +30661,26 @@
30659
30661
  .item.find(function (item) { return item.name === taxType; });
30660
30662
  return (_c = (_b = (_a = item.formGroup.get(field)).validator) === null || _b === void 0 ? void 0 : _b.call(_a, {})) === null || _c === void 0 ? void 0 : _c.required;
30661
30663
  };
30664
+ // Work-around pra resolver a #ERPPEQ-20595.
30665
+ // No futuro mover para o ManualTaxCalculationRule e TaxCalculationTypeCalculationRule
30666
+ // quando os impostos legados forem migrados para o novo padrão.
30667
+ ErpTributosComponent.prototype.markICMSSimplesAsManual = function (tax, group, field) {
30668
+ if (tax !== exports.EnumTipoTributo.ICMS)
30669
+ return;
30670
+ var ICMS_SIMPLES_ITEM = group.item.find(function (item) { return item.name === exports.EnumTipoTributo.ICMS_SIMPLES; });
30671
+ if (!ICMS_SIMPLES_ITEM)
30672
+ return;
30673
+ if (field === exports.EnumCampoTributo.ImpostoManual) {
30674
+ ICMS_SIMPLES_ITEM.formGroup
30675
+ .get('impostoManual')
30676
+ .setValue(true, { emitEvent: false });
30677
+ }
30678
+ else if (field === exports.EnumCampoTributo.TipoCalculoImposto) {
30679
+ ICMS_SIMPLES_ITEM.formGroup
30680
+ .get(field)
30681
+ .setValue(EnumTipoCalculoImposto.MANUAL, { emitEvent: false });
30682
+ }
30683
+ };
30662
30684
  ErpTributosComponent.ctorParameters = function () { return [
30663
30685
  { type: api.MessageService },
30664
30686
  { type: forms.FormBuilder },