rodrigo 2012-08-10 15:05:09 +00:00
parent 7a1c5155f6
commit 979b61407e
35 changed files with 658 additions and 751 deletions

View File

@ -52,6 +52,8 @@ import com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConver
*
*/
public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
private static final long serialVersionUID = 1L;
private List<Via> lsVias;
private List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoVO;
private ClaseServicio claseServicio;
@ -94,7 +96,8 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
}
/**
* Indica cuál es la clase de servicio usada para hacer la búsqueda de los tramos
* Indica cuál es la clase de servicio usada para hacer la búsqueda de los
* tramos
*
* @param claseServicio
*/
@ -122,7 +125,8 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
}
/**
* Agrega un nuevo tramo. Si la origen es la ultima parada, agrega al fin. Sino agrega al medio de la secuencia.
* Agrega un nuevo tramo. Si la origen es la ultima parada, agrega al fin.
* Sino agrega al medio de la secuencia.
*
* La parada destino es la que tienes que agregar.
*
@ -367,18 +371,20 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
@Override
public void onEvent(Event evt) throws Exception {
if (cboVia.getSelectedItem() != null) {
BigDecimal kmPagoConductorAntigo = secuenciaRutaTramoVO.getKmPagoConductor();
BigDecimal kmRealAntigo = secuenciaRutaTramoVO.getKmReal();
Hora tiempoRecorridoAntigo = secuenciaRutaTramoVO.getTiempoRecorrido();
secuenciaRutaTramoVO.setVia((Via) cboVia.getSelectedItem().getValue());
llenarTramo(secuenciaRutaTramoVO);
boolean tramoEditable = (secuenciaRutaTramoVO.getTramoId() == null);
boolean tramoServicioEditable = (secuenciaRutaTramoVO.getTramoServicioId() == null);
if (!tramoEditable) {// cuando el tramo no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos
if (!tramoEditable) {// cuando el tramo no es editable, es
// porque ya existe. Entonces lleno
// la pantalla con los nuevos
// valores
dKmsReal.setValueBigDecimal(secuenciaRutaTramoVO.getKmReal());
dKmsConductor.setValueBigDecimal(secuenciaRutaTramoVO.getKmPagoConductor());
@ -390,7 +396,10 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
lblID.setValue((secuenciaRutaTramoVO.getTramoId() != null) ? secuenciaRutaTramoVO.getTramoId().toString() : "");
if (!tramoServicioEditable) {// cuando el tramoServicio no es editable, es porque ya existe. Entonces lleno la pantalla
if (!tramoServicioEditable) {// cuando el tramoServicio no
// es editable, es porque ya
// existe. Entonces lleno la
// pantalla
// con los nuevos valores
spHora.setValue(secuenciaRutaTramoVO.getTiempoRecorrido().getHora());
spMinuto.setValue(secuenciaRutaTramoVO.getTiempoRecorrido().getMinuto());
@ -437,8 +446,8 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
spMinuto.setWidth("40px");
spMinuto.setConstraint("max 59,no negative,no empty");
spMinuto.setReadonly(!esTramoServicioEditable);
spMinuto.setButtonVisible(esTramoServicioEditable);
spMinuto.setReadonly(!esTramoServicioEditable);
spMinuto.setButtonVisible(esTramoServicioEditable);
hbox.appendChild(spMinuto);
if (secuenciaRutaTramoVO.getTiempoRecorrido() != null) {
@ -505,7 +514,8 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
SecuenciaRutaTramoVO s = buscarSecuencia(origenTramo, destinoTramo);
if (s == null) {
s = new SecuenciaRutaTramoVO(origenTramo, destinoTramo, i, null);
// si no existe, es el tramo nuevo. Entonces agrego los valores eliminados
// si no existe, es el tramo nuevo. Entonces agrego los valores
// eliminados
s.setKmPagoConductor(totalKmConductorRemovido);
s.setKmReal(totalKmRealRemovido);
s.setTiempoRecorrido(totalTiempoRecorridoRemovido);
@ -515,7 +525,7 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
}
lsSecuenciaRutaTramoVO.clear();
lsSecuenciaRutaTramoVO.addAll(lsSecuenciaRutaTramoNuevoVO);
actualizaModel();
}
@ -613,14 +623,10 @@ public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl {
@Override
public void doFinally() {
// TODO Auto-generated method stub
}
@Override
public void doTry() {
// TODO Auto-generated method stub
}
public void debugList() {

View File

@ -1,10 +1,10 @@
package com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional;
public class ParadaExisteException extends Exception {
private static final long serialVersionUID = 1L;
public ParadaExisteException(String msg) {
super(msg);
}
}

View File

@ -34,11 +34,11 @@ import com.rjconsultores.ventaboletos.web.utilerias.menu.MenuFactoryPropertiesIm
@Scope("prototype")
public class IndexController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private UsuarioService usuarioService;
@Autowired
private ConstanteService constanteService;
private static Logger log = Logger.getLogger(IndexController.class);
private Usuario usuario;
private Toolbarbutton toolBar;
private Toolbarbutton toolBarUser;
@ -78,7 +78,7 @@ public class IndexController extends MyGenericForwardComposer {
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
//cargarNombreAmbiente();
// cargarNombreAmbiente();
usuario = UsuarioLogado.getUsuarioLogado();

View File

@ -32,177 +32,114 @@ import org.zkoss.zul.Row;
import org.zkoss.zul.Textbox;
/**
*
*
* @author Rafius
*/
@Controller("busquedaEstadoController")
@Scope("prototype")
public class BusquedaEstadoController extends MyGenericForwardComposer {
@Autowired
private PaisService paisService;
@Autowired
private transient PagedListWrapper<Estado> plwEstado;
private MyListbox estadoList;
private Paging pagingEstado;
private Textbox txtNombre;
private Textbox txtEquivalencia;
private Combobox cmbPais;
private List<Pais> lsPais;
private Row rowEquivalencia;
private Listheader headerEquivalencia;
private static final long serialVersionUID = 1L;
@Autowired
private PaisService paisService;
@Autowired
private transient PagedListWrapper<Estado> plwEstado;
private MyListbox estadoList;
private Paging pagingEstado;
private Textbox txtNombre;
private Textbox txtEquivalencia;
private Combobox cmbPais;
private List<Pais> lsPais;
private Row rowEquivalencia;
private Listheader headerEquivalencia;
public Combobox getCmbPais() {
return cmbPais;
}
public List<Pais> getLsPais() {
return lsPais;
}
public void setCmbPais(Combobox cmbPais) {
this.cmbPais = cmbPais;
}
public void setLsPais(List<Pais> lsPais) {
this.lsPais = lsPais;
}
public MyListbox getEstadoList() {
return estadoList;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
public void setEstadoList(MyListbox estadoList) {
this.estadoList = estadoList;
}
lsPais = paisService.obtenerTodos();
super.doAfterCompose(comp);
public List<Pais> getLsPais() {
return lsPais;
}
estadoList.setItemRenderer(new RenderEstado());
estadoList.addEventListener("onDoubleClick", new EventListener() {
public void setLsPais(List<Pais> lsPais) {
this.lsPais = lsPais;
}
@Override
public void onEvent(Event event) throws Exception {
Estado est = (Estado) estadoList.getSelected();
verPeriodo(est);
}
});
public Paging getPagingEstado() {
return pagingEstado;
}
refreshLista();
public void setPagingEstado(Paging pagingEstado) {
this.pagingEstado = pagingEstado;
}
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
rowEquivalencia.setVisible(Boolean.FALSE);
headerEquivalencia.setVisible(Boolean.FALSE);
}
public PaisService getPaisService() {
return paisService;
}
txtNombre.focus();
}
public void setPaisService(PaisService paisService) {
this.paisService = paisService;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void verPeriodo(Estado e) {
if (e == null) {
return;
}
public Textbox getTxtNombre() {
return txtNombre;
}
Map args = new HashMap();
args.put("estado", e);
args.put("estadoList", estadoList);
public void setTxtNombre(Textbox txtNombre) {
this.txtNombre = txtNombre;
}
openWindow("/gui/catalogos/editarEstado.zul",
Labels.getLabel("editarEstadoController.window.title"), args, MODAL);
}
public Textbox getTxtEquivalencia() {
return txtEquivalencia;
}
private void refreshLista() throws InterruptedException {
HibernateSearchObject<Estado> estadoBusqueda =
new HibernateSearchObject<Estado>(Estado.class, pagingEstado.getPageSize());
public void setTxtEquivalencia(Textbox txtEquivalencia) {
this.txtEquivalencia = txtEquivalencia;
}
estadoBusqueda.addFilterLike("nombestado", "%" + txtNombre.getText().trim().concat("%"));
public Listheader getHeaderEquivalencia() {
return headerEquivalencia;
}
Comboitem itemPais = cmbPais.getSelectedItem();
if (itemPais != null) {
Pais pais = (Pais) itemPais.getValue();
estadoBusqueda.addFilterEqual("pais", pais);
}
public void setHeaderEquivalencia(Listheader headerEquivalencia) {
this.headerEquivalencia = headerEquivalencia;
}
if (!txtEquivalencia.getText().isEmpty()) {
estadoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%"));
}
public Row getRowEquivalencia() {
return rowEquivalencia;
}
estadoBusqueda.addFilterEqual("activo", Boolean.TRUE);
estadoBusqueda.addSortAsc("nombestado");
estadoBusqueda.addFilterNotEqual("estadoId", -1);
public void setRowEquivalencia(Row rowEquivalencia) {
this.rowEquivalencia = rowEquivalencia;
}
plwEstado.init(estadoBusqueda, estadoList, pagingEstado);
@Override
public void doAfterCompose(Component comp) throws Exception {
if (estadoList.getData().length == 0) {
Messagebox.show(
Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
}
lsPais = paisService.obtenerTodos();
super.doAfterCompose(comp);
public void onClick$btnRefresh(Event ev) throws InterruptedException {
refreshLista();
}
estadoList.setItemRenderer(new RenderEstado());
estadoList.addEventListener("onDoubleClick", new EventListener() {
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
refreshLista();
}
@Override
public void onEvent(Event event) throws Exception {
Estado est = (Estado) estadoList.getSelected();
verPeriodo(est);
}
});
refreshLista();
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
rowEquivalencia.setVisible(Boolean.FALSE);
headerEquivalencia.setVisible(Boolean.FALSE);
}
txtNombre.focus();
}
public void onClick$btnRefresh(Event ev) throws InterruptedException {
refreshLista();
}
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
refreshLista();
}
public void onClick$btnNovo(Event ev) throws InterruptedException {
verPeriodo(new Estado());
}
private void verPeriodo(Estado e) {
if (e == null) {
return;
}
Map args = new HashMap();
args.put("estado", e);
args.put("estadoList", estadoList);
openWindow("/gui/catalogos/editarEstado.zul",
Labels.getLabel("editarEstadoController.window.title"), args, MODAL);
}
private void refreshLista() throws InterruptedException {
HibernateSearchObject<Estado> estadoBusqueda =
new HibernateSearchObject<Estado>(Estado.class, pagingEstado.getPageSize());
estadoBusqueda.addFilterLike("nombestado", "%" + txtNombre.getText().trim().concat("%"));
Comboitem itemPais = cmbPais.getSelectedItem();
if (itemPais != null) {
Pais pais = (Pais) itemPais.getValue();
estadoBusqueda.addFilterEqual("pais", pais);
}
if (!txtEquivalencia.getText().isEmpty()) {
estadoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%"));
}
estadoBusqueda.addFilterEqual("activo", Boolean.TRUE);
estadoBusqueda.addSortAsc("nombestado");
estadoBusqueda.addFilterNotEqual("estadoId", -1);
plwEstado.init(estadoBusqueda, estadoList, pagingEstado);
if (estadoList.getData().length == 0) {
Messagebox.show(
Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
}
public void onClick$btnNovo(Event ev) throws InterruptedException {
verPeriodo(new Estado());
}
}

View File

@ -29,196 +29,141 @@ import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Row;
/**
*
*
* @author Rafius
*/
@Controller("editarEstadoController")
@Scope("prototype")
public class EditarEstadoController extends MyGenericForwardComposer {
@Autowired
private EstadoService estadoService;
@Autowired
private PaisService paisService;
private Estado estado;
private List<Pais> lsPais;
private MyListbox estadoList;
private static Logger log = Logger.getLogger(EditarEstadoController.class);
private MyTextbox txtNome;
private Combobox cmbPais;
private Button btnApagar;
private Row rowEquivalencia;
private static final long serialVersionUID = 1L;
@Autowired
private EstadoService estadoService;
@Autowired
private PaisService paisService;
private Estado estado;
private List<Pais> lsPais;
private MyListbox estadoList;
private static Logger log = Logger.getLogger(EditarEstadoController.class);
private MyTextbox txtNome;
private Combobox cmbPais;
private Button btnApagar;
private Row rowEquivalencia;
public Estado getEstado() {
return estado;
}
public Estado getEstado() {
return estado;
}
public void setEstado(Estado estado) {
this.estado = estado;
}
public void setEstado(Estado estado) {
this.estado = estado;
}
public MyListbox getEstadoList() {
return estadoList;
}
public List<Pais> getLsPais() {
return lsPais;
}
public void setEstadoList(MyListbox estadoList) {
this.estadoList = estadoList;
}
public void setLsPais(List<Pais> lsPais) {
this.lsPais = lsPais;
}
public EstadoService getEstadoService() {
return estadoService;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
public void setEstadoService(EstadoService estadoService) {
this.estadoService = estadoService;
}
lsPais = paisService.obtenerTodos();
super.doAfterCompose(comp);
public Button getBtnApagar() {
return btnApagar;
}
estado = (Estado) Executions.getCurrent().getArg().get("estado");
estadoList = (MyListbox) Executions.getCurrent().getArg().get("estadoList");
public void setBtnApagar(Button btnApagar) {
this.btnApagar = btnApagar;
}
if (estado.getEstadoId() == null) {
btnApagar.setVisible(Boolean.FALSE);
}
public MyTextbox getTxtNome() {
return txtNome;
}
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
rowEquivalencia.setVisible(Boolean.FALSE);
}
public void setTxtNome(MyTextbox txtNome) {
this.txtNome = txtNome;
}
txtNome.focus();
}
public List<Pais> getLsPais() {
return lsPais;
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtNome.getValue();
cmbPais.getValue();
try {
public void setLsPais(List<Pais> lsPais) {
this.lsPais = lsPais;
}
estado.setActivo(Boolean.TRUE);
estado.setFecmodif(Calendar.getInstance().getTime());
estado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
public PaisService getPaisService() {
return paisService;
}
List<Estado> lsEstado = estadoService.buscar(estado.getNombestado(), estado.getPais());
public void setPaisService(PaisService paisService) {
this.paisService = paisService;
}
boolean podeSalvar = false;
if (lsEstado.isEmpty()) {
podeSalvar = true;
} else {
if (estado.getEstadoId() == null) {
podeSalvar = false;
} else {
for (Estado e : lsEstado) {
if (e.getEstadoId().equals(estado.getEstadoId())) {
podeSalvar = true;
}
}
}
}
public Combobox getCmbPais() {
return cmbPais;
}
if (podeSalvar) {
if (estado.getEstadoId() == null) {
estadoService.suscribir(estado);
estadoList.addItem(estado);
} else {
estadoService.actualizacion(estado);
estadoList.updateItem(estado);
}
Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.suscribirOK"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
public void setCmbPais(Combobox cmbPais) {
this.cmbPais = cmbPais;
}
closeWindow();
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
public Row getRowEquivalencia() {
return rowEquivalencia;
}
} catch (Exception ex) {
log.error("editarEstadoController: " + ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void setRowEquivalencia(Row rowEquivalencia) {
this.rowEquivalencia = rowEquivalencia;
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.borrarPergunta"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
@Override
public void doAfterCompose(Component comp) throws Exception {
if (resp == Messagebox.YES) {
lsPais = paisService.obtenerTodos();
super.doAfterCompose(comp);
estadoService.borrar(estado);
estado = (Estado) Executions.getCurrent().getArg().get("estado");
estadoList = (MyListbox) Executions.getCurrent().getArg().get("estadoList");
Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.borrarOK"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
if (estado.getEstadoId() == null) {
btnApagar.setVisible(Boolean.FALSE);
}
estadoList.removeItem(estado);
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
rowEquivalencia.setVisible(Boolean.FALSE);
}
txtNome.focus();
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtNome.getValue();
cmbPais.getValue();
try {
estado.setActivo(Boolean.TRUE);
estado.setFecmodif(Calendar.getInstance().getTime());
estado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
List<Estado> lsEstado = estadoService.buscar(estado.getNombestado(), estado.getPais());
boolean podeSalvar = false;
if (lsEstado.isEmpty()) {
podeSalvar = true;
} else {
if (estado.getEstadoId() == null) {
podeSalvar = false;
} else {
for (Estado e : lsEstado) {
if (e.getEstadoId().equals(estado.getEstadoId())) {
podeSalvar = true;
}
}
}
}
if (podeSalvar) {
if (estado.getEstadoId() == null) {
estadoService.suscribir(estado);
estadoList.addItem(estado);
} else {
estadoService.actualizacion(estado);
estadoList.updateItem(estado);
}
Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.suscribirOK"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} catch (Exception ex) {
log.error("editarEstadoController: " + ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.borrarPergunta"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
estadoService.borrar(estado);
Messagebox.show(
Labels.getLabel("editarEstadoController.MSG.borrarOK"),
Labels.getLabel("editarEstadoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
estadoList.removeItem(estado);
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
}
}
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
}
}
}

View File

@ -195,6 +195,7 @@ public class MenuFactoryPropertiesImpl implements MenuFactory {
* @param strClass
* @return
*/
@SuppressWarnings("rawtypes")
private ItemMenuSistema crearNueboItem(String strClass) {
ItemMenuSistema classe = null;
try {

View File

@ -2,6 +2,8 @@ package com.rjconsultores.ventaboletos.web.utilerias.menu.exception;
public class MenuConfiguracionException extends RuntimeException {
private static final long serialVersionUID = 1L;
public MenuConfiguracionException(String arg0, Throwable arg1) {
super(arg0, arg1);
}

View File

@ -2,6 +2,8 @@ package com.rjconsultores.ventaboletos.web.utilerias.menu.exception;
public class MenuNoExisteException extends RuntimeException {
private static final long serialVersionUID = 1L;
public MenuNoExisteException(String arg0, Throwable arg1) {
super(arg0, arg1);
}

View File

@ -2,21 +2,14 @@ package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperaciona
import java.text.SimpleDateFormat;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Messagebox;
import com.rjconsultores.ventaboletos.entidad.Constante;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.service.CorridaService;
import com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.GeracionCorridaController;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
public class ItemMenuGeneracionCorrida extends DefaultItemMenuSistema {
private static Logger log = Logger.getLogger(ItemMenuGeneracionCorrida.class);
public ItemMenuGeneracionCorrida() {
super("indexController.mniGeracionCorrida.label");

View File

@ -4,18 +4,18 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.AlertaCtrl;
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
import com.rjconsultores.ventaboletos.entidad.Corrida;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import java.math.BigDecimal;
import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.AlertaCtrl;
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
import com.rjconsultores.ventaboletos.entidad.Corrida;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.Ruta;
/**
*
* @author Administrador

View File

@ -4,9 +4,6 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Cortesia;
import java.text.SimpleDateFormat;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

View File

@ -11,26 +11,26 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*
*
* @author Rafius
*/
public class RenderCancelacionCargo implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
CancelacionCargo cc = (CancelacionCargo) o;
public void render(Listitem lstm, Object o) throws Exception {
CancelacionCargo cc = (CancelacionCargo) o;
Listcell lc = lc = new Listcell((cc.getTiempominimo() == null) ? "" : cc.getTiempominimo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
Listcell lc = new Listcell((cc.getTiempominimo() == null) ? "" : cc.getTiempominimo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getTiempomaximo() == null) ? "" : cc.getTiempomaximo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getTiempomaximo() == null) ? "" : cc.getTiempomaximo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getPorccargo() == null) ? "" : cc.getPorccargo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getPorccargo() == null) ? "" : cc.getPorccargo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getImportecargo() == null) ? "" : cc.getImportecargo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lc = new Listcell((cc.getImportecargo() == null) ? "" : cc.getImportecargo().setScale(2, RoundingMode.HALF_UP).toString());
lc.setParent(lstm);
lstm.setAttribute("data", cc);
}
lstm.setAttribute("data", cc);
}
}

View File

@ -10,23 +10,23 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*
*
* @author Rafius
*/
public class RenderCatalogoDeParadas implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
Parada parada = (Parada) o;
public void render(Listitem lstm, Object o) throws Exception {
Parada parada = (Parada) o;
Listcell lc = lc = new Listcell(parada.getParadaId().toString());
lc.setParent(lstm);
Listcell lc = new Listcell(parada.getParadaId().toString());
lc.setParent(lstm);
lc = new Listcell(parada.getDescparada());
lc.setParent(lstm);
lc = new Listcell(parada.getDescparada());
lc.setParent(lstm);
lc = new Listcell(parada.getCveparada());
lc.setParent(lstm);
lc = new Listcell(parada.getCveparada());
lc.setParent(lstm);
lstm.setAttribute("data", parada);
}
lstm.setAttribute("data", parada);
}
}

View File

@ -23,75 +23,79 @@ import org.zkoss.zul.Radio;
import org.zkoss.zul.Radiogroup;
/**
*
*
* @author Rafius
*/
@Scope("prototype")
public class RenderCatalogoDeRutasCombinacion extends MyGenericForwardComposer implements ListitemRenderer {
@Autowired
private ViaService viaService;
private static final long serialVersionUID = 1L;
@Autowired
private ViaService viaService;
@Override
public void render(Listitem lstm, Object o) throws Exception {
RutaCombinacion rutaCombinacion = (RutaCombinacion) o;
@Override
public void render(Listitem lstm, Object o) throws Exception {
RutaCombinacion rutaCombinacion = (RutaCombinacion) o;
// Listcell lc = new Listcell((rutaCombinacion.getIndventa() == Boolean.TRUE) ? "Si" : "No");
Listcell lc = new Listcell();
// <radiogroup Id="radioGroup" >
// <radio value="si" id="si" label="${c:l('editarCatalogoDeRutaController.RadSi.value')}" checked="@{rutaCombinacionList.ventaSi}"/>
// <radio value="no" id="no" label="${c:l('editarCatalogoDeRutaController.RadNo.value')}" checked="@{rutaCombinacionList.ventaNo}"/>
// </radiogroup>
final Radiogroup rg = new Radiogroup();
//rc.setId("radioGroup2");
Radio r1 = new Radio();
r1.setValue("si");
r1.setLabel("Si");
// Listcell lc = new Listcell((rutaCombinacion.getIndventa() ==
// Boolean.TRUE) ? "Si" : "No");
Listcell lc = new Listcell();
// <radiogroup Id="radioGroup" >
// <radio value="si" id="si"
// label="${c:l('editarCatalogoDeRutaController.RadSi.value')}"
// checked="@{rutaCombinacionList.ventaSi}"/>
// <radio value="no" id="no"
// label="${c:l('editarCatalogoDeRutaController.RadNo.value')}"
// checked="@{rutaCombinacionList.ventaNo}"/>
// </radiogroup>
final Radiogroup rg = new Radiogroup();
// rc.setId("radioGroup2");
Radio r1 = new Radio();
r1.setValue("si");
r1.setLabel("Si");
//r1.setId("si");
Radio r2 = new Radio();
r2.setValue("no");
r2.setLabel("No");
//r2.setId("no");
r1.setParent(rg);
r2.setParent(rg);
if (rutaCombinacion.getIndventa() == Boolean.TRUE) {
r1.setChecked(true);
} else {
r2.setChecked(true);
}
rg.addEventListener("onClick", new EventListener() {
// r1.setId("si");
Radio r2 = new Radio();
r2.setValue("no");
r2.setLabel("No");
// r2.setId("no");
r1.setParent(rg);
r2.setParent(rg);
if (rutaCombinacion.getIndventa() == Boolean.TRUE) {
r1.setChecked(true);
} else {
r2.setChecked(true);
}
rg.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
Radio a = rg.getSelectedItem();
@Override
public void onEvent(Event event) throws Exception {
rg.getSelectedItem();
}
});
lc.appendChild(rg);
lc.setParent(lstm);
}
});
lc.appendChild(rg);
lc.setParent(lstm);
lc = new Listcell(rutaCombinacion.getTramo().getDesctramo());
lc.setParent(lstm);
lc = new Listcell(rutaCombinacion.getTramo().getDesctramo());
lc.setParent(lstm);
lc = new Listcell(rutaCombinacion.getTramo().getVia().getNombvia());
lc.setParent(lstm);
lc = new Listcell(rutaCombinacion.getTramo().getVia().getNombvia());
lc.setParent(lstm);
lc = new Listcell();
Combobox combo = new Combobox();
combo.setMold("rounded");
combo.setWidth("100%");
lc = new Listcell();
Combobox combo = new Combobox();
combo.setMold("rounded");
combo.setWidth("100%");
viaService.obtenerTodos();
List<Via> lsVia = viaService.obtenerTodos();
combo.setModel(new ListModelList(lsVia));
combo.setSelectedItem(new Comboitem(rutaCombinacion.getTramo().getVia().getNombvia()));
viaService.obtenerTodos();
List<Via> lsVia = viaService.obtenerTodos();
combo.setModel(new ListModelList(lsVia));
combo.setSelectedItem(new Comboitem(rutaCombinacion.getTramo().getVia().getNombvia()));
lc.appendChild(combo);
lc.setParent(lstm);
lc.appendChild(combo);
lc.setParent(lstm);
lstm.setAttribute("data", rutaCombinacion);
}
lstm.setAttribute("data", rutaCombinacion);
}
}

View File

@ -4,89 +4,81 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import java.util.ArrayList;
import java.util.List;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Button;
import org.zkoss.zul.Div;
import org.zkoss.zul.Grid;
import org.zkoss.zul.Label;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Radio;
import org.zkoss.zul.Radiogroup;
import org.zkoss.zul.Row;
import org.zkoss.zul.RowRenderer;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
/**
*
*
* @author Rafius
*/
public class RenderCatalogoDeRutasCombinacionRow implements RowRenderer {
private Grid demoGrid;
private MyListbox rutaCombinacionList;
public void render(Row row, java.lang.Object data) {
public void render(Row row, java.lang.Object data) {
RutaCombinacion rutaCombinacion = (RutaCombinacion) data;
RutaCombinacion rutaCombinacion = (RutaCombinacion) data;
// the data append to each row with simple label
Textbox text = new Textbox((rutaCombinacion.getIndventa() == Boolean.TRUE) ? "Si" : "No");
text.setInplace(true);
row.appendChild(text);
// the data append to each row with simple label
Textbox text = new Textbox((rutaCombinacion.getIndventa() == Boolean.TRUE) ? "Si" : "No");
text.setInplace(true);
row.appendChild(text);
Radio radio = new Radio();
radio.setLabel("Si");
// radio.setId("Si");
radio.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.TRUE : Boolean.FALSE);
Radio radio2 = new Radio();
radio2.setLabel("No");
// radio2.setId("No");
radio2.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE);
Radio radio = new Radio();
radio.setLabel("Si");
//radio.setId("Si");
radio.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.TRUE : Boolean.FALSE);
Radio radio2 = new Radio();
radio2.setLabel("No");
//radio2.setId("No");
radio2.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE);
final Radiogroup radioGroup = new Radiogroup();
radioGroup.setId("radioGroup" + rutaCombinacion.getTramo().getDesctramo());
radioGroup.appendChild(radio);
radioGroup.appendChild(radio2);
final Div d = new Div();
radioGroup.setParent(d);
radioGroup.addEventListener(Events.ON_CLICK, new EventListener() {
final Radiogroup radioGroup = new Radiogroup();
radioGroup.setId("radioGroup" + rutaCombinacion.getTramo().getDesctramo());
radioGroup.appendChild(radio);
radioGroup.appendChild(radio2);
final Div d = new Div();
radioGroup.setParent(d);
radioGroup.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
public void onEvent(Event event) throws Exception {
String retorno = radioGroup.getSelectedItem().getLabel();
d.appendChild(new Label(retorno));
}
});
row.appendChild(radioGroup);
row.appendChild(new Label(rutaCombinacion.getTramo().getDesctramo()));
String retorno = radioGroup.getSelectedItem().getLabel();
d.appendChild(new Label(retorno));
}
});
row.appendChild(radioGroup);
row.appendChild(new Label(rutaCombinacion.getTramo().getDesctramo()));
// we create a thumb up/down comment to each row
final Div d2 = new Div();
final Button thumbBtn = new Button(null, "/gui/img/create_doc.gif");
thumbBtn.setParent(d2);
thumbBtn.addEventListener(Events.ON_CLICK, new EventListener() {
// we create a thumb up/down comment to each row
final Div d2 = new Div();
final Button thumbBtn = new Button(null, "/gui/img/create_doc.gif");
thumbBtn.setParent(d2);
thumbBtn.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
d2.appendChild(new Label("Desativado!!!"));
thumbBtn.setDisabled(true);
// Pega o MysListBox
// List<RutaCombinacion> rc = new ArrayList<RutaCombinacion>();
// rutaCombinacionList = (MyListbox)
// d2.getFellow("rutaCombinacionList");
public void onEvent(Event event) throws Exception {
d2.appendChild(new Label("Desativado!!!"));
thumbBtn.setDisabled(true);
//Pega o MysListBox
// List<RutaCombinacion> rc = new ArrayList<RutaCombinacion>();
// rutaCombinacionList = (MyListbox) d2.getFellow("rutaCombinacionList");
// Pegar o dataGrid
//Pegar o dataGrid
d2.getFellow("demoGrid");
demoGrid = (Grid) d2.getFellow("demoGrid");
}
});
row.appendChild(d2); // Any component could created as a child of grid
}
}
});
row.appendChild(d2); // Any component could created as a child of grid
}
}

View File

@ -10,26 +10,26 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*
*
* @author Administrador
*/
public class RenderClaseservicioEquivalencia implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
ClaseservicioEquivalencia claseservicioEquivalencia = (ClaseservicioEquivalencia) o;
public void render(Listitem lstm, Object o) throws Exception {
ClaseservicioEquivalencia claseservicioEquivalencia = (ClaseservicioEquivalencia) o;
Listcell lc = lc = new Listcell(claseservicioEquivalencia.getClaseservicioequivalenciaId().toString());
lc.setParent(lstm);
Listcell lc = new Listcell(claseservicioEquivalencia.getClaseservicioequivalenciaId().toString());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getClaseservicio().getDescclase());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getClaseservicio().getDescclase());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lc = new Listcell(claseservicioEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lstm.setAttribute("data", claseservicioEquivalencia);
}
lstm.setAttribute("data", claseservicioEquivalencia);
}
}

View File

@ -4,14 +4,14 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
/**
*
* @author Administrador

View File

@ -4,58 +4,59 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario;
import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario;
import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento;
/**
*
*
* @author Shiro
*/
public class RenderCortesiaBeneficiario implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
CortesiaBeneficiario cortesiaBeneficiario = (CortesiaBeneficiario) o;
DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US));
StringBuilder sb = new StringBuilder("");
if (cortesiaBeneficiario.getNombBenef() != null){
sb.append(cortesiaBeneficiario.getNombBenef()).append(" ");
}
if (cortesiaBeneficiario.getNombPaterno()!= null){
sb.append(cortesiaBeneficiario.getNombPaterno()).append(" ");
}
if (cortesiaBeneficiario.getNombMaterno()!= null){
sb.append(cortesiaBeneficiario.getNombMaterno());
}
Listcell lc = new Listcell(sb.toString());
lc.setParent(lstm);
public void render(Listitem lstm, Object o) throws Exception {
CortesiaBeneficiario cortesiaBeneficiario = (CortesiaBeneficiario) o;
DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US));
if (cortesiaBeneficiario.getIndtipobenef() != null) {
String status;
if (cortesiaBeneficiario.getIndtipobenef().equals("E")) {
status = "Empleado";
} else {
status = "Familiar";
}
lc = new Listcell(status);
} else {
lc = new Listcell("-");
}
lc.setParent(lstm);
StringBuilder sb = new StringBuilder("");
if (cortesiaBeneficiario.getNombBenef() != null) {
sb.append(cortesiaBeneficiario.getNombBenef()).append(" ");
}
if (cortesiaBeneficiario.getNombPaterno() != null) {
sb.append(cortesiaBeneficiario.getNombPaterno()).append(" ");
}
if (cortesiaBeneficiario.getNombMaterno() != null) {
sb.append(cortesiaBeneficiario.getNombMaterno());
}
Listcell lc = new Listcell(sb.toString());
lc.setParent(lstm);
TipoCortesiaDescuento tcd = cortesiaBeneficiario.getDescuento();
if (tcd != null) {
lc = new Listcell(df.format(tcd.getPorcdescuento()));
} else {
lc = new Listcell("-");
}
lc.setParent(lstm);
if (cortesiaBeneficiario.getIndtipobenef() != null) {
String status;
if (cortesiaBeneficiario.getIndtipobenef().equals("E")) {
status = "Empleado";
} else {
status = "Familiar";
}
lc = new Listcell(status);
} else {
lc = new Listcell("-");
}
lc.setParent(lstm);
lstm.setAttribute("data", cortesiaBeneficiario);
}
TipoCortesiaDescuento tcd = cortesiaBeneficiario.getDescuento();
if (tcd != null) {
lc = new Listcell(df.format(tcd.getPorcdescuento()));
} else {
lc = new Listcell("-");
}
lc.setParent(lstm);
lstm.setAttribute("data", cortesiaBeneficiario);
}
}

