@senior-gestao-empresarial/erpx-components 1.17.0 → 1.17.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.
@@ -4598,8 +4598,6 @@
4598
4598
  return;
4599
4599
  }
4600
4600
  var loteOrSerieValues = this.formGroupBatchOrSeries.getRawValue();
4601
- this.qtdDistribuida += loteOrSerieValues.quantidade;
4602
- this.qtdRestante -= loteOrSerieValues.quantidade;
4603
4601
  loteOrSerieValues = this.formatDates(loteOrSerieValues, ['dataFabricacao', 'dataValidade']);
4604
4602
  if (((_c = (_b = this.loteSerieParams) === null || _b === void 0 ? void 0 : _b.invoiceInformation) === null || _c === void 0 ? void 0 : _c.origin) === exports.EnumInvoiceOrigin.V2) {
4605
4603
  if (Array.isArray(loteOrSerieValues.serie)) {
@@ -4613,6 +4611,8 @@
4613
4611
  dataFabricacao: value.datFabSep,
4614
4612
  dataValidade: value.datVltSep
4615
4613
  });
4614
+ this.qtdDistribuida += value.qtdDisponivel;
4615
+ this.qtdRestante -= value.qtdDisponivel;
4616
4616
  }
4617
4617
  }
4618
4618
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4631,6 +4631,8 @@
4631
4631
  dataFabricacao: loteOrSerieValues.serie.datFabSep,
4632
4632
  dataValidade: loteOrSerieValues.serie.datVltSep
4633
4633
  });
4634
+ this.qtdDistribuida += loteOrSerieValues.serie.qtdDisponivel;
4635
+ this.qtdRestante -= loteOrSerieValues.serie.qtdDisponivel;
4634
4636
  }
4635
4637
  }
4636
4638
  else {
@@ -4641,6 +4643,8 @@
4641
4643
  dataFabricacao: loteOrSerieValues.dataFabricacao,
4642
4644
  dataValidade: loteOrSerieValues.dataValidade
4643
4645
  });
4646
+ this.qtdDistribuida += loteOrSerieValues.quantidade;
4647
+ this.qtdRestante -= loteOrSerieValues.quantidade;
4644
4648
  }
4645
4649
  this.clearBatchSeries();
4646
4650
  this.loteSerieParams.lotesOrSeries = this.gridData;
@@ -4650,7 +4654,9 @@
4650
4654
  }
4651
4655
  };
4652
4656
  ErpLoteSerieComponent.prototype.isDuplicateBatchSeries = function () {
4657
+ var e_2, _a, e_3, _b;
4653
4658
  var _this = this;
4659
+ var _c, _d, _e, _f, _g, _h;
4654
4660
  var codigo;
4655
4661
  if (!this.isSerie) {
4656
4662
  if (this.isSaida) {
@@ -4668,6 +4674,35 @@
4668
4674
  });
4669
4675
  }
4670
4676
  else {
4677
+ if (this.isSaida && Array.isArray((_e = (_d = (_c = this.formGroupBatchOrSeries) === null || _c === void 0 ? void 0 : _c.controls) === null || _d === void 0 ? void 0 : _d.serie) === null || _e === void 0 ? void 0 : _e.value)) {
4678
+ try {
4679
+ for (var _j = __values((_h = (_g = (_f = this.formGroupBatchOrSeries) === null || _f === void 0 ? void 0 : _f.controls) === null || _g === void 0 ? void 0 : _g.serie) === null || _h === void 0 ? void 0 : _h.value), _k = _j.next(); !_k.done; _k = _j.next()) {
4680
+ var series = _k.value;
4681
+ try {
4682
+ for (var _l = (e_3 = void 0, __values(this.gridData)), _m = _l.next(); !_m.done; _m = _l.next()) {
4683
+ var addedSeries = _m.value;
4684
+ if (series.numSep === addedSeries.codigo)
4685
+ return true;
4686
+ }
4687
+ }
4688
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
4689
+ finally {
4690
+ try {
4691
+ if (_m && !_m.done && (_b = _l.return)) _b.call(_l);
4692
+ }
4693
+ finally { if (e_3) throw e_3.error; }
4694
+ }
4695
+ }
4696
+ }
4697
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
4698
+ finally {
4699
+ try {
4700
+ if (_k && !_k.done && (_a = _j.return)) _a.call(_j);
4701
+ }
4702
+ finally { if (e_2) throw e_2.error; }
4703
+ }
4704
+ return false;
4705
+ }
4671
4706
  return this.gridData.find(function (element) {
4672
4707
  if (_this.isSaida) {
4673
4708
  codigo = _this.formGroupBatchOrSeries.controls.serie.value.e200ser ?