leonardo 2015-07-14 13:57:50 +00:00
parent f143b02ffb
commit 8daa9f51e3
4 changed files with 59 additions and 23 deletions

View File

@ -15,7 +15,6 @@ import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@ -134,7 +133,8 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderParadaPtoVtaChe
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtoVtaSeguro;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaCatInd;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaComissao;
import com.rjconsultores.ws.totvs.service.TotvsService;
import com.rjconsultores.ws.totvs.service.GeradorTitulosIntegracion;
import com.rjconsultores.ws.totvs.service.GerenciadorEnvioTitulosWS;
import com.rjconsultores.ws.utileria.RetornoTotvs.TipoRetorno;
/**
@ -871,9 +871,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
return getString;
}
public void onClick$btnIntegracao(Event ev) throws InterruptedException {
public void onClick$btnGeraTitulos(Event ev) throws InterruptedException {
Connection myConn = null;
GeradorTitulosIntegracion gerador;
try {
myConn = dataSource.getConnection();
Date dateInicio = fecIntegracion.getValue();
@ -883,15 +883,46 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
StringBuilder sb = TotvsService.integraTitulosPagarReceber(puntoVenta.getPuntoventaId(), myConn, dateInicio,
dateFim,checkTodosPuntosVenta.isChecked(), checkSimulaIntegracion.isChecked(),
checkDinheiro.isChecked(), checkCredito.isChecked(), checkDebito.isChecked(),
checkTF.isChecked(), checkBOL.isChecked());
gerador = new GeradorTitulosIntegracion(myConn, puntoVenta.getPuntoventaId(), dateInicio,
dateFim,checkTodosPuntosVenta.isChecked());
gerador.execute();
if (sb != null){
logResult.setText(sb.toString());
} catch (Exception e) {
log.error("Erro ao integrar",e);
if (e instanceof WrongValueException) {
throw (WrongValueException) e;
}
log.error("", e);
Messagebox.show(
e.getMessage(),
Labels.getLabel("editarPuntoVentaController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnIntegracao(Event ev) throws InterruptedException {
Connection myConn = null;
GeradorTitulosIntegracion gerador;
try {
myConn = dataSource.getConnection();
Date dateInicio = fecIntegracion.getValue();
dateInicio = DateUtil.inicioFecha(dateInicio);
Date dateFim = DateUtil.fimFecha(fecIntegracion.getValue());
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
GerenciadorEnvioTitulosWS gerenciadorWS = new GerenciadorEnvioTitulosWS(myConn, checkDinheiro.isChecked(),
checkCredito.isChecked(), checkDebito.isChecked(), checkTF.isChecked(), checkBOL.isChecked(),
checkSimulaIntegracion.isChecked());
gerenciadorWS.execute();
} catch (Exception e) {
log.error("Erro ao integrar",e);
@ -907,13 +938,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
Messagebox.OK, Messagebox.ERROR);
}finally {
if (myConn != null) {
try {
myConn.close();
} catch (SQLException e) {
log.error("Erro ao fechar a conexão", e);
}
}
// if (myConn != null) {
// try {
// myConn.close();
// } catch (SQLException e) {
// log.error("Erro ao fechar a conexão", e);
// }
// }
}
}

View File

@ -714,7 +714,8 @@ busquedaEmpresaController.btnPesquisa.label = Búsqueda
busquedaEmpresaController.lhId.label = ID
busquedaEmpresaController.lhDesc.label = Descripción
busquedaEmpresaController.txtNombre.label = Empresa
busquedaEmpresaController.btnIntegracao.tooltiptext=Executar
busquedaEmpresaController.btnIntegracao.tooltiptext=Enviar
busquedaEmpresaController.btnGeraTitulos.tooltiptext=Gerar Títulos
# Pantalla de Edición da empresa
editarEmpresaController.window.title = Empresa

View File

@ -751,7 +751,8 @@ busquedaEmpresaController.btnPesquisa.label = Pesquisa
busquedaEmpresaController.lhId.label = ID
busquedaEmpresaController.lhDesc.label = Descrição
busquedaEmpresaController.txtNombre.label = Empresa
busquedaEmpresaController.btnIntegracao.tooltiptext=Executar
busquedaEmpresaController.btnIntegracao.tooltiptext=Enviar
busquedaEmpresaController.btnGeraTitulos.tooltiptext=Gerar Títulos
# Pantalla de Edición da empresa
editarEmpresaController.window.title = Empresa

View File

@ -1425,8 +1425,11 @@
<toolbar>
<hbox spacing="5px" style="padding:1px"
align="right">
<button id="btnGeraTitulos"
height="20" label="${c:l('busquedaEmpresaController.btnGeraTitulos.tooltiptext')}"
tooltiptext="${c:l('busquedaEmpresaController.btnGeraTitulos.tooltiptext')}" />
<button id="btnIntegracao"
height="20" image="/gui/img/icon-active.gif" width="35px"
height="20" label="${c:l('busquedaEmpresaController.btnIntegracao.tooltiptext')}"
tooltiptext="${c:l('busquedaEmpresaController.btnIntegracao.tooltiptext')}" />
</hbox>
<hbox spacing="5px" style="padding:1px" align="right">