View File

@ -4,33 +4,32 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Marca;
import com.rjconsultores.ventaboletos.entidad.ProdMarca;
import java.math.BigDecimal;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Marca;
import com.rjconsultores.ventaboletos.entidad.ProdMarca;
/**
*
*
* @author Administrador
*/
public class RenderCyberViajeProdMarca implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
ProdMarca prodMarca = (ProdMarca) o;
public void render(Listitem lstm, Object o) throws Exception {
ProdMarca prodMarca = (ProdMarca) o;
Listcell lc = null;
Listcell lc = null;
Marca marca = prodMarca.getMarca();
if (marca != null) {
lc = new Listcell(marca.getDescmarca());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
Marca marca = prodMarca.getMarca();
if (marca != null) {
lc = new Listcell(marca.getDescmarca());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
lstm.setAttribute("data", prodMarca);
}
lstm.setAttribute("data", prodMarca);
}
}

View File

@ -4,37 +4,35 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.ProdPrecio;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.ProdPrecio;
/**
*
*
* @author Rafius
*/
public class RenderCyberViajeProdPrecio implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
ProdPrecio prodMarca = (ProdPrecio) o;
SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy");
DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US));
public void render(Listitem lstm, Object o) throws Exception {
ProdPrecio prodMarca = (ProdPrecio) o;
DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US));
Listcell lc = null;
Listcell lc = null;
lc = new Listcell(prodMarca.getMarca() == null ? "" : prodMarca.getMarca().getDescmarca());
lc.setParent(lstm);
lc = new Listcell(prodMarca.getImporteinicial() == null ? "" : df.format(prodMarca.getImporteinicial()));
lc.setParent(lstm);
lc = new Listcell(prodMarca.getImportefinal() == null ? "" : df.format(prodMarca.getImportefinal()));
lc.setParent(lstm);
lc = new Listcell(prodMarca.getPrecio() == null ? "" : df.format(prodMarca.getPrecio()));
lc.setParent(lstm);
lc = new Listcell(prodMarca.getMarca() == null ? "" : prodMarca.getMarca().getDescmarca());
lc.setParent(lstm);
lc = new Listcell(prodMarca.getImporteinicial() == null ? "" : df.format(prodMarca.getImporteinicial()));
lc.setParent(lstm);
lc = new Listcell(prodMarca.getImportefinal() == null ? "" : df.format(prodMarca.getImportefinal()));
lc.setParent(lstm);
lc = new Listcell(prodMarca.getPrecio() == null ? "" : df.format(prodMarca.getPrecio()));
lc.setParent(lstm);
lstm.setAttribute("data", prodMarca);
}
lstm.setAttribute("data", prodMarca);
}
}

