Totvs - WS Fornecedor / WS Cliente / WS Pedido Compra (fixes bug #6127)

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@43048 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2015-04-13 14:32:53 +00:00
parent 851b6786c2
commit 0af7419a69
2 changed files with 36 additions and 25 deletions

View File

@ -101,6 +101,7 @@ import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
import com.rjconsultores.ventaboletos.service.UsuarioBancarioService; import com.rjconsultores.ventaboletos.service.UsuarioBancarioService;
import com.rjconsultores.ventaboletos.service.UsuarioService; import com.rjconsultores.ventaboletos.service.UsuarioService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.FechamentoParamptovtaListItemRenderer; import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.FechamentoParamptovtaListItemRenderer;
@ -307,6 +308,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Checkbox ckIsento; private Checkbox ckIsento;
private MyTextbox txtNumIEPuntoVenta; private MyTextbox txtNumIEPuntoVenta;
private Datebox fecIntegracion; private Datebox fecIntegracion;
private boolean integracionTotvs;
public static final int INTERVALO_FECHAMENTO_SEMANAL = 7; public static final int INTERVALO_FECHAMENTO_SEMANAL = 7;
public static final int INTERVALO_FECHAMENTO_DECENDIAL = 10; public static final int INTERVALO_FECHAMENTO_DECENDIAL = 10;
@ -805,40 +807,38 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
dateInicio = DateUtil.inicioFecha(dateInicio); dateInicio = DateUtil.inicioFecha(dateInicio);
Date dateFim = DateUtil.fimFecha(fecIntegracion.getValue()); Date dateFim = DateUtil.fimFecha(fecIntegracion.getValue());
log.info("puntoVentaId="+puntoVenta.getPuntoventaId()+";fecInicio="+dateInicio+";fecFin="+dateFim); log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
TotvsService.cadastrarTituloAReceber(puntoVenta.getPuntoventaId(), dateInicio, dateFim, myConn); TotvsService.cadastrarTituloAReceber(puntoVenta.getPuntoventaId(), dateInicio, dateFim, myConn);
myConn.commit(); myConn.commit();
} catch (Exception e) { } catch (Exception e) {
if (myConn != null) { if (myConn != null) {
try { try {
myConn.rollback(); myConn.rollback();
} catch (SQLException e1) { } catch (SQLException e1) {
log.error("Erro rollback",e1); log.error("Erro rollback", e1);
} }
} }
if (e instanceof WrongValueException) {
if (e instanceof WrongValueException){ throw (WrongValueException) e;
throw (WrongValueException)e;
} }
log.error("", e); log.error("", e);
Messagebox.show( Messagebox.show(
e.getMessage(), e.getMessage(),
Labels.getLabel("editarPuntoVentaController.window.title"), Labels.getLabel("editarPuntoVentaController.window.title"),
Messagebox.OK, Messagebox.ERROR); Messagebox.OK, Messagebox.ERROR);
}finally{ } finally {
if (myConn != null){ if (myConn != null) {
try { try {
myConn.close(); myConn.close();
} catch (SQLException e) { } catch (SQLException e) {
log.error("Erro ao fechar a conexão",e); log.error("Erro ao fechar a conexão", e);
} }
} }
} }
@ -2530,4 +2530,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
this.radTotvsErro = radTotvsErro; this.radTotvsErro = radTotvsErro;
} }
public boolean isIntegracionTotvs() {
integracionTotvs = false;
if (ApplicationProperties.getInstance().integracionTotvs()) {
integracionTotvs = true;
}
return integracionTotvs;
}
public void setIntegracionTotvs(boolean integracionTotvs) {
this.integracionTotvs = integracionTotvs;
}
} }

View File

@ -95,8 +95,8 @@
value="@{winEditarPuntoVenta$composer.puntoVenta.numPuntoVenta}" /> value="@{winEditarPuntoVenta$composer.puntoVenta.numPuntoVenta}" />
</row> </row>
<row> <!-- Integracion TOTVS -->
<!-- Integracion TOTVS --> <row visible="@{winEditarPuntoVenta$composer.integracionTotvs}">
<label <label
value="${c:l('editarPuntoVentaController.label.totvs')}" /> value="${c:l('editarPuntoVentaController.label.totvs')}" />
<radiogroup Id="indIntegracion" > <radiogroup Id="indIntegracion" >