fixes bug#14565
dev:JULIO qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@94557 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a510c2ef27
commit
644549529c
|
@ -32,6 +32,8 @@ public class BGMApplication {
|
|||
|
||||
private boolean isReceitasDespesasComporte;
|
||||
|
||||
private boolean isCodReceitaFixoBgm;
|
||||
|
||||
private BGMApplication(){
|
||||
|
||||
}
|
||||
|
@ -72,6 +74,11 @@ public class BGMApplication {
|
|||
return props;
|
||||
}
|
||||
|
||||
public String executaExportacao(Date dataInicio, Date dataFinal, String diretorio, Integer empresaId, Integer puntoVentaId, Connection con,String pathGravacaoExternaArquivos, boolean incluiTipoPagamentoTurismoBGM, boolean isReceitasDespesasComporte,boolean isCodReceitaFixoBgm) throws IllegalArgumentException, IntegracaoReceitaDespesaException{
|
||||
this.isCodReceitaFixoBgm = isCodReceitaFixoBgm;
|
||||
return executaExportacao(dataInicio, dataFinal, diretorio, empresaId, puntoVentaId, con, pathGravacaoExternaArquivos, incluiTipoPagamentoTurismoBGM);
|
||||
}
|
||||
|
||||
public String executaExportacao(Date dataInicio, Date dataFinal, String diretorio, Integer empresaId, Integer puntoVentaId, Connection con,String pathGravacaoExternaArquivos, boolean incluiTipoPagamentoTurismoBGM, boolean isReceitasDespesasComporte) throws IllegalArgumentException, IntegracaoReceitaDespesaException{
|
||||
this.isReceitasDespesasComporte = isReceitasDespesasComporte;
|
||||
return executaExportacao(dataInicio, dataFinal, diretorio, empresaId, puntoVentaId, con, pathGravacaoExternaArquivos, incluiTipoPagamentoTurismoBGM);
|
||||
|
@ -85,7 +92,7 @@ public class BGMApplication {
|
|||
throw new IllegalArgumentException("o parâmetro puntoVentaId é obrigatório!");
|
||||
}
|
||||
excluirArquivosZip(diretorio);
|
||||
Totalbus totalbus = new Totalbus(con, isReceitasDespesasComporte);
|
||||
Totalbus totalbus = new Totalbus(con, isReceitasDespesasComporte,isCodReceitaFixoBgm);
|
||||
if (totalbus.isConstanteBloqueioMenorQueData(empresaId, dataFinal)){
|
||||
totalbus.updateDataBloqueio(empresaId, dataFinal);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ public class Totalbus {
|
|||
private List<PuntoVenta> pontosVenda = new ArrayList<PuntoVenta>();
|
||||
private List<Empresa> empresas = new ArrayList<Empresa>();
|
||||
|
||||
private Boolean isCodReceitaFixoBgm = false;
|
||||
|
||||
private Boolean isReceitasDespesasComporte = false;
|
||||
|
||||
private DecimalFormat df = new DecimalFormat("#0.00");
|
||||
|
@ -41,6 +43,14 @@ public class Totalbus {
|
|||
loadPuntosVenta();
|
||||
}
|
||||
|
||||
public Totalbus(Connection con, Boolean isReceitasDespesasComporte,Boolean isCodReceitaFixoBgm) {
|
||||
this.conn = con;
|
||||
this.isReceitasDespesasComporte = isReceitasDespesasComporte;
|
||||
this.isCodReceitaFixoBgm = isCodReceitaFixoBgm;
|
||||
loadEmpresas();
|
||||
loadPuntosVenta();
|
||||
}
|
||||
|
||||
public List<String> getDespesasReceitas(Integer puntoventaId, Integer empresaId, Date fechaParam, boolean incluiTipoPagamentoTurismoBGM) throws IntegracaoReceitaDespesaException{
|
||||
log.debug("gerando depósitos...");
|
||||
List<DespesaReceita> despesasReceitas = getDepositos(puntoventaId, empresaId, fechaParam, incluiTipoPagamentoTurismoBGM);
|
||||
|
@ -135,7 +145,11 @@ public class Totalbus {
|
|||
sb.append(" e.empresa_id AS empresa, ");
|
||||
sb.append(" pv.puntoventa_id AS puntoventaId, ");
|
||||
sb.append(" sum(cdp.importe) AS valor, ");
|
||||
if(isCodReceitaFixoBgm){
|
||||
sb.append(" case when cdp.formapago_id = 2 then 802 else 803 end, ");
|
||||
}else{
|
||||
sb.append(" tee.contacontabil AS contacontabil, ");
|
||||
}
|
||||
sb.append(" pv.numpuntoventa AS numpuntoventa, ");
|
||||
sb.append(" ev.tipoeventoextra_id, ");
|
||||
sb.append(" cdp.formapago_id as formapagoId ");
|
||||
|
@ -157,7 +171,11 @@ public class Totalbus {
|
|||
sb.append(" cd.feccorte, ");
|
||||
sb.append(" e.empresa_id, ");
|
||||
sb.append(" pv.puntoventa_id, ");
|
||||
if(isCodReceitaFixoBgm){
|
||||
sb.append(" case when cdp.formapago_id = 2 then 802 else 803 end, ");
|
||||
}else{
|
||||
sb.append(" tee.contacontabil, ");
|
||||
}
|
||||
sb.append(" pv.numpuntoventa, ev.tipoeventoextra_id, ");
|
||||
sb.append(" cdp.formapago_id ");
|
||||
|
||||
|
@ -371,7 +389,12 @@ public class Totalbus {
|
|||
receita.setIdentificadorReceitaDespesa("R");
|
||||
receita.setValorLancamento(df.format(rs.getBigDecimal(4)));
|
||||
}
|
||||
receita.setDescricaoDetalhada(rs.getString(7));
|
||||
|
||||
String desc =rs.getString(7);
|
||||
if(StringUtils.isNotBlank(desc) && desc.contains("\t")){
|
||||
desc = desc.replaceAll("\t", "");
|
||||
}
|
||||
receita.setDescricaoDetalhada(desc);
|
||||
if (incluiTipoPagamentoTurismoBGM) {
|
||||
receita.setTipoPagamentoTurismo(rs.getString("tipoeventoextra_id"));
|
||||
}
|
||||
|
@ -447,7 +470,11 @@ public class Totalbus {
|
|||
despesa.setLocalArrecadacao(rs.getString(3));
|
||||
despesa.setValorLancamento(df.format(rs.getBigDecimal(4).doubleValue() * -1));
|
||||
despesa.setIdentificadorReceitaDespesa("D");
|
||||
despesa.setDescricaoDetalhada(rs.getString(6));
|
||||
String desc =rs.getString(6);
|
||||
if(StringUtils.isNotBlank(desc) && desc.contains("\t")){
|
||||
desc = desc.replaceAll("\t", "");
|
||||
}
|
||||
despesa.setDescricaoDetalhada(desc);
|
||||
if (incluiTipoPagamentoTurismoBGM) {
|
||||
despesa.setTipoPagamentoTurismo(rs.getString("tipoeventoextra_id"));
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class DespesaReceita {
|
|||
}
|
||||
|
||||
public void setTipoPagamentoTurismo(String tipoPagamentoTurismo) {
|
||||
this.tipoPagamentoTurismo = StringUtils.leftPad(tipoPagamentoTurismo, 2, " ");
|
||||
this.tipoPagamentoTurismo = StringUtils.leftPad(StringUtils.isNotEmpty(tipoPagamentoTurismo) ? truncStr(tipoPagamentoTurismo, 2):tipoPagamentoTurismo, 2, " ");
|
||||
}
|
||||
|
||||
public String getFormaPagamentoId() {
|
||||
|
|
Loading…
Reference in New Issue