View File

@ -10,26 +10,26 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*
*
* @author Administrador
*/
public class RenderEmpresaEquivalencia implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
EmpresaEquivalencia empresaEquivalencia = (EmpresaEquivalencia) o;
public void render(Listitem lstm, Object o) throws Exception {
EmpresaEquivalencia empresaEquivalencia = (EmpresaEquivalencia) o;
Listcell lc = lc = new Listcell(empresaEquivalencia.getEmpresaequivalenciaId().toString());
lc.setParent(lstm);
Listcell lc = new Listcell(empresaEquivalencia.getEmpresaequivalenciaId().toString());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getEmpresa().getNombempresa());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getEmpresa().getNombempresa());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lc = new Listcell(empresaEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lstm.setAttribute("data", empresaEquivalencia);
}
lstm.setAttribute("data", empresaEquivalencia);
}
}

View File

@ -4,41 +4,53 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Estado;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import java.math.BigDecimal;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Estado;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
/**
*
*
* @author MCosso
*/
public class RenderEstado implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
Estado estado = (Estado) o;
public void render(Listitem lstm, Object o) throws Exception {
Estado estado = (Estado) o;
Listcell lc = new Listcell();
Listcell lc = new Listcell();
lc = new Listcell(estado.getEstadoId().toString());
lc.setParent(lstm);
lc = new Listcell(estado.getEstadoId().toString());
lc.setParent(lstm);
lc = new Listcell(estado.getNombestado());
lc.setParent(lstm);
lc = new Listcell(estado.getNombestado());
lc.setParent(lstm);
if (estado.getPais() != null) {
lc = new Listcell(estado.getPais().getNombpais());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
if (estado.getPais() != null) {
lc = new Listcell(estado.getPais().getNombpais());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
if (ApplicationProperties.getInstance().mostrarEquivalencia()) {
lc = new Listcell(estado.getEquivalenciaId());
lc.setParent(lstm);
}
BigDecimal icms = estado.getIcms();
if (icms != null) {
lc = new Listcell(icms.setScale(3).toString());
lstm.setAttribute("data", estado);
}
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
if (ApplicationProperties.getInstance().mostrarEquivalencia()) {
lc = new Listcell(estado.getEquivalenciaId());
lc.setParent(lstm);
}
lstm.setAttribute("data", estado);
}
}

View File

@ -10,29 +10,29 @@ import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*
*
* @author Administrador
*/
public class RenderParadaEquivalencia implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
ParadaEquivalencia paradaEquivalencia = (ParadaEquivalencia) o;
public void render(Listitem lstm, Object o) throws Exception {
ParadaEquivalencia paradaEquivalencia = (ParadaEquivalencia) o;
Listcell lc = lc = new Listcell(paradaEquivalencia.getParadaequivalenciaId().toString());
lc.setParent(lstm);
Listcell lc = new Listcell(paradaEquivalencia.getParadaequivalenciaId().toString());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getParada().getDescparada());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getParada().getDescparada());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getParada().getCveparada());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getParada().getCveparada());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getComisionistaExterno().getDesccomisionista());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lc = new Listcell(paradaEquivalencia.getEquivalenciaId());
lc.setParent(lstm);
lstm.setAttribute("data", paradaEquivalencia);
}
lstm.setAttribute("data", paradaEquivalencia);
}
}

