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

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.
@@ -10080,10 +10080,10 @@
10080
10080
  return grupo.item.map(function (item) {
10081
10081
  _this.tributosValue.map(function (it) {
10082
10082
  if (item.name === it.tipoImposto) {
10083
+ item.formGroup.patchValue(it, { emitEvent: false });
10083
10084
  if (!isTaxFromTaxReform(it.tipoImposto)) {
10084
10085
  _this.setValidators(it.tipoImposto);
10085
10086
  }
10086
- item.formGroup.patchValue(it, { emitEvent: false });
10087
10087
  }
10088
10088
  });
10089
10089
  });
@@ -10127,16 +10127,14 @@
10127
10127
  grupo.item
10128
10128
  .filter(function (it) { return it.name == tributo; })
10129
10129
  .map(function (it) {
10130
- var hasValue = false;
10131
- Object.keys(it.formGroup.value).forEach(function (item) {
10132
- if (item !== 'impostoManual' && item !== exports.EnumCampoTributo.TipoCalculoImposto) {
10133
- if (it.formGroup.get(item).touched &&
10134
- it.formGroup.value[item] != undefined &&
10135
- it.formGroup.value[item] !== '') {
10136
- hasValue = true;
10137
- return;
10138
- }
10139
- }
10130
+ var hasValue = Object.keys(it.formGroup.value)
10131
+ .filter(function (key) {
10132
+ return key !== 'impostoManual' &&
10133
+ key !== exports.EnumCampoTributo.TipoCalculoImposto;
10134
+ })
10135
+ .some(function (key) {
10136
+ return it.formGroup.get(key).value !== null &&
10137
+ it.formGroup.get(key).value !== undefined;
10140
10138
  });
10141
10139
  if (hasValue)
10142
10140
  Object.keys(it.formGroup.value).forEach(function (item) {
@@ -10153,6 +10151,15 @@
10153
10151
  it.formGroup.controls[item].updateValueAndValidity({ emitEvent: false });
10154
10152
  _this.setRequired(tributo, true);
10155
10153
  }
10154
+ else if (item === 'situacaoTributaria') {
10155
+ it.formGroup.controls[item].setValidators(forms.Validators.compose([
10156
+ forms.Validators.required
10157
+ ]));
10158
+ it.formGroup.controls[item].updateValueAndValidity({
10159
+ emitEvent: false
10160
+ });
10161
+ _this.setRequired(tributo, true);
10162
+ }
10156
10163
  else if (item === 'observacao') {
10157
10164
  it.formGroup.controls[item].setValidators(forms.Validators.compose([forms.Validators.maxLength(120)]));
10158
10165
  it.formGroup.controls[item].updateValueAndValidity({ emitEvent: false });