horário de verão e fuso horário configurado por UF.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@31327 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c52c7b1ed5
commit
3e71ee254f
|
@ -4,30 +4,36 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||
import com.rjconsultores.ventaboletos.service.PaisService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Grid;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Row;
|
||||
import org.zkoss.zul.Spinner;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||
import com.rjconsultores.ventaboletos.service.PaisService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,6 +57,25 @@ public class EditarEstadoController extends MyGenericForwardComposer {
|
|||
private Button btnApagar;
|
||||
private Row rowEquivalencia;
|
||||
|
||||
private Spinner tiempoHorHuso;
|
||||
|
||||
private Radio sim;
|
||||
private Radio nao;
|
||||
private Grid hv1;
|
||||
private Grid hv2;
|
||||
|
||||
public void onCheck$sv1(Event ev) throws InterruptedException {
|
||||
|
||||
if (sim.isChecked()) {
|
||||
hv1.setVisible(Boolean.TRUE);
|
||||
hv2.setVisible(Boolean.TRUE);
|
||||
}
|
||||
if (nao.isChecked()) {
|
||||
hv1.setVisible(Boolean.FALSE);
|
||||
hv2.setVisible(Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
public Estado getEstado() {
|
||||
return estado;
|
||||
}
|
||||
|
@ -78,6 +103,26 @@ public class EditarEstadoController extends MyGenericForwardComposer {
|
|||
|
||||
if (estado.getEstadoId() == null) {
|
||||
btnApagar.setVisible(Boolean.FALSE);
|
||||
|
||||
nao.setChecked(Boolean.TRUE);
|
||||
hv1.setVisible(Boolean.FALSE);
|
||||
hv2.setVisible(Boolean.FALSE);
|
||||
|
||||
} else {
|
||||
try {
|
||||
tiempoHorHuso.setValue(estado.getTiempoHorHuso());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
if (estado.getFecInicioHorVerano() == null) {
|
||||
nao.setChecked(Boolean.TRUE);
|
||||
hv1.setVisible(Boolean.FALSE);
|
||||
hv2.setVisible(Boolean.FALSE);
|
||||
} else {
|
||||
sim.setChecked(Boolean.TRUE);
|
||||
hv1.setVisible(Boolean.TRUE);
|
||||
hv2.setVisible(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
|
||||
|
@ -90,8 +135,13 @@ public class EditarEstadoController extends MyGenericForwardComposer {
|
|||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
txtNome.getValue();
|
||||
cmbPais.getValue();
|
||||
try {
|
||||
|
||||
try {
|
||||
if (tiempoHorHuso.getValue() == null) {
|
||||
estado.setTiempoHorHuso(NumberUtils.INTEGER_ZERO);
|
||||
} else {
|
||||
estado.setTiempoHorHuso(tiempoHorHuso.getValue());
|
||||
}
|
||||
estado.setActivo(Boolean.TRUE);
|
||||
estado.setFecmodif(Calendar.getInstance().getTime());
|
||||
estado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
|||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -22,7 +20,6 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Paging;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
@ -46,6 +49,40 @@ public class RenderEstado implements ListitemRenderer {
|
|||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Integer tiempoHorHuso = estado.getTiempoHorHuso();
|
||||
if (tiempoHorHuso != null) {
|
||||
lc = new Listcell(tiempoHorHuso.toString());
|
||||
} else {
|
||||
lc = new Listcell(NumberUtils.INTEGER_ZERO.toString());
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Integer tiempoHorVerano = estado.getTiempoHorVerano();
|
||||
if (tiempoHorVerano != null) {
|
||||
lc = new Listcell(tiempoHorVerano.toString());
|
||||
} else {
|
||||
lc = new Listcell(NumberUtils.INTEGER_ZERO.toString());
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Date fecInicioHorVerano = estado.getFecInicioHorVerano();
|
||||
if (fecInicioHorVerano != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
|
||||
lc = new Listcell(format.format(fecInicioHorVerano));
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Date fecFinoHorVerano = estado.getFecFinoHorVerano();
|
||||
if (fecFinoHorVerano != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
|
||||
lc = new Listcell(format.format(fecFinoHorVerano));
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
if (ApplicationProperties.getInstance().mostrarEquivalencia()) {
|
||||
lc = new Listcell(estado.getEquivalenciaId());
|
||||
lc.setParent(lstm);
|
||||
|
|
|
@ -5,18 +5,21 @@
|
|||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winBusquedaEstado" title="${c:l('busquedaEstadoController.window.title')}"
|
||||
<window id="winBusquedaEstado"
|
||||
title="${c:l('busquedaEstadoController.window.title')}"
|
||||
apply="${busquedaEstadoController}" contentStyle="overflow:auto"
|
||||
height="400px" width="650px" border="normal" >
|
||||
height="415px" width="800px" border="normal">
|
||||
|
||||
<toolbar>
|
||||
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
|
||||
<button id="btnRefresh" image="/gui/img/refresh.png"
|
||||
width="35px"
|
||||
tooltiptext="${c:l('busquedaEstadoController.btnRefresh.tooltiptext')}" />
|
||||
<separator orient="vertical" />
|
||||
<button id="btnNovo" image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaEstadoController.btnNovo.tooltiptext')}" />
|
||||
<separator orient="vertical" />
|
||||
<button id="btnCerrar" onClick="winBusquedaEstado.detach()" image="/gui/img/exit.png" width="35px"
|
||||
<button id="btnCerrar" onClick="winBusquedaEstado.detach()"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaEstadoController.btnCerrar.tooltiptext')}" />
|
||||
</toolbar>
|
||||
|
||||
|
@ -27,18 +30,23 @@
|
|||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('busquedaEstadoController.txtNombre.label')}"/>
|
||||
<textbox id="txtNombre" width="200px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
|
||||
<label
|
||||
value="${c:l('busquedaEstadoController.txtNombre.label')}" />
|
||||
<textbox id="txtNombre" width="200px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('busquedaEstadoController.lhPais.label')}"/>
|
||||
<combobox id="cmbPais" width="90%" mold="rounded" buttonVisible="true"
|
||||
<label
|
||||
value="${c:l('busquedaEstadoController.lhPais.label')}" />
|
||||
<combobox id="cmbPais" width="90%" mold="rounded"
|
||||
buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winBusquedaEstado$composer.lsPais}" />
|
||||
</row>
|
||||
<row id="rowEquivalencia">
|
||||
<label value="${c:l('lb.Equivalencia')}" />
|
||||
<textbox id="txtEquivalencia" width="100px" maxlength="10"
|
||||
<textbox id="txtEquivalencia" width="100px"
|
||||
maxlength="10"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
|
@ -50,23 +58,32 @@
|
|||
</toolbar>
|
||||
|
||||
<paging id="pagingEstado" pageSize="20" />
|
||||
<listbox id="estadoList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
<listbox id="estadoList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader width="15%" image="/gui/img/builder.gif"
|
||||
<listheader width="10%" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaEstadoController.lhId.label')}"
|
||||
sort="auto(estadoId)" />
|
||||
<listheader image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaEstadoController.lhDesc.label')}"
|
||||
sort="auto(nombestado)" />
|
||||
<listheader image="/gui/img/builder.gif"
|
||||
<listheader width="15%" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaEstadoController.lhPais.label')}"
|
||||
sort="auto(pais.paisId)" />
|
||||
<listheader image="/gui/img/builder.gif" width="20%"
|
||||
<listheader image="/gui/img/builder.gif" width="10%"
|
||||
label="${c:l('busquedaEstadoController.ICMS.label')}"
|
||||
sort="auto(icms)" />
|
||||
<listheader id="headerEquivalencia" image="/gui/img/create_doc.gif"
|
||||
label="${c:l('lb.Equivalencia')}"
|
||||
<listheader image="/gui/img/create_doc.gif" width="10%"
|
||||
label="UTC" sort="auto(tiempoHorHuso)" />
|
||||
<listheader image="/gui/img/create_doc.gif" width="10%"
|
||||
label="BRST" sort="auto(tiempoHorVerano)" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="Ínicio - BRST" sort="auto(fecInicioHorVerano)" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="Fim - BRST" sort="auto(fecFinoHorVerano)" />
|
||||
<listheader id="headerEquivalencia"
|
||||
image="/gui/img/create_doc.gif" label="${c:l('lb.Equivalencia')}"
|
||||
sort="auto(equivalenciaId)" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
|
|
|
@ -5,13 +5,21 @@
|
|||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winEditarEstado" border="normal" apply="${editarEstadoController}" width="400px" height="557x" contentStyle="overflow:auto"
|
||||
<window id="winEditarEstado" border="normal"
|
||||
apply="${editarEstadoController}" width="550px" height="245px"
|
||||
contentStyle="overflow:auto"
|
||||
title="${c:l('editarEstadoController.window.title')}">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<button id="btnApagar" height="20" image="/gui/img/remove.png" width="35px" tooltiptext="${c:l('editarEstadoController.btnApagar.tooltiptext')}" />
|
||||
<button id="btnSalvar" height="20" image="/gui/img/save.png" width="35px" tooltiptext="${c:l('editarEstadoController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnFechar" height="20" image="/gui/img/exit.png" width="35px" onClick="winEditarEstado.detach()"
|
||||
<button id="btnApagar" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarEstadoController.btnApagar.tooltiptext')}" />
|
||||
<button id="btnSalvar" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarEstadoController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarEstado.detach()"
|
||||
tooltiptext="${c:l('editarEstadoController.btnFechar.tooltiptext')}" />
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
@ -23,31 +31,97 @@
|
|||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label id="lbNome" value="${c:l('busquedaEstadoController.lhDesc.label')}" />
|
||||
<textbox id="txtNome" constraint="no empty" width="90%" maxlength="30" value="@{winEditarEstado$composer.estado.nombestado}"
|
||||
<label id="lbNome"
|
||||
value="${c:l('busquedaEstadoController.lhDesc.label')}" />
|
||||
<textbox id="txtNome" constraint="no empty"
|
||||
width="90%" maxlength="30"
|
||||
value="@{winEditarEstado$composer.estado.nombestado}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarEstadoController.lbPais.value')}" />
|
||||
<combobox id="cmbPais" width="90%" mold="rounded" buttonVisible="true" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" model="@{winEditarEstado$composer.lsPais}"
|
||||
<label
|
||||
value="${c:l('editarEstadoController.lbPais.value')}" />
|
||||
<combobox id="cmbPais" width="90%" mold="rounded"
|
||||
buttonVisible="true" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarEstado$composer.lsPais}"
|
||||
selectedItem="@{winEditarEstado$composer.estado.pais}" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('busquedaEstadoController.ICMS.label')}" />
|
||||
<hbox>
|
||||
<textbox id="txtIcms" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal" maxValue="100"
|
||||
value="@{winEditarEstado$composer.estado.icms,converter=com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter}" />
|
||||
<label value="%"/>
|
||||
</hbox>
|
||||
|
||||
</row>
|
||||
<row id="rowEquivalencia">
|
||||
<label value="${c:l('lb.Equivalencia')}" />
|
||||
<textbox id="txtEquivalencia" width="100px" maxlength="10" value="@{winEditarEstado$composer.estado.equivalenciaId}"
|
||||
<textbox id="txtEquivalencia" width="100px"
|
||||
maxlength="10"
|
||||
value="@{winEditarEstado$composer.estado.equivalenciaId}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="50%" />
|
||||
<column width="50%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="Diferença em Horas do Fuso Horário" />
|
||||
<spinner id="tiempoHorHuso" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="Possui horário de verão ?" />
|
||||
<radiogroup id="sv1">
|
||||
<hbox>
|
||||
<radio id="sim" label="Sim" />
|
||||
<radio id="nao" label="Não" />
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid id="hv1" fixedLayout="true">
|
||||
|
||||
<columns>
|
||||
<column width="28%" />
|
||||
<column width="22%" />
|
||||
<column width="28%" />
|
||||
<column width="22%" />
|
||||
</columns>
|
||||
<rows>
|
||||
|
||||
<row>
|
||||
|
||||
<label value="Início Horário De Verão" />
|
||||
<datebox id="fecInicioHorVerano" width="90%"
|
||||
format="dd/MM/yyyy" lenient="false" maxlength="10"
|
||||
value="@{winEditarEstado$composer.estado.fecInicioHorVerano}" />
|
||||
<label value="Fim Horário De Verão" />
|
||||
<datebox id="fecFinoHorVerano" width="90%"
|
||||
format="dd/MM/yyyy" lenient="false" maxlength="10"
|
||||
value="@{winEditarEstado$composer.estado.fecFinoHorVerano}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid id="hv2" fixedLayout="true">
|
||||
<columns>
|
||||
<column width="50%" />
|
||||
<column width="50%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="Diferença em Horas do Horário de Verão" />
|
||||
<spinner id="tiempoHorVerano"
|
||||
value="@{winEditarEstado$composer.estado.tiempoHorVerano}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
</window>
|
||||
</zk>
|
||||
|
|
Loading…
Reference in New Issue