fixes bug#24733

dev: Wallace
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@113560 d1611594-4594-4d17-8e1d-87c2c4800839
master
fabio 2022-07-28 13:15:39 +00:00
parent 288c0b72fe
commit 6a333e7692
5 changed files with 60 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.rjconsultores.ventaboletos.ArquivoRemessa; import com.rjconsultores.ventaboletos.ArquivoRemessa;
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto; import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
@ -34,5 +35,6 @@ public interface RemessaCNABBancosDAO extends GenericDAO<FechamentoBoleto, Long>
public FechamentoBoleto obtenerFechamentoBoletoPorNossoNumero(String nossoNumero, Integer empresaId); public FechamentoBoleto obtenerFechamentoBoletoPorNossoNumero(String nossoNumero, Integer empresaId);
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException; public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException;
} }

View File

@ -28,6 +28,7 @@ import com.rjconsultores.ventaboletos.ArquivoRemessa;
import com.rjconsultores.ventaboletos.ArquivoRemessaItem; import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
import com.rjconsultores.ventaboletos.ArquivoRemessaItemInteface; import com.rjconsultores.ventaboletos.ArquivoRemessaItemInteface;
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio; import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao; import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
import com.rjconsultores.ventaboletos.blocos.bancobrasil.ArquivoRemessaBancoBrasil; import com.rjconsultores.ventaboletos.blocos.bancobrasil.ArquivoRemessaBancoBrasil;
import com.rjconsultores.ventaboletos.blocos.bancobrasil.CabecalhoLoteRemessaBancoBrasil; import com.rjconsultores.ventaboletos.blocos.bancobrasil.CabecalhoLoteRemessaBancoBrasil;
@ -1719,7 +1720,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
} }
@Override @Override
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException { public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
Connection con = getSession().connection(); Connection con = getSession().connection();
@ -1730,6 +1731,14 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
qry.append(" update FECHAMENTO_BOLETO set INDBOLETOQUITADO = 1, "); qry.append(" update FECHAMENTO_BOLETO set INDBOLETOQUITADO = 1, ");
qry.append(" FECMODIF = SYSDATE, "); qry.append(" FECMODIF = SYSDATE, ");
qry.append(" USUARIO_ID_QUITA = ").append(usuarioId); qry.append(" USUARIO_ID_QUITA = ").append(usuarioId);
qry.append(" , FECBAIXA = sysdate ");
if( detalhe.getValorJuros() != null) {
qry.append(" , VALOR_JUROS = ").append(detalhe.getValorJuros());
}else {
qry.append(" , VALOR_JUROS = 0 ");
}
qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId); qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId);
qry.append(" AND ACTIVO = 1 "); qry.append(" AND ACTIVO = 1 ");

View File

