diff --git a/src/Factories/Traits/TraitS2300.php b/src/Factories/Traits/TraitS2300.php index a3877687..e4144061 100644 --- a/src/Factories/Traits/TraitS2300.php +++ b/src/Factories/Traits/TraitS2300.php @@ -1602,48 +1602,50 @@ protected function toNodeS100() !empty($ens->cnpjinstensino) ? $ens->cnpjinstensino : null, false ); - $this->dom->addChild( - $instEnsino, - "nmRazao", - empty($ens->nmrazao) ? $ens->nmrazao : null, - false - ); - $this->dom->addChild( - $instEnsino, - "dscLograd", - !empty($ens->dsclograd) ? $ens->dsclograd : null, - false - ); - $this->dom->addChild( - $instEnsino, - "nrLograd", - !empty($ens->nrlograd) ? $ens->nrlograd : null, - false - ); - $this->dom->addChild( - $instEnsino, - "bairro", - !empty($ens->bairro) ? $ens->bairro : null, - false - ); - $this->dom->addChild( - $instEnsino, - "cep", - !empty($ens->cep) ? $ens->cep : null, - false - ); - $this->dom->addChild( - $instEnsino, - "codMunic", - !empty($ens->codmunic) ? $ens->codmunic : null, - false - ); - $this->dom->addChild( - $instEnsino, - "uf", - !empty($ens->uf) ? $ens->uf : null, - false - ); + if(empty($ens->cnpjinstensino)){ + $this->dom->addChild( + $instEnsino, + "nmRazao", + empty($ens->nmrazao) ? $ens->nmrazao : null, + false + ); + $this->dom->addChild( + $instEnsino, + "dscLograd", + !empty($ens->dsclograd) ? $ens->dsclograd : null, + false + ); + $this->dom->addChild( + $instEnsino, + "nrLograd", + !empty($ens->nrlograd) ? $ens->nrlograd : null, + false + ); + $this->dom->addChild( + $instEnsino, + "bairro", + !empty($ens->bairro) ? $ens->bairro : null, + false + ); + $this->dom->addChild( + $instEnsino, + "cep", + !empty($ens->cep) ? $ens->cep : null, + false + ); + $this->dom->addChild( + $instEnsino, + "codMunic", + !empty($ens->codmunic) ? $ens->codmunic : null, + false + ); + $this->dom->addChild( + $instEnsino, + "uf", + !empty($ens->uf) ? $ens->uf : null, + false + ); + } $infoEstagiario->appendChild($instEnsino); if (!empty($est->cnpjagntinteg)) { diff --git a/src/Factories/Traits/TraitS2306.php b/src/Factories/Traits/TraitS2306.php index e0c2b6bc..c91ea639 100644 --- a/src/Factories/Traits/TraitS2306.php +++ b/src/Factories/Traits/TraitS2306.php @@ -511,48 +511,50 @@ protected function toNodeS100() !empty($ens->cnpjinstensino) ? $ens->cnpjinstensino : null, false ); - $this->dom->addChild( - $instEnsino, - "nmRazao", - !empty($ens->nmrazao) ? $ens->nmrazao : null, - false - ); - $this->dom->addChild( - $instEnsino, - "dscLograd", - !empty($ens->dsclograd) ? $ens->dsclograd : null, - false - ); - $this->dom->addChild( - $instEnsino, - "nrLograd", - !empty($ens->nrlograd) ? $ens->nrlograd : null, - false - ); - $this->dom->addChild( - $instEnsino, - "bairro", - !empty($ens->bairro) ? $ens->bairro : null, - false - ); - $this->dom->addChild( - $instEnsino, - "cep", - !empty($ens->cep) ? $ens->cep : null, - false - ); - $this->dom->addChild( - $instEnsino, - "codMunic", - !empty($ens->codmunic) ? $ens->codmunic : null, - false - ); - $this->dom->addChild( - $instEnsino, - "uf", - !empty($ens->uf) ? $ens->uf : null, - false - ); + if(empty($ens->cnpjinstensino)){ + $this->dom->addChild( + $instEnsino, + "nmRazao", + !empty($ens->nmrazao) ? $ens->nmrazao : null, + false + ); + $this->dom->addChild( + $instEnsino, + "dscLograd", + !empty($ens->dsclograd) ? $ens->dsclograd : null, + false + ); + $this->dom->addChild( + $instEnsino, + "nrLograd", + !empty($ens->nrlograd) ? $ens->nrlograd : null, + false + ); + $this->dom->addChild( + $instEnsino, + "bairro", + !empty($ens->bairro) ? $ens->bairro : null, + false + ); + $this->dom->addChild( + $instEnsino, + "cep", + !empty($ens->cep) ? $ens->cep : null, + false + ); + $this->dom->addChild( + $instEnsino, + "codMunic", + !empty($ens->codmunic) ? $ens->codmunic : null, + false + ); + $this->dom->addChild( + $instEnsino, + "uf", + !empty($ens->uf) ? $ens->uf : null, + false + ); + } $infoEstagiario->appendChild($instEnsino); if (!empty($estag->ageintegracao)) { $ageIntegracao = $this->dom->createElement("ageIntegracao");