fixes bug#22155
dev: Wallace qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@106626 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
aaff5db051
commit
4020ad5086
|
@ -1,6 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Statement;
|
||||
import java.text.DateFormat;
|
||||
|
@ -113,7 +114,9 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
sb.append("pv.NUMDOCPUNTOVENTA AS \"numeroInscricaoPagador\", ");
|
||||
sb.append("pv.NOMBPUNTOVENTA AS \"nomePagador\", ");
|
||||
sb.append("pv.DIRECCIONCALLE || ', ' || pv.DIRECCIONNUMERO || ', ' || pl.NOMBPLAZA || ', ' || ci.NOMBCIUDAD || ', ' || es.NOMBESTADO AS \"enderecoCompletoPagador\", ");
|
||||
sb.append("pv.CODPOSTAL AS \"cepPagador\" ");
|
||||
sb.append("pv.CODPOSTAL AS \"cepPagador\", ");
|
||||
sb.append("fb.porc_mora AS \"porcentagemMora\", ");
|
||||
sb.append("fb.porc_multa AS \"porcentagemMulta\" ");
|
||||
|
||||
writeFROMClause(sb, dataDe != null && dataAte != null, reenviar);
|
||||
|
||||
|
@ -129,7 +132,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
ArquivoRemessa arquivoRemessa = new ArquivoRemessa(BancoLayout.BRADESCO_400_Envio);
|
||||
|
||||
String nomeArquivo = "CB" + new SimpleDateFormat("ddMM").format(new Date());
|
||||
int variavel = 0;
|
||||
int variavel = 0;
|
||||
|
||||
ArquivoRemessaItem arquivoRemessaItem = null;
|
||||
CabecalhoRemessaBradesco cabecalhoRemessaBradesco = null;
|
||||
|
@ -192,11 +195,12 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
detalhe.setVencimento((Date) tupla[9]);
|
||||
detalhe.setValor(new BigDecimal(tupla[10].toString().replaceAll(",", ".")));
|
||||
detalhe.setEmissao((Date) tupla[12]);
|
||||
detalhe.setPercentualMulta( (BigDecimal) tupla[24] );
|
||||
|
||||
if (!constanteValidacao) {
|
||||
detalhe.setEspecieDeTitulo("01");
|
||||
detalhe.setInstrucao1("00");
|
||||
detalhe.setInstrucao2("00");
|
||||
detalhe.setInstrucao2("00");
|
||||
}else {
|
||||
detalhe.setEspecieDeTitulo(tupla[11].toString());
|
||||
detalhe.setInstrucao1(tupla[13].toString());
|
||||
|
@ -211,8 +215,16 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
detalhe.setMensagem1("");
|
||||
|
||||
try{
|
||||
detalhe.setValorAtraso(new BigDecimal(tupla[15].toString().replaceAll(",", ".")));
|
||||
if( tupla[15] != null ) {
|
||||
detalhe.setValorAtraso(new BigDecimal(tupla[15].toString().replaceAll(",", ".")));
|
||||
}else if( tupla[23] != null ) {
|
||||
detalhe.setValorAtraso( calculaValorMora( (BigDecimal) tupla[23], new BigDecimal(tupla[10].toString().replaceAll(",", ".") )) );
|
||||
}else {
|
||||
detalhe.setValorAtraso( BigDecimal.ZERO );
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("Erro ao setar o valor de atraso do boleto "+tupla[0]+", favor entrar em contato com o suporte! ");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -1396,6 +1408,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
int count = 0;
|
||||
int seqRemessa = 0;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Connection con = getSession().connection();
|
||||
Statement stmt = con.createStatement();
|
||||
con.setAutoCommit(false);
|
||||
|
@ -1469,4 +1482,13 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
private BigDecimal calculaValorMora( BigDecimal mora, BigDecimal valor ) {
|
||||
if( mora != null && mora.compareTo(BigDecimal.ZERO) > 0 ) {
|
||||
BigDecimal valorMora = (valor.multiply(mora)).divide( new BigDecimal("100"));
|
||||
return valorMora.setScale(2, RoundingMode.HALF_UP);
|
||||
}else {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -76,6 +76,13 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
@Column(name = "REMESSA_ID")
|
||||
private Long remessaId;
|
||||
|
||||
@Column(name = "PORC_MULTA", precision = 5, scale = 2)
|
||||
private BigDecimal porcentagemMulta;
|
||||
|
||||
@Column(name = "PORC_MORA", precision = 5, scale = 2)
|
||||
private BigDecimal porcentagemMora;
|
||||
|
||||
|
||||
public Long getFechamentoboletoId() {
|
||||
return fechamentoboletoId;
|
||||
}
|
||||
|
@ -186,4 +193,16 @@ public class FechamentoBoleto implements java.io.Serializable{
|
|||
public void setRemessaId(Long remessaId) {
|
||||
this.remessaId = remessaId;
|
||||
}
|
||||
public BigDecimal getPorcentagemMulta() {
|
||||
return porcentagemMulta;
|
||||
}
|
||||
public void setPorcentagemMulta(BigDecimal porcentagemMulta) {
|
||||
this.porcentagemMulta = porcentagemMulta;
|
||||
}
|
||||
public BigDecimal getPorcentagemMora() {
|
||||
return porcentagemMora;
|
||||
}
|
||||
public void setPorcentagemMora(BigDecimal porcentagemMora) {
|
||||
this.porcentagemMora = porcentagemMora;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
@ -20,25 +21,72 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SequenceGenerator(name = "FECHAMENTO_PARAMGERAL_SEQ", sequenceName = "FECHAMENTO_PARAMGERAL_SEQ", allocationSize = 1)
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FECHAMENTO_PARAMGERAL_SEQ")
|
||||
@Column(name = "FECHAMENTOPARAMGERAL_ID", unique = true, nullable = false, precision = 15, scale = 0)
|
||||
private Long fechamentoparamgeralId;
|
||||
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
@ManyToOne
|
||||
private Empresa empresa;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_COD", length = 4)
|
||||
private String boletoBancoCod;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_AGENCIA", length = 10)
|
||||
private String boletoBancoAgencia;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_AGENCIA_DIGITO", length = 10)
|
||||
private String boletoBancoAgenciaDigito;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CONTA", length = 10)
|
||||
private String boletoBancoConta;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CONTA_DIGITO", length = 1)
|
||||
private String boletoBancoContaDigito;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CARTEIRA", length = 3)
|
||||
private String boletoBancoCarteira;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CARTEIRA_VARIAVEL", length = 3)
|
||||
private String boletoBancoCarteiraVariavel;
|
||||
|
||||
@Column(name = "BOLETO_DIAS_VENC", length = 3)
|
||||
private Integer boletoDiasVenc;
|
||||
|
||||
@Column(name = "BOLETO_JUROS", precision = 5, scale = 2)
|
||||
private BigDecimal boletoJuros;
|
||||
|
||||
@Column(name = "BOLETO_MULTA", precision = 5, scale = 2)
|
||||
private BigDecimal boletoMulta;
|
||||
|
||||
@Column(name = "COD_EMP_BANCO", precision = 7, scale = 0)
|
||||
private String codConvenio;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO", precision = 255)
|
||||
private String boletoBancoInstrucao;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO2", precision = 255)
|
||||
private String boletoBancoInstrucao2;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO3", precision = 255)
|
||||
private String boletoBancoInstrucao3;
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO_SACADO", precision = 255)
|
||||
private String boletoBancoInstrucaoSacado;
|
||||
|
||||
@Column(name = "COUNT_REMESSA", precision = 15, scale = 0)
|
||||
private Long countRemessa;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "FECMODIF", length = 7)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID", precision = 7, scale = 0)
|
||||
private Integer usuarioId;
|
||||
|
||||
@Column(name = "ACTIVO", precision = 1, scale = 0)
|
||||
private Boolean activo;
|
||||
|
||||
public FechamentoParamgeral() {
|
||||
|
@ -64,6 +112,37 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.activo = activo;
|
||||
}
|
||||
|
||||
public FechamentoParamgeral(Long fechamentoparamgeralId, Empresa empresa, String boletoBancoCod,
|
||||
String boletoBancoAgencia, String boletoBancoAgenciaDigito, String boletoBancoConta,
|
||||
String boletoBancoContaDigito, String boletoBancoCarteira, String boletoBancoCarteiraVariavel,
|
||||
Integer boletoDiasVenc, BigDecimal boletoJuros, BigDecimal boletoMulta,
|
||||
String codConvenio, String boletoBancoInstrucao, String boletoBancoInstrucao2,
|
||||
String boletoBancoInstrucao3, String boletoBancoInstrucaoSacado, Long countRemessa,
|
||||
Date fecmodif, Integer usuarioId, Boolean activo) {
|
||||
super();
|
||||
this.fechamentoparamgeralId = fechamentoparamgeralId;
|
||||
this.empresa = empresa;
|
||||
this.boletoBancoCod = boletoBancoCod;
|
||||
this.boletoBancoAgencia = boletoBancoAgencia;
|
||||
this.boletoBancoAgenciaDigito = boletoBancoAgenciaDigito;
|
||||
this.boletoBancoConta = boletoBancoConta;
|
||||
this.boletoBancoContaDigito = boletoBancoContaDigito;
|
||||
this.boletoBancoCarteira = boletoBancoCarteira;
|
||||
this.boletoBancoCarteiraVariavel = boletoBancoCarteiraVariavel;
|
||||
this.boletoDiasVenc = boletoDiasVenc;
|
||||
this.boletoJuros = boletoJuros;
|
||||
this.boletoMulta = boletoMulta;
|
||||
this.codConvenio = codConvenio;
|
||||
this.boletoBancoInstrucao = boletoBancoInstrucao;
|
||||
this.boletoBancoInstrucao2 = boletoBancoInstrucao2;
|
||||
this.boletoBancoInstrucao3 = boletoBancoInstrucao3;
|
||||
this.boletoBancoInstrucaoSacado = boletoBancoInstrucaoSacado;
|
||||
this.countRemessa = countRemessa;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public FechamentoParamgeral(Empresa empresa, String boletoBancoCod,
|
||||
String boletoBancoAgencia, String boletoBancoConta,
|
||||
String boletoBancoContaDigito, String boletoBancoCarteira,
|
||||
|
@ -82,10 +161,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.activo = true;
|
||||
}
|
||||
|
||||
@SequenceGenerator(name = "FECHAMENTO_PARAMGERAL_SEQ", sequenceName = "FECHAMENTO_PARAMGERAL_SEQ", allocationSize = 1)
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FECHAMENTO_PARAMGERAL_SEQ")
|
||||
@Column(name = "FECHAMENTOPARAMGERAL_ID", unique = true, nullable = false, precision = 15, scale = 0)
|
||||
public Long getFechamentoparamgeralId() {
|
||||
return fechamentoparamgeralId;
|
||||
}
|
||||
|
@ -93,97 +168,92 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.fechamentoparamgeralId = fechamentoparamgeralId;
|
||||
}
|
||||
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
@ManyToOne
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_COD", length = 4)
|
||||
|
||||
public String getBoletoBancoCod() {
|
||||
return boletoBancoCod;
|
||||
}
|
||||
|
||||
public void setBoletoBancoCod(String boletoBancoCod) {
|
||||
this.boletoBancoCod = boletoBancoCod;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_AGENCIA", length = 10)
|
||||
|
||||
public String getBoletoBancoAgencia() {
|
||||
return boletoBancoAgencia;
|
||||
}
|
||||
public void setBoletoBancoAgencia(String boletoBancoAgencia) {
|
||||
this.boletoBancoAgencia = boletoBancoAgencia;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_AGENCIA_DIGITO", length = 10)
|
||||
|
||||
public String getBoletoBancoAgenciaDigito() {
|
||||
return boletoBancoAgenciaDigito;
|
||||
}
|
||||
|
||||
public void setBoletoBancoAgenciaDigito(String boletoBancoAgenciaDigito) {
|
||||
this.boletoBancoAgenciaDigito = boletoBancoAgenciaDigito;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CONTA", length = 10)
|
||||
|
||||
public String getBoletoBancoConta() {
|
||||
return boletoBancoConta;
|
||||
}
|
||||
|
||||
public void setBoletoBancoConta(String boletoBancoConta) {
|
||||
this.boletoBancoConta = boletoBancoConta;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CONTA_DIGITO", length = 1)
|
||||
|
||||
public String getBoletoBancoContaDigito() {
|
||||
return boletoBancoContaDigito;
|
||||
}
|
||||
|
||||
public void setBoletoBancoContaDigito(String boletoBancoContaDigito) {
|
||||
this.boletoBancoContaDigito = boletoBancoContaDigito;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CARTEIRA", length = 3)
|
||||
|
||||
public String getBoletoBancoCarteira() {
|
||||
return boletoBancoCarteira;
|
||||
}
|
||||
|
||||
public void setBoletoBancoCarteira(String boletoBancoCarteira) {
|
||||
this.boletoBancoCarteira = boletoBancoCarteira;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_CARTEIRA_VARIAVEL", length = 3)
|
||||
|
||||
public String getBoletoBancoCarteiraVariavel() {
|
||||
return boletoBancoCarteiraVariavel;
|
||||
}
|
||||
|
||||
public void setBoletoBancoCarteiraVariavel(String boletoBancoCarteiraVariavel) {
|
||||
this.boletoBancoCarteiraVariavel = boletoBancoCarteiraVariavel;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_DIAS_VENC", length = 3)
|
||||
|
||||
public Integer getBoletoDiasVenc() {
|
||||
return boletoDiasVenc;
|
||||
}
|
||||
|
||||
public void setBoletoDiasVenc(Integer boletoDiasVenc) {
|
||||
this.boletoDiasVenc = boletoDiasVenc;
|
||||
}
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "FECMODIF", length = 7)
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
@Column(name = "USUARIO_ID", precision = 7, scale = 0)
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
@Column(name = "COD_EMP_BANCO", precision = 7, scale = 0)
|
||||
|
||||
public String getCodConvenio() {
|
||||
return codConvenio;
|
||||
}
|
||||
|
@ -192,7 +262,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.codConvenio = codConvenio;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO", precision = 255)
|
||||
public String getBoletoBancoInstrucao() {
|
||||
return boletoBancoInstrucao;
|
||||
}
|
||||
|
@ -201,7 +270,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.boletoBancoInstrucao = boletoBancoInstrucao;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO2", precision = 255)
|
||||
public String getBoletoBancoInstrucao2() {
|
||||
return boletoBancoInstrucao2;
|
||||
}
|
||||
|
@ -210,7 +278,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.boletoBancoInstrucao2 = boletoBancoInstrucao2;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO3", precision = 255)
|
||||
public String getBoletoBancoInstrucao3() {
|
||||
return boletoBancoInstrucao3;
|
||||
}
|
||||
|
@ -219,7 +286,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.boletoBancoInstrucao3 = boletoBancoInstrucao3;
|
||||
}
|
||||
|
||||
@Column(name = "BOLETO_BANCO_INSTRUCAO_SACADO", precision = 255)
|
||||
public String getBoletoBancoInstrucaoSacado() {
|
||||
return boletoBancoInstrucaoSacado;
|
||||
}
|
||||
|
@ -228,7 +294,6 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.boletoBancoInstrucaoSacado = boletoBancoInstrucaoSacado;
|
||||
}
|
||||
|
||||
@Column(name = "COUNT_REMESSA", precision = 15, scale = 0)
|
||||
public Long getCountRemessa() {
|
||||
return countRemessa;
|
||||
}
|
||||
|
@ -237,10 +302,26 @@ public class FechamentoParamgeral implements java.io.Serializable {
|
|||
this.countRemessa = countRemessa;
|
||||
}
|
||||
|
||||
@Column(name = "ACTIVO", precision = 1, scale = 0)
|
||||
public BigDecimal getBoletoJuros() {
|
||||
return boletoJuros.setScale(2);
|
||||
}
|
||||
|
||||
public void setBoletoJuros(BigDecimal boletoJuros) {
|
||||
this.boletoJuros = boletoJuros;
|
||||
}
|
||||
|
||||
public BigDecimal getBoletoMulta() {
|
||||
return boletoMulta.setScale(2);
|
||||
}
|
||||
|
||||
public void setBoletoMulta(BigDecimal boletoMulta) {
|
||||
this.boletoMulta = boletoMulta;
|
||||
}
|
||||
|
||||
public Boolean getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue