fixes bug #7867
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@60259 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2ba7d8d144
commit
6f95a3c519
|
@ -175,24 +175,28 @@ public class EditarOrgaoConcedenteController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
public void onClick$btnAdicionarClassePeaje(Event ev) throws InterruptedException {
|
public void onClick$btnAdicionarClassePeaje(Event ev) throws InterruptedException {
|
||||||
cmbClasseServicio.setConstraint("no empty");
|
cmbClasseServicio.setConstraint("no empty");
|
||||||
txtIndicePeajClasse.setConstraint("no empty,no negative, /[0-9]+(\\,[0-9][0-9]?)?|/ ");
|
|
||||||
|
|
||||||
if (!classeExistente((ClaseServicio) cmbClasseServicio.getSelectedItem().getValue())
|
if (!classeExistente((ClaseServicio) cmbClasseServicio.getSelectedItem().getValue())) {
|
||||||
&& txtIndicePeajClasse.getValueDecimal() != null) {
|
if (txtIndicePeajClasse.getValueDecimal() != null
|
||||||
|
&& !txtIndicePeajClasse.getValueDecimal().equals(BigDecimal.ZERO)) {
|
||||||
|
ClasseIndicePeaje classeIndicePeaje = new ClasseIndicePeaje();
|
||||||
|
classeIndicePeaje.setActivo(true);
|
||||||
|
classeIndicePeaje.setClasseServicio((ClaseServicio) cmbClasseServicio.getSelectedItem().getValue());
|
||||||
|
classeIndicePeaje.setOrgaoConcedente(orgaoConcedente);
|
||||||
|
classeIndicePeaje.setIndicePeaje(txtIndicePeajClasse.getValueDecimal());
|
||||||
|
|
||||||
ClasseIndicePeaje classeIndicePeaje = new ClasseIndicePeaje();
|
cmbClasseServicio.setConstraint("");
|
||||||
classeIndicePeaje.setActivo(true);
|
txtIndicePeajClasse.setConstraint("");
|
||||||
classeIndicePeaje.setClasseServicio((ClaseServicio) cmbClasseServicio.getSelectedItem().getValue());
|
|
||||||
classeIndicePeaje.setOrgaoConcedente(orgaoConcedente);
|
|
||||||
classeIndicePeaje.setIndicePeaje(txtIndicePeajClasse.getValueDecimal());
|
|
||||||
|
|
||||||
cmbClasseServicio.setConstraint("");
|
lsClasseIndicePeajes.add(classeIndicePeaje);
|
||||||
txtIndicePeajClasse.setConstraint("");
|
listBoxIndicePeaj.addItemNovo(classeIndicePeaje);
|
||||||
|
cmbClasseServicio.setSelectedItem(null);
|
||||||
lsClasseIndicePeajes.add(classeIndicePeaje);
|
} else {
|
||||||
listBoxIndicePeaj.addItemNovo(classeIndicePeaje);
|
Messagebox.show(
|
||||||
cmbClasseServicio.setSelectedItem(null);
|
Labels.getLabel("editarOrgaoConcedenteController.MSG.indicePeajeZeroInvalido"),
|
||||||
txtIndicePeajClasse.setText("");
|
Labels.getLabel("editarOrgaoConcedenteController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import org.zkoss.zul.Listcell;
|
import org.zkoss.zul.Listcell;
|
||||||
import org.zkoss.zul.Listitem;
|
import org.zkoss.zul.Listitem;
|
||||||
import org.zkoss.zul.ListitemRenderer;
|
import org.zkoss.zul.ListitemRenderer;
|
||||||
|
@ -12,10 +14,12 @@ public class RenderClasseIndicePeaj implements ListitemRenderer {
|
||||||
public void render(Listitem arg0, Object arg1) throws Exception {
|
public void render(Listitem arg0, Object arg1) throws Exception {
|
||||||
ClasseIndicePeaje classeIndicePeaje = (ClasseIndicePeaje) arg1;
|
ClasseIndicePeaje classeIndicePeaje = (ClasseIndicePeaje) arg1;
|
||||||
|
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
||||||
|
|
||||||
Listcell lc = new Listcell(classeIndicePeaje.getClasseServicio().getDescclase());
|
Listcell lc = new Listcell(classeIndicePeaje.getClasseServicio().getDescclase());
|
||||||
lc.setParent(arg0);
|
lc.setParent(arg0);
|
||||||
|
|
||||||
lc = new Listcell(classeIndicePeaje.getIndicePeaje().toString());
|
lc = new Listcell(decimalFormat.format(classeIndicePeaje.getIndicePeaje()));
|
||||||
lc.setParent(arg0);
|
lc.setParent(arg0);
|
||||||
|
|
||||||
arg0.setAttribute("data", classeIndicePeaje);
|
arg0.setAttribute("data", classeIndicePeaje);
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
DELETE FROM CLASSE_INDICE_PEAJE;
|
||||||
|
|
||||||
|
ALTER TABLE CLASSE_INDICE_PEAJE
|
||||||
|
MODIFY (INDICE_PEAJE NUMERIC(7,2));
|
|
@ -85,6 +85,7 @@
|
||||||
value="${c:l('busquedaOrgaoConcedenteController.indicePeaje.label')}" />
|
value="${c:l('busquedaOrgaoConcedenteController.indicePeaje.label')}" />
|
||||||
<textbox id="txtIndicePeajClasse"
|
<textbox id="txtIndicePeajClasse"
|
||||||
maxlength="8" mold="rounded"
|
maxlength="8" mold="rounded"
|
||||||
|
constraint=" no negative, /[0-9]+(\,[0-9][0-9]?)?|/ "
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal" />
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal" />
|
||||||
|
|
||||||
<button id="btnAdicionarClassePeaje"
|
<button id="btnAdicionarClassePeaje"
|
||||||
|
|
Loading…
Reference in New Issue