Package br.com.caelum.stella.nfe.xsd.recepcao.TNFe

Examples of br.com.caelum.stella.nfe.xsd.recepcao.TNFe.InfNFe


      //um wrapper de nota do lote...
      TNFe tnFe = factoryXSD.createTNFe();
     
      //uma nota do lote...
      InfNFe infNFe = factoryXSD.createTNFeInfNFe();
     
      Ide ide = factoryXSD.createTNFeInfNFeIde();
     
      // 3 cnpj (14)
      // 4 modelo (2)
      // 5 serie (3)
      // 6 numero nfe (9)
      // 7 forma de emissão (1)
      // 8 codigo numerico (8)
     
      //dados do emitente / nota
      SimpleDateFormat dfAmerican = new SimpleDateFormat("yyyy-MM-dd");
      SimpleDateFormat dfAnooMes = new SimpleDateFormat("yyMM");
      Calendar dataEmissao = Calendar.getInstance();
      String cnpj = "09661762000103";
     
      ide.setCUF(Estados.SP.getCodigo());
      ide.setCNF("00000001");
      ide.setNatOp("venda");
      ide.setIndPag("0");
      ide.setMod("55");
      ide.setSerie("0");
      ide.setNNF("1");
      ide.setDEmi(dfAmerican.format(dataEmissao.getTime()));
//      ide.setDSaiEnt("2012-05-09");
//      ide.setHSaiEnt("00:00:00");
      ide.setTpNF("1");
      ide.setCMunFG("3550308");
      ide.setTpImp("1");
      ide.setTpEmis("1");
      ide.setTpAmb("2"); // ambiente
      ide.setFinNFe("1");
      ide.setProcEmi("0");
      ide.setVerProc(VersaoNFE.V_2_00.getVersao());

      String baseCdv = ide.getCUF()
          + dfAnooMes.format(dataEmissao.getTime())
          + cnpj
          + StringUtils.leftPad(ide.getMod(), 2, '0')   
          + StringUtils.leftPad(ide.getSerie(), 3, '0')   
          + StringUtils.leftPad(ide.getNNF(), 9, '0')   
          + StringUtils.leftPad(ide.getNNF(), 9, '0')
          + ide.getTpEmis()
          + StringUtils.leftPad(ide.getCNF(), 8, '0');
     
//      ValidadorDeDv mod = new ValidadorDeDV(new DigitoVerificadorInfo(null, null, null, null, null))
     
     
//      ide.setCDV(cdv);
      /*
      cUF - Código da UF do emitente do Documento Fiscal
      • AAMM - Ano e Mês de emissão da NF-e
      • CNPJ - CNPJ do emitente
      • mod - Modelo do Documento Fiscal
      • serie - Série do Documento Fiscal
      • nNF - Número do Documento Fiscal
      • tpEmis – forma de emissão da NF-e
      • cNF - Código Numérico que compõe a Chave de Acesso
      • cDV - Dígito Verificador da Chave de Acesso
      */
     
      infNFe.setIde(ide);
     
     
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.nfe.xsd.recepcao.TNFe.InfNFe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.