@ -42,9 +42,16 @@ public class FechamentoBoleto implements java.io.Serializable{
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date fecvencimento; private Date fecvencimento;
@Column(name = "FECBAIXA", length = 7)
@Temporal(TemporalType.TIMESTAMP)
private Date fecbaixa;
@Column(name = "VALORDOCUMENTO") @Column(name = "VALORDOCUMENTO")
private BigDecimal valordocumento; private BigDecimal valordocumento;
@Column(name = "VALOR_JUROS")
private BigDecimal valorjuros;
@Column(name = "DESCONTOS") @Column(name = "DESCONTOS")
private BigDecimal descontos; private BigDecimal descontos;
@ -91,6 +98,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Long getFechamentoboletoId() { public Long getFechamentoboletoId() {
return fechamentoboletoId; return fechamentoboletoId;
} }
public void setFechamentoboletoId(Long fechamentoboletoId) { public void setFechamentoboletoId(Long fechamentoboletoId) {
this.fechamentoboletoId = fechamentoboletoId; this.fechamentoboletoId = fechamentoboletoId;
} }
@ -98,6 +106,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public FechamentoCntcorrente getFechamentoCntcorrente() { public FechamentoCntcorrente getFechamentoCntcorrente() {
return fechamentoCntcorrente; return fechamentoCntcorrente;
} }
public void setFechamentoCntcorrente(FechamentoCntcorrente fechamentoCntcorrente) { public void setFechamentoCntcorrente(FechamentoCntcorrente fechamentoCntcorrente) {
this.fechamentoCntcorrente = fechamentoCntcorrente; this.fechamentoCntcorrente = fechamentoCntcorrente;
} }
@ -105,6 +114,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public String getNossonumero() { public String getNossonumero() {
return nossonumero; return nossonumero;
} }
public void setNossonumero(String nossonumero) { public void setNossonumero(String nossonumero) {
this.nossonumero = nossonumero; this.nossonumero = nossonumero;
} }
@ -112,6 +122,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Date getFecdocumento() { public Date getFecdocumento() {
return fecdocumento; return fecdocumento;
} }
public void setFecdocumento(Date fecdocumento) { public void setFecdocumento(Date fecdocumento) {
this.fecdocumento = fecdocumento; this.fecdocumento = fecdocumento;
} }
@ -119,6 +130,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Date getFecvencimento() { public Date getFecvencimento() {
return fecvencimento; return fecvencimento;
} }
public void setFecvencimento(Date fecvencimento) { public void setFecvencimento(Date fecvencimento) {
this.fecvencimento = fecvencimento; this.fecvencimento = fecvencimento;
} }
@ -126,6 +138,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getValordocumento() { public BigDecimal getValordocumento() {
return valordocumento; return valordocumento;
} }
public void setValordocumento(BigDecimal valordocumento) { public void setValordocumento(BigDecimal valordocumento) {
this.valordocumento = valordocumento; this.valordocumento = valordocumento;
} }
@ -133,6 +146,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getDescontos() { public BigDecimal getDescontos() {
return descontos; return descontos;
} }
public void setDescontos(BigDecimal descontos) { public void setDescontos(BigDecimal descontos) {
this.descontos = descontos; this.descontos = descontos;
} }
@ -140,6 +154,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getDeducoes() { public BigDecimal getDeducoes() {
return deducoes; return deducoes;
} }
public void setDeducoes(BigDecimal deducoes) { public void setDeducoes(BigDecimal deducoes) {
this.deducoes = deducoes; this.deducoes = deducoes;
} }
@ -147,6 +162,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getMora() { public BigDecimal getMora() {
return mora; return mora;
} }
public void setMora(BigDecimal mora) { public void setMora(BigDecimal mora) {
this.mora = mora; this.mora = mora;
} }
@ -154,6 +170,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getAcrescimos() { public BigDecimal getAcrescimos() {
return acrescimos; return acrescimos;
} }
public void setAcrescimos(BigDecimal acrescimos) { public void setAcrescimos(BigDecimal acrescimos) {
this.acrescimos = acrescimos; this.acrescimos = acrescimos;
} }
@ -161,6 +178,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public BigDecimal getValorCobrado() { public BigDecimal getValorCobrado() {
return valorCobrado; return valorCobrado;
} }
public void setValorCobrado(BigDecimal valorCobrado) { public void setValorCobrado(BigDecimal valorCobrado) {
this.valorCobrado = valorCobrado; this.valorCobrado = valorCobrado;
} }
@ -168,6 +186,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Date getFecmodif() { public Date getFecmodif() {
return fecmodif; return fecmodif;
} }
public void setFecmodif(Date fecmodif) { public void setFecmodif(Date fecmodif) {
this.fecmodif = fecmodif; this.fecmodif = fecmodif;
} }
@ -175,6 +194,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Integer getUsuarioId() { public Integer getUsuarioId() {
return usuarioId; return usuarioId;
} }
public void setUsuarioId(Integer usuarioId) { public void setUsuarioId(Integer usuarioId) {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@ -182,6 +202,7 @@ public class FechamentoBoleto implements java.io.Serializable{
public Boolean getActivo() { public Boolean getActivo() {
return activo; return activo;
} }
public void setActivo(Boolean activo) { public void setActivo(Boolean activo) {
this.activo = activo; this.activo = activo;
} }
@ -189,36 +210,47 @@ public class FechamentoBoleto implements java.io.Serializable{
public String getStatus() { public String getStatus() {
return status; return status;
} }
public void setStatus(String status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
public Long getRemessaId() { public Long getRemessaId() {
return remessaId; return remessaId;
} }
public void setRemessaId(Long remessaId) { public void setRemessaId(Long remessaId) {
this.remessaId = remessaId; this.remessaId = remessaId;
} }
public BigDecimal getPorcentagemMulta() { public BigDecimal getPorcentagemMulta() {
return porcentagemMulta; return porcentagemMulta;
} }
public void setPorcentagemMulta(BigDecimal porcentagemMulta) { public void setPorcentagemMulta(BigDecimal porcentagemMulta) {
this.porcentagemMulta = porcentagemMulta; this.porcentagemMulta = porcentagemMulta;
} }
public BigDecimal getPorcentagemMora() { public BigDecimal getPorcentagemMora() {
return porcentagemMora; return porcentagemMora;
} }
public void setPorcentagemMora(BigDecimal porcentagemMora) { public void setPorcentagemMora(BigDecimal porcentagemMora) {
this.porcentagemMora = porcentagemMora; this.porcentagemMora = porcentagemMora;
} }
public Boolean getIndBoletoQuitado() { public Boolean getIndBoletoQuitado() {
return indBoletoQuitado; return indBoletoQuitado;
} }
public void setIndBoletoQuitado(Boolean indBoletoQuitado) { public void setIndBoletoQuitado(Boolean indBoletoQuitado) {
this.indBoletoQuitado = indBoletoQuitado; this.indBoletoQuitado = indBoletoQuitado;
} }
public Integer getUsuarioQuitacao() { public Integer getUsuarioQuitacao() {
return usuarioQuitacao; return usuarioQuitacao;
} }
public void setUsuarioQuitacao(Integer usuarioQuitacao) { public void setUsuarioQuitacao(Integer usuarioQuitacao) {
this.usuarioQuitacao = usuarioQuitacao; this.usuarioQuitacao = usuarioQuitacao;
} }

View File

@ -4,6 +4,7 @@ import java.io.BufferedReader;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.sql.SQLException; import java.sql.SQLException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -134,6 +135,7 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
if(linha.startsWith("1")) { //detalhe if(linha.startsWith("1")) { //detalhe
DetalheRetornoItau detalhe = new DetalheRetornoItau(); DetalheRetornoItau detalhe = new DetalheRetornoItau();
detalhe.setCodigoOcorrencia(linha.substring(108, 110)); detalhe.setCodigoOcorrencia(linha.substring(108, 110));
detalhe.setValorJuros( new BigDecimal(linha.substring(263, 279)).divide(new BigDecimal(100)) );
detalhe.setNossoNumero(linha.substring(85, 93)+"-"+linha.substring(93, 94)); detalhe.setNossoNumero(linha.substring(85, 93)+"-"+linha.substring(93, 94));
arquivo.addTitulo(detalhe); arquivo.addTitulo(detalhe);
continue; continue;
@ -163,7 +165,7 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
throw new RuntimeException("Boleto já quitado para a empresa com o nosso numero: "+detalhe.getNossoNumero()); throw new RuntimeException("Boleto já quitado para a empresa com o nosso numero: "+detalhe.getNossoNumero());
} }
return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId ); return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId, detalhe );
} }

View File

@ -207,6 +207,16 @@ public final class DateUtil {
return d; return d;
} }
public static java.sql.Timestamp getTimestampFromString(String data, String formato) throws java.text.ParseException {
Date d = new Date();
DateFormat df = new SimpleDateFormat(formato);
d = df.parse(data);
return new java.sql.Timestamp(d.getTime());
}
public static int compareDate(java.util.Date d1) { public static int compareDate(java.util.Date d1) {
return compareDate(d1, new java.util.Date()); return compareDate(d1, new java.util.Date());
} }