-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1078 from robmachado/master
inclusão da tag agropecuario em Make:class e novos XSD
- Loading branch information
Showing
35 changed files
with
1,298 additions
and
1,020 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
191 changes: 137 additions & 54 deletions
191
schemes/PL_009_V4/leiauteNFe_v4.00.xsd
100644 → 100755
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
namespace NFePHP\NFe\Traits; | ||
|
||
use stdClass; | ||
use DOMElement; | ||
use NFePHP\Common\DOMImproved; | ||
|
||
/** | ||
* @method equilizeParameters($std, $possible) | ||
* @property DOMImproved $dom | ||
* @property int $mod | ||
* @property int $tpAmb | ||
* @property DOMElement $dest | ||
*/ | ||
trait TraitTagAgropecuario | ||
{ | ||
/** | ||
* Informações de produtos da agricultura, pecuária e produção Florestal ZF01 pai A01 | ||
* tag NFe/infNFe/agropecuario (opcional) | ||
* @param stdClass $std | ||
* @return DOMElement | ||
* @throws \DOMException | ||
*/ | ||
public function tagagropecuario(stdClass $std): DOMElement | ||
{ | ||
$possible = [ | ||
'nReceituario', | ||
'CPFRespTec', | ||
'tpGuia', | ||
'UFGuia', | ||
'serieGuia', | ||
'nGuia' | ||
]; | ||
$std = $this->equilizeParameters($std, $possible); | ||
$agro = $this->dom->createElement("agropecuario"); | ||
if (!empty($std->nReceituario)) { | ||
$def = $this->dom->createElement("defencivo"); | ||
$this->dom->addChild( | ||
$def, | ||
"nReceituario", | ||
$std->nReceituario, | ||
true, | ||
"Número da receita ou receituário do agrotóxico/defensivo agrícola" | ||
); | ||
$this->dom->addChild( | ||
$def, | ||
"CPFRespTec", | ||
$std->CPFRespTec, | ||
true, | ||
"CPF do Responsável Técnico, emitente do receituário" | ||
); | ||
$agro->appendChild($def); | ||
} elseif (!empty($std->tpGuia)) { | ||
$guia = $this->dom->createElement("guiaTransito"); | ||
$this->dom->addChild( | ||
$guia, | ||
"tpGuia", | ||
$std->tpGuia, | ||
true, | ||
"Tipo da Guia" | ||
); | ||
$this->dom->addChild( | ||
$guia, | ||
"UFGuia", | ||
!empty($std->UFGuia) ? $std->UFGuia : null, | ||
false, | ||
"UF de emissão" | ||
); | ||
$this->dom->addChild( | ||
$guia, | ||
"serieGuia", | ||
$std->serieGuia ?? null, | ||
false, | ||
"Série da Guia" | ||
); | ||
$this->dom->addChild( | ||
$guia, | ||
"nGuia", | ||
$std->nGuia, | ||
true, | ||
"Número da Guia" | ||
); | ||
$agro->appendChild($guia); | ||
} | ||
$this->agropecuario = $agro; | ||
return $agro; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters