- merge conf. cat. descuento rodrigo
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@24789 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
05ddfdb197
commit
aef76265f4
|
@ -40,30 +40,6 @@ public class BusquedaConfiguracionCategoriaController extends MyGenericForwardCo
|
|||
private Paging pagingCategoriaCtrl;
|
||||
private Textbox txtNome;
|
||||
|
||||
public MyListbox getConfigCategoriaList() {
|
||||
return categoriaCtrlList;
|
||||
}
|
||||
|
||||
public void setConfigCategoriaList(MyListbox configCategoriaList) {
|
||||
this.categoriaCtrlList = configCategoriaList;
|
||||
}
|
||||
|
||||
public Paging getPagingConfigCategoria() {
|
||||
return pagingCategoriaCtrl;
|
||||
}
|
||||
|
||||
public void setPagingConfigCategoria(Paging pagingConfigCategoria) {
|
||||
this.pagingCategoriaCtrl = pagingConfigCategoria;
|
||||
}
|
||||
|
||||
public Textbox getTxtNome() {
|
||||
return txtNome;
|
||||
}
|
||||
|
||||
public void setTxtNome(Textbox txtNome) {
|
||||
this.txtNome = txtNome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.zkoss.zk.ui.WrongValueException;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.util.Clients;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Decimalbox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Radio;
|
||||
|
@ -43,6 +44,7 @@ import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
|||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
@ -52,12 +54,9 @@ import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService;
|
|||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||
import com.rjconsultores.ventaboletos.service.CorridaCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.UsuarioEmpresaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.TiempoEstanciaEsquemaTramoController;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaClase;
|
||||
|
@ -81,10 +80,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
@Autowired
|
||||
private ClaseServicioService claseServicioService;
|
||||
@Autowired
|
||||
private EmpresaService empresaService;
|
||||
@Autowired
|
||||
private UsuarioEmpresaService usuarioEmpresaService;
|
||||
@Autowired
|
||||
private CorridaCtrlService corridaCtrlService;
|
||||
@Autowired
|
||||
private CategoriaService categoriaService;
|
||||
|
@ -95,7 +90,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
@Autowired
|
||||
private CategoriaPeriodoService categoriaPeriodoService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoService ;
|
||||
private OrgaoConcedenteService orgaoService;
|
||||
private List<Marca> lsMarcas;
|
||||
private List<ClaseServicio> lsClaseServicio;
|
||||
private List<Empresa> lsEmpresas;
|
||||
|
@ -122,8 +117,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
private List<CategoriaMercado> lsCategoriaMercado;
|
||||
private List<CategoriaCorrida> lsCategoriaCorrida;
|
||||
private List<CategoriaOrgao> lsCategoriaOrgao;
|
||||
|
||||
|
||||
private Combobox cmbCategorias;
|
||||
private Combobox cmbEmpresas;
|
||||
private Combobox cmbMarca;
|
||||
|
@ -131,6 +124,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
private Combobox cmbParadaOrigem;
|
||||
private Combobox cmbParadaDestino;
|
||||
private Combobox cmbOrgao;
|
||||
private Combobox cmbIndGeneraFeriado;
|
||||
private Decimalbox descuentoImporte;
|
||||
private Decimalbox descuentoPorc;
|
||||
private Intbox idCorrida;
|
||||
|
@ -138,7 +132,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
private Radio radioImp;
|
||||
private Radio radioImprimePassagem;
|
||||
private Radio rdCuotaSi;
|
||||
private Radio rdCuotaNo;
|
||||
private Row rowTrecho;;
|
||||
private Row rowTiempo;;
|
||||
private Radio rdTrecho;
|
||||
|
@ -151,6 +144,10 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
private Tab tabClasse;
|
||||
private static Logger log = Logger.getLogger(EditarConfiguracionCategoriaController.class);
|
||||
|
||||
public List<Categoria> getLsCategorias() {
|
||||
return lsCategorias;
|
||||
}
|
||||
|
||||
public void setLsCategorias(List<Categoria> lsCategorias) {
|
||||
this.lsCategorias = lsCategorias;
|
||||
}
|
||||
|
@ -187,7 +184,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
this.lsMarcas = lsMarcas;
|
||||
}
|
||||
|
||||
|
||||
public List<OrgaoConcedente> getLsOrgao() {
|
||||
return lsOrgao;
|
||||
}
|
||||
|
@ -220,7 +216,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
this.categoriaCorrida = categoriaCorrida;
|
||||
}
|
||||
|
||||
|
||||
public CategoriaOrgao getCategoriaOrgao() {
|
||||
return categoriaOrgao;
|
||||
}
|
||||
|
@ -257,8 +252,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
return categoriaMarca;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setCategoriaMarca(CategoriaMarca categoriaMarca) {
|
||||
this.categoriaMarca = categoriaMarca;
|
||||
}
|
||||
|
@ -311,6 +304,26 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
this.lsCategoriaCorrida = lsCategoriaCorrida;
|
||||
}
|
||||
|
||||
public void clearCombobox(Combobox combobox) {
|
||||
int size = combobox.getItemCount();
|
||||
|
||||
for (int i = size - 1; i >= 0; i--) {
|
||||
combobox.removeItemAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void popularCombobox(Combobox cmb) throws Exception {
|
||||
|
||||
clearCombobox(cmb);
|
||||
for (EsquemaCorrida.GerarFeriado p : EsquemaCorrida.GerarFeriado.values()) {
|
||||
Comboitem comboItem = new Comboitem(p.descricao());
|
||||
comboItem.setValue(p.valor());
|
||||
comboItem.setParent(cmb);
|
||||
}
|
||||
|
||||
cmb.setSelectedIndex(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsCategorias = categoriaService.obtenerTodasCategoriasVisibles();
|
||||
|
@ -321,6 +334,8 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
popularCombobox(cmbIndGeneraFeriado);
|
||||
|
||||
categoriaCtrlList = (MyListbox) Executions.getCurrent().getArg().get("categoriaCtrlList");
|
||||
categoriaCtrl = (CategoriaCtrl) Executions.getCurrent().getArg().get("categoriaCtrl");
|
||||
|
||||
|
@ -379,7 +394,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
radioImp.setChecked(true);
|
||||
onClick$radioImp(null);
|
||||
cmbEmpresas.focus();
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
|
@ -411,7 +425,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
* Nao deixa editar periodos para novos tipo de pasajero Desa forma nao
|
||||
* traslapa os periodos.
|
||||
*/
|
||||
|
||||
if (categoriaCtrl.getCategoriactrlId() == null) {
|
||||
Messagebox.show(Labels.getLabel("editarConfiguracionCategoriaController.MSG.editarPeriodo"),
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
||||
|
@ -465,7 +478,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||
|
||||
tabEmpresa.setSelected(Boolean.TRUE);
|
||||
cmbEmpresas.getValue();
|
||||
|
||||
|
@ -483,7 +495,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
}
|
||||
}
|
||||
// Deixa salvar sem Vigência para categorias novas.
|
||||
// Deixa salvar sem Vigencia para categorias novas.
|
||||
if (sinPeriodo && categoriaCtrl.getCategoriactrlId() != null) {
|
||||
tabDesconto.setSelected(true);
|
||||
Clients.alert(
|
||||
|
@ -499,7 +511,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
|
||||
if (categoriaCtrl.getCategoriactrlId() == null) {
|
||||
categoriaCtrlService.suscribir(categoriaCtrl);
|
||||
categoriaCtrlList.addItem(categoriaCtrl);
|
||||
categoriaCtrlList.addItemNovo(categoriaCtrl);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.MSG.suscribirOK"),
|
||||
|
@ -602,6 +614,10 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cDescuento.setDescuentoimporte(descuentoImporte.getValue());
|
||||
cDescuento.setDescuentoporc(descuentoPorc.getValue());
|
||||
|
||||
if (cmbIndGeneraFeriado.getSelectedItem() != null) {
|
||||
cDescuento.setIndAplicaFeriado((String) cmbIndGeneraFeriado.getSelectedItem().getValue());
|
||||
}
|
||||
|
||||
if (radioImprimePassagem.isSelected()) {
|
||||
cDescuento.setIndImprimeBoleto(Boolean.TRUE);
|
||||
} else if (radioNaoImprimePassagem.isSelected()) {
|
||||
|
@ -611,8 +627,8 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cDescuento.setIndCuota(false);
|
||||
cDescuento.setIndCuotaTramo(false);
|
||||
|
||||
if (rdCuotaSi.isChecked()){
|
||||
if (timeTempoPermitir.getValue() == null){
|
||||
if (rdCuotaSi.isChecked()) {
|
||||
if (timeTempoPermitir.getValue() == null) {
|
||||
throw new WrongValueException(timeTempoPermitir, Labels.getLabel("MSG.CONSTRAINT.CONSTRAINTNUMBERBDOBLIGATORIO"));
|
||||
}
|
||||
|
||||
|
@ -622,7 +638,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
|
||||
lsCategoriaDescuento.add(cDescuento);
|
||||
categoriaDescuentoList.addItem(cDescuento);
|
||||
categoriaDescuentoList.addItemNovo(cDescuento);
|
||||
categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuento);
|
||||
|
||||
cmbCategorias.setSelectedItem(null);
|
||||
|
@ -632,13 +648,14 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
} else {
|
||||
onClick$radioPor(null);
|
||||
}
|
||||
|
||||
cmbIndGeneraFeriado.setSelectedItem(null);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("MSG.Registro.Existe"),
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverDesconto(Event ev) {
|
||||
|
@ -729,7 +746,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cMarca.setFecmodif(Calendar.getInstance().getTime());
|
||||
cMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsCategoriaMarca.add(cMarca);
|
||||
categoriaMarcaList.addItem(cMarca);
|
||||
categoriaMarcaList.addItemNovo(cMarca);
|
||||
categoriaCtrl.setCategoriaMarcaList(lsCategoriaMarca);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
|
@ -746,8 +763,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void onClick$btnRemoverMarca(Event ev) {
|
||||
try {
|
||||
CategoriaMarca cMarca = (CategoriaMarca) categoriaMarcaList.getSelected();
|
||||
|
@ -777,7 +792,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnAdicionarOrgao(Event ev) throws InterruptedException {
|
||||
if (cmbOrgao.getSelectedItem() == null) {
|
||||
Messagebox.show(
|
||||
|
@ -831,7 +845,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cOrgao.setFecmodif(Calendar.getInstance().getTime());
|
||||
cOrgao.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsCategoriaOrgao.add(cOrgao);
|
||||
categoriaOrgaoList.addItem(cOrgao);
|
||||
categoriaOrgaoList.addItemNovo(cOrgao);
|
||||
categoriaCtrl.setCategoriaorgaoList(lsCategoriaOrgao);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
|
@ -848,11 +862,8 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnRemoverOrgao(Event ev) {
|
||||
try {
|
||||
|
||||
|
||||
CategoriaOrgao cOrgao = (CategoriaOrgao) categoriaOrgaoList.getSelected();
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"),
|
||||
|
@ -862,20 +873,12 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
if (cOrgao != null) {
|
||||
// removo o antigo
|
||||
lsCategoriaOrgao.remove(cOrgao);
|
||||
List<CategoriaOrgao> lsAuxiliar = lsCategoriaOrgao;
|
||||
cOrgao.setFecmodif(Calendar.getInstance().getTime());
|
||||
cOrgao.setActivo(Boolean.FALSE);
|
||||
cOrgao.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsCategoriaOrgao.add(cOrgao);
|
||||
categoriaCtrl.setCategoriaorgaoList(lsCategoriaOrgao);
|
||||
categoriaOrgaoList.removeItem(cOrgao);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"),
|
||||
|
@ -892,8 +895,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void onClick$btnAdicionarCorrida(Event ev) {
|
||||
idCorrida.getValue();
|
||||
|
||||
|
@ -919,7 +920,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
cc.setCorridaCtrl(corrida);
|
||||
lsCategoriaCorrida.add(cc);
|
||||
categoriaCorridaList.addItem(cc);
|
||||
categoriaCorridaList.addItemNovo(cc);
|
||||
categoriaCtrl.setCategoriaCorridaList(lsCategoriaCorrida);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
|
@ -1002,7 +1003,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
}
|
||||
if (!existe) {
|
||||
lsCategoriaMercado.add(cMercado);
|
||||
categoriaMercadoList.addItem(cMercado);
|
||||
categoriaMercadoList.addItemNovo(cMercado);
|
||||
categoriaCtrl.setCategoriaMercadoList(lsCategoriaMercado);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
|
@ -1077,7 +1078,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
cClase.setFecmodif(Calendar.getInstance().getTime());
|
||||
cClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsCategoriaClase.add(cClase);
|
||||
categoriaClaseList.addItem(cClase);
|
||||
categoriaClaseList.addItemNovo(cClase);
|
||||
categoriaCtrl.setCategoriaClaseList(lsCategoriaClase);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
|
@ -1162,20 +1163,17 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|||
descuentoPorc.setConstraint("no empty, no zero, no negative");
|
||||
}
|
||||
|
||||
public List<Categoria> getLsCategorias() {
|
||||
return lsCategorias;
|
||||
}
|
||||
|
||||
public void onClick$rdCuotaSi(Event ev) {
|
||||
mudarCamposCuota(true);
|
||||
}
|
||||
|
||||
private void mudarCamposCuota(boolean visible){
|
||||
private void mudarCamposCuota(boolean visible) {
|
||||
rowTrecho.setVisible(visible);
|
||||
rowTiempo.setVisible(visible);
|
||||
|
||||
timeTempoPermitir.setValue(null);
|
||||
}
|
||||
|
||||
public void onClick$rdCuotaNo(Event ev) {
|
||||
mudarCamposCuota(false);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.zkoss.zul.Messagebox;
|
|||
@Scope("prototype")
|
||||
public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Autowired
|
||||
private CategoriaDescuentoService categoriaDescuentoService;
|
||||
@Autowired
|
||||
|
@ -41,7 +42,6 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
private MyListbox categoriaDescuentoList;
|
||||
private MyListbox categoriaPeriodoList;
|
||||
private CategoriaDescuento categoriaDescuento;
|
||||
private CategoriaPeriodo categoriaPeriodo;
|
||||
private List<CategoriaPeriodo> lsCategoriaPeriodo;
|
||||
private Datebox fecInicio;
|
||||
private Datebox fecFinal;
|
||||
|
@ -58,8 +58,6 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
lsCategoriaPeriodo = new ArrayList<CategoriaPeriodo>();
|
||||
|
||||
if (categoriaDescuento.getCategoriadescuentoId() != null) {
|
||||
//categoriaDescuento = categoriaDescuentoService.obtenerID(categoriaDescuento.getCategoriadescuentoId());
|
||||
|
||||
lsCategoriaPeriodo = categoriaDescuento.getCategoriaPeriodoList();
|
||||
categoriaPeriodoList.setData(lsCategoriaPeriodo);
|
||||
}
|
||||
|
@ -82,7 +80,6 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
CategoriaPeriodo cPeriodo = new CategoriaPeriodo();
|
||||
cPeriodo.setFecmodif(Calendar.getInstance().getTime());
|
||||
cPeriodo.setActivo(Boolean.TRUE);
|
||||
|
@ -95,9 +92,9 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
List<CategoriaPeriodo> lsVT1 = categoriaPeriodoService.buscarPeriodoIntervalo(cPeriodo);
|
||||
|
||||
Boolean podeSalvar = lsVT1.isEmpty() ? true : false;
|
||||
//Se for ele mesmo pode salvar.
|
||||
// Se for ele mesmo pode salvar.
|
||||
if (lsVT1.size() == 1) {
|
||||
//Somente edição
|
||||
// Somente edicao
|
||||
if (categoriaDescuento.getCategoriadescuentoId() != null) {
|
||||
if (categoriaDescuento.getCategoriadescuentoId().equals(lsVT1.get(0).getCategoriaperiodoId())) {
|
||||
podeSalvar = true;
|
||||
|
@ -131,7 +128,6 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
}
|
||||
|
@ -147,10 +143,8 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
categoriaPeriodoService.borrar(cPeriodo);
|
||||
lsCategoriaPeriodo.remove(cPeriodo);
|
||||
categoriaPeriodoList.setData(lsCategoriaPeriodo);
|
||||
//categoriaPeriodoList.removeItem(cPeriodo);
|
||||
|
||||
categoriaDescuento.setCategoriaPeriodoList(lsCategoriaPeriodo);
|
||||
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionCategoriaController.MSG.selecionarPeriodo"),
|
||||
|
@ -169,11 +163,7 @@ public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForw
|
|||
categoriaDescuento.setFecmodif(Calendar.getInstance().getTime());
|
||||
categoriaDescuento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
||||
|
||||
if (categoriaDescuento.getCategoriadescuentoId() != null) {
|
||||
// categoriaDescuentoService.suscribir(categoriaDescuento);
|
||||
// categoriaDescuentoList.addItem(categoriaDescuento);
|
||||
// } else {
|
||||
categoriaDescuentoService.actualizacion(categoriaDescuento);
|
||||
categoriaDescuentoList.updateItem(categoriaDescuento);
|
||||
}
|
||||
|
|
|
@ -4,24 +4,21 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaCtrlService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author rodrigo
|
||||
*/
|
||||
public class RenderCategoriaDescuento implements ListitemRenderer {
|
||||
@Autowired
|
||||
private CategoriaCtrlService categoriaCtrlService;
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
CategoriaCtrl cc = (CategoriaCtrl) o;
|
||||
|
||||
|
@ -44,10 +41,10 @@ public class RenderCategoriaDescuento implements ListitemRenderer {
|
|||
}
|
||||
lc = new Listcell(sb2.toString());
|
||||
lc.setParent(lstm);
|
||||
if(!cc.getCategoriaDescuentoList().isEmpty()){
|
||||
if (!cc.getCategoriaDescuentoList().isEmpty()) {
|
||||
|
||||
sb = new StringBuilder();
|
||||
for(CategoriaDescuento catDesc : cc.getCategoriaDescuentoList()){
|
||||
for (CategoriaDescuento catDesc : cc.getCategoriaDescuentoList()) {
|
||||
sb.append(catDesc.getCategoria()).append(", ");
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,12 @@ package com.rjconsultores.ventaboletos.web.utilerias.render;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
@ -30,17 +34,15 @@ public class RenderConfiguracionCategoriaDecuento implements ListitemRenderer {
|
|||
lc = new Listcell(categoria.getDescuentoimporte() != null ? categoria.getDescuentoimporte().toString() : "0");
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(categoria.getIndImprimeBoleto() != null ? (categoria.getIndImprimeBoleto()?"Sim":"Não") : "Não");
|
||||
lc = new Listcell(categoria.getIndImprimeBoleto() != null ? (categoria.getIndImprimeBoleto() ? "Sim" : "Não") : "Não");
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(categoria.getIndCuota() != null ? (categoria.getIndCuota()?"Sim":"Não") : "Não");
|
||||
lc = new Listcell(categoria.getIndCuota() != null ? (categoria.getIndCuota() ? "Sim" : "Não") : "Não");
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(categoria.getDescuentoporc() != null ? categoria.getDescuentoporc().toString() : "0");
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
|
||||
String vigencia = "";
|
||||
List<CategoriaPeriodo> lsCategoriaPeriodo = categoria.getCategoriaPeriodoList();
|
||||
|
@ -62,6 +64,17 @@ public class RenderConfiguracionCategoriaDecuento implements ListitemRenderer {
|
|||
lc = new Listcell(vigencia);
|
||||
lc.setParent(lstm);
|
||||
|
||||
String aplicaFeriado = "";
|
||||
if (categoria.getIndAplicaFeriado() != null) {
|
||||
for (EsquemaCorrida.GerarFeriado p : EsquemaCorrida.GerarFeriado.values()) {
|
||||
if (p.valor().equals(categoria.getIndAplicaFeriado())) {
|
||||
aplicaFeriado = p.descricao();
|
||||
}
|
||||
}
|
||||
}
|
||||
lc = new Listcell(aplicaFeriado);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", categoria);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
|
||||
<window id="winEditarConfiguracionCategoria" border="normal"
|
||||
apply="${editarConfiguracionCategoriaController}" height="540px"
|
||||
width="750px" contentStyle="overflow:auto"
|
||||
width="900px" contentStyle="overflow:auto"
|
||||
title="${c:l('editarConfiguracionCategoriaController.window.title')}">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
|
@ -94,7 +93,6 @@
|
|||
<radio id="radioPor"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblDescuentoPorc.value')}" />
|
||||
</radiogroup>
|
||||
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
|
@ -120,24 +118,37 @@
|
|||
constraint="no empty" width="50%" maxlength="9" />
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarConfiguracionCategoriaController.lblCotaObli.value')}" />
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCategoriaController.lblCotaObli.value')}" />
|
||||
<radiogroup>
|
||||
<radio id="rdCuotaSi" label="Sim" />
|
||||
<radio id="rdCuotaNo" label="Nao" selected="true"/>
|
||||
<radio id="rdCuotaNo" label="Nao"
|
||||
selected="true" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
<row id="rowTrecho" visible="false">
|
||||
<label value="${c:l('editarConfiguracionCategoriaController.lblTipoCota.value')}" />
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCategoriaController.lblTipoCota.value')}" />
|
||||
<radiogroup>
|
||||
<radio selected="true" label="${c:l('editarConfiguracionCategoriaController.lblServico.value')}" />
|
||||
<radio id="rdTrecho" label="${c:l('editarConfiguracionCategoriaController.lblTrecho.value')}" />
|
||||
<radio selected="true"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblServico.value')}" />
|
||||
<radio id="rdTrecho"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblTrecho.value')}" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
<row id="rowTiempo" visible="false">
|
||||
<label value="${c:l('editarConfiguracionCategoriaController.lblTiempoValido.value')}" />
|
||||
<timebox id="timeTempoPermitir" width="25%" mold="rounded" format="HH:mm"/>
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCategoriaController.lblTiempoValido.value')}" />
|
||||
<timebox id="timeTempoPermitir"
|
||||
width="25%" mold="rounded" format="HH:mm" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCorridaController.cmbIndGeneraFeriado.value')}" />
|
||||
<combobox id="cmbIndGeneraFeriado"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
constraint="no empty" mold="rounded" width="70%" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value=" " />
|
||||
<hbox>
|
||||
|
@ -161,30 +172,26 @@
|
|||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader
|
||||
width="150px"
|
||||
<listheader width="150px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblCategorias.value')}"
|
||||
sort="auto(categoria.desccategoria)" />
|
||||
<listheader
|
||||
width="60px"
|
||||
<listheader width="60px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblGridCantAutorizada.value')}"
|
||||
sort="auto(cantautorizada)" />
|
||||
<listheader
|
||||
width="50px"
|
||||
<listheader width="50px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblDescuentoImporte.value')}"
|
||||
sort="auto(descuentoimporte)" />
|
||||
<listheader
|
||||
width="60px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblGridImprime.value')}"/>
|
||||
<listheader
|
||||
width="50px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblCota.value')}"/>
|
||||
<listheader
|
||||
width="100px"
|
||||
<listheader width="60px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblGridImprime.value')}" />
|
||||
<listheader width="50px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblCota.value')}" />
|
||||
<listheader width="100px"
|
||||
label="${c:l('editarConfiguracionCategoriaController.lblDescuentoPorc.value')}"
|
||||
sort="auto(descuentoporc)" />
|
||||
<listheader width="100%"
|
||||
label="${c:l('editarConfiguracionCategoriaControllerPeriodo.window.title')}" />
|
||||
<listheader width="100%"
|
||||
label="${c:l('editarConfiguracionCorridaController.cmbIndGeneraFeriado.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
|
@ -366,7 +373,7 @@
|
|||
constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
model="@{winEditarConfiguracionCategoria$composer.lsOrgao}"/>
|
||||
model="@{winEditarConfiguracionCategoria$composer.lsOrgao}" />
|
||||
<button id="btnAdicionarOrgao"
|
||||
height="20" image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarConfiguracionCategoriaController.btnAddOrgao.tooltiptext')}" />
|
||||
|
@ -380,9 +387,14 @@
|
|||
<listbox id="categoriaOrgaoList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true" >
|
||||
<listheader id="lhCategoriaOrgaoId" image="/gui/img/create_doc.gif" label="${c:l('editarConfiguracionCategoriaController.tabOrgao.labelOrgao')}" width="10%"/>
|
||||
<listheader id="lhCategoriaOrgaoNome" image="/gui/img/create_doc.gif" label="${c:l('editarConfiguracionCategoriaController.tabOrgao.labelNome')}" />
|
||||
<listhead sizable="true">
|
||||
<listheader id="lhCategoriaOrgaoId"
|
||||
image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConfiguracionCategoriaController.tabOrgao.labelOrgao')}"
|
||||
width="10%" />
|
||||
<listheader id="lhCategoriaOrgaoNome"
|
||||
image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConfiguracionCategoriaController.tabOrgao.labelNome')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
|
|
Loading…
Reference in New Issue