Correção para habilitar os campos de edição da categoria no cadastro do pricing, conforme parâmetro. ( fixes bug #5799 )
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@39493 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9d0ae8e50f
commit
e53cdd9884
|
@ -647,31 +647,6 @@ public class EditarPricingController extends MyGenericForwardComposer {
|
||||||
pricingRutaList.setData(lsPricingRuta);
|
pricingRutaList.setData(lsPricingRuta);
|
||||||
pricingRutaService.suscribir(pr);
|
pricingRutaService.suscribir(pr);
|
||||||
}
|
}
|
||||||
// Tipo Pasajero - Categoria
|
|
||||||
PricingCategoria pc = new PricingCategoria();
|
|
||||||
Categoria categoria = null;
|
|
||||||
|
|
||||||
if (ApplicationProperties.getInstance().habilitarPricingCategoria()) {
|
|
||||||
pricingCategoriaList.setDisabled(Boolean.FALSE);
|
|
||||||
btnNovoCategoria.setDisabled(Boolean.FALSE);
|
|
||||||
btnApagarCategoria.setDisabled(Boolean.FALSE);
|
|
||||||
btnModificarCategoria.setDisabled(Boolean.FALSE);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
categoria = categoriaService.obtenerID(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (categoria != null) {
|
|
||||||
pc.setCategoria(categoria);
|
|
||||||
pc.setPricing(pricing);
|
|
||||||
pc.setActivo(Pricing.ATIVO);
|
|
||||||
pc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
pc.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
lsPricingCategoria.add(pc);
|
|
||||||
pricingCategoriaList.setData(lsPricingCategoria);
|
|
||||||
pricingCategoriaService.suscribir(pc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mercado
|
// Mercado
|
||||||
PricingMercado pme = new PricingMercado();
|
PricingMercado pme = new PricingMercado();
|
||||||
|
@ -697,6 +672,31 @@ public class EditarPricingController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tipo Pasajero - Categoria
|
||||||
|
PricingCategoria pc = new PricingCategoria();
|
||||||
|
Categoria categoria = null;
|
||||||
|
|
||||||
|
if (ApplicationProperties.getInstance().habilitarPricingCategoria()) {
|
||||||
|
pricingCategoriaList.setDisabled(Boolean.FALSE);
|
||||||
|
btnNovoCategoria.setDisabled(Boolean.FALSE);
|
||||||
|
btnApagarCategoria.setDisabled(Boolean.FALSE);
|
||||||
|
btnModificarCategoria.setDisabled(Boolean.FALSE);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
categoria = categoriaService.obtenerID(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (categoria != null && verificarCategoriaNaoAdicionada(categoria)) {
|
||||||
|
pc.setCategoria(categoria);
|
||||||
|
pc.setPricing(pricing);
|
||||||
|
pc.setActivo(Pricing.ATIVO);
|
||||||
|
pc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
pc.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
lsPricingCategoria.add(pc);
|
||||||
|
pricingCategoriaList.setData(lsPricingCategoria);
|
||||||
|
pricingCategoriaService.suscribir(pc);
|
||||||
|
}
|
||||||
|
|
||||||
if (pricing.getPricingId() == null) {
|
if (pricing.getPricingId() == null) {
|
||||||
btnApagar.setVisible(Boolean.FALSE);
|
btnApagar.setVisible(Boolean.FALSE);
|
||||||
btnInativar.setVisible(Boolean.FALSE);
|
btnInativar.setVisible(Boolean.FALSE);
|
||||||
|
@ -704,6 +704,19 @@ public class EditarPricingController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Valida se a categoria não foi adicionada */
|
||||||
|
private boolean verificarCategoriaNaoAdicionada(Categoria categoria) {
|
||||||
|
if(lsPricingCategoria == null || lsPricingCategoria.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (PricingCategoria pricingCategoria : lsPricingCategoria) {
|
||||||
|
if(pricingCategoria.getCategoria() != null && pricingCategoria.getCategoria().equals(categoria)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void onClick$radioImp(Event ev) {
|
public void onClick$radioImp(Event ev) {
|
||||||
btnNovoImporte.setVisible(true);
|
btnNovoImporte.setVisible(true);
|
||||||
btnApagarImporte.setVisible(true);
|
btnApagarImporte.setVisible(true);
|
||||||
|
|
Loading…
Reference in New Issue