git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@20659 d1611594-4594-4d17-8e1d-87c2c4800839
parent
e1b858ea2a
commit
ab5cb1f4f9
|
@ -15,7 +15,6 @@ import org.zkoss.zhtml.Messagebox;
|
|||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Paging;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
|
@ -40,23 +39,20 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
private MyListbox tipoEventoExtraList;
|
||||
private Paging pagingTipoEventoExtra;
|
||||
private Textbox txtNombre;
|
||||
private Combobox cmbIndOperacion;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
tipoEventoExtraList.setItemRenderer(new RenderTipoEventoExtra());
|
||||
tipoEventoExtraList.addEventListener("onDoubleClick",
|
||||
new EventListener() {
|
||||
tipoEventoExtraList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
TipoEventoExtra emp = (TipoEventoExtra) tipoEventoExtraList
|
||||
.getSelected();
|
||||
verPeriodo(emp);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
TipoEventoExtra emp = (TipoEventoExtra) tipoEventoExtraList.getSelected();
|
||||
verEventoExtra(emp);
|
||||
}
|
||||
});
|
||||
|
||||
refreshLista();
|
||||
|
||||
|
@ -64,7 +60,7 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void verPeriodo(TipoEventoExtra emp) {
|
||||
private void verEventoExtra(TipoEventoExtra emp) {
|
||||
if (emp == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -73,8 +69,7 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
args.put("tipoEventoExtra", emp);
|
||||
args.put("tipoEventoExtraList", tipoEventoExtraList);
|
||||
|
||||
openWindow(
|
||||
"/gui/ingreso/editarTipoEventoExtra.zul",
|
||||
openWindow("/gui/ingreso/editarTipoEventoExtra.zul",
|
||||
Labels.getLabel("editarTipoEventoExtraController.window.title"),
|
||||
args, MODAL);
|
||||
}
|
||||
|
@ -85,10 +80,7 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
pagingTipoEventoExtra.getPageSize());
|
||||
|
||||
tipoEventoExtraBusqueda.addFilterLike("descTipoEvento", "%" + txtNombre.getText().trim().concat("%"));
|
||||
if (cmbIndOperacion.getSelectedItem() != null) {
|
||||
tipoEventoExtraBusqueda.addFilterEqual("indoperacion",
|
||||
Short.parseShort(cmbIndOperacion.getSelectedItem().getValue().toString()));
|
||||
}
|
||||
|
||||
tipoEventoExtraBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
tipoEventoExtraBusqueda.addSortAsc("descTipoEvento");
|
||||
|
||||
|
@ -96,8 +88,7 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
|
||||
if (tipoEventoExtraList.getData().length == 0) {
|
||||
try {
|
||||
Messagebox
|
||||
.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||
Labels.getLabel("busquedaTipoEventoExtraController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
} catch (InterruptedException ex) {
|
||||
|
@ -114,6 +105,6 @@ public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
public void onClick$btnNovo(Event ev) {
|
||||
verPeriodo(new TipoEventoExtra());
|
||||
verEventoExtra(new TipoEventoExtra());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,26 +15,15 @@ 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.zkplus.databind.BindingListModel;
|
||||
import org.zkoss.zkplus.databind.BindingListModelList;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Radiogroup;
|
||||
import org.zkoss.zul.Row;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Articulo;
|
||||
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
||||
import com.rjconsultores.ventaboletos.entidad.ParamArticulo;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.ArticuloService;
|
||||
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
||||
import com.rjconsultores.ventaboletos.service.ParamArticuloService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
|
||||
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;
|
||||
|
@ -52,45 +40,16 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
|
|||
private static final long serialVersionUID = 1L;
|
||||
@Autowired
|
||||
private TipoEventoExtraService tipoEventoExtraService;
|
||||
@Autowired
|
||||
private ArticuloService articuloService;
|
||||
@Autowired
|
||||
private FormaPagoService formaPagoService;
|
||||
@Autowired
|
||||
private ParamArticuloService paramArticuloService;
|
||||
private List<Articulo> lsArticulo;
|
||||
private List<FormaPago> lsFormaPago;
|
||||
private List<ParamArticulo> lsParamArticulo;
|
||||
private TipoEventoExtra tipoEventoExtra;
|
||||
private MyListbox tipoEventoExtraList;
|
||||
private MyTextbox txtNome;
|
||||
private Button btnApagar;
|
||||
private Textbox impMax;
|
||||
private Textbox porcIva;
|
||||
private Checkbox cbValidaCorte;
|
||||
private Checkbox cbValidaDocumento;
|
||||
private Checkbox cbContrapartida;
|
||||
private Checkbox cbOrdenServicio;
|
||||
private Checkbox cbBoleto;
|
||||
private Combobox cmbIndOperacion;
|
||||
private Combobox cmbFormaPago2;
|
||||
private Combobox cmbParamArticulo;
|
||||
private Combobox cmbParamArticulo2;
|
||||
private Combobox cmbFormaPago;
|
||||
private Radiogroup sv1;
|
||||
private Radiogroup sv2;
|
||||
private Row rowParamArticulo;
|
||||
private Row rowParamArticulo2;
|
||||
private Radio raTipo11;
|
||||
private Radio raTipo22;
|
||||
private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class);
|
||||
|
||||
public List<ParamArticulo> getLsParamArticulo() {
|
||||
return lsParamArticulo;
|
||||
}
|
||||
|
||||
public void setLsParamArticulo(List<ParamArticulo> lsParamArticulo) {
|
||||
this.lsParamArticulo = lsParamArticulo;
|
||||
}
|
||||
|
||||
public TipoEventoExtra getTipoEventoExtra() {
|
||||
return tipoEventoExtra;
|
||||
}
|
||||
|
@ -99,203 +58,37 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
|
|||
this.tipoEventoExtra = tipoEventoExtra;
|
||||
}
|
||||
|
||||
public List<Articulo> getLsArticulo() {
|
||||
return lsArticulo;
|
||||
}
|
||||
|
||||
public void setLsArticulo(List<Articulo> lsArticulo) {
|
||||
this.lsArticulo = lsArticulo;
|
||||
}
|
||||
|
||||
public List<FormaPago> getLsFormaPago() {
|
||||
return lsFormaPago;
|
||||
}
|
||||
|
||||
public void setLsFormaPago(List<FormaPago> lsFormaPago) {
|
||||
this.lsFormaPago = lsFormaPago;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsArticulo = articuloService.obtenerTodos();
|
||||
lsFormaPago = formaPagoService.obtenerTodos();
|
||||
lsParamArticulo = paramArticuloService.obtenerTodos();
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
tipoEventoExtra = (TipoEventoExtra) Executions.getCurrent().getArg().get("tipoEventoExtra");
|
||||
tipoEventoExtraList = (MyListbox) Executions.getCurrent().getArg().get("tipoEventoExtraList");
|
||||
|
||||
if (tipoEventoExtra.getTipoeventoextraId() != null) {
|
||||
cbContrapartida.setChecked(tipoEventoExtra.getIndcontrapartida());
|
||||
cbOrdenServicio.setChecked(tipoEventoExtra.getIndordenservicio());
|
||||
cbValidaCorte.setChecked(tipoEventoExtra.getIndvalidacorte());
|
||||
cbValidaDocumento.setChecked(tipoEventoExtra.getIndvalidadocumento());
|
||||
if (tipoEventoExtra.getIndboleto() == Boolean.TRUE) {
|
||||
cbBoleto.setChecked(true);
|
||||
}
|
||||
|
||||
onChange$cmbIndOperacion(null);
|
||||
|
||||
if (tipoEventoExtra.getIndtipo() != null) {
|
||||
if (tipoEventoExtra.getIndtipo().equals("0")) {
|
||||
sv1.setSelectedIndex(1);
|
||||
} else {
|
||||
sv1.setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (tipoEventoExtra.getIndtipo2() != null) {
|
||||
if (tipoEventoExtra.getIndtipo2().equals("0")) {
|
||||
sv2.setSelectedIndex(1);
|
||||
} else {
|
||||
sv2.setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
btnApagar.setVisible(false);
|
||||
}
|
||||
|
||||
// Sino es para exhibir la cuenta contable, no dejo las lines visibles.
|
||||
if (!exhibirCuentaContable()) {
|
||||
rowParamArticulo.setVisible(false);
|
||||
rowParamArticulo2.setVisible(false);
|
||||
|
||||
cmbParamArticulo.setConstraint("");
|
||||
if (tipoEventoExtra.getIndtipo() != null) {
|
||||
if (tipoEventoExtra.getIndtipo().equals("1")) {
|
||||
raTipo11.setChecked(Boolean.TRUE);
|
||||
raTipo22.setChecked(Boolean.FALSE);
|
||||
} else {
|
||||
raTipo11.setChecked(Boolean.FALSE);
|
||||
raTipo22.setChecked(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
txtNome.focus();
|
||||
}
|
||||
|
||||
public void onChange$cmbIndOperacion(Event ev) throws InterruptedException {
|
||||
if (tipoEventoExtra.getIndoperacion() != null) {
|
||||
sv1.setSelectedIndex(-1);
|
||||
sv2.setSelectedIndex(-1);
|
||||
if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("1"))) {
|
||||
cbValidaCorte.setDisabled(true);
|
||||
cbValidaCorte.setChecked(false);
|
||||
|
||||
cbValidaDocumento.setDisabled(false);
|
||||
|
||||
cbContrapartida.setDisabled(true);
|
||||
cbContrapartida.setChecked(false);
|
||||
|
||||
cbBoleto.setDisabled(false);
|
||||
|
||||
cbOrdenServicio.setDisabled(true);
|
||||
cbOrdenServicio.setChecked(false);
|
||||
|
||||
BindingListModel listModelCiudad = new BindingListModelList(new ArrayList<FormaPago>(), true);
|
||||
cmbFormaPago2.setModel(listModelCiudad);
|
||||
|
||||
cmbFormaPago2.setDisabled(true);
|
||||
|
||||
cmbFormaPago2.setSelectedItem(null);
|
||||
|
||||
BindingListModel listModelParmArticulo = new BindingListModelList(new ArrayList<ParamArticulo>(), true);
|
||||
cmbParamArticulo2.setModel(listModelParmArticulo);
|
||||
|
||||
cmbParamArticulo2.setDisabled(true);
|
||||
|
||||
cmbParamArticulo2.setSelectedItem(null);
|
||||
|
||||
} else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("2"))) {
|
||||
|
||||
cbValidaCorte.setDisabled(true);
|
||||
cbValidaCorte.setChecked(true);
|
||||
|
||||
cbValidaDocumento.setDisabled(false);
|
||||
|
||||
cbContrapartida.setDisabled(true);
|
||||
cbContrapartida.setChecked(true);
|
||||
|
||||
cbBoleto.setDisabled(true);
|
||||
cbBoleto.setChecked(false);
|
||||
|
||||
cbOrdenServicio.setDisabled(false);
|
||||
|
||||
BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true);
|
||||
cmbFormaPago2.setModel(listModelCiudad);
|
||||
cmbFormaPago2.setDisabled(false);
|
||||
|
||||
BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true);
|
||||
cmbParamArticulo2.setModel(listModelParmArticulo);
|
||||
|
||||
cmbParamArticulo2.setDisabled(false);
|
||||
|
||||
cmbParamArticulo2.setSelectedItem(null);
|
||||
|
||||
} else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("3"))) {
|
||||
|
||||
cbValidaCorte.setDisabled(true);
|
||||
cbValidaCorte.setChecked(false);
|
||||
|
||||
cbValidaDocumento.setChecked(true);
|
||||
cbValidaDocumento.setDisabled(true);
|
||||
|
||||
cbContrapartida.setDisabled(true);
|
||||
cbContrapartida.setChecked(true);
|
||||
|
||||
cbBoleto.setDisabled(true);
|
||||
cbBoleto.setChecked(false);
|
||||
|
||||
cbOrdenServicio.setDisabled(true);
|
||||
cbOrdenServicio.setChecked(false);
|
||||
|
||||
BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true);
|
||||
cmbFormaPago2.setModel(listModelCiudad);
|
||||
|
||||
cmbFormaPago2.setDisabled(false);
|
||||
|
||||
BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true);
|
||||
cmbParamArticulo2.setModel(listModelParmArticulo);
|
||||
|
||||
cmbParamArticulo2.setDisabled(false);
|
||||
|
||||
cmbParamArticulo2.setSelectedItem(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
|
||||
txtNome.getValue();
|
||||
impMax.getValue();
|
||||
cmbIndOperacion.getValue();
|
||||
porcIva.getValue();
|
||||
cmbFormaPago.getValue();
|
||||
cmbParamArticulo.getValue();
|
||||
|
||||
if (sv1.getSelectedIndex() == -1) {
|
||||
Messagebox.show(Labels.getLabel("MSG.necesita.tipoEvento"),
|
||||
Labels.getLabel("editarTipoEventoExtraController.MSG.tipoObligatolia"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
if (!cmbFormaPago2.isDisabled() && cmbFormaPago2.getSelectedItem() == null) {
|
||||
Messagebox.show(Labels.getLabel("MSG.necesita.formaPago"),
|
||||
Labels.getLabel("editarTipoEventoExtraController.MSG.formaPagoObligatolia"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (exhibirCuentaContable()) {
|
||||
if (cmbIndOperacion.getSelectedItem() != null) {
|
||||
String indOp = (String) cmbIndOperacion.getSelectedItem().getValue();
|
||||
if (!cmbParamArticulo2.isDisabled() && indOp.equals("3")) {
|
||||
if (cmbParamArticulo2.getSelectedItem() == null) {
|
||||
Messagebox.show(Labels.getLabel("MSG.necesita.contaContable"),
|
||||
Labels.getLabel("editarTarjetaViajeController.MSG.cuentaContableObligatorio"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tipoEventoExtra.setActivo(Boolean.TRUE);
|
||||
tipoEventoExtra.setFecmodif(Calendar.getInstance().getTime());
|
||||
tipoEventoExtra.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
@ -318,32 +111,7 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
|
|||
|
||||
return;
|
||||
} else {
|
||||
|
||||
if (sv1.getSelectedIndex() == 0) {
|
||||
tipoEventoExtra.setIndtipo("1");
|
||||
} else {
|
||||
tipoEventoExtra.setIndtipo("0");
|
||||
}
|
||||
|
||||
if (sv2.getSelectedIndex() == -1) {
|
||||
tipoEventoExtra.setIndtipo2(null);
|
||||
} else if (sv2.getSelectedIndex() == 0) {
|
||||
tipoEventoExtra.setIndtipo2("1");
|
||||
} else {
|
||||
tipoEventoExtra.setIndtipo2("0");
|
||||
}
|
||||
|
||||
tipoEventoExtra.setFormaPago((FormaPago) cmbFormaPago.getSelectedItem().getValue());
|
||||
|
||||
tipoEventoExtra.setIndvalidacorte(cbValidaCorte.isChecked());
|
||||
tipoEventoExtra.setIndvalidadocumento(cbValidaDocumento.isChecked());
|
||||
tipoEventoExtra.setIndcontrapartida(cbContrapartida.isChecked());
|
||||
tipoEventoExtra.setIndordenservicio(cbOrdenServicio.isChecked());
|
||||
tipoEventoExtra.setIndboleto(cbBoleto.isChecked() ? Boolean.TRUE : Boolean.FALSE);
|
||||
|
||||
tipoEventoExtra.setParamArticulo(cmbParamArticulo.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo.getSelectedItem().getValue());
|
||||
tipoEventoExtra.setParamArticulo2(cmbParamArticulo2.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo2.getSelectedItem().getValue());
|
||||
|
||||
if (tipoEventoExtra.getTipoeventoextraId() == null) {
|
||||
tipoEventoExtraService.suscribir(tipoEventoExtra);
|
||||
tipoEventoExtraList.addItem(tipoEventoExtra);
|
||||
|
@ -367,22 +135,6 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
public void onCheck$sv1(Event ev) {
|
||||
String indOperacion = null;
|
||||
if (cmbIndOperacion.getSelectedItem() != null) {
|
||||
indOperacion = (String) cmbIndOperacion.getSelectedItem().getValue();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (!indOperacion.equals("1")) {
|
||||
if (sv1.getSelectedIndex() == 0) {
|
||||
sv2.setSelectedIndex(1);
|
||||
} else {
|
||||
sv2.setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnApagar(Event ev) throws InterruptedException {
|
||||
try {
|
||||
int resp = Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarPergunta"),
|
||||
|
@ -407,8 +159,4 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
|
|||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean exhibirCuentaContable() {
|
||||
return ApplicationProperties.getInstance().exhibirCuentaContableTiposEventos();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,62 +15,66 @@ public class RenderOrgaoTramo implements ListitemRenderer {
|
|||
|
||||
Listcell lc = new Listcell();
|
||||
|
||||
CoeficienteTarifa coeficienteTarifa1 = orgaoTramo.getCoeficienteTarifa1();
|
||||
if (coeficienteTarifa1 != null) {
|
||||
lc = new Listcell(coeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
if (orgaoTramo.getActivo()) {
|
||||
CoeficienteTarifa coeficienteTarifa1 = orgaoTramo.getCoeficienteTarifa1();
|
||||
if (coeficienteTarifa1 != null) {
|
||||
lc = new Listcell(coeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Integer kmCoeficienteTarifa1 = orgaoTramo.getKmCoeficiente1();
|
||||
if (kmCoeficienteTarifa1 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
Integer kmCoeficienteTarifa1 = orgaoTramo.getKmCoeficiente1();
|
||||
if (kmCoeficienteTarifa1 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
CoeficienteTarifa coeficienteTarifa2 = orgaoTramo.getCoeficienteTarifa2();
|
||||
if (coeficienteTarifa2 != null) {
|
||||
lc = new Listcell(coeficienteTarifa2.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
CoeficienteTarifa coeficienteTarifa2 = orgaoTramo.getCoeficienteTarifa2();
|
||||
if (coeficienteTarifa2 != null) {
|
||||
lc = new Listcell(coeficienteTarifa2.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Integer kmCoeficienteTarifa2 = orgaoTramo.getKmCoeficiente2();
|
||||
if (kmCoeficienteTarifa2 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa2.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
Integer kmCoeficienteTarifa2 = orgaoTramo.getKmCoeficiente2();
|
||||
if (kmCoeficienteTarifa2 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa2.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
CoeficienteTarifa coeficienteTarifa3 = orgaoTramo.getCoeficienteTarifa3();
|
||||
if (coeficienteTarifa3 != null) {
|
||||
lc = new Listcell(coeficienteTarifa3.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
CoeficienteTarifa coeficienteTarifa3 = orgaoTramo.getCoeficienteTarifa3();
|
||||
if (coeficienteTarifa3 != null) {
|
||||
lc = new Listcell(coeficienteTarifa3.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Integer kmCoeficienteTarifa3 = orgaoTramo.getKmCoeficiente3();
|
||||
if (kmCoeficienteTarifa3 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
Integer kmCoeficienteTarifa3 = orgaoTramo.getKmCoeficiente3();
|
||||
if (kmCoeficienteTarifa3 != null) {
|
||||
lc = new Listcell(kmCoeficienteTarifa1.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
OrgaoConcedente orgaoConcedente = orgaoTramo.getOrgaoConcedente();
|
||||
if (orgaoConcedente != null) {
|
||||
lc = new Listcell(orgaoConcedente.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
OrgaoConcedente orgaoConcedente = orgaoTramo.getOrgaoConcedente();
|
||||
if (orgaoConcedente != null) {
|
||||
lc = new Listcell(orgaoConcedente.toString());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", orgaoTramo);
|
||||
lstm.setAttribute("data", orgaoTramo);
|
||||
} else {
|
||||
lstm.setVisible(Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
@ -9,41 +10,23 @@ import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
|||
|
||||
public class RenderTipoEventoExtra implements ListitemRenderer {
|
||||
|
||||
private String getTipo(int idTipo) {
|
||||
if (idTipo == 1) {
|
||||
return Labels.getLabel("editarTipoEventoExtraController.rd1.label");
|
||||
} else if (idTipo == 2) {
|
||||
return Labels.getLabel("editarTipoEventoExtraController.rd2.label");
|
||||
} else if (idTipo == 3) {
|
||||
return Labels.getLabel("editarTipoEventoExtraController.rd3.label");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
TipoEventoExtra banco = (TipoEventoExtra) o;
|
||||
|
||||
Listcell lc = new Listcell(banco.getTipoeventoextraId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(banco.getDescTipoEvento() == null ? ""
|
||||
: banco.getDescTipoEvento());
|
||||
lc = new Listcell(banco.getDescTipoEvento() == null ? "" : banco.getDescTipoEvento());
|
||||
lc.setParent(lstm);
|
||||
|
||||
String indTipo = null;
|
||||
|
||||
if (banco.getIndoperacion() == null) {
|
||||
indTipo = "";
|
||||
BigDecimal valorMax = banco.getImpmax();
|
||||
if (valorMax != null) {
|
||||
lc = new Listcell(valorMax.setScale(2).toString());
|
||||
} else {
|
||||
indTipo = getTipo(banco.getIndoperacion().intValue());
|
||||
lc = new Listcell("");
|
||||
}
|
||||
|
||||
lc = new Listcell(indTipo);
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
||||
|
||||
lstm.setAttribute("data", banco);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<window id="winBusquedaTipoEventoExtra"
|
||||
title="${c:l('busquedaTipoEventoExtraController.window.title')}"
|
||||
apply="${busquedaTipoEventoExtraController}"
|
||||
contentStyle="overflow:auto" height="450px" width="850px"
|
||||
contentStyle="overflow:auto" height="400px" width="600px"
|
||||
border="normal">
|
||||
<toolbar>
|
||||
<button id="btnRefresh" image="/gui/img/refresh.png"
|
||||
|
@ -26,8 +26,8 @@
|
|||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="80%" />
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
|
@ -36,21 +36,6 @@
|
|||
<textbox id="txtNombre" width="282px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.Operacion.label')}" />
|
||||
<combobox id="cmbIndOperacion" width="45%"
|
||||
mold="rounded" buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.indoperacion, converter='com.rjconsultores.ventaboletos.web.utilerias.StringToShortConverter'}">
|
||||
<comboitem value="1"
|
||||
label="${c:l('editarTipoEventoExtraController.rd1.label')}" />
|
||||
<comboitem value="2"
|
||||
label="${c:l('editarTipoEventoExtraController.rd2.label')}" />
|
||||
<comboitem value="3"
|
||||
label="${c:l('editarTipoEventoExtraController.rd3.label')}" />
|
||||
</combobox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
|
@ -64,15 +49,15 @@
|
|||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader id="lhId" width="70px"
|
||||
<listheader id="lhId" width="10%"
|
||||
image="/gui/img/builder.gif" sort="auto(tipoeventoextraId)"
|
||||
label="${c:l('busquedaTipoEventoExtraController.lhId.label')}" />
|
||||
<listheader id="lhDesc" image="/gui/img/create_doc.gif"
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
sort="auto(descTipoEvento)"
|
||||
label="${c:l('busquedaTipoEventoExtraController.lhDesc.label')}" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
width="100px" sort="auto(indoperacion)"
|
||||
label="${c:l('editarTipoEventoExtraController.Operacion.label')}" />
|
||||
sort="auto(impmax)" width="20%" align="right"
|
||||
label="${c:l('editarTipoEventoExtraController.importeMaximo.label')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</window>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winEditarTipoEventoExtra" border="normal"
|
||||
apply="${editarTipoEventoExtraController}" height="550px"
|
||||
width="600px" contentStyle="overflow:auto"
|
||||
apply="${editarTipoEventoExtraController}" width="500px"
|
||||
contentStyle="overflow:auto"
|
||||
title="${c:l('editarTipoEventoExtraController.window.title')}">
|
||||
|
||||
<toolbar>
|
||||
|
@ -25,15 +25,10 @@
|
|||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<radiogroup id="sv1"
|
||||
onCheck="choice1.value = self.selectedItem.label" />
|
||||
<radiogroup id="sv2"
|
||||
onCheck="choice1.value = self.selectedItem.label" />
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
<column width="60%" />
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
|
@ -52,127 +47,18 @@
|
|||
precision="7" scale="2" constraint="no empty"
|
||||
value="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.impmax,converter=com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.Operacion.label')}" />
|
||||
<combobox id="cmbIndOperacion" constraint="no empty"
|
||||
width="90%" mold="rounded" buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.indoperacion, converter='com.rjconsultores.ventaboletos.web.utilerias.StringToShortConverter'}">
|
||||
<comboitem value="1"
|
||||
label="${c:l('editarTipoEventoExtraController.rd1.label')}" />
|
||||
<comboitem value="2"
|
||||
label="${c:l('editarTipoEventoExtraController.rd2.label')}" />
|
||||
<comboitem value="3"
|
||||
label="${c:l('editarTipoEventoExtraController.rd3.label')}" />
|
||||
</combobox>
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.validaCorte.label')}" />
|
||||
<checkbox id="cbValidaCorte" checked="false"
|
||||
disabled="true" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.validaDocumento.label')}" />
|
||||
<checkbox id="cbValidaDocumento" checked="false"
|
||||
disabled="true" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.contrapartida.label')}" />
|
||||
<checkbox id="cbContrapartida" checked="false"
|
||||
disabled="true" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.ordem.label')}" />
|
||||
<checkbox id="cbOrdenServicio" checked="false"
|
||||
disabled="true" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.boleto.label')}" />
|
||||
<checkbox id="cbBoleto" checked="false"
|
||||
disabled="true" />
|
||||
<checkbox id="cbValidaDocumento" checked="false" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.tipoOperacion.value')}" />
|
||||
<hbox>
|
||||
<radio id="raTipo11" label="(+)"
|
||||
radiogroup="sv1" />
|
||||
<radio id="raTipo22" label="(-)"
|
||||
radiogroup="sv1" />
|
||||
</hbox>
|
||||
</row>
|
||||
<row id="rowParamArticulo">
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.cuentaContable.label')}" />
|
||||
<combobox id="cmbParamArticulo"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
constraint="no empty" mold="rounded" buttonVisible="true"
|
||||
width="80%"
|
||||
model="@{winEditarTipoEventoExtra$composer.lsParamArticulo}"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.paramArticulo}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.formaPago.label')}" />
|
||||
<combobox id="cmbFormaPago"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
constraint="no empty" mold="rounded" buttonVisible="true"
|
||||
width="80%"
|
||||
model="@{winEditarTipoEventoExtra$composer.lsFormaPago}"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.formaPago}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.iva.label')}" />
|
||||
<textbox id="porcIva"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal"
|
||||
precision="7" scale="2"
|
||||
value="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.porciva,converter=com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.proveedor.label')}" />
|
||||
<textbox id="proveedor" width="80%" maxlength="20"
|
||||
value="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.proveedor}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
<row spans="2">
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.contrapartida.label')}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.tipoOperacion.value')}" />
|
||||
<hbox>
|
||||
<radio id="raTipo1" label="(+)" radiogroup="sv2"
|
||||
disabled="true" />
|
||||
<radio id="raTipo2" label="(-)" radiogroup="sv2"
|
||||
disabled="true" />
|
||||
</hbox>
|
||||
</row>
|
||||
<row id="rowParamArticulo2">
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.cuentaContable.label')}" />
|
||||
<combobox id="cmbParamArticulo2"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="80%"
|
||||
model="@{winEditarTipoEventoExtra$composer.lsParamArticulo}"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.paramArticulo2}" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarTipoEventoExtraController.formaPago.label')}" />
|
||||
<combobox id="cmbFormaPago2"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="80%"
|
||||
model="@{winEditarTipoEventoExtra$composer.lsFormaPago}"
|
||||
selectedItem="@{winEditarTipoEventoExtra$composer.tipoEventoExtra.formaPago2}" />
|
||||
<radiogroup>
|
||||
<radio id="raTipo11" label="(+)" />
|
||||
<radio id="raTipo22" label="(-)" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
Loading…
Reference in New Issue