fixes bug#13931
dev: Ramires qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/GeneradorBoletosCNAB/trunk@93044 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1fc2732397
commit
7cc70b25bf
|
@ -5,25 +5,21 @@ import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
||||||
import com.rjconsultores.ventaboletos.blocos.bradesco.ArquivoRemessaBradesco;
|
import com.rjconsultores.ventaboletos.blocos.santander.ArquivoRemessaSantander;
|
||||||
import com.rjconsultores.ventaboletos.blocos.bradesco.CabecalhoRemessaBradesco;
|
import com.rjconsultores.ventaboletos.blocos.santander.CabecalhoRemessaSantander;
|
||||||
import com.rjconsultores.ventaboletos.blocos.bradesco.DetalheObrigatorioBradesco;
|
import com.rjconsultores.ventaboletos.blocos.santander.DetalheObrigatorioSantander;
|
||||||
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
||||||
import com.rjconsultores.ventaboletos.enuns.MotivoOcorrenciaBradesco;
|
|
||||||
import com.rjconsultores.ventaboletos.enuns.OcorrenciaBradesco;
|
|
||||||
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
||||||
import com.rjconsultores.ventaboletos.layouts.BradescoFlatFile;
|
|
||||||
import com.rjconsultores.ventaboletos.layouts.RemessaInterface;
|
import com.rjconsultores.ventaboletos.layouts.RemessaInterface;
|
||||||
|
import com.rjconsultores.ventaboletos.layouts.SantanderFlatFile;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
ArquivoRemessaItem arquivoRemessaItem = new ArquivoRemessaBradesco();
|
ArquivoRemessaItem arquivoRemessaItem = new ArquivoRemessaSantander();
|
||||||
|
|
||||||
|
CabecalhoRemessaSantander cabecalhoRemessa = new CabecalhoRemessaSantander();
|
||||||
|
|
||||||
CabecalhoRemessaBradesco cabecalhoRemessa = new CabecalhoRemessaBradesco();
|
|
||||||
|
|
||||||
//cabecalhoRemessa.setCodigoBanco("123");
|
//cabecalhoRemessa.setCodigoBanco("123");
|
||||||
cabecalhoRemessa.setCodigoEmpresa("123456");
|
cabecalhoRemessa.setCodigoEmpresa("123456");
|
||||||
|
@ -33,63 +29,60 @@ public class Main {
|
||||||
//cabecalhoRemessa.setLiteralServico("COBRANCA");
|
//cabecalhoRemessa.setLiteralServico("COBRANCA");
|
||||||
cabecalhoRemessa.setNumeroSequencialRemessa(1);
|
cabecalhoRemessa.setNumeroSequencialRemessa(1);
|
||||||
cabecalhoRemessa.setNumeroSequencialRegistro(9);
|
cabecalhoRemessa.setNumeroSequencialRegistro(9);
|
||||||
|
cabecalhoRemessa.setCodigoTransmissao(1234567890);
|
||||||
cabecalhoRemessa.setNomeEmpresa("RJ Consultores");
|
cabecalhoRemessa.setNomeEmpresa("RJ Consultores");
|
||||||
|
|
||||||
arquivoRemessaItem.setCabecalhoRemessa(cabecalhoRemessa);
|
arquivoRemessaItem.setCabecalhoRemessa(cabecalhoRemessa);
|
||||||
|
|
||||||
DetalheObrigatorioBradesco tituloBradesco = new DetalheObrigatorioBradesco();
|
DetalheObrigatorioSantander tituloSantander = new DetalheObrigatorioSantander();
|
||||||
|
|
||||||
tituloBradesco.setValor(BigDecimal.TEN);
|
tituloSantander.setValor(new BigDecimal("4567.88"));
|
||||||
tituloBradesco.setVencimento(new Date());
|
tituloSantander.setVencimento(new Date());
|
||||||
tituloBradesco.setTipoInscricaoPagador(TipoInscricaoPagador.getInstanceByName("cpf"));
|
tituloSantander.setTipoInscricao(TipoInscricaoPagador.getInstanceByName("cpf"));
|
||||||
tituloBradesco.setNumeroInscricaoPagador(new Long(1452265658));
|
tituloSantander.setNumeroInscricao(new Long(1452265658));
|
||||||
tituloBradesco.setCEP_Prefixo("32015");
|
tituloSantander.setCepSacado("32015");
|
||||||
tituloBradesco.setCEP_Sufixo("490");
|
tituloSantander.setComplementoCepSacado("490");
|
||||||
//tituloBradesco.setOrigemDoPagamento(999);
|
tituloSantander.setNumeroDoDocumento("555666777");
|
||||||
|
tituloSantander.setAgencia("0555");
|
||||||
|
tituloSantander.setEmissao( new Date() );
|
||||||
|
//tituloSantander.setOrigemDoPagamento(999);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
arquivoRemessaItem.addTitulo(tituloBradesco.clone());
|
arquivoRemessaItem.addTitulo(tituloSantander.clone());
|
||||||
} catch (CloneNotSupportedException e1) {
|
} catch (CloneNotSupportedException e1) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RemessaInterface remessaInterface = new BradescoFlatFile();
|
RemessaInterface remessaInterface = new SantanderFlatFile();
|
||||||
|
|
||||||
RodapeRemessaPadrao rodapeRemessa = new RodapeRemessaPadrao();
|
RodapeRemessaPadrao rodapeRemessa = new RodapeRemessaPadrao();
|
||||||
rodapeRemessa.setNumeroSequencialRegistro(9999);
|
rodapeRemessa.setNumeroSequencialRegistro(9999);
|
||||||
|
|
||||||
arquivoRemessaItem.setRodapeRemessa(rodapeRemessa);
|
arquivoRemessaItem.setRodapeRemessa(rodapeRemessa);
|
||||||
|
|
||||||
File arquivoRemessaFisico = new File("C:\\Users\\Rafael\\rafael.txt");
|
File arquivoRemessaFisico = new File("C:\\Fabio\\fabio.txt");
|
||||||
|
|
||||||
|
ArquivoRemessa arquivoRemessa = new ArquivoRemessa(BancoLayout.SANTANDER_400_Envio);
|
||||||
OcorrenciaBradesco oco = OcorrenciaBradesco.getInstance("02");
|
|
||||||
MotivoOcorrenciaBradesco mo = MotivoOcorrenciaBradesco.getInstance(oco, "00");
|
|
||||||
System.out.println(mo.getMotivo());
|
|
||||||
|
|
||||||
ArquivoRemessa arquivoRemessa = new ArquivoRemessa(BancoLayout.BRADESCO_400_Envio);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
arquivoRemessa.addItem(arquivoRemessaItem.clone());
|
arquivoRemessa.addItem(arquivoRemessaItem.clone());
|
||||||
arquivoRemessa.addItem(arquivoRemessaItem.clone());
|
arquivoRemessa.addItem(arquivoRemessaItem.clone());
|
||||||
} catch (CloneNotSupportedException e1) {
|
} catch (CloneNotSupportedException e1) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
remessaInterface.gerarRemessa(arquivoRemessaFisico, arquivoRemessa);
|
remessaInterface.gerarRemessa(arquivoRemessaFisico, arquivoRemessa);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.rjconsultores.ventaboletos.blocos.santander;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
||||||
|
|
||||||
|
public class ArquivoRemessaSantander extends ArquivoRemessaItem {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCabecalhoRemessa(CabecalhoRemessa cabecalhoRemessa) {
|
||||||
|
|
||||||
|
if(cabecalhoRemessa instanceof CabecalhoRemessaSantander){
|
||||||
|
super.setCabecalhoRemessa(cabecalhoRemessa);
|
||||||
|
}else{
|
||||||
|
throw new ClassCastException("Somente cabecalho tipo: " + CabecalhoRemessaSantander.class.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addTitulo(DetalheObrigatorio titulo){
|
||||||
|
if(this.titulos == null){
|
||||||
|
this.titulos = new ArrayList<DetalheObrigatorio>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(titulo instanceof DetalheObrigatorioSantander){
|
||||||
|
|
||||||
|
titulo.setNumeroSequencialRegistro(titulos.size() + 2);
|
||||||
|
|
||||||
|
this.titulos.add(titulo);
|
||||||
|
}else{
|
||||||
|
throw new ClassCastException("Somente cabecalho tipo: " + DetalheObrigatorioSantander.class.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RodapeRemessa getRodapeRemessa() {
|
||||||
|
this.rodapeRemessa = this.rodapeRemessa == null ? new RodapeRemessaPadrao() : this.rodapeRemessa;
|
||||||
|
rodapeRemessa.setNumeroSequencialRegistro(titulos.size() + 2);
|
||||||
|
return rodapeRemessa;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.rjconsultores.ventaboletos.blocos.santander;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRemessa;
|
||||||
|
|
||||||
|
public class CabecalhoRemessaSantander implements CabecalhoRemessa {
|
||||||
|
|
||||||
|
private String codigoEmpresa;
|
||||||
|
private String nomeEmpresa;
|
||||||
|
private Date dataGravacao;
|
||||||
|
private Integer codigoTransmissao;
|
||||||
|
private Integer numeroSequencialRemessa;
|
||||||
|
private Integer numeroSequencialRegistro;
|
||||||
|
|
||||||
|
public String getCodigoEmpresa() {
|
||||||
|
return codigoEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigoEmpresa(String codigoEmpresa) {
|
||||||
|
this.codigoEmpresa = codigoEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNomeEmpresa() {
|
||||||
|
return nomeEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNomeEmpresa(String nomeEmpresa) {
|
||||||
|
this.nomeEmpresa = nomeEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataGravacao() {
|
||||||
|
return dataGravacao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataGravacao(Date dataGravacao) {
|
||||||
|
this.dataGravacao = dataGravacao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCodigoTransmissao() {
|
||||||
|
return codigoTransmissao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigoTransmissao(Integer codigoTransmissao) {
|
||||||
|
this.codigoTransmissao = codigoTransmissao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumeroSequencialRemessa() {
|
||||||
|
return numeroSequencialRemessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroSequencialRemessa(Integer numeroSequencialRemessa) {
|
||||||
|
this.numeroSequencialRemessa = numeroSequencialRemessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumeroSequencialRegistro() {
|
||||||
|
return numeroSequencialRegistro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroSequencialRegistro(Integer numeroSequencialRegistro) {
|
||||||
|
this.numeroSequencialRegistro = numeroSequencialRegistro;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,314 @@
|
||||||
|
package com.rjconsultores.ventaboletos.blocos.santander;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DadosBoleto;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RateioDeCredito;
|
||||||
|
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
||||||
|
|
||||||
|
public class DetalheObrigatorioSantander implements DetalheObrigatorio, Cloneable {
|
||||||
|
|
||||||
|
private Integer idBoletoFechamento;
|
||||||
|
private TipoInscricaoPagador tipoInscricao;
|
||||||
|
private Long numeroInscricao;
|
||||||
|
private Integer codigoTransmissao;
|
||||||
|
private String numControleDoParticipante;
|
||||||
|
private String nossoNumeroComDigito;
|
||||||
|
private String carteira;
|
||||||
|
private String agencia;
|
||||||
|
private String contacorrente;
|
||||||
|
private String dvConta;
|
||||||
|
private Integer QtdPagamento = 0;
|
||||||
|
private Integer codigoDeOcorrencia = 0;
|
||||||
|
private Date dataOcorrencia;
|
||||||
|
private String numeroDoDocumento;
|
||||||
|
private Date vencimento;
|
||||||
|
private BigDecimal valor;
|
||||||
|
private String especieDeTitulo;
|
||||||
|
private Date emissao;
|
||||||
|
private String instrucao1;
|
||||||
|
private String instrucao2;
|
||||||
|
private BigDecimal valorAtraso = BigDecimal.ZERO;
|
||||||
|
private Date dataLimiteDesconto;
|
||||||
|
private BigDecimal valorDesconto = BigDecimal.ZERO;
|
||||||
|
private BigDecimal valorIOF = BigDecimal.ZERO;
|
||||||
|
private BigDecimal valorAbatimentoConcedido = BigDecimal.ZERO;
|
||||||
|
private String nomeSacado;
|
||||||
|
private String mensagem1;
|
||||||
|
private String enderecoSacado;
|
||||||
|
private String bairroSacado;
|
||||||
|
private String cepSacado;
|
||||||
|
private String complementoCepSacado;
|
||||||
|
private String cidade;
|
||||||
|
private String estado;
|
||||||
|
private String identificadorComplemento;
|
||||||
|
private String complemento;
|
||||||
|
private String sacadorAvalista;
|
||||||
|
private Integer numeroSequencialRegistro;
|
||||||
|
private DadosBoleto dadosBoleto;
|
||||||
|
private RateioDeCredito rateioDeCredito;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setIdBoletoFechamento(Integer id) {
|
||||||
|
this.idBoletoFechamento = id;
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Integer getIdBoletoFechamento(){
|
||||||
|
return this.idBoletoFechamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DetalheObrigatorio clone() throws CloneNotSupportedException {
|
||||||
|
return (DetalheObrigatorio) super.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoInscricaoPagador getTipoInscricao() {
|
||||||
|
return tipoInscricao;
|
||||||
|
}
|
||||||
|
public void setTipoInscricao(TipoInscricaoPagador tipoInscricao) {
|
||||||
|
this.tipoInscricao = tipoInscricao;
|
||||||
|
}
|
||||||
|
public Long getNumeroInscricao() {
|
||||||
|
return numeroInscricao;
|
||||||
|
}
|
||||||
|
public void setNumeroInscricao(Long numeroInscricao) {
|
||||||
|
this.numeroInscricao = numeroInscricao;
|
||||||
|
}
|
||||||
|
public Integer getCodigoTransmissao() {
|
||||||
|
return codigoTransmissao;
|
||||||
|
}
|
||||||
|
public void setCodigoTransmissao(Integer codigoTransmissao) {
|
||||||
|
this.codigoTransmissao = codigoTransmissao;
|
||||||
|
}
|
||||||
|
public String getNumControleDoParticipante() {
|
||||||
|
return numControleDoParticipante;
|
||||||
|
}
|
||||||
|
public void setNumControleDoParticipante(String numControleDoParticipante) {
|
||||||
|
this.numControleDoParticipante = numControleDoParticipante;
|
||||||
|
}
|
||||||
|
public String getNossoNumeroComDigito() {
|
||||||
|
return nossoNumeroComDigito;
|
||||||
|
}
|
||||||
|
public void setNossoNumeroComDigito(String nossoNumeroComDigito) {
|
||||||
|
this.nossoNumeroComDigito = nossoNumeroComDigito;
|
||||||
|
}
|
||||||
|
public String getCarteira() {
|
||||||
|
return carteira;
|
||||||
|
}
|
||||||
|
public void setCarteira(String carteira) {
|
||||||
|
this.carteira = carteira;
|
||||||
|
}
|
||||||
|
public String getAgencia() {
|
||||||
|
return agencia;
|
||||||
|
}
|
||||||
|
public void setAgencia(String agencia) {
|
||||||
|
this.agencia = agencia;
|
||||||
|
}
|
||||||
|
public String getContacorrente() {
|
||||||
|
return contacorrente;
|
||||||
|
}
|
||||||
|
public void setContacorrente(String contacorrente) {
|
||||||
|
this.contacorrente = contacorrente;
|
||||||
|
}
|
||||||
|
public String getDvConta() {
|
||||||
|
return dvConta;
|
||||||
|
}
|
||||||
|
public void setDvConta(String dvConta) {
|
||||||
|
this.dvConta = dvConta;
|
||||||
|
}
|
||||||
|
public Integer getQtdPagamento() {
|
||||||
|
return QtdPagamento;
|
||||||
|
}
|
||||||
|
public void setQtdPagamento(Integer qtdPagamento) {
|
||||||
|
QtdPagamento = qtdPagamento;
|
||||||
|
}
|
||||||
|
public Integer getCodigoDeOcorrencia() {
|
||||||
|
return codigoDeOcorrencia;
|
||||||
|
}
|
||||||
|
public void setCodigoDeOcorrencia(Integer codigoDeOcorrencia) {
|
||||||
|
this.codigoDeOcorrencia = codigoDeOcorrencia;
|
||||||
|
}
|
||||||
|
public Date getDataOcorrencia() {
|
||||||
|
return dataOcorrencia;
|
||||||
|
}
|
||||||
|
public void setDataOcorrencia(Date dataOcorrencia) {
|
||||||
|
this.dataOcorrencia = dataOcorrencia;
|
||||||
|
}
|
||||||
|
public String getNumeroDoDocumento() {
|
||||||
|
return numeroDoDocumento;
|
||||||
|
}
|
||||||
|
public void setNumeroDoDocumento(String numeroDoDocumento) {
|
||||||
|
this.numeroDoDocumento = numeroDoDocumento;
|
||||||
|
}
|
||||||
|
public Date getVencimento() {
|
||||||
|
return vencimento;
|
||||||
|
}
|
||||||
|
public void setVencimento(Date vencimento) {
|
||||||
|
this.vencimento = vencimento;
|
||||||
|
}
|
||||||
|
public BigDecimal getValor() {
|
||||||
|
return valor;
|
||||||
|
}
|
||||||
|
public void setValor(BigDecimal valor) {
|
||||||
|
this.valor = valor;
|
||||||
|
}
|
||||||
|
public String getEspecieDeTitulo() {
|
||||||
|
return especieDeTitulo;
|
||||||
|
}
|
||||||
|
public void setEspecieDeTitulo(String especieDeTitulo) {
|
||||||
|
this.especieDeTitulo = especieDeTitulo;
|
||||||
|
}
|
||||||
|
public Date getEmissao() {
|
||||||
|
return emissao;
|
||||||
|
}
|
||||||
|
public void setEmissao(Date emissao) {
|
||||||
|
this.emissao = emissao;
|
||||||
|
}
|
||||||
|
public String getInstrucao1() {
|
||||||
|
return instrucao1;
|
||||||
|
}
|
||||||
|
public void setInstrucao1(String instrucao1) {
|
||||||
|
this.instrucao1 = instrucao1;
|
||||||
|
}
|
||||||
|
public String getInstrucao2() {
|
||||||
|
return instrucao2;
|
||||||
|
}
|
||||||
|
public void setInstrucao2(String instrucao2) {
|
||||||
|
this.instrucao2 = instrucao2;
|
||||||
|
}
|
||||||
|
public BigDecimal getValorAtraso() {
|
||||||
|
return valorAtraso;
|
||||||
|
}
|
||||||
|
public void setValorAtraso(BigDecimal valorAtraso) {
|
||||||
|
this.valorAtraso = valorAtraso;
|
||||||
|
}
|
||||||
|
public Date getDataLimiteDesconto() {
|
||||||
|
return dataLimiteDesconto;
|
||||||
|
}
|
||||||
|
public void setDataLimiteDesconto(Date dataLimiteDesconto) {
|
||||||
|
this.dataLimiteDesconto = dataLimiteDesconto;
|
||||||
|
}
|
||||||
|
public BigDecimal getValorDesconto() {
|
||||||
|
return valorDesconto;
|
||||||
|
}
|
||||||
|
public void setValorDesconto(BigDecimal valorDesconto) {
|
||||||
|
this.valorDesconto = valorDesconto;
|
||||||
|
}
|
||||||
|
public BigDecimal getValorIOF() {
|
||||||
|
return valorIOF;
|
||||||
|
}
|
||||||
|
public void setValorIOF(BigDecimal valorIOF) {
|
||||||
|
this.valorIOF = valorIOF;
|
||||||
|
}
|
||||||
|
public BigDecimal getValorAbatimentoConcedido() {
|
||||||
|
return valorAbatimentoConcedido;
|
||||||
|
}
|
||||||
|
public void setValorAbatimentoConcedido(BigDecimal valorAbatimentoConcedido) {
|
||||||
|
this.valorAbatimentoConcedido = valorAbatimentoConcedido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMensagem1() {
|
||||||
|
return mensagem1;
|
||||||
|
}
|
||||||
|
public void setMensagem1(String mensagem1) {
|
||||||
|
this.mensagem1 = mensagem1;
|
||||||
|
}
|
||||||
|
public String getCepSacado() {
|
||||||
|
return cepSacado;
|
||||||
|
}
|
||||||
|
public void setCepSacado(String cepSacado) {
|
||||||
|
this.cepSacado = cepSacado;
|
||||||
|
}
|
||||||
|
public String getComplementoCepSacado() {
|
||||||
|
return complementoCepSacado;
|
||||||
|
}
|
||||||
|
public void setComplementoCepSacado(String complementoCepSacado) {
|
||||||
|
this.complementoCepSacado = complementoCepSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumeroSequencialRegistro() {
|
||||||
|
return numeroSequencialRegistro;
|
||||||
|
}
|
||||||
|
public void setNumeroSequencialRegistro(Integer numeroSequencialRegistro) {
|
||||||
|
this.numeroSequencialRegistro = numeroSequencialRegistro;
|
||||||
|
}
|
||||||
|
public DadosBoleto getDadosBoleto() {
|
||||||
|
return dadosBoleto;
|
||||||
|
}
|
||||||
|
public void setDadosBoleto(DadosBoleto dadosBoleto) {
|
||||||
|
this.dadosBoleto = dadosBoleto;
|
||||||
|
}
|
||||||
|
public RateioDeCredito getRateioDeCredito() {
|
||||||
|
return rateioDeCredito;
|
||||||
|
}
|
||||||
|
public void setRateioDeCredito(RateioDeCredito rateioDeCredito) {
|
||||||
|
this.rateioDeCredito = rateioDeCredito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBairroSacado() {
|
||||||
|
return bairroSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBairroSacado(String bairroSacado) {
|
||||||
|
this.bairroSacado = bairroSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCidade() {
|
||||||
|
return cidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCidade(String cidade) {
|
||||||
|
this.cidade = cidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEstado() {
|
||||||
|
return estado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstado(String estado) {
|
||||||
|
this.estado = estado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdentificadorComplemento() {
|
||||||
|
return identificadorComplemento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentificadorComplemento(String identificadorComplemento) {
|
||||||
|
this.identificadorComplemento = identificadorComplemento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComplemento() {
|
||||||
|
return complemento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComplemento(String complemento) {
|
||||||
|
this.complemento = complemento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNomeSacado() {
|
||||||
|
return nomeSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNomeSacado(String nomeSacado) {
|
||||||
|
this.nomeSacado = nomeSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnderecoSacado() {
|
||||||
|
return enderecoSacado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnderecoSacado(String enderecoSacado) {
|
||||||
|
this.enderecoSacado = enderecoSacado;
|
||||||
|
}
|
||||||
|
public String getSacadorAvalista() {
|
||||||
|
return sacadorAvalista;
|
||||||
|
}
|
||||||
|
public void setSacadorAvalista(String sacadorAvalista) {
|
||||||
|
this.sacadorAvalista = sacadorAvalista;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ public enum BancoLayout {
|
||||||
BRADESCO_400_Envio("237", false, "/layouts/LayoutBradescoCNAB400Envio.txg.xml"),
|
BRADESCO_400_Envio("237", false, "/layouts/LayoutBradescoCNAB400Envio.txg.xml"),
|
||||||
ITAU_400_Envio("341", false, "/layouts/LayoutItauCNAB400Envio.txg.xml"),
|
ITAU_400_Envio("341", false, "/layouts/LayoutItauCNAB400Envio.txg.xml"),
|
||||||
BB_240_Envio("001", false, "/layouts/LayoutBBCNAB240Envio.txg.xml"),
|
BB_240_Envio("001", false, "/layouts/LayoutBBCNAB240Envio.txg.xml"),
|
||||||
|
SANTANDER_400_Envio("033", false, "/layouts/LayoutSantanderCNAB400Envio.txg.xml"),
|
||||||
|
SANTANDER_400_Retorno("033", true, "/layouts/LayoutSantanderCNAB400Retorno.txg.xml"),
|
||||||
BRADESCO_400_Retorno("237", true, "/layouts/LayoutBradescoCNAB400Retorno.txg.xml"),
|
BRADESCO_400_Retorno("237", true, "/layouts/LayoutBradescoCNAB400Retorno.txg.xml"),
|
||||||
ITAU_400_Retorno("341", true, ""),
|
ITAU_400_Retorno("341", true, ""),
|
||||||
BB_240_Retorno("001", true, "");
|
BB_240_Retorno("001", true, "");
|
||||||
|
@ -14,12 +16,13 @@ public enum BancoLayout {
|
||||||
this.codBanco = codBanco;
|
this.codBanco = codBanco;
|
||||||
this.retorno = retorno;
|
this.retorno = retorno;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
|
this.valido = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String codBanco;
|
private String codBanco;
|
||||||
private boolean retorno;
|
private boolean retorno;
|
||||||
private String path;
|
private String path;
|
||||||
|
private boolean valido = true;
|
||||||
|
|
||||||
public String getCodBanco() {
|
public String getCodBanco() {
|
||||||
return codBanco;
|
return codBanco;
|
||||||
|
@ -37,6 +40,14 @@ public enum BancoLayout {
|
||||||
return path.substring(path.lastIndexOf("/"));
|
return path.substring(path.lastIndexOf("/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValido() {
|
||||||
|
return valido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValido(boolean valido) {
|
||||||
|
this.valido = valido;
|
||||||
|
}
|
||||||
|
|
||||||
public static BancoLayout getInstanceByCodBanco(String codBanco){
|
public static BancoLayout getInstanceByCodBanco(String codBanco){
|
||||||
|
|
||||||
for(BancoLayout o : BancoLayout.values()){
|
for(BancoLayout o : BancoLayout.values()){
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.rjconsultores.ventaboletos.enuns;
|
||||||
|
|
||||||
|
public enum CarteiraSantander {
|
||||||
|
|
||||||
|
ELETRONICA_REGISTRO(1,"ELETRÔNICA COM REGISTRO"),
|
||||||
|
CAUCIONADA_ELETRONICA(3,"CAUCIONADA ELETRÔNICA"),
|
||||||
|
COBRANÇA_SEM_REGISTRO(4,"COBRANÇA SEM REGISTRO"),
|
||||||
|
RAPIDA_COM_REGISTRO(5,"RÁPIDA COM REGISTRO"), //(BLOQUETE EMITIDO PELO CLIENTE)
|
||||||
|
CAUCIONADA_RAPIDA(6,"CAUCIONADA RAPIDA"),
|
||||||
|
DESCONTADA_ELETRONICA(7,"DESCONTADA ELETRÔNICA");
|
||||||
|
|
||||||
|
private CarteiraSantander(Integer id, String label){
|
||||||
|
this.id = id;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CarteiraSantander getInstance(String id){
|
||||||
|
|
||||||
|
for(CarteiraSantander o : CarteiraSantander.values()){
|
||||||
|
|
||||||
|
if(o.getId().equals(id)){
|
||||||
|
return o;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.rjconsultores.ventaboletos.enuns;
|
||||||
|
|
||||||
|
public enum OcorrenciaSantander {
|
||||||
|
|
||||||
|
ENTRADA_TITULO("01","ENTRADA DE TÍTULO"),
|
||||||
|
BAIXA_TITULO("02","BAIXA DE TÍTULO"),
|
||||||
|
CONCESSAO_ABATIMENTO("04","CONCESSÃO DE ABATIMENTO"),
|
||||||
|
CANCELAMENTO_ABATIMENTO("05","CANCELAMENTO ABATIMENTO"),
|
||||||
|
PRORROGACAO_VENCIMENTO("06","PRORROGAÇÃO DE VENCIMENTO"),
|
||||||
|
ALTERACAO_CEDENTE("07","ALT. NÚMERO CONT.CEDENTE"),
|
||||||
|
ALTERACAO_NUMERO("08","ALTERAÇÃO DO SEU NÚMERO"),
|
||||||
|
PROTESTAR("09","PROTESTAR"),
|
||||||
|
SUSTAR_PROTESTO("18","SUSTAR PROTESTO");
|
||||||
|
|
||||||
|
private OcorrenciaSantander(String id, String label){
|
||||||
|
this.id = id;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OcorrenciaSantander getInstance(String id){
|
||||||
|
|
||||||
|
for(OcorrenciaSantander o : OcorrenciaSantander.values()){
|
||||||
|
|
||||||
|
if(o.getId().equals(id)){
|
||||||
|
return o;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,17 +1,11 @@
|
||||||
package com.rjconsultores.ventaboletos.layouts;
|
package com.rjconsultores.ventaboletos.layouts;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.Reader;
|
|
||||||
import java.io.Writer;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -22,7 +16,6 @@ import org.apache.commons.io.IOUtils;
|
||||||
import org.jrimum.texgit.FlatFile;
|
import org.jrimum.texgit.FlatFile;
|
||||||
import org.jrimum.texgit.Record;
|
import org.jrimum.texgit.Record;
|
||||||
import org.jrimum.texgit.Texgit;
|
import org.jrimum.texgit.Texgit;
|
||||||
import org.jrimum.utilix.ClassLoaders;
|
|
||||||
import org.jrimum.utilix.Collections;
|
import org.jrimum.utilix.Collections;
|
||||||
import org.jrimum.utilix.Objects;
|
import org.jrimum.utilix.Objects;
|
||||||
import org.jrimum.utilix.text.Strings;
|
import org.jrimum.utilix.text.Strings;
|
||||||
|
|
|
@ -10,6 +10,8 @@ public class CNABFactory {
|
||||||
switch (bancoLayout) {
|
switch (bancoLayout) {
|
||||||
case BRADESCO_400_Envio:
|
case BRADESCO_400_Envio:
|
||||||
return new BradescoFlatFile();
|
return new BradescoFlatFile();
|
||||||
|
case SANTANDER_400_Envio:
|
||||||
|
return new SantanderFlatFile();
|
||||||
case ITAU_400_Envio:
|
case ITAU_400_Envio:
|
||||||
return new ItauFlatFile();
|
return new ItauFlatFile();
|
||||||
case BB_240_Envio:
|
case BB_240_Envio:
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
||||||
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
|
||||||
|
|
||||||
public interface RemessaInterface {
|
public interface RemessaInterface {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
package com.rjconsultores.ventaboletos.layouts;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.jrimum.texgit.Record;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DadosBoleto;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RateioDeCredito;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.santander.CabecalhoRemessaSantander;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.santander.DetalheObrigatorioSantander;
|
||||||
|
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
||||||
|
import com.rjconsultores.ventaboletos.utils.FormataUtil;
|
||||||
|
|
||||||
|
public class SantanderFlatFile extends AbstractFlatFile implements RemessaInterface {
|
||||||
|
|
||||||
|
public SantanderFlatFile() {
|
||||||
|
super(BancoLayout.SANTANDER_400_Envio);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createHeader(CabecalhoRemessa cabecalhoRemessaParam) {
|
||||||
|
|
||||||
|
Record header = getFlatFile().createRecord("Header");
|
||||||
|
|
||||||
|
CabecalhoRemessaSantander cabecalhoRemessa = (CabecalhoRemessaSantander) cabecalhoRemessaParam;
|
||||||
|
|
||||||
|
header.setValue("CodigoDaEmpresa", FormataUtil.formatarValorPorTamanho(cabecalhoRemessa.getCodigoEmpresa().toString(), 20));
|
||||||
|
header.setValue("NomeDaEmpresa", FormataUtil.formatarValorPorTamanho(cabecalhoRemessa.getNomeEmpresa(), 30));
|
||||||
|
header.setValue("CodigoTransmissao", FormataUtil.formatarValorPorTamanho(cabecalhoRemessa.getCodigoTransmissao().toString(), 20));
|
||||||
|
header.setValue("DataGravacaoArquivo", FormataUtil.formataDataToString(cabecalhoRemessa.getDataGravacao(), "000000", "ddMMyy"));
|
||||||
|
header.setValue("NumeroSequencialRemessa", FormataUtil.formatarValorPorTamanho(cabecalhoRemessa.getNumeroSequencialRemessa().toString(), 7));
|
||||||
|
header.setValue("NumeroSequencialRegistro", FormataUtil.formatarValorPorTamanho(cabecalhoRemessa.getNumeroSequencialRegistro().toString(), 6));
|
||||||
|
|
||||||
|
getFlatFile().addRecord(header);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createTransacaoTitulos(DetalheObrigatorio tituloParam) {
|
||||||
|
|
||||||
|
Record transacaoTitulos = getFlatFile().createRecord("TransacaoTitulo");
|
||||||
|
|
||||||
|
DetalheObrigatorioSantander titulo = (DetalheObrigatorioSantander) tituloParam;
|
||||||
|
|
||||||
|
transacaoTitulos.setValue("TipoInscricao", FormataUtil.formatarValorPorTamanho(titulo.getTipoInscricao().toString(), 2));
|
||||||
|
transacaoTitulos.setValue("NumeroInscricao", FormataUtil.formatarValorPorTamanho(titulo.getNumeroInscricao().toString(), 14));
|
||||||
|
transacaoTitulos.setValue("CodigoTransmissao", FormataUtil.formatarValorPorTamanho(titulo.getCodigoTransmissao().toString(), 20));
|
||||||
|
transacaoTitulos.setValue("NumControleDoParticipante", FormataUtil.formatarValorPorTamanho(titulo.getNumControleDoParticipante(), 25));
|
||||||
|
transacaoTitulos.setValue("NossoNumeroComDigito", FormataUtil.formatarValorPorTamanho(titulo.getNossoNumeroComDigito(), 9));
|
||||||
|
transacaoTitulos.setValue("Carteira", FormataUtil.formatarValorPorTamanho(titulo.getCarteira(), 3));
|
||||||
|
transacaoTitulos.setValue("Agencia", FormataUtil.formatarValorPorTamanho(titulo.getAgencia(), 5));
|
||||||
|
transacaoTitulos.setValue("Contacorrente", FormataUtil.formatarValorPorTamanho(titulo.getContacorrente(), 7));
|
||||||
|
transacaoTitulos.setValue("DvConta", FormataUtil.formatarValorPorTamanho(titulo.getDvConta(), 1));
|
||||||
|
|
||||||
|
transacaoTitulos.setValue("Filler1", FormataUtil.formatarValorPorTamanho("0", 8));
|
||||||
|
|
||||||
|
transacaoTitulos.setValue("QtdPagamento", FormataUtil.formatarValorPorTamanho(titulo.getQtdPagamento().toString(), 25));
|
||||||
|
transacaoTitulos.setValue("NumeroDoDocumento", FormataUtil.formatarValorPorTamanho(titulo.getNumeroDoDocumento(), 10));
|
||||||
|
transacaoTitulos.setValue("Vencimento", FormataUtil.formataDataToString(titulo.getVencimento(), "000000", "ddMMyy"));
|
||||||
|
transacaoTitulos.setValue("Valor", titulo.getValor());
|
||||||
|
transacaoTitulos.setValue("EspecieDeTitulo", FormataUtil.formatarValorPorTamanho(titulo.getEspecieDeTitulo(), 2));
|
||||||
|
transacaoTitulos.setValue("Emissao", FormataUtil.formataDataToString(titulo.getEmissao(), "000000", "ddMMyy"));
|
||||||
|
transacaoTitulos.setValue("Instrucao1", FormataUtil.formatarValorPorTamanho(titulo.getInstrucao1(), 2));
|
||||||
|
transacaoTitulos.setValue("Instrucao2", FormataUtil.formatarValorPorTamanho(titulo.getInstrucao2(), 2));
|
||||||
|
transacaoTitulos.setValue("ValorAtraso", titulo.getValorAtraso());
|
||||||
|
transacaoTitulos.setValue("DataLimiteDesconto", FormataUtil.formataData(titulo.getDataLimiteDesconto()));
|
||||||
|
transacaoTitulos.setValue("ValorDesconto", titulo.getValorDesconto());
|
||||||
|
transacaoTitulos.setValue("ValorIOF", titulo.getValorIOF());
|
||||||
|
transacaoTitulos.setValue("ValorAbatimentoConcedido", titulo.getValorAbatimentoConcedido());
|
||||||
|
transacaoTitulos.setValue("Mensagem1", FormataUtil.formatarValorPorTamanho(titulo.getMensagem1(), 12));
|
||||||
|
transacaoTitulos.setValue("NomeSacado", FormataUtil.formatarValorPorTamanho(titulo.getNomeSacado(), 40));
|
||||||
|
transacaoTitulos.setValue("EnderecoSacado", FormataUtil.formatarValorPorTamanho(titulo.getEnderecoSacado(), 40));
|
||||||
|
transacaoTitulos.setValue("BairroSacado", FormataUtil.formatarValorPorTamanho(titulo.getBairroSacado(), 12));
|
||||||
|
transacaoTitulos.setValue("CepSacado", FormataUtil.formatarValorPorTamanho(titulo.getCepSacado().toString(), 5));
|
||||||
|
transacaoTitulos.setValue("ComplementoCepSacado", FormataUtil.formatarValorPorTamanho(titulo.getComplementoCepSacado().toString(), 3));
|
||||||
|
transacaoTitulos.setValue("Cidade", FormataUtil.formatarValorPorTamanho(titulo.getCidade(), 15));
|
||||||
|
transacaoTitulos.setValue("Estado", FormataUtil.formatarValorPorTamanho(titulo.getEstado(), 2));
|
||||||
|
transacaoTitulos.setValue("SacadorAvalista", FormataUtil.formatarValorPorTamanho(titulo.getSacadorAvalista(), 30));
|
||||||
|
transacaoTitulos.setValue("NumeroSequencialRegistro", FormataUtil.formatarValorPorTamanho(titulo.getNumeroSequencialRegistro().toString(), 6));
|
||||||
|
|
||||||
|
DadosBoleto dadosBoleto = titulo.getDadosBoleto();
|
||||||
|
|
||||||
|
try{
|
||||||
|
if(dadosBoleto != null){
|
||||||
|
transacaoTitulos.addInnerRecord(createDadosBoletos(dadosBoleto));
|
||||||
|
}
|
||||||
|
}catch(UnsupportedOperationException e){ }
|
||||||
|
|
||||||
|
RateioDeCredito rateioDeCredito = titulo.getRateioDeCredito();
|
||||||
|
|
||||||
|
try{
|
||||||
|
if(dadosBoleto != null){
|
||||||
|
transacaoTitulos.addInnerRecord(createRateioDeCredito(rateioDeCredito));
|
||||||
|
}
|
||||||
|
}catch(UnsupportedOperationException e){ }
|
||||||
|
|
||||||
|
getFlatFile().addRecord(transacaoTitulos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Record createDadosBoletos(DadosBoleto boleto) {
|
||||||
|
throw new UnsupportedOperationException("Não necessário...");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Record createRateioDeCredito(RateioDeCredito rateioDeCredito) {
|
||||||
|
throw new UnsupportedOperationException("Não necessário...");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createTrailler(RodapeRemessa trailler){
|
||||||
|
|
||||||
|
Record trailer = getFlatFile().createRecord("Trailler");
|
||||||
|
|
||||||
|
trailer.setValue("NumeroSequencialRegistro", FormataUtil.formatarValorPorTamanho(trailler.getNumeroSequencialRegistro().toString(), 6));
|
||||||
|
|
||||||
|
getFlatFile().addRecord(trailer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CabecalhoRetorno readHeader(Record header) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Retorno.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<DetalheRetorno> readTransacaoTitulos(Collection<Record> registrosDeTransacoes) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Retorno.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RodapeRetorno readTrailler(Record trailler) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Retorno.");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.rjconsultores.ventaboletos.layouts;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.jrimum.texgit.Record;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.CabecalhoRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DadosBoleto;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RateioDeCredito;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.RodapeRetorno;
|
||||||
|
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
||||||
|
|
||||||
|
public class SantanderProcessaRetorno extends AbstractFlatFile implements RetornoInteface {
|
||||||
|
|
||||||
|
protected SantanderProcessaRetorno() {
|
||||||
|
super(BancoLayout.SANTANDER_400_Retorno);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createHeader(CabecalhoRemessa cabecalhoRemessaParam) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Envio.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createTransacaoTitulos(DetalheObrigatorio tituloParam) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Envio.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Record createDadosBoletos(DadosBoleto boleto) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Envio.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Record createRateioDeCredito(RateioDeCredito rateioDeCredito) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Envio.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createTrailler(RodapeRemessa trailler) {
|
||||||
|
throw new UnsupportedOperationException("Somente classe de Envio.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CabecalhoRetorno readHeader(Record header) {
|
||||||
|
|
||||||
|
CabecalhoRetorno cabecalhoRetorno = new CabecalhoRetorno();
|
||||||
|
String codEmpresa = header.getValue("CodigoDaEmpresa");
|
||||||
|
String numeroDoAvisoBancario = header.getValue("NumeroDoAvisoBancario");
|
||||||
|
|
||||||
|
cabecalhoRetorno.setCodEmpresa(codEmpresa);
|
||||||
|
cabecalhoRetorno.setNumeroDoAvisoBancario(numeroDoAvisoBancario);
|
||||||
|
|
||||||
|
return cabecalhoRetorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<DetalheRetorno> readTransacaoTitulos(Collection<Record> registrosDeTransacoes) {
|
||||||
|
|
||||||
|
List<DetalheRetorno> retornos = new ArrayList<DetalheRetorno>();
|
||||||
|
|
||||||
|
for (Record record : registrosDeTransacoes) {
|
||||||
|
|
||||||
|
DetalheRetorno detalheRetorno = new DetalheRetorno();
|
||||||
|
|
||||||
|
String numeroControleDoParticipante = record.getValue("NumeroControleDoParticipante");
|
||||||
|
String codigoDeOcorrencia = record.getValue("CodigoDeOcorrencia");
|
||||||
|
String codigoDeMotivo1 = record.getValue("CodigoDeMotivo1");
|
||||||
|
String codigoDeMotivo2 = record.getValue("CodigoDeMotivo2");
|
||||||
|
String codigoDeMotivo3 = record.getValue("CodigoDeMotivo3");
|
||||||
|
String codigoDeMotivo4 = record.getValue("CodigoDeMotivo4");
|
||||||
|
String codigoDeMotivo5 = record.getValue("CodigoDeMotivo5");
|
||||||
|
/*
|
||||||
|
OcorrenciaSantander ocorrencia = OcorrenciaSantander.getInstance(codigoDeOcorrencia);
|
||||||
|
detalheRetorno.setNumeroControleDoParticipante(numeroControleDoParticipante);
|
||||||
|
detalheRetorno.setOcorrencia(ocorrencia);
|
||||||
|
|
||||||
|
if(checkIsNullOrBlank(codigoDeMotivo1)){
|
||||||
|
MotivoOcorrenciaSantander motivoOcorrencia = MotivoOcorrenciaSantander.getInstance(ocorrencia, codigoDeMotivo1);
|
||||||
|
detalheRetorno.addMotivoOcorrencia(motivoOcorrencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(checkIsNullOrBlank(codigoDeMotivo2)){
|
||||||
|
MotivoOcorrenciaSantander motivoOcorrencia = MotivoOcorrenciaSantander.getInstance(ocorrencia, codigoDeMotivo2);
|
||||||
|
detalheRetorno.addMotivoOcorrencia(motivoOcorrencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(checkIsNullOrBlank(codigoDeMotivo3)){
|
||||||
|
MotivoOcorrenciaSantander motivoOcorrencia = MotivoOcorrenciaSantander.getInstance(ocorrencia, codigoDeMotivo3);
|
||||||
|
detalheRetorno.addMotivoOcorrencia(motivoOcorrencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(checkIsNullOrBlank(codigoDeMotivo4)){
|
||||||
|
MotivoOcorrenciaSantander motivoOcorrencia = MotivoOcorrenciaSantander.getInstance(ocorrencia, codigoDeMotivo4);
|
||||||
|
detalheRetorno.addMotivoOcorrencia(motivoOcorrencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(checkIsNullOrBlank(codigoDeMotivo5)){
|
||||||
|
MotivoOcorrenciaSantander motivoOcorrencia = MotivoOcorrenciaSantander.getInstance(ocorrencia, codigoDeMotivo5);
|
||||||
|
detalheRetorno.addMotivoOcorrencia(motivoOcorrencia);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
retornos.add(detalheRetorno);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retornos;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkIsNullOrBlank(String value){
|
||||||
|
|
||||||
|
if(value != null){
|
||||||
|
return StringUtils.isEmpty(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected RodapeRetorno readTrailler(Record trailler) {
|
||||||
|
|
||||||
|
RodapeRetorno rodapeRetorno = new RodapeRetorno();
|
||||||
|
|
||||||
|
|
||||||
|
return rodapeRetorno;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,10 +15,7 @@ public class NossoNumeroUtils {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String calcularNossonumeroBradesco(Integer numCarteira, BigInteger nossoNumero){
|
public static String calcularNossonumeroBradesco(Integer numCarteira, BigInteger nossoNumero){
|
||||||
|
|
||||||
|
|
||||||
return StringUtils.right("00000000000" + nossoNumero, 11) + dacBradesco(numCarteira, nossoNumero);
|
return StringUtils.right("00000000000" + nossoNumero, 11) + dacBradesco(numCarteira, nossoNumero);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,10 +27,12 @@ public class NossoNumeroUtils {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String calcularNossoNumeroItau(Integer codAgencia, Integer numConta, Integer numCarteira, BigInteger nossoNumero){
|
public static String calcularNossoNumeroItau(Integer codAgencia, Integer numConta, Integer numCarteira, BigInteger nossoNumero){
|
||||||
|
|
||||||
|
|
||||||
return StringUtils.right("00000000" + nossoNumero, 8) + dacItau(codAgencia, numConta, numCarteira, nossoNumero);
|
return StringUtils.right("00000000" + nossoNumero, 8) + dacItau(codAgencia, numConta, numCarteira, nossoNumero);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String calcularNossoNumeroSantander(BigInteger nossoNumero){
|
||||||
|
return StringUtils.right("0000000" + nossoNumero, 7)+dacSantander( nossoNumero.toString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -187,6 +186,37 @@ public class NossoNumeroUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String dacSantander(String nossoNumero){
|
||||||
|
|
||||||
|
int multiplicador = 2;
|
||||||
|
|
||||||
|
int soma = 0;
|
||||||
|
|
||||||
|
for (int i = nossoNumero.length() - 1; i >= 0 ; i--) {
|
||||||
|
|
||||||
|
int current = Integer.parseInt(nossoNumero.charAt(i) + "");
|
||||||
|
|
||||||
|
current = current * multiplicador;
|
||||||
|
soma = soma + current;
|
||||||
|
multiplicador++;
|
||||||
|
|
||||||
|
if(multiplicador == 2){
|
||||||
|
multiplicador = 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int mod = soma % 11;
|
||||||
|
|
||||||
|
if(mod == 10){
|
||||||
|
return "1";
|
||||||
|
}else if( mod == 0 || mod == 1 ) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.valueOf(11 - mod);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calcula do DV para o Itau (Numero Documento)
|
* Calcula do DV para o Itau (Numero Documento)
|
||||||
* @param codAgencia
|
* @param codAgencia
|
||||||
|
@ -240,6 +270,10 @@ public class NossoNumeroUtils {
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(BancoLayout.SANTANDER_400_Envio.equals(bancoLayout) && nossoNumero.length() == 9 ){
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if(BancoLayout.BB_240_Envio.equals(bancoLayout) && (nossoNumero.length() == 13 || nossoNumero.length() == 17)){
|
if(BancoLayout.BB_240_Envio.equals(bancoLayout) && (nossoNumero.length() == 13 || nossoNumero.length() == 17)){
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
@ -250,29 +284,7 @@ public class NossoNumeroUtils {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
System.out.println( calcularNossoNumeroSantander( new BigInteger("2457800") ));
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102031")));
|
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102032")));
|
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102033")));
|
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102034")));
|
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102035")));
|
|
||||||
System.out.println(calcularNossonumeroBradesco(9, new BigInteger("102036")));
|
|
||||||
//System.out.println(calcularNossoNumeroItau(57, 72192, 109, new BigInteger("987123451")));
|
|
||||||
//System.out.println(dvDocumentoItau(1108954));
|
|
||||||
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100000")));
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100001")));
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100002")));
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100003")));
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100004")));
|
|
||||||
// System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100005")));
|
|
||||||
|
|
||||||
|
|
||||||
//System.out.println(calcularNossoNumeroBancoBrasil(490, 17, new BigInteger("100006")));
|
|
||||||
//System.out.println(calcularNossoNumeroBancoBrasil(88490, 17, new BigInteger("100007")));
|
|
||||||
//System.out.println(calcularNossoNumeroBancoBrasil(3088490, 17, new BigInteger("100005")));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,114 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<txg:Texgit xmlns:txg="http://gilmatryx.googlepages.com/Texgit"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://gilmatryx.googlepages.com/Texgit file:////home/gilmar/NFM/WORKSPACE/TexgitSchema.xsd"
|
||||||
|
version="1.0-academic">
|
||||||
|
|
||||||
|
<FlatFile>
|
||||||
|
<layout>
|
||||||
|
<name>Arquivo-Remessa_SantanderCNAB400</name>
|
||||||
|
<version>Version 2,0, Published: outubro/2009</version>
|
||||||
|
<description>
|
||||||
|
Layout para Cobrança.
|
||||||
|
|
||||||
|
Arquivo texto - padrão CNAB
|
||||||
|
Meio de Registro Transmissão de Dados
|
||||||
|
Descrição de Registro - Tamanho 400 Bytes
|
||||||
|
Organização Sequencial
|
||||||
|
|
||||||
|
ARQUIVO FORMATO CNAB REMESSA, REGISTROS:
|
||||||
|
|
||||||
|
0 = Header
|
||||||
|
1 = Registro de Movimento
|
||||||
|
2 = Mensagem Variável por Título (Opcional)
|
||||||
|
4 = Mensagem Variável por Título (Opcional)
|
||||||
|
5 = Mensagem Variável por Título (Opcional)
|
||||||
|
6 = Mensagem Variável por Título (Opcional)
|
||||||
|
7 = Mensagem Variável por Título (Opcional)
|
||||||
|
9 = Trailler
|
||||||
|
</description>
|
||||||
|
</layout>
|
||||||
|
<GroupOfRecords>
|
||||||
|
<Record name="Header" description="Protocolo de comunicação" repeatable="true">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" length="1" value="0" position="1" />
|
||||||
|
<Field name="IdentificacaoRemessa" length="1" value="1" />
|
||||||
|
<Field name="LiteralRemessa" length="7" value="REMESSA" />
|
||||||
|
<Field name="CodigoDeServico" length="2" value="01" />
|
||||||
|
<Field name="LiteralServico" length="15" value="COBRANCA" />
|
||||||
|
<Field name="CodigoTransmissao" length="20" type="INTEGER" />
|
||||||
|
<Field name="NomeCedente" length="30" type="CHARACTER" />
|
||||||
|
<Field name="CodigoBanco" length="3" value="033" />
|
||||||
|
<Field name="NomeBanco" length="15" value="SANTANDER" />
|
||||||
|
<Field name="DataGravacao" length="6" type="DATE" format="DATE_DDMMYY" />
|
||||||
|
<Field name="Zeros" length="16" value="00" />
|
||||||
|
<Field name="Brancos" length="274" blankAccepted="true" /><!--Enviar 274 Brancos -->
|
||||||
|
<Field name="NumeroVersao" length="3" blankAccepted="true" /><!--Opcional -->
|
||||||
|
<Field name="NumeroSequencialRegistro" length="6" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
<Record name="TransacaoTitulo" repeatable="true">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" length="1" position="1" value="1"/>
|
||||||
|
<Field name="TipoInscricao" length="2" type="INTEGER" />
|
||||||
|
<Field name="NumeroInscricao" length="14" type="INTEGER" /><!-- CNPJ EMPRESA -->
|
||||||
|
<Field name="CodigoTransmissao" length="20" type="INTEGER" />
|
||||||
|
<Field name="NumControleParticipante" length="25" type="CHARACTER" />
|
||||||
|
<Field name="NossoNumero" length="8" type="INTEGER" />
|
||||||
|
<Field name="DataSegundoDesconto" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Brancos1" length="1" type="CHARACTER" blankAccepted="true" /><!--Enviar 1 Brancos -->
|
||||||
|
<Field name="MultaInformacao" length="1" type="INTEGER" />
|
||||||
|
<Field name="MultaPercentual" length="4" type="CHARACTER" />
|
||||||
|
<Field name="UnidadeMoeda" length="2" type="INTEGER" value="00" />
|
||||||
|
<Field name="ValorTitulo" length="13" type="INTEGER" />
|
||||||
|
<Field name="Brancos2" length="4" type="CHARACTER" blankAccepted="true" /><!--Enviar 4 Brancos -->
|
||||||
|
<Field name="MultaDataCobranca" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="CodigoCarteira" length="1" type="INTEGER" />
|
||||||
|
<Field name="CodigoDeOcorrencia" length="2" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NumeroDoDocumento" length="10" type="CHARACTER" />
|
||||||
|
<Field name="DataVencimento" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Valor" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="CodigoBanco" length="3" type="INTEGER" value="033"/>
|
||||||
|
<Field name="Agencia" length="5" type="INTEGER" padding="ZERO_LEFT" /> <!--Opcional Default 00000 -->
|
||||||
|
<Field name="EspecieDeTitulo" length="2" type="CHARACTER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Aceite" length="1" type="CHARACTER" value="N" /><!-- A = Aceite N = Não Aceite -->
|
||||||
|
<Field name="Emissao" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Instrucao1" length="2" type="CHARACTER" />
|
||||||
|
<Field name="Instrucao2" length="2" type="CHARACTER" />
|
||||||
|
<Field name="JurosDeMora" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DataLimiteDesconto" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DescontoConcedido" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="IOF_Devido" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="AbatimentoConcedido" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="TipoInscricaoSacado" length="2" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NumeroInscricaoSacado" length="14" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NomeSacado" length="40" type="CHARACTER" />
|
||||||
|
<Field name="EnderecoSacado" length="40" type="CHARACTER" />
|
||||||
|
<Field name="BairroSacado" length="12" type="CHARACTER" />
|
||||||
|
<Field name="CepSacado" length="5" type="INTEGER" />
|
||||||
|
<Field name="ComplementoCepSacado" length="3" type="INTEGER" />
|
||||||
|
<Field name="Cidade" length="15" type="CHARACTER" />
|
||||||
|
<Field name="Estado" length="2" type="CHARACTER" />
|
||||||
|
<Field name="SacadorAvalista" length="30" type="CHARACTER" />
|
||||||
|
<Field name="Brancos3" length="1" type="CHARACTER" blankAccepted="true" /><!--Enviar 1 Brancos -->
|
||||||
|
<Field name="IdentificadorComplemento" length="1" type="CHARACTER" />
|
||||||
|
<Field name="Complemento" length="2" type="INTEGER" />
|
||||||
|
<Field name="Brancos4" length="6" type="CHARACTER" blankAccepted="true" /><!--Enviar 6 Branco -->
|
||||||
|
<Field name="NumeroDiasProtesto" length="2" type="INTEGER" /><!--Quando tiver registro no instrução -->
|
||||||
|
<Field name="Brancos5" length="1" type="CHARACTER" blankAccepted="true" /><!--Enviar 1 Brancos -->
|
||||||
|
<Field name="NumeroSequencialRegistro" length="6" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
<Record name="Trailler">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" length="1" value="9" position="1" />
|
||||||
|
<Field name="QuantidadeRegistro" length="6" type="INTEGER" />
|
||||||
|
<Field name="DescontoConcedido" length="13" type="BIGDECIMAL" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Filler" length="374" />
|
||||||
|
<Field name="NumeroSequencialRegistro" length="6" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
</GroupOfRecords>
|
||||||
|
</FlatFile>
|
||||||
|
|
||||||
|
</txg:Texgit>
|
|
@ -0,0 +1,131 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<txg:Texgit xmlns:txg="http://gilmatryx.googlepages.com/Texgit"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://gilmatryx.googlepages.com/Texgit file:////home/gilmar/NFM/WORKSPACE/TexgitSchema.xsd"
|
||||||
|
version="1.0-academic">
|
||||||
|
|
||||||
|
<FlatFile>
|
||||||
|
<layout>
|
||||||
|
<name>Arquivo-Retorno_ItauCNAB400</name>
|
||||||
|
<version>Version 01, Published: 2012/05/25</version>
|
||||||
|
<description>
|
||||||
|
Layout para Cobrança.
|
||||||
|
|
||||||
|
Arquivo texto - padrão CNAB
|
||||||
|
Meio de Registro Transmissão de Dados
|
||||||
|
Descrição de Registro - Tamanho 400 Bytes
|
||||||
|
Organização Sequencial
|
||||||
|
|
||||||
|
ARQUIVO FORMATO CNAB RETORNO, REGISTROS:
|
||||||
|
|
||||||
|
0 - Header Label
|
||||||
|
1 - Cobrança - Transação
|
||||||
|
3 - Rateio de Crédito (opcional)
|
||||||
|
9 - Trailler (Papel de finalizador de lote e totalizador)
|
||||||
|
</description>
|
||||||
|
</layout>
|
||||||
|
<GroupOfRecords>
|
||||||
|
<Record name="Header" description="Protocolo de comunicação">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" value="0" length="1" position="1" />
|
||||||
|
<Field name="IdentificacaoRetorno" value="2" length="1" />
|
||||||
|
<Field name="LiteralRetorno" value="RETORNO" length="7" />
|
||||||
|
<Field name="CodigoDeServico" value="01" length="2" />
|
||||||
|
<Field name="LiteralServico" value="COBRANCA" length="15" />
|
||||||
|
<Field name="Agencia" length="04" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Zeros" length="02" value="00" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Conta" length="05" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DacConta" length="01" type="INTEGER" />
|
||||||
|
<Field name="Brancos1" type="STRING" length="08" blankAccepted="true" />
|
||||||
|
<Field name="NomeDaEmpresa" length="30" />
|
||||||
|
<Field name="CodigoCompensacao" value="341" length="3" />
|
||||||
|
<Field name="NomeBanco" value="BANCO ITAU SA" length="15" />
|
||||||
|
<Field name="DataGravacaoArquivo" length="6" type="DATE" format="DATE_DDMMYY" />
|
||||||
|
<Field name="Densidade" value="00000" length="5" />
|
||||||
|
<Field name="UnidadeDensidade" value="BPI" length="3" />
|
||||||
|
<Field name="NumeroSequencialRetorno" type="INTEGER" length="5" />
|
||||||
|
<Field name="DataDoCredito" length="6" type="DATE" format="DATE_DDMMYY" />
|
||||||
|
<Field name="Brancos1" type="STRING" length="275" />
|
||||||
|
<Field name="NumeroSequencialRegistro" type="INTEGER" length="6" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
<Record name="TransacaoTitulo" repeatable="true">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" value="1" length="1" position="1" />
|
||||||
|
<Field name="CodigoInscricao" length="02" value = "02" /><!-- 01 = CPF 02 = CNPJ -->
|
||||||
|
<Field name="NumeroControleDoParticipante" type="STRING" length="14" />
|
||||||
|
<Field name="Agencia" length="4" type="INTEGER" />
|
||||||
|
<Field name="Zeros" length="2" value="00" />
|
||||||
|
<Field name="Conta" length="5" type="INTEGER" />
|
||||||
|
<Field name="DacConta" length="1" type="INTEGER" />
|
||||||
|
<Field name="Brancos1" length="8" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="UsoDaEmpresa" length="25" type="STRING" />
|
||||||
|
<Field name="NossoNumero" length="08" type="INTEGER" />
|
||||||
|
<Field name="Brancos2" length="12" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="NumCarteira" length="3" type="INTEGER" />
|
||||||
|
<Field name="NossoNumeroComDigito" length="08" type="INTEGER" />
|
||||||
|
<Field name="DacNossoNumero" length="1" type="INTEGER" />
|
||||||
|
<Field name="Brancos3" length="13" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="CodCarteira" length="1" type="CHARACTER" value="I" />
|
||||||
|
<Field name="CodigoDeOcorrencia" length="2" type="INTEGER" value="0" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DataDaOcorrencia" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NumeroDoDocumento" length="10" />
|
||||||
|
<Field name="NossoNumeroComDigito-Repetido" length="8" />
|
||||||
|
<Field name="Brancos4" length="12" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="Vencimento" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Valor" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="CodigoCompensacaoBancoRecebedor" value="0" length="3" padding="ZERO_LEFT" />
|
||||||
|
<Field name="PrefixoDaAgenciaRecebedora" type="INTEGER" value="0" length="4" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DacDaAgenciaRecebedora" type="INTEGER" value="0" length="1" padding="ZERO_LEFT" />
|
||||||
|
<Field name="EspecieDeTitulo" length="2" />
|
||||||
|
<Field name="DespesasDeCobranca" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Brancos5" length="26" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="IOF_Devido" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="AbatimentoConcedido" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="DescontoConcedido" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="ValorPago" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="JurosDeMora" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="OutrosCreditos" type="BIGDECIMAL" length="13" value="0" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="BoletoDDA" type="CHARACTER" length="1" />
|
||||||
|
<Field name="Brancos6" length="2" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="DataDoCredito" length="6" type="DATE" format="DATE_DDMMYY" padding="ZERO_LEFT" blankAccepted="true" />
|
||||||
|
<Field name="CodInstrucaoCancelada" length="4" type="INTEGER" />
|
||||||
|
<Field name="Brancos7" length="6" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="Zeros" length="13" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NomeSacado" length="30" type="STRING" />
|
||||||
|
<Field name="Brancos8" length="23" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="CodAlegacaoDoSacado" length="8" type="STRING" />
|
||||||
|
<Field name="Brancos9" length="7" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="CodLiquidacao" length="02" padding="ZERO_LEFT" />
|
||||||
|
<Field name="NumeroSequencialRegistro" type="INTEGER" length="6" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
<Record name="Trailler">
|
||||||
|
<GroupOfFields>
|
||||||
|
<IdType name="IDReg" length="1" value="9" position="1" />
|
||||||
|
<Field name="CodigoRetorno" length="1" value="2" />
|
||||||
|
<Field name="CodigoServico" length="2" value="01"/>
|
||||||
|
<Field name="CodigoBanco" length="3" value="341" />
|
||||||
|
<Field name="Brancos" length="10" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="QtdTitulosCobSimples" length="8" type="INTEGER" />
|
||||||
|
<Field name="VlrTotalCobSimples" type="BIGDECIMAL" length="14" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="AvisoBancarioCobSimples" type="STRING" length="08"/>
|
||||||
|
<Field name="Brancos" length="10" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="QtdTitulosCobVinculada" length="8" type="INTEGER" />
|
||||||
|
<Field name="VlrTotalCobVinculada" type="BIGDECIMAL" length="14" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="AvisoBancarioCobVinculada" type="STRING" length="08"/>
|
||||||
|
<Field name="Brancos" length="90" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="QtdTitulosCobEscritural" length="8" type="INTEGER" />
|
||||||
|
<Field name="VlrTotalCobEscritural" type="BIGDECIMAL" length="14" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="AvisoBancarioCobEscrituraL" type="STRING" length="08"/>
|
||||||
|
<Field name="NumSeqRetorno" length="5" type="INTEGER" padding="ZERO_LEFT" />
|
||||||
|
<Field name="QtdRegDetalhe" type="INTEGER" length="8" padding="ZERO_LEFT" />
|
||||||
|
<Field name="ValTotArquivo" type="BIGDECIMAL" length="14" format="DECIMAL_DD" padding="ZERO_LEFT" />
|
||||||
|
<Field name="Brancos" length="160" type="STRING" blankAccepted="true" />
|
||||||
|
<Field name="NumeroSequencialRegistro" type="INTEGER" length="6" padding="ZERO_LEFT" />
|
||||||
|
</GroupOfFields>
|
||||||
|
</Record>
|
||||||
|
</GroupOfRecords>
|
||||||
|
</FlatFile>
|
||||||
|
|
||||||
|
</txg:Texgit>
|
Loading…
Reference in New Issue