@seniorsistemas/yms-integration 1.9.0 → 2.0.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.
@@ -3711,6 +3711,52 @@ var ErpProcessService = /** @class */ (function () {
3711
3711
  erpProcessData.fornecedores = this.listarIdsFornecedores(formGroup.getRawValue().fornecedores);
3712
3712
  return erpProcessData;
3713
3713
  };
3714
+ ErpProcessService.prototype.builderErpProcessDataValidaNotaNoContrato = function (erpProcessData, formGroup) {
3715
+ erpProcessData = this.builderErpProcessData(erpProcessData, formGroup);
3716
+ erpProcessData.recebimentoTemNota = this.verificaSeTemNotaNoContratoNoFornecedo(formGroup.getRawValue().fornecedores);
3717
+ return erpProcessData;
3718
+ };
3719
+ ErpProcessService.prototype.verificaSeTemNotaNoContratoNoFornecedo = function (fornecedores) {
3720
+ var _this = this;
3721
+ var contratosTemNota = false;
3722
+ var listaContratos = [];
3723
+ if (fornecedores != null) {
3724
+ fornecedores.filter(function (element) { return element.contratos != null && element.contratos != undefined; }).forEach(function (element) { return listaContratos.push(element.contratos); });
3725
+ }
3726
+ var listaNotas = [];
3727
+ if (listaContratos != null) {
3728
+ listaContratos.filter(function (contratos) { return contratos != null && contratos != undefined; }).forEach(function (contratos) { return listaNotas.push(contratosTemNota = _this.verificaSeContratosTemNota(contratos)); });
3729
+ }
3730
+ return contratosTemNota;
3731
+ };
3732
+ ErpProcessService.prototype.verificaSeContratosTemNota = function (contratos) {
3733
+ var contratosTemNota = true;
3734
+ contratos.filter(function (contrato) { return contrato != null && contrato != undefined; }).forEach(function (contrato) { return contratosTemNota = contratosTemNota && (contrato.notas.length > 0); });
3735
+ return contratosTemNota;
3736
+ };
3737
+ ErpProcessService.prototype.builderErpProcessDataValidaNotaNaOrdemCompra = function (erpProcessData, formGroup) {
3738
+ erpProcessData = this.builderErpProcessData(erpProcessData, formGroup);
3739
+ erpProcessData.recebimentoTemNota = this.verificaSeTemNotaNaOrdemCompraDoFornecedo(formGroup.getRawValue().fornecedores);
3740
+ return erpProcessData;
3741
+ };
3742
+ ErpProcessService.prototype.verificaSeTemNotaNaOrdemCompraDoFornecedo = function (fornecedores) {
3743
+ var _this = this;
3744
+ var ordemCompraTemNota = false;
3745
+ var listaOrdens = [];
3746
+ if (fornecedores != null) {
3747
+ fornecedores.filter(function (element) { return element.ordens != null && element.ordens != undefined; }).forEach(function (element) { return listaOrdens.push(element.ordens); });
3748
+ }
3749
+ var listaNotas = [];
3750
+ if (listaOrdens != null) {
3751
+ listaOrdens.filter(function (ordens) { return ordens != null && ordens != undefined; }).forEach(function (ordens) { return listaNotas.push(ordemCompraTemNota = _this.verificaSeOrdemCompraTemNota(ordens)); });
3752
+ }
3753
+ return ordemCompraTemNota;
3754
+ };
3755
+ ErpProcessService.prototype.verificaSeOrdemCompraTemNota = function (contratos) {
3756
+ var ordemCompraTemNota = true;
3757
+ contratos.filter(function (ordem) { return ordem != null && ordem != undefined; }).forEach(function (ordem) { return ordemCompraTemNota = ordemCompraTemNota && (ordem.notas.length > 0); });
3758
+ return ordemCompraTemNota;
3759
+ };
3714
3760
  ErpProcessService.prototype.getFieldFormGroup = function (formGroup, fieldName) {
3715
3761
  if (formGroup.get(fieldName) == null || formGroup.get(fieldName).value == null) {
3716
3762
  return null;
@@ -8311,7 +8357,7 @@ var RecebimentoOrdemCompraFormComponent = /** @class */ (function () {
8311
8357
  if (this.isNew() || !this.enableRevalidation) {
8312
8358
  return this.saveAndInit(start);
8313
8359
  }
8314
- this.erpProcessData = this.erpProcessService.builderErpProcessData(this.erpProcessData, this.formGroup);
8360
+ this.erpProcessData = this.erpProcessService.builderErpProcessDataValidaNotaNaOrdemCompra(this.erpProcessData, this.formGroup);
8315
8361
  this.erpProcessService.changeDataErp(this.erpProcessData);
8316
8362
  return this.agendaService
8317
8363
  .checarRevalidacao(this.erpProcessData)
@@ -9825,7 +9871,7 @@ var RecebimentoFormComponent = /** @class */ (function () {
9825
9871
  if (this.isNew() || !this.enableRevalidation) {
9826
9872
  return this.saveAndInit(start);
9827
9873
  }
9828
- this.erpProcessData = this.erpProcessService.builderErpProcessData(this.erpProcessData, this.formGroup);
9874
+ this.erpProcessData = this.erpProcessService.builderErpProcessDataValidaNotaNoContrato(this.erpProcessData, this.formGroup);
9829
9875
  this.erpProcessService.changeDataErp(this.erpProcessData);
9830
9876
  return this.agendaService
9831
9877
  .checarRevalidacao(this.erpProcessData)