fixes bug#21109

qua:
dev:

Observações.

1 - Ativar o custom no cliente isReceitasDespesasOuroPrata = 1

2 - Explicar ao cliente:

Em relação aos eventos COMISSAO  e  TOTAL A DEPOSITAR, o arquivo BGM importa os valores diariamente, não trabalha com histórico de valores para realização de abatimento.
Exemplo: Se no dia 01 houver uma comissao negativa, mas o cliente importar o arquivo BGM apenas do dia 02, o sistema não consegue realizar essa lógica, pois como foi dito, o arquivo é do caixa do dia.
O Globus trabalha apenas com o Tipo Receita x Despesa.
Entendo que esse controle deve ser feito no sistema fiscal do cliente.

3 - Em relação aos eventos extras já existentes.
Peço que solicite o cliente alguns exemplos para podermos verificar e ajustar, como as informaçoes são agrupadas(totalizadas), essa distinção se torna bem criteriosa.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@105436 d1611594-4594-4d17-8e1d-87c2c4800839
master
walace 2021-02-23 13:25:27 +00:00
parent eec6e2e97b
commit 84ad19c695
1 changed files with 19 additions and 15 deletions

View File

@ -217,9 +217,9 @@ public class Totalbus {
receita.setDataLancamento(rs.getDate(10)); receita.setDataLancamento(rs.getDate(10));
receita.setDataMovimento(rs.getDate(10)); receita.setDataMovimento(rs.getDate(10));
receita.setLocalArrecadacao(rs.getString(7)); receita.setLocalArrecadacao(rs.getString(7));
if (rs.getBigDecimal(1).signum() == -1) { if (rs.getBigDecimal(1).signum() == 1) {
receita.setIdentificadorReceitaDespesa("D"); receita.setIdentificadorReceitaDespesa("D");
receita.setValorLancamento(df.format(rs.getBigDecimal(1).multiply(new BigDecimal(-1)))); receita.setValorLancamento(df.format(rs.getBigDecimal(1)));
} else { } else {
receita.setIdentificadorReceitaDespesa("R"); receita.setIdentificadorReceitaDespesa("R");
receita.setValorLancamento(df.format(rs.getBigDecimal(1))); receita.setValorLancamento(df.format(rs.getBigDecimal(1)));
@ -289,7 +289,7 @@ public class Totalbus {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyy"); SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy");
String fechaStr = sf.format(fechaParam); String fechaStr = sf.format(fechaParam);
if (fechaParam == null) { if (fechaParam == null) {
fechaStr = sf.format(getData()); fechaStr = sf.format(getData());
@ -339,8 +339,6 @@ public class Totalbus {
rs = stmt.executeQuery(); rs = stmt.executeQuery();
BigDecimal valorAcumulado = BigDecimal.ZERO;
while (rs.next()) { while (rs.next()) {
DespesaReceita receita = new DespesaReceita(); DespesaReceita receita = new DespesaReceita();
receita.setCodigoEmpresa(rs.getInt(4)); receita.setCodigoEmpresa(rs.getInt(4));
@ -348,21 +346,27 @@ public class Totalbus {
receita.setDataLancamento(rs.getDate(7)); receita.setDataLancamento(rs.getDate(7));
receita.setDataMovimento(rs.getDate(7)); receita.setDataMovimento(rs.getDate(7));
receita.setLocalArrecadacao(rs.getString(6)); receita.setLocalArrecadacao(rs.getString(6));
if (rs.getBigDecimal(1).signum() == -1) { if(rs.getString(3) != null) {
receita.setIdentificadorReceitaDespesa("R"); if(rs.getString(3).equalsIgnoreCase("COMISSAO")) {
valorAcumulado = valorAcumulado.add((rs.getBigDecimal(4).multiply(new BigDecimal(-1)))); if (rs.getBigDecimal(1).signum() == 1) {
receita.setValorLancamento(df.format(valorAcumulado)); receita.setIdentificadorReceitaDespesa("D");
} else { } else {
receita.setIdentificadorReceitaDespesa("D"); receita.setIdentificadorReceitaDespesa("R");
receita.setValorLancamento(df.format(rs.getBigDecimal(1))); }
}else if(rs.getString(3).equalsIgnoreCase("LQ")) {
if (rs.getBigDecimal(1).signum() == 1) {
receita.setIdentificadorReceitaDespesa("D");
} else {
receita.setIdentificadorReceitaDespesa("R");
}
}
} }
receita.setValorLancamento(df.format(rs.getBigDecimal(1)));
receita.setDescricaoDetalhada(""); receita.setDescricaoDetalhada("");
if (incluiTipoPagamentoTurismoBGM) { if (incluiTipoPagamentoTurismoBGM) {
receita.setTipoPagamentoTurismo(rs.getString("tipoeventoextra_id")); receita.setTipoPagamentoTurismo(rs.getString("tipoeventoextra_id"));
} }
receita.setFormaPagamentoId(rs.getString(2).equals("CREDITO") ? "2" : "3"); receita.setFormaPagamentoId("1");
despesas.add(receita); despesas.add(receita);
} }
} catch (Exception e) { } catch (Exception e) {