public function tagICMS($nItem = '', $orig = '', $cst = '', $modBC = '', $pRedBC = '', $vBC = '', $pICMS = '', $vICMS = '', $vICMSDeson = '', $motDesICMS = '', $modBCST = '', $pMVAST = '', $pRedBCST = '', $vBCST = '', $pICMSST = '', $vICMSST = '', $pDif = '', $vICMSDif = '', $vICMSOp = '', $vBCSTRet = '', $vICMSSTRet = '')
{
$identificador = 'N01 <ICMSxx> - ';
switch ($cst) {
case '00':
$icms = $this->dom->createElement("ICMS00");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 00");
$this->dom->addChild($icms, 'modBC', $modBC, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'vBC', $vBC, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pICMS', $pICMS, true, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMS', $vICMS, true, "{$identificador} [item {$nItem}] Valor do ICMS");
break;
case '10':
$icms = $this->dom->createElement("ICMS10");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 10");
$this->dom->addChild($icms, 'modBC', $modBC, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'vBC', $vBC, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pICMS', $pICMS, true, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMS', $vICMS, true, "{$identificador} [item {$nItem}] Valor do ICMS");
$this->dom->addChild($icms, 'modBCST', $modBCST, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS ST");
$this->dom->addChild($icms, 'pMVAST', $pMVAST, false, "{$identificador} [item {$nItem}] Percentual da margem de valor Adicionado do ICMS ST");
$this->dom->addChild($icms, 'pRedBCST', $pRedBCST, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC do ICMS ST");
$this->dom->addChild($icms, 'vBCST', $vBCST, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS ST");
$this->dom->addChild($icms, 'pICMSST', $pICMSST, true, "{$identificador} [item {$nItem}] Alíquota do imposto do ICMS ST");
$this->dom->addChild($icms, 'vICMSST', $vICMSST, true, "{$identificador} [item {$nItem}] Valor do ICMS ST");
break;
case '20':
$icms = $this->dom->createElement("ICMS20");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 20");
$this->dom->addChild($icms, 'modBC', $modBC, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'pRedBC', $pRedBC, true, "{$identificador} [item {$nItem}] Percentual da Redução de BC");
$this->dom->addChild($icms, 'vBC', $vBC, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pICMS', $pICMS, true, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMS', $vICMS, true, "{$identificador} [item {$nItem}] Valor do ICMS");
$this->dom->addChild($icms, 'vICMSDeson', $vICMSDeson, false, "{$identificador} [item {$nItem}] Valor do ICMS desonerado");
$this->dom->addChild($icms, 'motDesICMS', $motDesICMS, false, "{$identificador} [item {$nItem}] Motivo da desoneração do ICMS");
break;
case '30':
$icms = $this->dom->createElement("ICMS30");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 30");
$this->dom->addChild($icms, 'modBCST', $modBCST, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS ST");
$this->dom->addChild($icms, 'pMVAST', $pMVAST, false, "{$identificador} [item {$nItem}] Percentual da margem de valor Adicionado do ICMS ST");
$this->dom->addChild($icms, 'pRedBCST', $pRedBCST, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC do ICMS ST");
$this->dom->addChild($icms, 'vBCST', $vBCST, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS ST");
$this->dom->addChild($icms, 'pICMSST', $pICMSST, true, "{$identificador} [item {$nItem}] Alíquota do imposto do ICMS ST");
$this->dom->addChild($icms, 'vICMSST', $vICMSST, true, "{$identificador} [item {$nItem}] Valor do ICMS ST");
$this->dom->addChild($icms, 'vICMSDeson', $vICMSDeson, false, "{$identificador} [item {$nItem}] Valor do ICMS desonerado");
$this->dom->addChild($icms, 'motDesICMS', $motDesICMS, false, "{$identificador} [item {$nItem}] Motivo da desoneração do ICMS");
break;
case '40':
case '41':
case '50':
$icms = $this->dom->createElement("ICMS40");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS {$cst}");
$this->dom->addChild($icms, 'vICMSDeson', $vICMSDeson, false, "{$identificador} [item {$nItem}] Valor do ICMS desonerado");
$this->dom->addChild($icms, 'motDesICMS', $motDesICMS, false, "{$identificador} [item {$nItem}] Motivo da desoneração do ICMS");
break;
case '51':
$icms = $this->dom->createElement("ICMS51");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 51");
$this->dom->addChild($icms, 'modBC', $modBC, false, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'pRedBC', $pRedBC, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC");
$this->dom->addChild($icms, 'vBC', $vBC, false, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pICMS', $pICMS, false, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMSOp', $vICMSOp, false, "{$identificador} [item {$nItem}] Valor do ICMS da Operação");
$this->dom->addChild($icms, 'pDif', $pDif, false, "{$identificador} [item {$nItem}] Percentual do diferimento");
$this->dom->addChild($icms, 'vICMSDif', $vICMSDif, false, "{$identificador} [item {$nItem}] Valor do ICMS diferido");
$this->dom->addChild($icms, 'vICMS', $vICMS, false, "{$identificador} [item {$nItem}] Valor do ICMS realmente devido");
break;
case '60':
$icms = $this->dom->createElement("ICMS60");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 60");
$this->dom->addChild($icms, 'vBCSTRet', $vBCSTRet, false, "{$identificador} [item {$nItem}] Valor da BC do ICMS ST retido");
$this->dom->addChild($icms, 'vICMSSTRet', $vICMSSTRet, false, "{$identificador} [item {$nItem}] Valor do ICMS ST retido");
break;
case '70':
$icms = $this->dom->createElement("ICMS70");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 70");
$this->dom->addChild($icms, 'modBC', $modBC, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'pRedBC', $pRedBC, true, "{$identificador} [item {$nItem}] Percentual da Redução de BC");
$this->dom->addChild($icms, 'vBC', $vBC, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pICMS', $pICMS, true, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMS', $vICMS, true, "{$identificador} [item {$nItem}] Valor do ICMS");
$this->dom->addChild($icms, 'modBCST', $modBCST, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS ST");
$this->dom->addChild($icms, 'pMVAST', $pMVAST, false, "{$identificador} [item {$nItem}] Percentual da margem de valor Adicionado do ICMS ST");
$this->dom->addChild($icms, 'pRedBCST', $pRedBCST, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC do ICMS ST");
$this->dom->addChild($icms, 'vBCST', $vBCST, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS ST");
$this->dom->addChild($icms, 'pICMSST', $pICMSST, true, "{$identificador} [item {$nItem}] Alíquota do imposto do ICMS ST");
$this->dom->addChild($icms, 'vICMSST', $vICMSST, true, "{$identificador} [item {$nItem}] Valor do ICMS ST");
$this->dom->addChild($icms, 'vICMSDeson', $vICMSDeson, false, "{$identificador} [item {$nItem}] Valor do ICMS desonerado");
$this->dom->addChild($icms, 'motDesICMS', $motDesICMS, false, "{$identificador} [item {$nItem}] Motivo da desoneração do ICMS");
break;
case '90':
$icms = $this->dom->createElement("ICMS90");
$this->dom->addChild($icms, 'orig', $orig, true, "{$identificador} [item {$nItem}] Origem da mercadoria");
$this->dom->addChild($icms, 'CST', $cst, true, "{$identificador} [item {$nItem}] Tributação do ICMS = 90");
$this->dom->addChild($icms, 'modBC', $modBC, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS");
$this->dom->addChild($icms, 'vBC', $vBC, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS");
$this->dom->addChild($icms, 'pRedBC', $pRedBC, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC");
$this->dom->addChild($icms, 'pICMS', $pICMS, true, "{$identificador} [item {$nItem}] Alíquota do imposto");
$this->dom->addChild($icms, 'vICMS', $vICMS, true, "{$identificador} [item {$nItem}] Valor do ICMS");
$this->dom->addChild($icms, 'modBCST', $modBCST, true, "{$identificador} [item {$nItem}] Modalidade de determinação da BC do ICMS ST");
$this->dom->addChild($icms, 'pMVAST', $pMVAST, false, "{$identificador} [item {$nItem}] Percentual da margem de valor Adicionado do ICMS ST");
$this->dom->addChild($icms, 'pRedBCST', $pRedBCST, false, "{$identificador} [item {$nItem}] Percentual da Redução de BC do ICMS ST");
$this->dom->addChild($icms, 'vBCST', $vBCST, true, "{$identificador} [item {$nItem}] Valor da BC do ICMS ST");
$this->dom->addChild($icms, 'pICMSST', $pICMSST, true, "{$identificador} [item {$nItem}] Alíquota do imposto do ICMS ST");
$this->dom->addChild($icms, 'vICMSST', $vICMSST, true, "{$identificador} [item {$nItem}] Valor do ICMS ST");
$this->dom->addChild($icms, 'vICMSDeson', $vICMSDeson, false, "{$identificador} [item {$nItem}] Valor do ICMS desonerado");
$this->dom->addChild($icms, 'motDesICMS', $motDesICMS, false, "{$identificador} [item {$nItem}] Motivo da desoneração do ICMS");
break;
}
$tagIcms = $this->dom->createElement('ICMS');
if (isset($icms)) {
$tagIcms->appendChild($icms);
}
$this->aICMS[$nItem] = $tagIcms;
return $tagIcms;
}