Git Product home page Git Product logo

coffeepot-br-sped-fiscal's Introduction

coffeepot-br-sped-fiscal

Project to be used in Brazil to write file in accordance to local regulations.

Este projeto é um mapeamento de classes Java para formatação e gravação do arquivo texto no layout definido para o SPED Fiscal.

Para manter uma relação com a documentação oficial do Sped e facilitar o entendimento dos campos, os nomes dos campos seguem a mesma nomeclatura que está no layout técnico do Sped, mas sem a utilização do underline, usando a notação camelCase.

Projeto baseado em Maven. Utilizando JDK 1.7

Documentação técnica e layout: http://www.fazenda.gov.br/confaz/confaz/Atos/Atos_Cotepe/2008/ac009_08.htm

Dependência: coffeepot-bean-wr - https://github.com/jean-merelis/coffeepot-bean-wr

Exemplo escrevendo registro a registro no arquivo:

	//Criando o escritor do Sped Fiscal
	Writer fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "ISO-8859-1"));       
	SpedFiscalWriter spedFiscalWriter = new SpedFiscalWriter(fw);
	
	Reg0000 reg = new Reg0000();
	//atribui os dados do registro
	//reg.set...
	
	//Escreve o registro no arquivo
    spedFiscalWriter.write(reg);
	
	Reg0001 reg1 = new Reg0001();
	//atribui os dados do registro
	//reg1.set...
	
	//Escreve o registro no arquivo
    spedFiscalWriter.write(reg1);		

	spedFiscalWriter.writerFlush();
    spedFiscalWriter.writerClose();

Exemplo escrevendo um bloco inteiro no arquivo:

	//Criando o escritor do Sped Fiscal
	Writer fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "ISO-8859-1"));       
	SpedFiscalWriter spedFiscalWriter = new SpedFiscalWriter(fw);
	
	Bloco0 bloco0 = new Bloco0();
	//atribui os registros do bloco
	//bloco0.setReg...
	
	//Escreve o bloco no arquivo
    spedFiscalWriter.write(bloco0);

	spedFiscalWriter.writerFlush();
    spedFiscalWriter.writerClose();

coffeepot-br-sped-fiscal's People

Contributors

jean-merelis avatar maumorais avatar

Watchers

James Cloos avatar Bruno César avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.