public NFeTotal GetTotal(List <NFeDetalhe> produtos) { decimal totalItens = produtos.Where(p => p.Produto.IndTot == NFeIndTotal.ValorItemCompoeTotalNota).Sum(p => p.Produto.VProd); decimal totalDesconto = produtos.Where(p => p.Produto.IndTot == NFeIndTotal.ValorItemCompoeTotalNota).Sum(p => p.Produto.VDesc); decimal totalOutros = produtos.Where(p => p.Produto.IndTot == NFeIndTotal.ValorItemCompoeTotalNota).Sum(e => e.Produto.VOutro); decimal totalTrib = produtos.Where(p => p.Produto.IndTot == NFeIndTotal.ValorItemCompoeTotalNota).Sum(p => p.Imposto.VTotTrib); //Totalizadores de impostos deverão vir da camada de dados do sistema decimal ValorFCPST = 0; decimal ValorIcmsST = 0; decimal ValorIPI = 0; decimal ValorFrete = 0; decimal ValorOutro = 0; decimal ValorSeguro = 0; decimal ValorPIS = 0; decimal ValorCOFINS = 0; decimal ValorFCP = 0; decimal ValorFCPSTRet = 0; var icmsTot = new NFeIcmsTot { VBcSt = 0, VSt = 0, VBc = 0, VIcms = 0, VProd = 100, VNf = totalItens - totalDesconto + ValorFCPST + ValorIcmsST + ValorIPI + ValorFrete + ValorOutro + ValorSeguro, VDesc = totalDesconto, VTotTrib = totalTrib, VPis = ValorPIS, VCofins = ValorCOFINS, VIpi = ValorIPI, VSeg = ValorSeguro, VOutro = ValorOutro, VFcp = ValorFCP, VFcpSt = ValorFCPST, VFcpStRet = ValorFCPSTRet, VIpiDevol = 0, VFrete = ValorFrete, }; icmsTot.VIcmsDeson = 0; var total = new NFeTotal { IcmsTot = icmsTot }; return(total); }
public infNFe() { Versao = NFeVersao.v400; _ide = new NFeIde(); Emitente = new NFeEmit(); Avulsa = new NFeAvulsa(); _destinatario = new NFeDest(this); Retirada = new NFeRetirada(); Entrega = new NFeEntrega(); AutXML = new DFeCollection <NFeAutXml>(); Detalhe = new NFeDetCollection(); Total = new NFeTotal(); Transporte = new NFeTransporte(); Cobranca = new NFeCobranca(); Pagamento = new NFePagamento(); Intermediador = new NFeIntermediador(); InformacaoAdicional = new NFeInformacaoAdicional(); Exporta = new NFeExporta(); Compra = new NFeCompra(); Cana = new NFeCana(); ResponsavelTecnico = new NFeResponsavelTecnico(); }