rodrigo 2012-08-20 19:49:48 +00:00
parent 34ccd46f32
commit d7810bfbf2
19 changed files with 888 additions and 1143 deletions

View File

@ -44,7 +44,6 @@ public class BusquedaEmpresaController extends MyGenericForwardComposer {
private Textbox txtNombre; private Textbox txtNombre;
private Textbox txtEquivalencia; private Textbox txtEquivalencia;
private Textbox txtRFC; private Textbox txtRFC;
private Combobox cmbExterna;
private Combobox cmbIndTipo; private Combobox cmbIndTipo;
private Row rowEquivalencia; private Row rowEquivalencia;
private Listheader headerEquivalencia; private Listheader headerEquivalencia;
@ -91,18 +90,6 @@ public class BusquedaEmpresaController extends MyGenericForwardComposer {
HibernateSearchObject<Empresa> empresaBusqueda = HibernateSearchObject<Empresa> empresaBusqueda =
new HibernateSearchObject<Empresa>(Empresa.class, pagingEmpresa.getPageSize()); new HibernateSearchObject<Empresa>(Empresa.class, pagingEmpresa.getPageSize());
Comboitem ci = cmbExterna.getSelectedItem();
String value;
if (ci != null) {
value = (String) ci.getValue();
if (value.equals("1")) {
empresaBusqueda.addFilterEqual("indExterna", Boolean.TRUE);
} else {
empresaBusqueda.addFilterEqual("indExterna", Boolean.FALSE);
}
}
Comboitem cbiTipo = cmbIndTipo.getSelectedItem(); Comboitem cbiTipo = cmbIndTipo.getSelectedItem();
Short tipo = null; Short tipo = null;
if (cbiTipo != null) { if (cbiTipo != null) {

View File

@ -34,137 +34,91 @@ import org.zkoss.zul.Textbox;
@Scope("prototype") @Scope("prototype")
public class BusquedaFormaPagoController extends MyGenericForwardComposer { public class BusquedaFormaPagoController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private transient PagedListWrapper<FormaPago> plwFormaPago; @Autowired
private MyListbox formaPagoList; private transient PagedListWrapper<FormaPago> plwFormaPago;
private Paging pagingFormaPago; private MyListbox formaPagoList;
private Textbox txtNome; private Paging pagingFormaPago;
private Textbox txtEquivalencia; private Textbox txtNome;
private Row rowEquivalencia; private Textbox txtEquivalencia;
private Listheader headerEquivalencia; private Row rowEquivalencia;
private Listheader headerEquivalencia;
public MyListbox getFormaPagoList() { @Override
return formaPagoList; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
public void setFormaPagoList(MyListbox formaPagoList) { formaPagoList.setItemRenderer(new RenderFormaPago());
this.formaPagoList = formaPagoList; formaPagoList.addEventListener("onDoubleClick", new EventListener() {
}
public Paging getPagingFormaPago() { @Override
return pagingFormaPago; public void onEvent(Event event) throws Exception {
} FormaPago c = (FormaPago) formaPagoList.getSelected();
verFormaPago(c);
}
});
public void setPagingFormaPago(Paging pagingFormaPago) { refreshLista();
this.pagingFormaPago = pagingFormaPago;
}
public Textbox getTxtNome() { if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
return txtNome; rowEquivalencia.setVisible(Boolean.FALSE);
} headerEquivalencia.setVisible(Boolean.FALSE);
}
public void setTxtNome(Textbox txtNome) { txtNome.focus();
this.txtNome = txtNome; }
}
public Textbox getTxtEquivalencia() { @SuppressWarnings({ "rawtypes", "unchecked" })
return txtEquivalencia; private void verFormaPago(FormaPago f) {
} if (f == null) {
return;
}
public void setTxtEquivalencia(Textbox txtEquivalencia) { Map args = new HashMap();
this.txtEquivalencia = txtEquivalencia; args.put("formaPago", f);
} args.put("busquedaFormaPagoController", this);
args.put("formaPagoList", formaPagoList);
public Listheader getHeaderEquivalencia() { openWindow("/gui/catalogos/editarFormaPago.zul",
return headerEquivalencia; Labels.getLabel("editarFormaPagoController.window.title"), args, MODAL);
} }
public void setHeaderEquivalencia(Listheader headerEquivalencia) { public void refreshLista() {
this.headerEquivalencia = headerEquivalencia; HibernateSearchObject<FormaPago> formaPagoBusqueda =
} new HibernateSearchObject<FormaPago>(FormaPago.class,
pagingFormaPago.getPageSize());
public Row getRowEquivalencia() { formaPagoBusqueda.addFilterLike("descpago", "%" + txtNome.getText().trim().concat("%"));
return rowEquivalencia;
}
public void setRowEquivalencia(Row rowEquivalencia) { if (!txtEquivalencia.getText().isEmpty()) {
this.rowEquivalencia = rowEquivalencia; formaPagoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%"));
} }
@Override formaPagoBusqueda.addFilterNotEqual("formapagoId", -1);
public void doAfterCompose(Component comp) throws Exception { formaPagoBusqueda.addSortAsc("descpago");
super.doAfterCompose(comp); formaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
formaPagoList.setItemRenderer(new RenderFormaPago()); plwFormaPago.init(formaPagoBusqueda, formaPagoList, pagingFormaPago);
formaPagoList.addEventListener("onDoubleClick", new EventListener() {
@Override if (formaPagoList.getData().length == 0) {
public void onEvent(Event event) throws Exception { try {
FormaPago c = (FormaPago) formaPagoList.getSelected(); Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
verFormaPago(c); Labels.getLabel("busquedaFormaPagoController.window.title"),
} Messagebox.OK, Messagebox.INFORMATION);
}); } catch (InterruptedException ex) {
}
}
}
refreshLista(); public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { public void onClick$btnRefresh(Event ev) {
rowEquivalencia.setVisible(Boolean.FALSE); refreshLista();
headerEquivalencia.setVisible(Boolean.FALSE); }
}
txtNome.focus(); public void onClick$btnNovo(Event ev) {
} verFormaPago(new FormaPago());
}
private void verFormaPago(FormaPago f) {
if (f == null) {
return;
}
Map args = new HashMap();
args.put("formaPago", f);
args.put("busquedaFormaPagoController", this);
args.put("formaPagoList", formaPagoList);
openWindow("/gui/catalogos/editarFormaPago.zul",
Labels.getLabel("editarFormaPagoController.window.title"), args, MODAL);
}
public void refreshLista() {
HibernateSearchObject<FormaPago> formaPagoBusqueda =
new HibernateSearchObject<FormaPago>(FormaPago.class,
pagingFormaPago.getPageSize());
formaPagoBusqueda.addFilterLike("descpago", "%" + txtNome.getText().trim().concat("%"));
if (!txtEquivalencia.getText().isEmpty()) {
formaPagoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%"));
}
formaPagoBusqueda.addFilterNotEqual("formapagoId", -1);
formaPagoBusqueda.addSortAsc("descpago");
formaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwFormaPago.init(formaPagoBusqueda, formaPagoList, pagingFormaPago);
if (formaPagoList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnNovo(Event ev) {
verFormaPago(new FormaPago());
}
} }

View File

@ -31,106 +31,76 @@ import org.zkoss.zul.Textbox;
@Scope("prototype") @Scope("prototype")
public class BusquedaTipoVentaController extends MyGenericForwardComposer { public class BusquedaTipoVentaController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private transient PagedListWrapper<TipoVenta> plwTipoVenta; @Autowired
private MyListbox tipoVentaList; private transient PagedListWrapper<TipoVenta> plwTipoVenta;
private Paging pagingTipoVenta; private MyListbox tipoVentaList;
private Textbox txtNombre; private Paging pagingTipoVenta;
private Textbox txtNombre;
public Textbox getTxtNombre() { @Override
return txtNombre; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
public void setTxtNombre(Textbox txtNombre) { tipoVentaList.setItemRenderer(new RenderTipoVenta());
this.txtNombre = txtNombre; tipoVentaList.addEventListener("onDoubleClick", new EventListener() {
}
public Paging getPagingTipoVenta() { @Override
return pagingTipoVenta; public void onEvent(Event event) throws Exception {
} TipoVenta ts = (TipoVenta) tipoVentaList.getSelected();
verPeriodo(ts);
}
});
public void setPagingTipoVenta(Paging pagingTipoVenta) { refreshLista();
this.pagingTipoVenta = pagingTipoVenta;
}
public MyListbox getTipoVentaList() { txtNombre.focus();
return tipoVentaList; }
}
public void setTipoVentaList(MyListbox tipoVentaList) { @SuppressWarnings({ "rawtypes", "unchecked" })
this.tipoVentaList = tipoVentaList; private void verPeriodo(TipoVenta ts) {
} if (ts == null) {
return;
}
public PagedListWrapper<TipoVenta> getPlwTipoVenta() { Map args = new HashMap();
return plwTipoVenta; args.put("tipoVenta", ts);
} args.put("tipoVentaList", tipoVentaList);
public void setPlwTipoVenta(PagedListWrapper<TipoVenta> plwTipoVenta) { openWindow("/gui/catalogos/editarTipoVenta.zul",
this.plwTipoVenta = plwTipoVenta; Labels.getLabel("editarTipoVentaController.window.title"), args, MODAL);
} }
public void onClick$btnPesquisa(Event ev) throws InterruptedException { private void refreshLista() {
refreshLista(); HibernateSearchObject<TipoVenta> claseVentaBusqueda =
} new HibernateSearchObject<TipoVenta>(TipoVenta.class, pagingTipoVenta.getPageSize());
public void onClick$btnRefresh(Event ev) { claseVentaBusqueda.addFilterLike("desctipoventa", "%" + txtNombre.getText().trim().concat("%"));
refreshLista(); claseVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
} claseVentaBusqueda.addSortAsc("desctipoventa");
claseVentaBusqueda.addFilterNotEqual("tipoventaId", -1);
public void onClick$btnNovo(Event ev) { plwTipoVenta.init(claseVentaBusqueda, tipoVentaList, pagingTipoVenta);
verPeriodo(new TipoVenta());
}
@Override if (tipoVentaList.getData().length == 0) {
public void doAfterCompose(Component comp) throws Exception { try {
super.doAfterCompose(comp); Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaTipoVentaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
tipoVentaList.setItemRenderer(new RenderTipoVenta()); public void onClick$btnPesquisa(Event ev) throws InterruptedException {
tipoVentaList.addEventListener("onDoubleClick", new EventListener() { refreshLista();
}
@Override public void onClick$btnRefresh(Event ev) {
public void onEvent(Event event) throws Exception { refreshLista();
TipoVenta ts = (TipoVenta) tipoVentaList.getSelected(); }
verPeriodo(ts);
}
});
refreshLista(); public void onClick$btnNovo(Event ev) {
verPeriodo(new TipoVenta());
txtNombre.focus(); }
}
private void verPeriodo(TipoVenta ts) {
if (ts == null) {
return;
}
Map args = new HashMap();
args.put("tipoVenta", ts);
args.put("tipoVentaList", tipoVentaList);
openWindow("/gui/catalogos/editarTipoVenta.zul",
Labels.getLabel("editarTipoVentaController.window.title"), args, MODAL);
}
private void refreshLista() {
HibernateSearchObject<TipoVenta> claseVentaBusqueda =
new HibernateSearchObject<TipoVenta>(TipoVenta.class, pagingTipoVenta.getPageSize());
claseVentaBusqueda.addFilterLike("desctipoventa", "%" + txtNombre.getText().trim().concat("%"));
claseVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
claseVentaBusqueda.addSortAsc("desctipoventa");
claseVentaBusqueda.addFilterNotEqual("tipoventaId", -1);
plwTipoVenta.init(claseVentaBusqueda, tipoVentaList, pagingTipoVenta);
if (tipoVentaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaTipoVentaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
} }

View File

@ -19,7 +19,6 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zkplus.databind.BindingListModel; import org.zkoss.zkplus.databind.BindingListModel;
import org.zkoss.zkplus.databind.BindingListModelList; import org.zkoss.zkplus.databind.BindingListModelList;
import org.zkoss.zul.Button; import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox; import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem; import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
@ -59,7 +58,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
private MyTextbox txtCNPJ; private MyTextbox txtCNPJ;
private Button btnApagar; private Button btnApagar;
private Combobox cmbIndTipo; private Combobox cmbIndTipo;
private Checkbox chkExterna;
private Combobox cmbEstado; private Combobox cmbEstado;
private Combobox cmbCidade; private Combobox cmbCidade;
private Row rowEquivalencia; private Row rowEquivalencia;
@ -104,10 +102,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
if (empresa.getEmpresaId() == null) { if (empresa.getEmpresaId() == null) {
btnApagar.setVisible(Boolean.FALSE); btnApagar.setVisible(Boolean.FALSE);
chkExterna.setChecked(true);
} else { } else {
chkExterna.setChecked(empresa.getIndExterna() == null ? false : empresa.getIndExterna());
Ciudad cidade = empresa.getCidade(); Ciudad cidade = empresa.getCidade();
if (cidade != null) { if (cidade != null) {
cmbCidade.setText(cidade.getNombciudad()); cmbCidade.setText(cidade.getNombciudad());
@ -144,7 +139,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
empresa.setActivo(Boolean.TRUE); empresa.setActivo(Boolean.TRUE);
empresa.setFecmodif(Calendar.getInstance().getTime()); empresa.setFecmodif(Calendar.getInstance().getTime());
empresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); empresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
empresa.setIndExterna(chkExterna.isChecked());
if (empresa.getEmpresaId() == null) { if (empresa.getEmpresaId() == null) {
List<Empresa> lsEmpresa = List<Empresa> lsEmpresa =
@ -183,14 +177,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
} }
} }
public void onClick$chkExterna(Event ev) {
if (!chkExterna.isChecked()) {
chkExterna.setChecked(false);
} else {
chkExterna.setChecked(true);
}
}
public void onClick$btnApagar(Event ev) { public void onClick$btnApagar(Event ev) {
try { try {
int resp = Messagebox.show( int resp = Messagebox.show(

View File

@ -4,15 +4,9 @@
*/ */
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
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.Calendar;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -23,10 +17,17 @@ import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Button; import org.zkoss.zul.Button;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Radio; import org.zkoss.zul.Radio;
import org.zkoss.zul.Row; import org.zkoss.zul.Row;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
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;
/** /**
* *
* @author Administrador * @author Administrador
@ -35,179 +36,147 @@ import org.zkoss.zul.Row;
@Scope("prototype") @Scope("prototype")
public class EditarFormaPagoController extends MyGenericForwardComposer { public class EditarFormaPagoController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private FormaPagoService formaPagoService; @Autowired
private FormaPago formaPago; private FormaPagoService formaPagoService;
private MyListbox formaPagoList; private FormaPago formaPago;
private MyTextbox txtNome; private MyListbox formaPagoList;
private Button btnApagar; private MyTextbox txtNome;
private BusquedaFormaPagoController busquedaFormaPagoController; private Button btnApagar;
private Button btnSalvar; private BusquedaFormaPagoController busquedaFormaPagoController;
private Radio rd1; private Button btnSalvar;
private Radio rd2; private Radio rd1;
private Radio rd3; private Radio rd2;
private Radio rd4; private Radio rd3;
private static Logger log = Logger.getLogger(EditarFormaPagoController.class); private Radio rd4;
private Row rowEquivalencia; private static Logger log = Logger.getLogger(EditarFormaPagoController.class);
private Row rowEquivalencia;
public FormaPago getFormaPago() { public FormaPago getFormaPago() {
return formaPago; return formaPago;
} }
public void setFormaPago(FormaPago formaPago) { public void setFormaPago(FormaPago formaPago) {
this.formaPago = formaPago; this.formaPago = formaPago;
} }
public MyTextbox getTxtNome() { @Override
return txtNome; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
busquedaFormaPagoController = (BusquedaFormaPagoController) Executions.getCurrent().getArg().get("busquedaFormaPagoController");
formaPago = (FormaPago) Executions.getCurrent().getArg().get("formaPago");
formaPagoList = (MyListbox) Executions.getCurrent().getArg().get("formaPagoList");
public void setTxtNome(MyTextbox txtNome) { if (formaPago.getFormapagoId() == null) {
this.txtNome = txtNome; btnApagar.setVisible(Boolean.FALSE);
} } else {
public Button getBtnApagar() { if (formaPago.getIndoperacion() == null) {
return btnApagar; rd4.setChecked(true);
} } else if (formaPago.getIndoperacion() == 1) {
rd1.setChecked(true);
} else if (formaPago.getIndoperacion() == 2) {
rd2.setChecked(true);
} else if (formaPago.getIndoperacion() == 3) {
rd3.setChecked(true);
}
public void setBtnApagar(Button btnApagar) { if (formaPago.getFormapagoId() <= 11 || (formaPago.getFormapagoId() >= 96 && formaPago.getFormapagoId() <= 99)) {
this.btnApagar = btnApagar; btnApagar.setVisible(Boolean.FALSE);
} btnSalvar.setVisible(Boolean.FALSE);
txtNome.setDisabled(Boolean.TRUE);
public Button getBtnSalvar() { Messagebox.show(
return btnSalvar; Labels.getLabel("MSG.noEditabled"),
} Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
}
public void setBtnSalvar(Button btnSalvar) { if (!ApplicationProperties.getInstance().mostrarEquivalencia()) {
this.btnSalvar = btnSalvar; rowEquivalencia.setVisible(Boolean.FALSE);
} }
public Row getRowEquivalencia() { txtNome.focus();
return rowEquivalencia; }
}
public void setRowEquivalencia(Row rowEquivalencia) { public void onClick$btnSalvar(Event ev) throws InterruptedException {
this.rowEquivalencia = rowEquivalencia; txtNome.getText();
}
@Override try {
public void doAfterCompose(Component comp) throws Exception { formaPago.setActivo(Boolean.TRUE);
super.doAfterCompose(comp); formaPago.setFecmodif(Calendar.getInstance().getTime());
busquedaFormaPagoController = (BusquedaFormaPagoController) Executions.getCurrent().getArg().get("busquedaFormaPagoController"); formaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
formaPago = (FormaPago) Executions.getCurrent().getArg().get("formaPago");
formaPagoList = (MyListbox) Executions.getCurrent().getArg().get("formaPagoList");
if (formaPago.getFormapagoId() == null) { if (rd4.isChecked()) {
btnApagar.setVisible(Boolean.FALSE); formaPago.setIndoperacion(null);
} else { } else if (rd1.isChecked()) {
formaPago.setIndoperacion(new Short("1"));
} else if (rd2.isChecked()) {
formaPago.setIndoperacion(new Short("2"));
} else if (rd3.isChecked()) {
formaPago.setIndoperacion(new Short("3"));
}
if (formaPago.getIndoperacion() == null) { if (formaPago.getFormapagoId() == null) {
rd4.setChecked(true); List<FormaPago> lsFP =
} else if (formaPago.getIndoperacion() == 1) { formaPagoService.buscarPorDescricao(formaPago.getDescpago());
rd1.setChecked(true);
} else if (formaPago.getIndoperacion() == 2) {
rd2.setChecked(true);
} else if (formaPago.getIndoperacion() == 3) {
rd3.setChecked(true);
}
if (lsFP.isEmpty()) {
formaPagoService.suscribir(formaPago);
formaPagoList.addItem(formaPago);
if (formaPago.getFormapagoId() <= 11 || (formaPago.getFormapagoId() >= 96 && formaPago.getFormapagoId() <= 99)) { Messagebox.show(
btnApagar.setVisible(Boolean.FALSE); Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"),
btnSalvar.setVisible(Boolean.FALSE); Labels.getLabel("editarFormaPagoController.window.title"),
txtNome.setDisabled(Boolean.TRUE); Messagebox.OK, Messagebox.INFORMATION);
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} else {
formaPagoService.actualizacion(formaPago);
formaPagoList.updateItem(formaPago);
Messagebox.show( Messagebox.show(
Labels.getLabel("MSG.noEditabled"), Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"),
Labels.getLabel("editarFormaPagoController.window.title"), Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION); Messagebox.OK, Messagebox.INFORMATION);
} }
} busquedaFormaPagoController.refreshLista();
closeWindow();
} catch (Exception ex) {
log.error("editarFormaPagoController: " + ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { public void onClick$btnApagar(Event ev) {
rowEquivalencia.setVisible(Boolean.FALSE); try {
} int resp = Messagebox.show(
Labels.getLabel("editarFormaPagoController.MSG.borrarPergunta"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
txtNome.focus(); if (resp == Messagebox.YES) {
} formaPagoService.borrar(formaPago);
public void onClick$btnSalvar(Event ev) throws InterruptedException { Messagebox.show(
txtNome.getText(); Labels.getLabel("editarFormaPagoController.MSG.borrarOK"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
try { formaPagoList.removeItem(formaPago);
formaPago.setActivo(Boolean.TRUE);
formaPago.setFecmodif(Calendar.getInstance().getTime());
formaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
if (rd4.isChecked()) { closeWindow();
formaPago.setIndoperacion(null); }
} else if (rd1.isChecked()) { } catch (Exception ex) {
formaPago.setIndoperacion(new Short("1")); log.error(ex);
} else if (rd2.isChecked()) { }
formaPago.setIndoperacion(new Short("2")); }
} else if (rd3.isChecked()) {
formaPago.setIndoperacion(new Short("3"));
}
if (formaPago.getFormapagoId() == null) {
List<FormaPago> lsFP =
formaPagoService.buscarPorDescricao(formaPago.getDescpago());
if (lsFP.isEmpty()) {
formaPagoService.suscribir(formaPago);
formaPagoList.addItem(formaPago);
Messagebox.show(
Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} else {
formaPagoService.actualizacion(formaPago);
formaPagoList.updateItem(formaPago);
Messagebox.show(
Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
busquedaFormaPagoController.refreshLista();
closeWindow();
} catch (Exception ex) {
log.error("editarFormaPagoController: " + ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(
Labels.getLabel("editarFormaPagoController.MSG.borrarPergunta"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
formaPagoService.borrar(formaPago);
Messagebox.show(
Labels.getLabel("editarFormaPagoController.MSG.borrarOK"),
Labels.getLabel("editarFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
formaPagoList.removeItem(formaPago);
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
}
}
} }

View File

@ -4,25 +4,25 @@
*/ */
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
import java.util.Calendar;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
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.Messagebox;
import com.rjconsultores.ventaboletos.entidad.TipoVenta; import com.rjconsultores.ventaboletos.entidad.TipoVenta;
import com.rjconsultores.ventaboletos.service.TipoVentaService; import com.rjconsultores.ventaboletos.service.TipoVentaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
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.Messagebox;
import org.zkoss.zul.Textbox;
/** /**
* *
@ -32,158 +32,122 @@ import org.zkoss.zul.Textbox;
@Scope("prototype") @Scope("prototype")
public class EditarTipoVentaController extends MyGenericForwardComposer { public class EditarTipoVentaController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private TipoVentaService tipoVentaService; @Autowired
private TipoVenta tipoVenta; private TipoVentaService tipoVentaService;
private MyListbox tipoVentaList; private TipoVenta tipoVenta;
private static Logger log = Logger.getLogger(EditarTipoVentaController.class); private MyListbox tipoVentaList;
private MyTextbox txtNome; private static Logger log = Logger.getLogger(EditarTipoVentaController.class);
private Button btnApagar; private MyTextbox txtNome;
private Button btnSalvar;
public Button getBtnApagar() { public TipoVenta getTipoVenta() {
return btnApagar; return tipoVenta;
} }
public void setBtnApagar(Button btnApagar) { public void setTipoVenta(TipoVenta tipoVenta) {
this.btnApagar = btnApagar; this.tipoVenta = tipoVenta;
} }
public Textbox getTxtNome() { @Override
return txtNome; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
public void setTxtNome(MyTextbox txtNome) { TipoVenta tp = (TipoVenta) Executions.getCurrent().getArg().get("tipoVenta");
this.txtNome = txtNome; tipoVenta = (tp.getTipoventaId() == null) ? tp : tipoVentaService.obtenerID(tp.getTipoventaId());
} tipoVentaList = (MyListbox) Executions.getCurrent().getArg().get("tipoVentaList");
@Override if (tipoVenta.getDesctipoventa() != null) {
public void doAfterCompose(Component comp) throws Exception { txtNome.setValue(tipoVenta.getDesctipoventa());
super.doAfterCompose(comp); }
TipoVenta tp = (TipoVenta) Executions.getCurrent().getArg().get("tipoVenta"); if (tipoVenta.getTipoventaId() != null) {
tipoVenta = (tp.getTipoventaId() == null) ? tp : tipoVentaService.obtenerID(tp.getTipoventaId()); if (tipoVenta.getTipoventaId() <= 12) {
tipoVentaList = (MyListbox) Executions.getCurrent().getArg().get("tipoVentaList"); txtNome.setDisabled(Boolean.TRUE);
if (tipoVenta.getDesctipoventa() != null) { Messagebox.show(
txtNome.setValue(tipoVenta.getDesctipoventa()); Labels.getLabel("MSG.noEditabled"),
} Labels.getLabel("editarTipoVentaController.window.title"),
if (tipoVenta.getTipoventaId() == null) { Messagebox.OK, Messagebox.INFORMATION);
btnApagar.setVisible(Boolean.FALSE); }
} else { }
if (tipoVenta.getTipoventaId() <= 12) {
btnApagar.setVisible(Boolean.FALSE);
btnSalvar.setVisible(Boolean.FALSE);
txtNome.setDisabled(Boolean.TRUE);
Messagebox.show( txtNome.focus();
Labels.getLabel("MSG.noEditabled"), }
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
}
txtNome.focus(); public void onClick$btnSalvar(Event ev) throws InterruptedException {
} txtNome.getValue();
try {
tipoVenta.setDesctipoventa(txtNome.getValue());
tipoVenta.setActivo(Boolean.TRUE);
tipoVenta.setFecmodif(Calendar.getInstance().getTime());
tipoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
public void onClick$btnSalvar(Event ev) throws InterruptedException { List<TipoVenta> lsTipoVenta = tipoVentaService.buscar(tipoVenta.getDesctipoventa());
txtNome.getValue();
try {
tipoVenta.setDesctipoventa(txtNome.getValue());
tipoVenta.setActivo(Boolean.TRUE);
tipoVenta.setFecmodif(Calendar.getInstance().getTime());
tipoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
List<TipoVenta> lsTipoVenta = tipoVentaService.buscar(tipoVenta.getDesctipoventa()); boolean podeSalvar = false;
if (lsTipoVenta.isEmpty()) {
podeSalvar = true;
} else {
for (TipoVenta m : lsTipoVenta) {
if (m.getTipoventaId().equals(tipoVenta.getTipoventaId())) {
podeSalvar = true;
}
}
}
boolean podeSalvar = false; if (!podeSalvar) {
if (lsTipoVenta.isEmpty()) { Messagebox.show(
podeSalvar = true; Labels.getLabel("MSG.Registro.Existe"),
} else { Labels.getLabel("editarTipoVentaController.window.title"),
for (TipoVenta m : lsTipoVenta) { Messagebox.OK, Messagebox.EXCLAMATION);
if (m.getTipoventaId().equals(tipoVenta.getTipoventaId())) { } else {
podeSalvar = true;
}
}
}
if (!podeSalvar) { if (tipoVenta.getTipoventaId() == null) {
Messagebox.show( tipoVentaService.suscribir(tipoVenta);
Labels.getLabel("MSG.Registro.Existe"), tipoVentaList.addItem(tipoVenta);
Labels.getLabel("editarTipoVentaController.window.title"), } else {
Messagebox.OK, Messagebox.EXCLAMATION); tipoVentaService.actualizacion(tipoVenta);
} else { tipoVentaList.updateItem(tipoVenta);
}
if (tipoVenta.getTipoventaId() == null) { Messagebox.show(
tipoVentaService.suscribir(tipoVenta); Labels.getLabel("editarTipoVentaController.MSG.suscribirOK"),
tipoVentaList.addItem(tipoVenta); Labels.getLabel("editarTipoVentaController.window.title"),
} else { Messagebox.OK, Messagebox.INFORMATION);
tipoVentaService.actualizacion(tipoVenta);
tipoVentaList.updateItem(tipoVenta);
}
Messagebox.show( closeWindow();
Labels.getLabel("editarTipoVentaController.MSG.suscribirOK"), }
Labels.getLabel("editarTipoVentaController.window.title"), } catch (Exception ex) {
Messagebox.OK, Messagebox.INFORMATION); log.error("Suscribir TipoVenta: " + ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
closeWindow(); public void onClick$btnApagar(Event ev) {
} try {
} catch (Exception ex) { int resp = Messagebox.show(
log.error("Suscribir TipoVenta: " + ex); Labels.getLabel("editarTipoVentaController.MSG.borrarPergunta"),
Messagebox.show( Labels.getLabel("editarTipoVentaController.window.title"),
Labels.getLabel("MSG.Error"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnApagar(Event ev) { if (resp == Messagebox.YES) {
try {
int resp = Messagebox.show(
Labels.getLabel("editarTipoVentaController.MSG.borrarPergunta"),
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) { tipoVentaService.borrar(tipoVenta);
tipoVentaService.borrar(tipoVenta); Messagebox.show(
Labels.getLabel("editarTipoVentaController.MSG.borrarOK"),
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
Messagebox.show( tipoVentaList.removeItem(tipoVenta);
Labels.getLabel("editarTipoVentaController.MSG.borrarOK"),
Labels.getLabel("editarTipoVentaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
tipoVentaList.removeItem(tipoVenta); closeWindow();
}
closeWindow(); } catch (Exception ex) {
} log.error(ex);
} catch (Exception ex) { }
log.error(ex); }
}
}
public TipoVenta getTipoVenta() {
return tipoVenta;
}
public void setTipoVenta(TipoVenta tipoVenta) {
this.tipoVenta = tipoVenta;
}
public MyListbox getTipoVentaList() {
return tipoVentaList;
}
public void setTipoVentaList(MyListbox tipoVentaList) {
this.tipoVentaList = tipoVentaList;
}
public TipoVentaService getTipoVentaService() {
return tipoVentaService;
}
public void setTipoVentaService(TipoVentaService tipoVentaService) {
this.tipoVentaService = tipoVentaService;
}
} }

View File

@ -31,100 +31,76 @@ import org.zkoss.zul.Textbox;
@Scope("prototype") @Scope("prototype")
public class BusquedaConfiguracionFormaPagoController extends MyGenericForwardComposer { public class BusquedaConfiguracionFormaPagoController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private transient PagedListWrapper<FormaPagoDet> plwConfigFormaPago; @Autowired
private MyListbox configFormaPagoList; private transient PagedListWrapper<FormaPagoDet> plwConfigFormaPago;
private Paging pagingConfigFormaPago; private MyListbox configFormaPagoList;
private Textbox txtNome; private Paging pagingConfigFormaPago;
private Textbox txtNome;
public MyListbox getConfigFormaPagoList() { @Override
return configFormaPagoList; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
public void setConfigFormaPagoList(MyListbox configFormaPagoList) { configFormaPagoList.setItemRenderer(new RenderConfiguracionFormasPago());
this.configFormaPagoList = configFormaPagoList; configFormaPagoList.addEventListener("onDoubleClick", new EventListener() {
}
public Paging getPagingConfigFormaPago() { @Override
return pagingConfigFormaPago; public void onEvent(Event event) throws Exception {
} FormaPagoDet fpd = (FormaPagoDet) configFormaPagoList.getSelected();
verConfigFormaPago(fpd);
}
});
public void setPagingConfigFormaPago(Paging pagingConfigFormaPago) { refreshLista();
this.pagingConfigFormaPago = pagingConfigFormaPago;
}
public Textbox getTxtNome() { txtNome.focus();
return txtNome; }
}
public void setTxtNome(Textbox txtNome) { @SuppressWarnings({ "rawtypes", "unchecked" })
this.txtNome = txtNome; private void verConfigFormaPago(FormaPagoDet fpd) {
} if (fpd == null) {
return;
}
@Override Map args = new HashMap();
public void doAfterCompose(Component comp) throws Exception { args.put("formaPagoDet", fpd);
super.doAfterCompose(comp); args.put("configFormaPagoList", configFormaPagoList);
configFormaPagoList.setItemRenderer(new RenderConfiguracionFormasPago()); openWindow("/gui/configuraciones_comerciales/editarConfiguracionFormaPago.zul",
configFormaPagoList.addEventListener("onDoubleClick", new EventListener() { Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), args, MODAL);
}
@Override private void refreshLista() {
public void onEvent(Event event) throws Exception { HibernateSearchObject<FormaPagoDet> configFormaPagoBusqueda =
FormaPagoDet fpd = (FormaPagoDet) configFormaPagoList.getSelected(); new HibernateSearchObject<FormaPagoDet>(FormaPagoDet.class, pagingConfigFormaPago.getPageSize());
verConfigFormaPago(fpd);
}
});
refreshLista(); configFormaPagoBusqueda.addFilterLike("formaPago.descpago", "%" + txtNome.getText().trim().concat("%"));
txtNome.focus(); configFormaPagoBusqueda.addSortAsc("formaPago.descpago");
} configFormaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
private void verConfigFormaPago(FormaPagoDet fpd) { plwConfigFormaPago.init(configFormaPagoBusqueda, configFormaPagoList, pagingConfigFormaPago);
if (fpd == null) {
return;
}
Map args = new HashMap(); if (configFormaPagoList.getData().length == 0) {
args.put("formaPagoDet", fpd); try {
args.put("configFormaPagoList", configFormaPagoList); Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaConfiguracionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
openWindow("/gui/configuraciones_comerciales/editarConfiguracionFormaPago.zul", public void onClick$btnPesquisa(Event ev) {
Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), args, MODAL); refreshLista();
} }
private void refreshLista() { public void onClick$btnRefresh(Event ev) {
HibernateSearchObject<FormaPagoDet> configFormaPagoBusqueda = refreshLista();
new HibernateSearchObject<FormaPagoDet>(FormaPagoDet.class, }
pagingConfigFormaPago.getPageSize());
configFormaPagoBusqueda.addFilterLike("formaPago.descpago", public void onClick$btnNovo(Event ev) {
"%" + txtNome.getText().trim().concat("%")); verConfigFormaPago(new FormaPagoDet());
}
configFormaPagoBusqueda.addSortAsc("formaPago.descpago");
configFormaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwConfigFormaPago.init(configFormaPagoBusqueda, configFormaPagoList, pagingConfigFormaPago);
if (configFormaPagoList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaConfiguracionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnNovo(Event ev) {
verConfigFormaPago(new FormaPagoDet());
}
} }

View File

@ -31,105 +31,83 @@ import org.zkoss.zul.Textbox;
@Scope("prototype") @Scope("prototype")
public class BusquedaRestriccionFormaPagoController extends MyGenericForwardComposer { public class BusquedaRestriccionFormaPagoController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private transient PagedListWrapper<ConfigRestriccionPago> plwRestriccionFormaPago; @Autowired
private MyListbox restriccionFormaPagoList; private transient PagedListWrapper<ConfigRestriccionPago> plwRestriccionFormaPago;
private Paging pagingrestriccionFormaPago; private MyListbox restriccionFormaPagoList;
private Textbox txtNome; private Paging pagingrestriccionFormaPago;
private Textbox txtNome;
public Paging getPagingrestriccionFormaPago() { @Override
return pagingrestriccionFormaPago; public void doAfterCompose(Component comp) throws Exception {
} super.doAfterCompose(comp);
public void setPagingrestriccionFormaPago(Paging pagingrestriccionFormaPago) { restriccionFormaPagoList.setItemRenderer(new RenderRestriccionFormaPago());
this.pagingrestriccionFormaPago = pagingrestriccionFormaPago; restriccionFormaPagoList.addEventListener("onDoubleClick",
} new EventListener() {
public MyListbox getRestriccionFormaPagoList() { @Override
return restriccionFormaPagoList; public void onEvent(Event event) throws Exception {
} ConfigRestriccionPago c =
(ConfigRestriccionPago) restriccionFormaPagoList.getSelected();
verConfigRestriccionPago(c);
}
});
public void setRestriccionFormaPagoList(MyListbox restriccionFormaPagoList) { refreshLista();
this.restriccionFormaPagoList = restriccionFormaPagoList;
}
public Textbox getTxtNome() { txtNome.focus();
return txtNome; }
}
public void setTxtNome(Textbox txtNome) { @SuppressWarnings({ "rawtypes", "unchecked" })
this.txtNome = txtNome; private void verConfigRestriccionPago(ConfigRestriccionPago c) {
} if (c == null) {
return;
}
@Override Map args = new HashMap();
public void doAfterCompose(Component comp) throws Exception { args.put("configRestriccionPago", c);
super.doAfterCompose(comp); args.put("configRestriccionFormaPagoList", restriccionFormaPagoList);
restriccionFormaPagoList.setItemRenderer(new RenderRestriccionFormaPago()); openWindow("/gui/configuraciones_comerciales/editarRestriccionFormaPago.zul",
restriccionFormaPagoList.addEventListener("onDoubleClick", Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
new EventListener() { args, MODAL);
}
@Override private void refreshLista() {
public void onEvent(Event event) throws Exception { HibernateSearchObject<ConfigRestriccionPago> configRestriccionPagoBusqueda =
ConfigRestriccionPago c = new HibernateSearchObject<ConfigRestriccionPago>(
(ConfigRestriccionPago) restriccionFormaPagoList.getSelected(); ConfigRestriccionPago.class,
verConfigRestriccionPago(c); pagingrestriccionFormaPago.getPageSize());
}
});
refreshLista(); configRestriccionPagoBusqueda.addFilterLike("formaPago.descpago",
"%" + txtNome.getText().trim().concat("%"));
txtNome.focus(); configRestriccionPagoBusqueda.addSortAsc("formaPago.descpago");
} configRestriccionPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
private void verConfigRestriccionPago(ConfigRestriccionPago c) { plwRestriccionFormaPago.init(configRestriccionPagoBusqueda,
if (c == null) { restriccionFormaPagoList, pagingrestriccionFormaPago);
return;
}
Map args = new HashMap(); if (restriccionFormaPagoList.getData().length == 0) {
args.put("configRestriccionPago", c); try {
args.put("configRestriccionFormaPagoList", restriccionFormaPagoList); Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
openWindow("/gui/configuraciones_comerciales/editarRestriccionFormaPago.zul", public void onClick$btnPesquisa(Event ev) {
Labels.getLabel("editarRestriccionFormaPagoController.window.title"), refreshLista();
args, MODAL); }
}
private void refreshLista() { public void onClick$btnRefresh(Event ev) {
HibernateSearchObject<ConfigRestriccionPago> configRestriccionPagoBusqueda = refreshLista();
new HibernateSearchObject<ConfigRestriccionPago>( }
ConfigRestriccionPago.class,
pagingrestriccionFormaPago.getPageSize());
configRestriccionPagoBusqueda.addFilterLike("formaPago.descpago", public void onClick$btnNovo(Event ev) {
"%" + txtNome.getText().trim().concat("%")); verConfigRestriccionPago(new ConfigRestriccionPago());
}
configRestriccionPagoBusqueda.addSortAsc("formaPago.descpago");
configRestriccionPagoBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwRestriccionFormaPago.init(configRestriccionPagoBusqueda,
restriccionFormaPagoList, pagingrestriccionFormaPago);
if (restriccionFormaPagoList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnNovo(Event ev) {
verConfigRestriccionPago(new ConfigRestriccionPago());
}
} }

View File

@ -4,6 +4,20 @@
*/ */
package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales;
import java.util.Calendar;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Combobox;
import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago;
import com.rjconsultores.ventaboletos.entidad.FormaPago; import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.entidad.RestriccionPago; import com.rjconsultores.ventaboletos.entidad.RestriccionPago;
@ -13,19 +27,6 @@ import com.rjconsultores.ventaboletos.service.RestriccionPagoService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import java.util.Calendar;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
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;
/** /**
* *
@ -35,187 +36,150 @@ import org.zkoss.zul.Combobox;
@Scope("prototype") @Scope("prototype")
public class EditarRestriccionFormaPagoController extends MyGenericForwardComposer { public class EditarRestriccionFormaPagoController extends MyGenericForwardComposer {
@Autowired private static final long serialVersionUID = 1L;
private FormaPagoService formaPagoService; @Autowired
@Autowired private FormaPagoService formaPagoService;
private RestriccionPagoService restriccionPagoService; @Autowired
@Autowired private RestriccionPagoService restriccionPagoService;
private ConfigRestriccionPagoService configRestriccionPagoService; @Autowired
private ConfigRestriccionPago configRestriccionPago; private ConfigRestriccionPagoService configRestriccionPagoService;
private MyListbox restriccionFormaPagoList; private ConfigRestriccionPago configRestriccionPago;
private List<FormaPago> lsFormaPago; private MyListbox restriccionFormaPagoList;
private List<RestriccionPago> lsRestriccionPago; private List<FormaPago> lsFormaPago;
private Combobox cmbFormaPago; private List<RestriccionPago> lsRestriccionPago;
private Combobox cmbRestriccionFormaPago; private Combobox cmbFormaPago;
private Button btnApagar; private Combobox cmbRestriccionFormaPago;
private static Logger log = Logger.getLogger(EditarRestriccionFormaPagoController.class); private static Logger log = Logger.getLogger(EditarRestriccionFormaPagoController.class);
public Button getBtnApagar() { public List<FormaPago> getLsFormaPago() {
return btnApagar; return lsFormaPago;
} }
public void setBtnApagar(Button btnApagar) { public void setLsFormaPago(List<FormaPago> lsFormaPago) {
this.btnApagar = btnApagar; this.lsFormaPago = lsFormaPago;
} }
public FormaPagoService getFormaPagoService() { public List<RestriccionPago> getLsRestriccionPago() {
return formaPagoService; return lsRestriccionPago;
} }
public void setFormaPagoService(FormaPagoService formaPagoService) { public void setLsRestriccionPago(List<RestriccionPago> lsRestriccionPago) {
this.formaPagoService = formaPagoService; this.lsRestriccionPago = lsRestriccionPago;
} }
public List<FormaPago> getLsFormaPago() { public ConfigRestriccionPago getConfigRestriccionPago() {
return lsFormaPago; return configRestriccionPago;
} }
public void setLsFormaPago(List<FormaPago> lsFormaPago) { public void setConfigRestriccionPago(ConfigRestriccionPago configRestriccionPago) {
this.lsFormaPago = lsFormaPago; this.configRestriccionPago = configRestriccionPago;
} }
public List<RestriccionPago> getLsRestriccionPago() { @Override
return lsRestriccionPago; public void doAfterCompose(Component comp) throws Exception {
} lsFormaPago = formaPagoService.obtenerTodos();
lsRestriccionPago = restriccionPagoService.obtenerTodos();
public void setLsRestriccionPago(List<RestriccionPago> lsRestriccionPago) { super.doAfterCompose(comp);
this.lsRestriccionPago = lsRestriccionPago;
}
public ConfigRestriccionPago getConfigRestriccionPago() { configRestriccionPago = (ConfigRestriccionPago) Executions.getCurrent().getArg().get("configRestriccionPago");
return configRestriccionPago; restriccionFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("configRestriccionFormaPagoList");
}
public void setConfigRestriccionPago(ConfigRestriccionPago configRestriccionPago) { cmbFormaPago.focus();
this.configRestriccionPago = configRestriccionPago; }
}
public Combobox getCmbFormaPago() { public void onClick$btnSalvar(Event ev) {
return cmbFormaPago; cmbFormaPago.getValue();
} cmbRestriccionFormaPago.getValue();
public void setCmbFormaPago(Combobox cmbFormaPago) { try {
this.cmbFormaPago = cmbFormaPago; boolean puedoDarDeAlta = configRestriccionPagoService.puedoDarDeAlta(configRestriccionPago);
}
public Combobox getCmbRestriccionFormaPago() { List<ConfigRestriccionPago> lsConfig = configRestriccionPagoService.buscar(configRestriccionPago.getFormaPago(), configRestriccionPago.getRestriccion());
return cmbRestriccionFormaPago;
}
public void setCmbRestriccionFormaPago(Combobox cmbRestriccionFormaPago) { boolean podeSalvar = false;
this.cmbRestriccionFormaPago = cmbRestriccionFormaPago; if (lsConfig.isEmpty()) {
} podeSalvar = true;
} else {
for (ConfigRestriccionPago m : lsConfig) {
if (m.getConfigrestriccionId().equals(configRestriccionPago.getConfigrestriccionId())) {
podeSalvar = true;
}
}
}
@Override if (!puedoDarDeAlta) {
public void doAfterCompose(Component comp) throws Exception {
lsFormaPago = formaPagoService.obtenerTodos();
lsRestriccionPago = restriccionPagoService.obtenerTodos();
super.doAfterCompose(comp); Integer idRestricion = (configRestriccionPago.getRestriccion().getRestriccionId() == 1)
? 4
: (configRestriccionPago.getRestriccion().getRestriccionId() == 2)
? 5
: (configRestriccionPago.getRestriccion().getRestriccionId() == 3)
? 6 : 0;
RestriccionPago restriContraria = restriccionPagoService.obtenerID(idRestricion.shortValue());
String msg = "";
if (restriContraria != null) {
msg = restriContraria.getDescrestriccion();
}
configRestriccionPago = (ConfigRestriccionPago) Executions.getCurrent().getArg().get("configRestriccionPago"); Messagebox.show(
restriccionFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("configRestriccionFormaPagoList"); Labels.getLabel("editarRestriccionFormaPagoController.MSG.puedoDarDeAlta", new Object[] { msg }),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
if (configRestriccionPago.getConfigrestriccionId() == null) { if (podeSalvar) {
btnApagar.setVisible(Boolean.FALSE); configRestriccionPago.setActivo(Boolean.TRUE);
} configRestriccionPago.setFecmodif(Calendar.getInstance().getTime());
configRestriccionPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
cmbFormaPago.focus(); if (configRestriccionPago.getConfigrestriccionId() == null) {
} configRestriccionPagoService.suscribir(configRestriccionPago);
restriccionFormaPagoList.addItem(configRestriccionPago);
} else {
configRestriccionPagoService.actualizacion(configRestriccionPago);
restriccionFormaPagoList.updateItem(configRestriccionPago);
}
public void onClick$btnSalvar(Event ev) { Messagebox.show(
cmbFormaPago.getValue(); Labels.getLabel("editarRestriccionFormaPagoController.MSG.suscribirOK"),
cmbRestriccionFormaPago.getValue(); Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} catch (Exception ex) {
log.error(ex);
}
}
try { public void onClick$btnApagar(Event ev) {
boolean puedoDarDeAlta = configRestriccionPagoService.puedoDarDeAlta(configRestriccionPago); try {
int resp = Messagebox.show(
Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarPergunta"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
List<ConfigRestriccionPago> lsConfig = configRestriccionPagoService.buscar(configRestriccionPago.getFormaPago(), configRestriccionPago.getRestriccion()); if (resp == Messagebox.YES) {
configRestriccionPagoService.borrar(configRestriccionPago);
boolean podeSalvar = false; Messagebox.show(
if (lsConfig.isEmpty()) { Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarOK"),
podeSalvar = true; Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
} else { Messagebox.OK, Messagebox.INFORMATION);
for (ConfigRestriccionPago m : lsConfig) {
if (m.getConfigrestriccionId().equals(configRestriccionPago.getConfigrestriccionId())) {
podeSalvar = true;
}
}
}
if (!puedoDarDeAlta) { restriccionFormaPagoList.removeItem(configRestriccionPago);
Integer idRestricion = (configRestriccionPago.getRestriccion().getRestriccionId() == 1) closeWindow();
? 4 }
: (configRestriccionPago.getRestriccion().getRestriccionId() == 2) } catch (Exception ex) {
? 5 log.error(ex);
: (configRestriccionPago.getRestriccion().getRestriccionId() == 3) }
? 6 : 0; }
RestriccionPago restriContraria = restriccionPagoService.obtenerID(idRestricion.shortValue());
String msg = "";
if (restriContraria != null) {
msg = restriContraria.getDescrestriccion();
}
Messagebox.show(
Labels.getLabel("editarRestriccionFormaPagoController.MSG.puedoDarDeAlta", new Object[]{msg}),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
if (podeSalvar) {
configRestriccionPago.setActivo(Boolean.TRUE);
configRestriccionPago.setFecmodif(Calendar.getInstance().getTime());
configRestriccionPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
if (configRestriccionPago.getConfigrestriccionId() == null) {
configRestriccionPagoService.suscribir(configRestriccionPago);
restriccionFormaPagoList.addItem(configRestriccionPago);
} else {
configRestriccionPagoService.actualizacion(configRestriccionPago);
restriccionFormaPagoList.updateItem(configRestriccionPago);
}
Messagebox.show(
Labels.getLabel("editarRestriccionFormaPagoController.MSG.suscribirOK"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
} else {
Messagebox.show(
Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} catch (Exception ex) {
log.error(ex);
}
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(
Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarPergunta"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
configRestriccionPagoService.borrar(configRestriccionPago);
Messagebox.show(
Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarOK"),
Labels.getLabel("editarRestriccionFormaPagoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
restriccionFormaPagoList.removeItem(configRestriccionPago);
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
}
}
} }

View File

@ -26,17 +26,6 @@ public class RenderEmpresa implements ListitemRenderer {
lc = new Listcell(empresa.getNombempresa()); lc = new Listcell(empresa.getNombempresa());
lc.setParent(lstm); lc.setParent(lstm);
Boolean externa = empresa.getIndExterna();
if (externa != null) {
if (externa) {
lc = new Listcell(Labels.getLabel("MSG.SI"));
lc.setParent(lstm);
} else {
lc = new Listcell(Labels.getLabel("MSG.NO"));
lc.setParent(lstm);
}
}
Short tipo = empresa.getIndTipo(); Short tipo = empresa.getIndTipo();
Short short1 = 1; Short short1 = 1;
Short short2 = 2; Short short2 = 2;

View File

@ -286,19 +286,19 @@
class="com.rjconsultores.ventaboletos.web.utilerias.spring.ApplicationContextProvider"> class="com.rjconsultores.ventaboletos.web.utilerias.spring.ApplicationContextProvider">
</bean> </bean>
<!-- <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> --> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<!-- <property name="resourceRef" value="true" /> --> <property name="resourceRef" value="true" />
<!-- <property name="jndiName" value="${database.jndi.name}" /> --> <property name="jndiName" value="${database.jndi.name}" />
<!-- </bean> -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${database.driver}" />
<property name="url" value="${database.url}" />
<property name="username" value="${database.username}" />
<property name="password" value="${database.password}" />
</bean> </bean>
<!-- <bean id="dataSource" -->
<!-- class="org.springframework.jdbc.datasource.DriverManagerDataSource"> -->
<!-- <property name="driverClassName" value="${database.driver}" /> -->
<!-- <property name="url" value="${database.url}" /> -->
<!-- <property name="username" value="${database.username}" /> -->
<!-- <property name="password" value="${database.password}" /> -->
<!-- </bean> -->
<!-- ====================================================== --> <!-- ====================================================== -->
<!-- Search class from Hibernate-Generic-DAO framework --> <!-- Search class from Hibernate-Generic-DAO framework -->
<!-- ====================================================== --> <!-- ====================================================== -->

View File

@ -7,7 +7,7 @@
# <controler>. <id>. <propiedade> = XXX # <controler>. <id>. <propiedade> = XXX
#Versao do VentaBoleto: #Versao do VentaBoleto:
versao = ADM_20120817_1RC47 versao = ADM_20120820_1RC48
# MSG Defaut: # MSG Defaut:
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100 MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100

View File

@ -5,89 +5,94 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaEmpresa" title="${c:l('busquedaEmpresaController.window.title')}" <window id="winBusquedaEmpresa"
apply="${busquedaEmpresaController}" contentStyle="overflow:auto" title="${c:l('busquedaEmpresaController.window.title')}"
height="450px" width="850px" border="normal" > apply="${busquedaEmpresaController}" contentStyle="overflow:auto"
<toolbar> height="450px" width="850px" border="normal">
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px" <toolbar>
tooltiptext="${c:l('busquedaEmpresaController.btnRefresh.tooltiptext')}" /> <button id="btnRefresh" image="/gui/img/refresh.png"
<separator orient="vertical" /> width="35px"
<button id="btnNovo" image="/gui/img/add.png" width="35px" tooltiptext="${c:l('busquedaEmpresaController.btnRefresh.tooltiptext')}" />
tooltiptext="${c:l('busquedaEmpresaController.btnNovo.tooltiptext')}" /> <separator orient="vertical" />
<separator orient="vertical" /> <button id="btnNovo" image="/gui/img/add.png" width="35px"
<button id="btnCerrar" onClick="winBusquedaEmpresa.detach()" image="/gui/img/exit.png" width="35px" tooltiptext="${c:l('busquedaEmpresaController.btnNovo.tooltiptext')}" />
tooltiptext="${c:l('busquedaEmpresaController.btnCerrar.tooltiptext')}"/> <separator orient="vertical" />
</toolbar> <button id="btnCerrar" onClick="winBusquedaEmpresa.detach()"
image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('busquedaEmpresaController.btnCerrar.tooltiptext')}" />
</toolbar>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="20%" /> <column width="20%" />
<column width="80%" /> <column width="80%" />
</columns> </columns>
<rows> <rows>
<row> <row>
<label value="${c:l('busquedaEmpresaController.txtNombre.label')}"/> <label
<textbox id="txtNombre" width="300px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> value="${c:l('busquedaEmpresaController.txtNombre.label')}" />
</row> <textbox id="txtNombre" width="300px"
<row> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<label value="${c:l('editarEmpresaController.IndTipo.label')}"/> </row>
<combobox id="cmbIndTipo" width="90%" mold="rounded" buttonVisible="true" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"> <row>
<comboitem value="1" label="${c:l('editarEmpresaController.IndTipo.1')}" /> <label
<comboitem value="2" label="${c:l('editarEmpresaController.IndTipo.2')}" /> value="${c:l('editarEmpresaController.IndTipo.label')}" />
<comboitem value="3" label="${c:l('editarEmpresaController.IndTipo.3')}" /> <combobox id="cmbIndTipo" width="90%" mold="rounded"
</combobox> buttonVisible="true"
</row> use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar">
<row> <comboitem value="1"
<label value="${c:l('editarEmpresaController.externa.label')}"/> label="${c:l('editarEmpresaController.IndTipo.1')}" />
<combobox id="cmbExterna" width="90%" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" mold="rounded" buttonVisible="true"> <comboitem value="2"
<comboitem value="1" label="${c:l('MSG.SI')}" /> label="${c:l('editarEmpresaController.IndTipo.2')}" />
<comboitem value="0" label="${c:l('MSG.NO')}" /> <comboitem value="3"
</combobox> label="${c:l('editarEmpresaController.IndTipo.3')}" />
</row> </combobox>
<row> </row>
<label value="${c:l('editarEmpresaController.rfc.label')}"/> <row>
<textbox id="txtRFC" width="100px" maxlength="13" <label
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> value="${c:l('editarEmpresaController.rfc.label')}" />
</row> <textbox id="txtRFC" width="100px" maxlength="13"
<row id="rowEquivalencia"> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<label value="${c:l('lb.Equivalencia')}"/> </row>
<textbox id="txtEquivalencia" width="100px" maxlength="10" <row id="rowEquivalencia">
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> <label value="${c:l('lb.Equivalencia')}" />
</row> <textbox id="txtEquivalencia" width="100px"
</rows> maxlength="10"
</grid> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
</rows>
</grid>
<toolbar> <toolbar>
<button id="btnPesquisa" image="/gui/img/find.png" <button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaEmpresaController.btnPesquisa.label')}"/> label="${c:l('busquedaEmpresaController.btnPesquisa.label')}" />
</toolbar> </toolbar>
<paging id="pagingEmpresa" pageSize="20"/> <paging id="pagingEmpresa" pageSize="20" />
<listbox id="empresaList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" <listbox id="empresaList"
vflex="true" multiple="false"> use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
<listhead sizable="true"> vflex="true" multiple="false">
<listheader id="lhId" width="70px" image="/gui/img/builder.gif" <listhead sizable="true">
label="${c:l('busquedaEmpresaController.lhId.label')}" <listheader id="lhId" width="70px"
sort="auto(empresaId)"/> image="/gui/img/builder.gif"
<listheader id="lhDesc" image="/gui/img/create_doc.gif" label="${c:l('busquedaEmpresaController.lhId.label')}"
label="${c:l('busquedaEmpresaController.lhDesc.label')}" sort="auto(empresaId)" />
sort="auto(nombempresa)"/> <listheader id="lhDesc" image="/gui/img/create_doc.gif"
<listheader image="/gui/img/create_doc.gif" width="100px" label="${c:l('busquedaEmpresaController.lhDesc.label')}"
label="${c:l('editarEmpresaController.externa.label')}" sort="auto(nombempresa)" />
sort="auto(indExterna)"/> <listheader image="/gui/img/create_doc.gif"
<listheader image="/gui/img/create_doc.gif" label="${c:l('editarEmpresaController.IndTipo.label')}"
label="${c:l('editarEmpresaController.IndTipo.label')}" sort="auto(indTipo)" />
sort="auto(indTipo)"/> <listheader image="/gui/img/create_doc.gif"
<listheader image="/gui/img/create_doc.gif" label="${c:l('editarEmpresaController.rfc.label')}"
label="${c:l('editarEmpresaController.rfc.label')}" sort="auto(rfc)" />
sort="auto(rfc)"/> <listheader image="/gui/img/create_doc.gif"
<listheader image="/gui/img/create_doc.gif" label="${c:l('editarEmpresaController.cnpj.label')}"
label="${c:l('editarEmpresaController.cnpj.label')}" sort="auto(cnpj)" />
sort="auto(cnpj)"/> <listheader id="headerEquivalencia"
<listheader id="headerEquivalencia" image="/gui/img/create_doc.gif" image="/gui/img/create_doc.gif" label="${c:l('lb.Equivalencia')}"
label="${c:l('lb.Equivalencia')}" sort="auto(equivalenciaId)" />
sort="auto(equivalenciaId)"/> </listhead>
</listhead> </listbox>
</listbox> </window>
</window>
</zk> </zk>

View File

@ -5,58 +5,65 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaFormaPago" title="${c:l('busquedaFormaPagoController.window.title')}" <window id="winBusquedaFormaPago"
apply="${busquedaFormaPagoController}" contentStyle="overflow:auto" title="${c:l('busquedaFormaPagoController.window.title')}"
height="350px" width="600px" border="normal" > apply="${busquedaFormaPagoController}" contentStyle="overflow:auto"
<toolbar> height="350px" width="600px" border="normal">
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px" <toolbar>
tooltiptext="${c:l('busquedaFormaPagoController.btnRefresh.tooltiptext')}" /> <button id="btnRefresh" image="/gui/img/refresh.png"
<separator orient="vertical" /> width="35px"
<button id="btnNovo" image="/gui/img/add.png" width="35px" tooltiptext="${c:l('busquedaFormaPagoController.btnRefresh.tooltiptext')}" />
tooltiptext="${c:l('busquedaFormaPagoController.btnNovo.tooltiptext')}" /> <separator orient="vertical" />
<separator orient="vertical" /> <button id="btnNovo" image="/gui/img/add.png" width="35px"
<button id="btnCerrar" onClick="winBusquedaFormaPago.detach()" image="/gui/img/exit.png" width="35px" tooltiptext="${c:l('busquedaFormaPagoController.btnNovo.tooltiptext')}" />
tooltiptext="${c:l('busquedaFormaPagoController.btnCerrar.tooltiptext')}"/> <separator orient="vertical" />
</toolbar> <button id="btnCerrar"
onClick="winBusquedaFormaPago.detach()" image="/gui/img/exit.png"
width="35px"
tooltiptext="${c:l('busquedaFormaPagoController.btnCerrar.tooltiptext')}" />
</toolbar>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="20%" /> <column width="30%" />
<column width="80%" /> <column width="70%" />
</columns> </columns>
<rows> <rows>
<row> <row>
<label value="${c:l('busquedaFormaPagoController.txtNome.label')}"/> <label
<textbox id="txtNome" width="300px" value="${c:l('busquedaFormaPagoController.txtNome.label')}" />
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> <textbox id="txtNome" width="300px"
</row> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<row id="rowEquivalencia"> </row>
<label value="${c:l('lb.Equivalencia')}"/> <row id="rowEquivalencia">
<textbox id="txtEquivalencia" width="100px" maxlength="10" <label value="${c:l('lb.Equivalencia')}" />
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> <textbox id="txtEquivalencia" width="100px"
</row> maxlength="10"
</rows> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</grid> </row>
</rows>
</grid>
<toolbar> <toolbar>
<button id="btnPesquisa" image="/gui/img/find.png" <button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaFormaPagoController.btnPesquisa.label')}"/> label="${c:l('busquedaFormaPagoController.btnPesquisa.label')}" />
</toolbar> </toolbar>
<paging id="pagingFormaPago" pageSize="15"/> <paging id="pagingFormaPago" pageSize="15" />
<listbox id="formaPagoList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" <listbox id="formaPagoList"
vflex="true" multiple="false"> use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
<listhead sizable="true"> vflex="true" multiple="false">
<listheader image="/gui/img/create_doc.gif" <listhead sizable="true">
label="${c:l('busquedaFormaPagoController.lhId.label')}" width="70px" <listheader image="/gui/img/create_doc.gif"
sort="auto(formapagoId)"/> label="${c:l('busquedaFormaPagoController.lhId.label')}"
<listheader id="lhDesc" image="/gui/img/create_doc.gif" width="70px" sort="auto(formapagoId)" />
label="${c:l('busquedaFormaPagoController.lhDesc.label')}" <listheader id="lhDesc" image="/gui/img/create_doc.gif"
sort="auto(descpago)"/> label="${c:l('busquedaFormaPagoController.lhDesc.label')}"
<listheader id="headerEquivalencia" image="/gui/img/create_doc.gif" sort="auto(descpago)" />
label="${c:l('lb.Equivalencia')}" <listheader id="headerEquivalencia"
sort="auto(equivalenciaId)"/> image="/gui/img/create_doc.gif" label="${c:l('lb.Equivalencia')}"
</listhead> sort="auto(equivalenciaId)" />
</listbox> </listhead>
</window> </listbox>
</window>
</zk> </zk>

View File

@ -14,9 +14,6 @@
width="35px" width="35px"
tooltiptext="${c:l('busquedaTipoVentaController.btnRefresh.tooltiptext')}" /> tooltiptext="${c:l('busquedaTipoVentaController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" /> <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" <button id="btnCerrar"
onClick="winBusquedaTipoVenta.detach()" image="/gui/img/exit.png" onClick="winBusquedaTipoVenta.detach()" image="/gui/img/exit.png"
width="35px" width="35px"

View File

@ -64,11 +64,6 @@
label="${c:l('editarEmpresaController.IndTipo.3')}" /> label="${c:l('editarEmpresaController.IndTipo.3')}" />
</combobox> </combobox>
</row> </row>
<row>
<label id="lbExterna"
value="${c:l('editarEmpresaController.externa.label')}" />
<checkbox id="chkExterna" />
</row>
<row> <row>
<label <label
value="${c:l('editarEmpresaController.rfc.label')}" /> value="${c:l('editarEmpresaController.rfc.label')}" />

View File

@ -5,56 +5,65 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winEditarFormaPago" border="normal" <window id="winEditarFormaPago" border="normal"
apply="${editarFormaPagoController}" apply="${editarFormaPagoController}" width="400px" height="457x"
width="400px" height="457x" contentStyle="overflow:auto" contentStyle="overflow:auto"
title="${c:l('editarFormaPagoController.window.title')}"> title="${c:l('editarFormaPagoController.window.title')}">
<toolbar> <toolbar>
<hbox spacing="5px" style="padding:1px" align="right"> <hbox spacing="5px" style="padding:1px" align="right">
<button id="btnApagar" height="20" <button id="btnApagar" height="20"
image="/gui/img/remove.png" width="35px" image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarFormaPagoController.btnApagar.tooltiptext')}"/> tooltiptext="${c:l('editarFormaPagoController.btnApagar.tooltiptext')}" />
<button id="btnSalvar" height="20" <button id="btnSalvar" height="20"
image="/gui/img/save.png" width="35px" image="/gui/img/save.png" width="35px"
tooltiptext="${c:l('editarFormaPagoController.btnSalvar.tooltiptext')}"/> tooltiptext="${c:l('editarFormaPagoController.btnSalvar.tooltiptext')}" />
<button id="btnFechar" height="20" <button id="btnFechar" height="20"
image="/gui/img/exit.png" width="35px" image="/gui/img/exit.png" width="35px"
onClick="winEditarFormaPago.detach()" onClick="winEditarFormaPago.detach()"
tooltiptext="${c:l('editarFormaPagoController.btnFechar.tooltiptext')}"/> tooltiptext="${c:l('editarFormaPagoController.btnFechar.tooltiptext')}" />
</hbox> </hbox>
</toolbar> </toolbar>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="40%" /> <column width="40%" />
<column width="60%" /> <column width="60%" />
</columns> </columns>
<rows> <rows>
<row> <row>
<label id="lbNome" value="${c:l('editarFormaPagoController.lbNome.value')}"/> <label id="lbNome"
<textbox id="txtNome" constraint="no empty" width="90%" maxlength="30" value="${c:l('editarFormaPagoController.lbNome.value')}" />
value="@{winEditarFormaPago$composer.formaPago.descpago}" <textbox id="txtNome" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> width="90%" maxlength="30"
</row> value="@{winEditarFormaPago$composer.formaPago.descpago}"
<row id="rowEquivalencia"> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<label value="${c:l('lb.Equivalencia')}"/> </row>
<textbox id="txtEquivalencia" width="100px" maxlength="10" <row id="rowEquivalencia">
value="@{winEditarFormaPago$composer.formaPago.equivalenciaId}" <label value="${c:l('lb.Equivalencia')}" />
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/> <textbox id="txtEquivalencia" width="100px"
</row> maxlength="10"
<row> value="@{winEditarFormaPago$composer.formaPago.equivalenciaId}"
<label value="${c:l('editarFormaPagoController.lbOperacion.value')}"/> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<radiogroup id="radioIndOperacion"> </row>
<vbox> <row visible="false"><!-- Adaptacao Brasil -->
<radio value="1" id="rd1" label="${c:l('editarFormaPagoController.lbOperacion1.value')}" /> <label
<radio value="2" id="rd2" label="${c:l('editarFormaPagoController.lbOperacion2.value')}" /> value="${c:l('editarFormaPagoController.lbOperacion.value')}" />
<radio value="3" id="rd3" label="${c:l('editarFormaPagoController.lbOperacion3.value')}" /> <radiogroup id="radioIndOperacion">
<radio value="4" id="rd4" label="${c:l('editarFormaPagoController.lbOperacion4.value')}" checked="true"/> <vbox>
</vbox> <radio value="1" id="rd1"
</radiogroup> label="${c:l('editarFormaPagoController.lbOperacion1.value')}" />
</row> <radio value="2" id="rd2"
</rows> label="${c:l('editarFormaPagoController.lbOperacion2.value')}" />
</grid> <radio value="3" id="rd3"
label="${c:l('editarFormaPagoController.lbOperacion3.value')}" />
<radio value="4" id="rd4"
label="${c:l('editarFormaPagoController.lbOperacion4.value')}"
checked="true" />
</vbox>
</radiogroup>
</row>
</rows>
</grid>
</window> </window>
</zk> </zk>

View File

@ -7,22 +7,19 @@
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaRestriccionFormaPago" title="${c:l('busquedaRestriccionFormaPagoController.window.title')}" <window id="winBusquedaRestriccionFormaPago" title="${c:l('busquedaRestriccionFormaPagoController.window.title')}"
apply="${busquedaRestriccionFormaPagoController}" contentStyle="overflow:auto" apply="${busquedaRestriccionFormaPagoController}" contentStyle="overflow:auto"
height="500px" width="600px" border="normal" > height="450px" width="650px" border="normal" >
<toolbar> <toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px" <button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
tooltiptext="${c:l('busquedaRestriccionFormaPagoController.btnRefresh.tooltiptext')}" /> tooltiptext="${c:l('busquedaRestriccionFormaPagoController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" /> <separator orient="vertical" />
<button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaRestriccionFormaPagoController.btnNovo.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnCerrar" onClick="winBusquedaRestriccionFormaPago.detach()" image="/gui/img/exit.png" width="35px" <button id="btnCerrar" onClick="winBusquedaRestriccionFormaPago.detach()" image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('busquedaRestriccionFormaPagoController.btnCerrar.tooltiptext')}"/> tooltiptext="${c:l('busquedaRestriccionFormaPagoController.btnCerrar.tooltiptext')}"/>
</toolbar> </toolbar>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="20%" /> <column width="30%" />
<column width="80%" /> <column width="70%" />
</columns> </columns>
<rows> <rows>
<row> <row>

View File

@ -5,48 +5,46 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winEditarRestriccionFormaPago" border="normal" <window id="winEditarRestriccionFormaPago" border="normal"
apply="${editarRestriccionFormaPagoController}" apply="${editarRestriccionFormaPagoController}" width="400px"
width="400px" height="400x" contentStyle="overflow:auto" height="400x" contentStyle="overflow:auto"
title="${c:l('editarRestriccionFormaPagoController.window.title')}"> title="${c:l('editarRestriccionFormaPagoController.window.title')}">
<toolbar> <toolbar>
<hbox spacing="5px" style="padding:1px" align="right"> <hbox spacing="5px" style="padding:1px" align="right">
<button id="btnApagar" height="20" <button id="btnFechar" height="20"
image="/gui/img/remove.png" width="35px" image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('editarRestriccionFormaPagoController.btnApagar.tooltiptext')}"/> onClick="winEditarRestriccionFormaPago.detach()"
<button id="btnSalvar" height="20" tooltiptext="${c:l('editarRestriccionFormaPagoController.btnFechar.tooltiptext')}" />
image="/gui/img/save.png" width="35px" </hbox>
tooltiptext="${c:l('editarRestriccionFormaPagoController.btnSalvar.tooltiptext')}"/> </toolbar>
<button id="btnFechar" height="20"
image="/gui/img/exit.png" width="35px"
onClick="winEditarRestriccionFormaPago.detach()"
tooltiptext="${c:l('editarRestriccionFormaPagoController.btnFechar.tooltiptext')}"/>
</hbox>
</toolbar>
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="40%" /> <column width="40%" />
<column width="60%" /> <column width="60%" />
</columns> </columns>
<rows> <rows>
<row> <row>
<label id="lblFormaPago" value="${c:l('busquedaRestriccionFormaPagoController.FormaPago')}"/> <label id="lblFormaPago"
<combobox id="cmbFormaPago" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" constraint="no empty" value="${c:l('busquedaRestriccionFormaPagoController.FormaPago')}" />
mold="rounded" buttonVisible="true" <combobox id="cmbFormaPago"
model="@{winEditarRestriccionFormaPago$composer.lsFormaPago}" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
selectedItem="@{winEditarRestriccionFormaPago$composer.configRestriccionPago.formaPago}"/> constraint="no empty" mold="rounded" buttonVisible="true"
</row> model="@{winEditarRestriccionFormaPago$composer.lsFormaPago}"
<row> selectedItem="@{winEditarRestriccionFormaPago$composer.configRestriccionPago.formaPago}" />
<label id="lblRestricionFormaPago" value="${c:l('editarRestriccionFormaPagoController.lblRestricionFormaPago.value')}"/> </row>
<combobox id="cmbRestriccionFormaPago" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" constraint="no empty" <row>
mold="rounded" buttonVisible="true" <label id="lblRestricionFormaPago"
model="@{winEditarRestriccionFormaPago$composer.lsRestriccionPago}" value="${c:l('editarRestriccionFormaPagoController.lblRestricionFormaPago.value')}" />
selectedItem="@{winEditarRestriccionFormaPago$composer.configRestriccionPago.restriccion}"/> <combobox id="cmbRestriccionFormaPago"
</row> use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
</rows> constraint="no empty" mold="rounded" buttonVisible="true"
</grid> model="@{winEditarRestriccionFormaPago$composer.lsRestriccionPago}"
selectedItem="@{winEditarRestriccionFormaPago$composer.configRestriccionPago.restriccion}" />
</row>
</rows>
</grid>
</window> </window>
</zk> </zk>