View File

@ -4,18 +4,19 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import java.text.SimpleDateFormat;
import java.util.List;
import org.zkoss.zkplus.spring.SpringUtil;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.PricingCorrida;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.RutaSecuencia;
import com.rjconsultores.ventaboletos.entidad.Tramo;
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
import java.text.SimpleDateFormat;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.zkoss.zkplus.spring.SpringUtil;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
*

View File

@ -4,14 +4,12 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.ProdMarca;
import com.rjconsultores.ventaboletos.entidad.ProductoServicio;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.ProductoServicio;
/**
*
* @author Shiro

View File

@ -4,13 +4,13 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Ciudad;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
/**
*
* @author Administrador

View File

@ -4,34 +4,34 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta;
/**
*
*
* @author Rafius
*/
public class RenderSendaAmigoParamCostoTarjeta implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy");
DecimalFormat df = new DecimalFormat("###,###,##0.00",new java.text.DecimalFormatSymbols(java.util.Locale.US));
ParamCostoTarjeta pct = (ParamCostoTarjeta) o;
public void render(Listitem lstm, Object o) throws Exception {
DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US));
Listcell lc = new Listcell(pct.getParamcostotarjetaId().toString());
lc.setParent(lstm);
ParamCostoTarjeta pct = (ParamCostoTarjeta) o;
lc = new Listcell(pct.getEmpresa().getNombempresa());
lc.setParent(lstm);
Listcell lc = new Listcell(pct.getParamcostotarjetaId().toString());
lc.setParent(lstm);
lc = new Listcell(df.format(pct.getValcostoinicial()));
lc.setParent(lstm);
lc = new Listcell(pct.getEmpresa().getNombempresa());
lc.setParent(lstm);
lstm.setAttribute("data", pct);
}
lc = new Listcell(df.format(pct.getValcostoinicial()));
lc.setParent(lstm);
lstm.setAttribute("data", pct);
}
}

