NFePHP\NFe\MakeNFe::tagcana PHP Method

tagcana() public method

tagcana Grupo Cana ZC01 pai A01 tag NFe/infNFe/cana (opcional)
public tagcana ( string $safra = '', string $ref = '' ) : DOMELEment
$safra string
$ref string
return DOMELEment
    public function tagcana($safra = '', $ref = '')
    {
        $this->cana = $this->dom->createElement("cana");
        $this->dom->addChild($this->cana, "safra", $safra, true, "Identificação da safra");
        $this->dom->addChild($this->cana, "ref", $ref, true, "Mês e ano de referência");
        return $this->cana;
    }

Usage Example

Example #1
0
 /**
  * zc01Entity
  * Cria a tag cana
  *
  * @param array $aCampos
  */
 protected function zc01Entity($aCampos)
 {
     //ZC|safra|ref|qTotMes|qTotAnt|qTotGer|vFor|vTotDed|vLiqFor|
     $this->make->tagcana($aCampos[1], $aCampos[2]);
     $this->linhaZC[1] = $aCampos[3];
     //qTotMes
     $this->linhaZC[2] = $aCampos[4];
     //qTotAnt
     $this->linhaZC[3] = $aCampos[5];
     //qTotGer
     $this->linhaZC[4] = $aCampos[6];
     //vFor
     $this->linhaZC[5] = $aCampos[7];
     //vTotDed
     $this->linhaZC[6] = $aCampos[8];
     //vLiqFor
 }