NFePHP\NFe\MakeNFe::tagvol PHP Method

tagvol() public method

tagvol Grupo Volumes X26 pai X01 tag NFe/infNFe/transp/vol (opcional)
public tagvol ( string $qVol = '', string $esp = '', string $marca = '', string $nVol = '', string $pesoL = '', string $pesoB = '', array $aLacres = [] ) : DOMElement
$qVol string
$esp string
$marca string
$nVol string
$pesoL string
$pesoB string
$aLacres array
return DOMElement
    public function tagvol($qVol = '', $esp = '', $marca = '', $nVol = '', $pesoL = '', $pesoB = '', $aLacres = array())
    {
        $vol = $this->dom->createElement("vol");
        $this->dom->addChild($vol, "qVol", $qVol, false, "Quantidade de volumes transportados");
        $this->dom->addChild($vol, "esp", $esp, false, "Espécie dos volumes transportados");
        $this->dom->addChild($vol, "marca", $marca, false, "Marca dos volumes transportados");
        $this->dom->addChild($vol, "nVol", $nVol, false, "Numeração dos volumes transportados");
        $this->dom->addChild($vol, "pesoL", $pesoL, false, "Peso Líquido (em kg) dos volumes transportados");
        $this->dom->addChild($vol, "pesoB", $pesoB, false, "Peso Bruto (em kg) dos volumes transportados");
        if (!empty($aLacres)) {
            //tag transp/vol/lacres (opcional)
            foreach ($aLacres as $nLacre) {
                $lacre = $this->zTaglacres($nLacre);
                $vol->appendChild($lacre);
                $lacre = null;
            }
        }
        $this->aVol[] = $vol;
        $this->dom->appChild($this->transp, $vol, 'A tag transp deveria ter sido carregada primeiro.');
        return $vol;
    }

Usage Example

Example #1
0
 /**
  * zLinhaXVolEntity
  * Cria a tag vol
  *
  * @param array $aCampos
  */
 protected function zLinhaXVolEntity($aCampos)
 {
     $lacres = '';
     if ($this->volId > -1 && !empty($this->aLacres)) {
         $lacres = $this->aLacres[$aCampos[0]];
     }
     $this->make->tagvol($aCampos[1], $aCampos[2], $aCampos[3], $aCampos[4], $aCampos[5], $aCampos[6], $lacres);
 }
All Usage Examples Of NFePHP\NFe\MakeNFe::tagvol