View File

@ -4,14 +4,15 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Tarifa;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Tarifa;
/**
*
* @author rodrigo

View File

@ -1,7 +1,5 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import java.math.RoundingMode;
import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;

View File

@ -4,12 +4,12 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.TramoKmServicio;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.TramoKmServicio;
/**
*
* @author Desenvolvimento

View File

@ -1,12 +1,9 @@
package com.rjconsultores.ventaboletos.web.utilerias.servlet;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

View File

@ -2943,6 +2943,7 @@ busquedaEstadoController.lhId.label = ID
busquedaEstadoController.lhDesc.label = Descrição
busquedaEstadoController.txtNombre.label = Estado
busquedaEstadoController.lhPais.label = País
busquedaEstadoController.ICMS.label = ICMS
# Pantalla Editar Estado
editarEstadoController.window.title = Estado

View File

@ -7,7 +7,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaEstado" title="${c:l('busquedaEstadoController.window.title')}"
apply="${busquedaEstadoController}" contentStyle="overflow:auto"
height="450px" width="600px" border="normal" >
height="400px" width="650px" border="normal" >
<toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
@ -53,7 +53,7 @@
<listbox id="estadoList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false">
<listhead sizable="true">
<listheader width="70px" image="/gui/img/builder.gif"
<listheader width="15%" image="/gui/img/builder.gif"
label="${c:l('busquedaEstadoController.lhId.label')}"
sort="auto(estadoId)"/>
<listheader image="/gui/img/builder.gif"
@ -62,6 +62,9 @@
<listheader image="/gui/img/builder.gif"
label="${c:l('busquedaEstadoController.lhPais.label')}"
sort="auto(pais.paisId)"/>
<listheader image="/gui/img/builder.gif" width="20%"
label="${c:l('busquedaEstadoController.ICMS.label')}"
sort="auto(icms)"/>
<listheader id="headerEquivalencia" image="/gui/img/create_doc.gif"
label="${c:l('lb.Equivalencia')}"
sort="auto(equivalenciaId)"/>

View File

@ -5,47 +5,56 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaTipoVenta" title="${c:l('busquedaTipoVentaController.window.title')}"
apply="${busquedaTipoVentaController}" contentStyle="overflow:auto"
height="350px" width="600px" border="normal" >
<toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnNovo.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnCerrar" onClick="winBusquedaTipoVenta.detach()" image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnCerrar.tooltiptext')}"/>
</toolbar>
<window id="winBusquedaTipoVenta"
title="${c:l('busquedaTipoVentaController.window.title')}"
apply="${busquedaTipoVentaController}" contentStyle="overflow:auto"
height="350px" width="600px" border="normal">
<toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png"
width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnNovo.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnCerrar"
onClick="winBusquedaTipoVenta.detach()" image="/gui/img/exit.png"
width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnCerrar.tooltiptext')}" />
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="80px" />
<column width="100px" />
</columns>
<rows>
<row>
<label value="${c:l('busquedaTipoVentaController.txtNombre.label')}"/>
<textbox id="txtNombre" width="300px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
</row>
</rows>
</grid>
<toolbar>
<button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaTipoVentaController.btnPesquisa.label')}"/>
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="20%" />
<column width="80%" />
</columns>
<rows>
<row>
<label
value="${c:l('busquedaTipoVentaController.txtNombre.label')}" />
<textbox id="txtNombre" width="98%"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
</rows>
</grid>
<paging id="pagingTipoVenta" pageSize="20" />
<listbox id="tipoVentaList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false">
<listhead sizable="true">
<listheader image="/gui/img/create_doc.gif" width="55px"
label="${c:l('busquedaTipoVentaController.lhId.label')}" sort="auto(tipoventaId)"/>
<listheader id="lhDesc" image="/gui/img/create_doc.gif"
label="${c:l('busquedaTipoVentaController.lhDesc.label')}" sort="auto(desctipoventa)"/>
</listhead>
</listbox>
</window>
<toolbar>
<button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaTipoVentaController.btnPesquisa.label')}" />
</toolbar>
<paging id="pagingTipoVenta" pageSize="20" />
<listbox id="tipoVentaList"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false">
<listhead sizable="true">
<listheader image="/gui/img/create_doc.gif" width="55px"
label="${c:l('busquedaTipoVentaController.lhId.label')}"
sort="auto(tipoventaId)" />
<listheader id="lhDesc" image="/gui/img/create_doc.gif"
label="${c:l('busquedaTipoVentaController.lhDesc.label')}"
sort="auto(desctipoventa)" />
</listhead>
</listbox>
</window>
</zk>

View File

@ -5,52 +5,62 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winEditarEstado" border="normal"
apply="${editarEstadoController}"
width="400px" height="557x" 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()"
tooltiptext="${c:l('editarEstadoController.btnFechar.tooltiptext')}"/>
</hbox>
</toolbar>
<window id="winEditarEstado" border="normal"
apply="${editarEstadoController}" width="400px" height="557x"
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()"
tooltiptext="${c:l('editarEstadoController.btnFechar.tooltiptext')}" />
</hbox>
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</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}"
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}"
selectedItem="@{winEditarEstado$composer.estado.pais}" />
</row>
<row id="rowEquivalencia">
<label value="${c:l('lb.Equivalencia')}"/>
<textbox id="txtEquivalencia" width="100px" maxlength="10"
value="@{winEditarEstado$composer.estado.equivalenciaId}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
</row>
</rows>
</grid>
</window>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</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}"
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}"
selectedItem="@{winEditarEstado$composer.estado.pais}" />
</row>
<row>
<label
value="${c:l('busquedaEstadoController.ICMS.label')}" />
<decimalbox id="txtIcms"
value="@{winEditarEstado$composer.estado.icms}" />
</row>
<row id="rowEquivalencia">
<label value="${c:l('lb.Equivalencia')}" />
<textbox id="txtEquivalencia" width="100px"
maxlength="10"
value="@{winEditarEstado$composer.estado.equivalenciaId}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
</rows>
</grid>
</window>
</zk>