Skip to content

Commit

Permalink
Merge pull request #108 from paseto/v3.0
Browse files Browse the repository at this point in the history
Inclusão do grupo CT-e de Substituição
  • Loading branch information
paseto authored Jun 13, 2017
2 parents b31aca5 + 469425e commit e6af712
Showing 1 changed file with 143 additions and 0 deletions.
143 changes: 143 additions & 0 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,15 @@ public function montaCTe()
}
$this->dom->appChild($this->infCTeNorm, $this->seg, 'Falta tag "seg"');
$this->dom->appChild($this->infCTeNorm, $this->infModal, 'Falta tag "infModal"');
if ($this->infCteSub != '') {
$this->dom->appChild($this->infCTeNorm, $this->infCteSub, 'Falta tag "infCteSub"');
if ($this->tomaICMS != '') {
$this->dom->appChild($this->infCteSub, $this->tomaICMS, 'Falta tag "tomaICMS"');
if ($this->refNF != '') {
$this->dom->appChild($this->tomaICMS, $this->refNF, 'Falta tag "refNF"');
}
}
}
$this->dom->appChild($this->infModal, $this->rodo, 'Falta tag "rodo"');
}
$this->dom->appChild($this->imp, $this->vTotTrib, 'Falta tag "vTotTrib"');
Expand Down Expand Up @@ -3077,6 +3086,140 @@ public function rodoTag($RNTRC = '')
return $this->rodo;
}

/**
* Gera as tags para o elemento: "infCteSub" (Detalhamento do CT-e de substituição)
* #370
* Nível: 2
* @param string $chCte
* @param string $refCteAnu [CE] Choice com tomaICMSTag [CG] - Informar apenas um
* @param string $indAlteraToma Aguardando NT específica
* @return DOMElement|\DOMNode
*/
public function infCTeSubTag($chCte = '', $refCteAnu = '', $indAlteraToma = '')
{
$identificador = '#370 <infCteSub> - ';
$this->infCteSub = $this->dom->createElement('infCteSub');
$this->dom->addChild(
$this->infCteSub,
'chCte',
$chCte,
true,
$identificador . ' Chave de acesso do CT-e a ser substituído (original) '
);
if ($refCteAnu != '') {
$this->dom->addChild(
$this->infCteSub,
'refCteAnu',
$refCteAnu,
true,
$identificador . ' Chave de acesso do CT-e de Anulação'
);
}
// Não utilizar antes deNT específica
// $this->dom->addChild(
// $this->infCteSub,
// 'indAlteraToma',
// $indAlteraToma,
// true,
// $identificador . ' Indicação do CT-e Alteração de Tomador'
// );
return $this->infCteSub;
}

/**
* Gera as tags para o elemento: "tomaICMS" (Tomador é contribuinte do ICMS,
* mas não é emitente de documento fiscal eletrônico)
*
* Parâmetros Choice [CE] informar apenas um ou informar refNFTag [CG]
* #373
* Nível: 3
* @param string $refNFe [CE]
* @param string $refCte [CE]
* @return DOMElement|\DOMNode
*/
public function tomaICMSTag($refNFe = '', $refCte = '')
{
$identificador = '#373 <tomaICMS> - ';
$this->tomaICMS = $this->dom->createElement('tomaICMS');
if ($refNFe != '') {
$this->dom->addChild(
$this->tomaICMS,
'refNFe',
$refNFe,
true,
$identificador . ' Chave de acesso do NF-e emitida pelo Tomador '
);
} elseif ($refCte != '') {
$this->dom->addChild(
$this->tomaICMS,
'refCte',
$refCte,
true,
$identificador . ' Chave de acesso do CT-e emitido pelo Tomador '
);
}

return $this->tomaICMS;
}


/**
* Gera as tags para o elemento: "refNF" (Informações da NF ou CT emitido pelo Tomador)
* #375
* Nível: 4
* @param string $CNPJ
* @param string $CPF
* @param string $mod
* @param string $serie
* @param string $subserie
* @param string $nro
* @param string $valor
* @param string $dEmi
* @return mixed
*/
public function refNFTag(
$CNPJ = '',
$CPF = '',
$mod = '',
$serie = '',
$subserie = '',
$nro = '',
$valor = '',
$dEmi = ''
) {
$identificador = '#375 <refNF> - ';
$this->refNF = $this->dom->createElement('refNF');

if ($CNPJ != '') {
$this->dom->addChild(
$this->refNF,
'CNPJ',
$CNPJ,
true,
$identificador . 'CNPJ do Emitente do Documento Fiscal'
);
} elseif ($CPF != '') {
$this->dom->addChild(
$this->refNF,
'CPF',
$CPF,
true,
$identificador . 'Número do CPF'
);
}
$this->dom->addChild($this->refNF, 'mod', $mod, true, $identificador . 'Modelo do Documento fiscal');
$this->dom->addChild($this->refNF, 'serie', $serie, true, $identificador . 'Serie do Documento fiscal');
$this->dom->addChild($this->refNF, 'subserie', $subserie, false, $identificador . 'Subserie do
documento fiscal');
$this->dom->addChild($this->refNF, 'nro', $nro, true, $identificador . 'Número do documento fiscal');
$this->dom->addChild($this->refNF, 'valor', $valor, true, $identificador . 'Valor do documento fiscal');
$this->dom->addChild($this->refNF, 'dEmi', $dEmi, true, $identificador . 'Data de emissão do
documento fiscal');

return $this->refNF;
}


/**
* Gera as tags para o elemento: "infCteComp" (Detalhamento do CT-e complementado)
* #410
Expand Down

0 comments on commit e6af712

Please sign in to comment.