fixes bug#0012389
dev: fabricio qua: renato git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@86172 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
b8e97c2e51
commit
3645ba5913
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
@ -48,13 +49,15 @@ import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoCo
|
||||||
public class GridRutaTramoCoeficiente extends Grid implements RowRenderer, RendererCtrl {
|
public class GridRutaTramoCoeficiente extends Grid implements RowRenderer, RendererCtrl {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final String CONSTRAINT_NO_EMPTY = "no empty";
|
||||||
|
private static final String VALOR_COMBO_NAO = "Não";
|
||||||
|
private static final String VALOR_COMBO_SIM = "Sim";
|
||||||
private List<Via> lsVias;
|
private List<Via> lsVias;
|
||||||
private List<CoeficienteTarifa> lsCoeficientes;
|
private List<CoeficienteTarifa> lsCoeficientes;
|
||||||
private List<SecuenciaRutaTramoCoeficienteVO> lsSecuenciaRutaTramoCoeficienteVO;
|
private List<SecuenciaRutaTramoCoeficienteVO> lsSecuenciaRutaTramoCoeficienteVO;
|
||||||
private ClaseServicio claseServicio;
|
private ClaseServicio claseServicio;
|
||||||
private OrgaoConcedente orgaoConcedente;
|
private OrgaoConcedente orgaoConcedente;
|
||||||
private DataBinder dataBinder;
|
private DataBinder dataBinder;
|
||||||
// private Combobox cboVenda;
|
|
||||||
private static Logger log = Logger.getLogger(GridRutaTramoCoeficiente.class);
|
private static Logger log = Logger.getLogger(GridRutaTramoCoeficiente.class);
|
||||||
|
|
||||||
public GridRutaTramoCoeficiente() {
|
public GridRutaTramoCoeficiente() {
|
||||||
|
@ -122,99 +125,243 @@ public class GridRutaTramoCoeficiente extends Grid implements RowRenderer, Rende
|
||||||
private Columns generarColumns() {
|
private Columns generarColumns() {
|
||||||
Columns columns = new Columns();
|
Columns columns = new Columns();
|
||||||
|
|
||||||
Column columnSecuencia = new Column("#");
|
columns.appendChild(criaColuna("#", "2%"));
|
||||||
columnSecuencia.setWidth("1%");
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnOrigen.label"), "20%"));
|
||||||
columns.appendChild(columnSecuencia);
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnDestino.label"), "20%"));
|
||||||
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnVia.label"), "15%"));
|
||||||
Column columnOrigen = new Column(Labels.getLabel("gridRutaSecuencia.columnOrigen.label"));
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnVenda.label"), "6%"));
|
||||||
columnOrigen.setWidth("20%");
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnKmsReal.label"), "6%"));
|
||||||
columns.appendChild(columnOrigen);
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnTiempoRecorrido.label"), "10%"));
|
||||||
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnIDTramo.label"), "6%"));
|
||||||
Column columnDestino = new Column(Labels.getLabel("gridRutaSecuencia.columnDestino.label"));
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnCoeficiente1.label"), "12%"));
|
||||||
columnDestino.setWidth("20%");
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnKmCoeficiente1.label"), "5%"));
|
||||||
columns.appendChild(columnDestino);
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnCoeficiente2.label"), "12%"));
|
||||||
|
columns.appendChild(criaColuna(Labels.getLabel("gridRutaSecuencia.columnKmCoeficiente2.label"), "5%"));
|
||||||
Column columnVia = new Column(Labels.getLabel("gridRutaSecuencia.columnVia.label"));
|
|
||||||
columnVia.setWidth("15%");
|
|
||||||
columns.appendChild(columnVia);
|
|
||||||
|
|
||||||
Column permiteVenda = new Column(Labels.getLabel("gridRutaSecuencia.columnVenda.label"));
|
|
||||||
permiteVenda.setWidth("6%");
|
|
||||||
columns.appendChild(permiteVenda);
|
|
||||||
|
|
||||||
Column kmsReal = new Column(Labels.getLabel("gridRutaSecuencia.columnKmsReal.label"));
|
|
||||||
kmsReal.setWidth("6%");
|
|
||||||
columns.appendChild(kmsReal);
|
|
||||||
|
|
||||||
Column tiempoRecorrido = new Column(Labels.getLabel("gridRutaSecuencia.columnTiempoRecorrido.label"));
|
|
||||||
tiempoRecorrido.setWidth("10%");
|
|
||||||
columns.appendChild(tiempoRecorrido);
|
|
||||||
|
|
||||||
Column columnIDTramo = new Column(Labels.getLabel("gridRutaSecuencia.columnIDTramo.label"));
|
|
||||||
columnSecuencia.setWidth("6%");
|
|
||||||
columns.appendChild(columnIDTramo);
|
|
||||||
|
|
||||||
Column columnCoeficiente1 = new Column(Labels.getLabel("gridRutaSecuencia.columnCoeficiente1.label"));
|
|
||||||
columnCoeficiente1.setWidth("12%");
|
|
||||||
columns.appendChild(columnCoeficiente1);
|
|
||||||
|
|
||||||
Column columnKmCoeficiente1 = new Column(Labels.getLabel("gridRutaSecuencia.columnKmCoeficiente1.label"));
|
|
||||||
columnKmCoeficiente1.setWidth("5%");
|
|
||||||
columns.appendChild(columnKmCoeficiente1);
|
|
||||||
|
|
||||||
Column columnCoeficiente2 = new Column(Labels.getLabel("gridRutaSecuencia.columnCoeficiente2.label"));
|
|
||||||
columnCoeficiente2.setWidth("12%");
|
|
||||||
columns.appendChild(columnCoeficiente2);
|
|
||||||
|
|
||||||
Column columnKmCoeficiente2 = new Column(Labels.getLabel("gridRutaSecuencia.columnKmCoeficiente2.label"));
|
|
||||||
columnKmCoeficiente2.setWidth("5%");
|
|
||||||
columns.appendChild(columnKmCoeficiente2);
|
|
||||||
|
|
||||||
return columns;
|
return columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Column criaColuna(String label, String width) {
|
||||||
|
Column coluna = new Column(label);
|
||||||
|
coluna.setWidth(width);
|
||||||
|
return coluna;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(Row row, Object obj) throws Exception {
|
public void render(Row row, Object obj) throws Exception {
|
||||||
final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO = (SecuenciaRutaTramoCoeficienteVO) obj;
|
final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO = (SecuenciaRutaTramoCoeficienteVO) obj;
|
||||||
// binder row->bean
|
|
||||||
dataBinder.bindBean(row.getUuid(), secuenciaRutaTramoCoeficienteVO);
|
dataBinder.bindBean(row.getUuid(), secuenciaRutaTramoCoeficienteVO);
|
||||||
|
|
||||||
// Cell secuencia
|
row.appendChild(criaCellSequencia(secuenciaRutaTramoCoeficienteVO));
|
||||||
Intbox ibxSumSecuencia = new Intbox(secuenciaRutaTramoCoeficienteVO.getSecuencia());
|
row.appendChild(criaCellOrigem(secuenciaRutaTramoCoeficienteVO));
|
||||||
ibxSumSecuencia.setWidth("50%");
|
row.appendChild(criaCellDestino(secuenciaRutaTramoCoeficienteVO));
|
||||||
ibxSumSecuencia.setReadonly(true);
|
|
||||||
row.appendChild(ibxSumSecuencia);
|
final MyCustomTextboxDecimal dKmsReal = criaKmsReal(secuenciaRutaTramoCoeficienteVO, row.getUuid());
|
||||||
|
final Spinner spHora = criaSpinerHora(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
final Spinner spMinuto = criaSpinerMinuto(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
final Label lblID = criaLabelId(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
|
||||||
|
final Combobox comboCoeficiente1 = criaCoeficienteTarifario1(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
final MyCustomTextboxDecimal kmCoeficiente1 = criaKmCoeficiente1(secuenciaRutaTramoCoeficienteVO, row.getUuid() + ".kmCoeficiente1");
|
||||||
|
|
||||||
// Cell Origen
|
final Combobox comboCoeficiente2 = criaCoeficienteTarifario2(secuenciaRutaTramoCoeficienteVO);
|
||||||
String strOrigem = secuenciaRutaTramoCoeficienteVO.getOrigen().getCveparada() + " - " + secuenciaRutaTramoCoeficienteVO.getOrigen().getDescparada();
|
final MyCustomTextboxDecimal kmCoeficiente2 = criaKmCoeficiente2(secuenciaRutaTramoCoeficienteVO, row.getUuid() + ".kmCoeficiente2");
|
||||||
Label lblOrigen = new Label(strOrigem);
|
|
||||||
lblOrigen.setWidth("80%");
|
Combobox comboVia = criaCellComboVia(secuenciaRutaTramoCoeficienteVO);
|
||||||
row.appendChild(lblOrigen);
|
comboVia.addEventListener(Events.ON_CHANGE,
|
||||||
|
new EventListenerComboVia(comboVia, spHora, spMinuto, lblID, kmCoeficiente2,
|
||||||
|
comboCoeficiente1, secuenciaRutaTramoCoeficienteVO, kmCoeficiente1,
|
||||||
|
comboCoeficiente2, dKmsReal));
|
||||||
|
row.appendChild(comboVia);
|
||||||
|
|
||||||
|
row.appendChild(criaCellComboVenda(secuenciaRutaTramoCoeficienteVO));
|
||||||
|
|
||||||
|
row.appendChild(dKmsReal);
|
||||||
|
|
||||||
|
row.appendChild(criaCellHora(row, secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido(), spHora, spMinuto));
|
||||||
|
|
||||||
// Cell Destino
|
row.appendChild(lblID);
|
||||||
String strDestino = secuenciaRutaTramoCoeficienteVO.getDestino().getCveparada() + " - " + secuenciaRutaTramoCoeficienteVO.getDestino().getDescparada();
|
|
||||||
Label lblDestino = new Label(strDestino);
|
|
||||||
lblDestino.setWidth("80%");
|
|
||||||
row.appendChild(lblDestino);
|
|
||||||
|
|
||||||
// son creados antes pues el cboVia los estan ocupando
|
row.appendChild(comboCoeficiente1);
|
||||||
final MyCustomTextboxDecimal dKmsReal = new MyCustomTextboxDecimal((secuenciaRutaTramoCoeficienteVO.getKmReal() == null) ? BigDecimal.ZERO : secuenciaRutaTramoCoeficienteVO.getKmReal());
|
|
||||||
dKmsReal.setWidth("90%");
|
row.appendChild(kmCoeficiente1);
|
||||||
|
|
||||||
final Spinner spHora = new Spinner();
|
row.appendChild(comboCoeficiente2);
|
||||||
final Spinner spMinuto = new Spinner();
|
|
||||||
|
row.appendChild(kmCoeficiente2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Hbox criaCellHora(Row row, final HoraSistema horaSistema, final Spinner spHora, final Spinner spMinuto) {
|
||||||
|
Hbox hbox = new Hbox();
|
||||||
|
hbox.appendChild(spHora);
|
||||||
|
hbox.appendChild(new Label(":"));
|
||||||
|
hbox.appendChild(spMinuto);
|
||||||
|
|
||||||
|
if (horaSistema != null) {
|
||||||
|
HoraSistema hora = horaSistema;
|
||||||
|
spHora.setValue(hora.getHora());
|
||||||
|
spMinuto.setValue(hora.getMinuto());
|
||||||
|
}
|
||||||
|
dataBinder.addBinding(spHora, "value", row.getUuid() + ".tiempoRecorrido.hora", null, null, "save", null, null, null, null);
|
||||||
|
dataBinder.addBinding(spMinuto, "value", row.getUuid() + ".tiempoRecorrido.minuto", null, null, "save", null, null, null, null);
|
||||||
|
return hbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MyCustomTextboxDecimal criaKmCoeficiente2(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO, String rowId) {
|
||||||
|
final MyCustomTextboxDecimal kmCoeficiente2 = new MyCustomTextboxDecimal();
|
||||||
|
|
||||||
|
configuraKmCoeficiente(secuenciaRutaTramoCoeficienteVO, rowId, kmCoeficiente2, secuenciaRutaTramoCoeficienteVO.getKmCoeficiente2());
|
||||||
|
|
||||||
|
return kmCoeficiente2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MyCustomTextboxDecimal criaKmCoeficiente1(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO, String rowId) {
|
||||||
|
final MyCustomTextboxDecimal kmCoeficiente1 = new MyCustomTextboxDecimal();
|
||||||
|
|
||||||
|
configuraKmCoeficiente(secuenciaRutaTramoCoeficienteVO, rowId, kmCoeficiente1, secuenciaRutaTramoCoeficienteVO.getKmCoeficiente1());
|
||||||
|
|
||||||
|
return kmCoeficiente1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void configuraKmCoeficiente(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO, String rowId, final MyCustomTextboxDecimal kmCoeficiente,
|
||||||
|
final BigDecimal valorKmCoeficiente) {
|
||||||
|
kmCoeficiente.setValueBigDecimal(valorKmCoeficiente != null ? valorKmCoeficiente : BigDecimal.ZERO);
|
||||||
|
kmCoeficiente.setWidth("80%");
|
||||||
|
kmCoeficiente.setReadonly(!possuiOrgao(secuenciaRutaTramoCoeficienteVO));
|
||||||
|
dataBinder.addBinding(kmCoeficiente, "value", rowId, null, null,
|
||||||
|
"save", "com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Combobox criaCellComboVenda(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
final Combobox comboVenda = new Combobox();
|
||||||
|
comboVenda.setId(comboVenda.getUuid());
|
||||||
|
comboVenda.setReadonly(true);
|
||||||
|
comboVenda.setWidth("100%");
|
||||||
|
comboVenda.setConstraint(CONSTRAINT_NO_EMPTY);
|
||||||
|
|
||||||
|
final ListModelList listComboVenda = configuraModelListComboVenda(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
|
||||||
|
comboVenda.setModel(listComboVenda);
|
||||||
|
|
||||||
|
comboVenda.addEventListener(Events.ON_CHANGE, new EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event evt) throws Exception {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(
|
||||||
|
VALOR_COMBO_SIM.equals(comboVenda.getSelectedItem().getValue()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return comboVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ListModelList configuraModelListComboVenda(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
final ListModelList listComboVenda = new ListModelList();
|
||||||
|
|
||||||
|
final Comboitem comboItemSim = new Comboitem(VALOR_COMBO_SIM);
|
||||||
|
comboItemSim.setValue(VALOR_COMBO_SIM);
|
||||||
|
|
||||||
|
final Comboitem comboItemNao = new Comboitem(VALOR_COMBO_NAO);
|
||||||
|
comboItemNao.setValue(VALOR_COMBO_NAO);
|
||||||
|
|
||||||
|
listComboVenda.add(comboItemSim.getValue());
|
||||||
|
listComboVenda.add(comboItemNao.getValue());
|
||||||
|
|
||||||
|
if (getId().equalsIgnoreCase("gridrutasecuenciaida")) {
|
||||||
|
if (secuenciaRutaTramoCoeficienteVO.getPermiteVenda() == null) {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(false);
|
||||||
|
}
|
||||||
|
listComboVenda.addSelection(BooleanUtils.isTrue(secuenciaRutaTramoCoeficienteVO.getPermiteVenda())
|
||||||
|
? comboItemSim.getValue() : comboItemNao.getValue());
|
||||||
|
}
|
||||||
|
return listComboVenda;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Combobox criaCoeficienteTarifario2(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
final Combobox cboCoeficiente = criaCoeficiente(secuenciaRutaTramoCoeficienteVO,
|
||||||
|
secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2());
|
||||||
|
cboCoeficiente.addEventListener(Events.ON_CHANGE, new EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event arg0) throws Exception {
|
||||||
|
if (cboCoeficiente.getSelectedItem() == null) {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2(null);
|
||||||
|
} else {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2((CoeficienteTarifa) cboCoeficiente.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return cboCoeficiente;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Combobox criaCoeficienteTarifario1(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
final Combobox cboCoeficiente = criaCoeficiente(secuenciaRutaTramoCoeficienteVO, secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa1());
|
||||||
|
cboCoeficiente.addEventListener(Events.ON_CHANGE, new EventListener() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event arg0) throws Exception {
|
||||||
|
if (cboCoeficiente.getSelectedItem() == null) {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1(null);
|
||||||
|
} else {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1((CoeficienteTarifa) cboCoeficiente.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return cboCoeficiente;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Combobox criaCoeficiente(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO,
|
||||||
|
CoeficienteTarifa coeficienteTarifa) {
|
||||||
|
final Combobox cboCoeficiente = new Combobox();
|
||||||
|
cboCoeficiente.setId(cboCoeficiente.getUuid());
|
||||||
|
cboCoeficiente.setWidth("99%");
|
||||||
|
|
||||||
|
ListModelList lmlCoeficiente = getListCoeficienteCombobox();
|
||||||
|
if (coeficienteTarifa != null) {
|
||||||
|
lmlCoeficiente.addSelection(coeficienteTarifa);
|
||||||
|
}
|
||||||
|
cboCoeficiente.setModel(lmlCoeficiente);
|
||||||
|
cboCoeficiente.setConstraint(CONSTRAINT_NO_EMPTY);
|
||||||
|
cboCoeficiente.setDisabled(!possuiOrgao(secuenciaRutaTramoCoeficienteVO));
|
||||||
|
cboCoeficiente.setReadonly(true);
|
||||||
|
return cboCoeficiente;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean possuiOrgao(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
return secuenciaRutaTramoCoeficienteVO.getOrgaoTramoId() == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean possuiTramo(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
|
return secuenciaRutaTramoCoeficienteVO.getTramoId() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Label criaLabelId(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
final Label lblID = new Label("");
|
final Label lblID = new Label("");
|
||||||
|
lblID.setValue(possuiTramo(secuenciaRutaTramoCoeficienteVO)
|
||||||
|
? secuenciaRutaTramoCoeficienteVO.getTramoId().toString() : "");
|
||||||
|
return lblID;
|
||||||
|
}
|
||||||
|
|
||||||
// Campos coeficientes tarifario
|
private Spinner criaSpinerMinuto(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
final Combobox cboCoeficiente1 = new Combobox();
|
final Spinner spMinuto = new Spinner();
|
||||||
// final Intbox ibxKm1 = new Intbox();
|
configuraSpinerHoraMinuto(secuenciaRutaTramoCoeficienteVO, spMinuto);
|
||||||
final MyCustomTextboxDecimal ibxKm1 = new MyCustomTextboxDecimal();
|
spMinuto.setConstraint("max 59,no negative,no empty");
|
||||||
|
return spMinuto;
|
||||||
|
}
|
||||||
|
|
||||||
final Combobox cboCoeficiente2 = new Combobox();
|
private Spinner criaSpinerHora(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
// final Intbox ibxKm2 = new Intbox();
|
final Spinner spHora = new Spinner();
|
||||||
final MyCustomTextboxDecimal ibxKm2 = new MyCustomTextboxDecimal();
|
configuraSpinerHoraMinuto(secuenciaRutaTramoCoeficienteVO, spHora);
|
||||||
|
spHora.setConstraint("max 99, no negative, no empty");
|
||||||
|
return spHora;
|
||||||
|
}
|
||||||
|
|
||||||
// Cell Via
|
private void configuraSpinerHoraMinuto(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO,
|
||||||
|
final Spinner spinner) {
|
||||||
|
spinner.setWidth("40px");
|
||||||
|
spinner.setReadonly(secuenciaRutaTramoCoeficienteVO.getTramoServicioId() != null);
|
||||||
|
spinner.setButtonVisible(secuenciaRutaTramoCoeficienteVO.getTramoServicioId() == null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Combobox criaCellComboVia(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
final Combobox cboVia = new Combobox();
|
final Combobox cboVia = new Combobox();
|
||||||
cboVia.setId(cboVia.getUuid());
|
cboVia.setId(cboVia.getUuid());
|
||||||
cboVia.setReadonly(true);
|
cboVia.setReadonly(true);
|
||||||
|
@ -223,223 +370,40 @@ public class GridRutaTramoCoeficiente extends Grid implements RowRenderer, Rende
|
||||||
listModelList.addSelection(secuenciaRutaTramoCoeficienteVO.getVia());
|
listModelList.addSelection(secuenciaRutaTramoCoeficienteVO.getVia());
|
||||||
}
|
}
|
||||||
cboVia.setModel(listModelList);
|
cboVia.setModel(listModelList);
|
||||||
cboVia.setConstraint("no empty");
|
cboVia.setConstraint(CONSTRAINT_NO_EMPTY);
|
||||||
cboVia.addEventListener(Events.ON_CHANGE, new EventListener() {
|
return cboVia;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
private MyCustomTextboxDecimal criaKmsReal(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO, String rowId) {
|
||||||
public void onEvent(Event evt) throws Exception {
|
MyCustomTextboxDecimal dKmsReal = new MyCustomTextboxDecimal((secuenciaRutaTramoCoeficienteVO.getKmReal() == null) ? BigDecimal.ZERO : secuenciaRutaTramoCoeficienteVO.getKmReal());
|
||||||
if (cboVia.getSelectedItem() != null) {
|
dKmsReal.setWidth("90%");
|
||||||
|
dKmsReal.setReadonly(possuiTramo(secuenciaRutaTramoCoeficienteVO));
|
||||||
BigDecimal kmRealAntigo = secuenciaRutaTramoCoeficienteVO.getKmReal();
|
dataBinder.addBinding(dKmsReal, "value", rowId + ".kmReal", null, null, "save",
|
||||||
HoraSistema tiempoRecorridoAntigo = secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido();
|
|
||||||
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setVia((Via) cboVia.getSelectedItem().getValue());
|
|
||||||
llenarTramo(secuenciaRutaTramoCoeficienteVO);
|
|
||||||
|
|
||||||
boolean tramoEditable = (secuenciaRutaTramoCoeficienteVO.getTramoId() == null);
|
|
||||||
boolean tramoCoeficienteEditable = (secuenciaRutaTramoCoeficienteVO.getOrgaoTramoId() == null);
|
|
||||||
boolean tramoServicioEditable = (secuenciaRutaTramoCoeficienteVO.getTramoServicioId() == null);
|
|
||||||
|
|
||||||
if (!tramoEditable) {// cuando el tramo no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos valores
|
|
||||||
dKmsReal.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmReal());
|
|
||||||
} else {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setKmReal(kmRealAntigo);
|
|
||||||
}
|
|
||||||
|
|
||||||
lblID.setValue((secuenciaRutaTramoCoeficienteVO.getTramoId() != null) ? secuenciaRutaTramoCoeficienteVO.getTramoId().toString() : "");
|
|
||||||
|
|
||||||
if (!tramoServicioEditable) {// cuando el tramoServicio no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos valores
|
|
||||||
spHora.setValue(secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido().getHora());
|
|
||||||
spMinuto.setValue(secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido().getMinuto());
|
|
||||||
} else {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setTiempoRecorrido(tiempoRecorridoAntigo);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tramoCoeficienteEditable) {
|
|
||||||
cboCoeficiente1.setText(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa1().getDescCoeficiente());
|
|
||||||
ibxKm1.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmCoeficiente1());
|
|
||||||
|
|
||||||
cboCoeficiente2.setSelectedIndex(-1);
|
|
||||||
ibxKm2.setValueBigDecimal(BigDecimal.ZERO);
|
|
||||||
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2() != null) {
|
|
||||||
cboCoeficiente2.setText(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2().getDescCoeficiente());
|
|
||||||
ibxKm2.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmCoeficiente2());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dKmsReal.setReadonly(!tramoEditable);
|
|
||||||
spHora.setReadonly(!tramoServicioEditable);
|
|
||||||
spHora.setButtonVisible(tramoServicioEditable);
|
|
||||||
spMinuto.setReadonly(!tramoServicioEditable);
|
|
||||||
spMinuto.setButtonVisible(tramoServicioEditable);
|
|
||||||
cboCoeficiente1.setDisabled(!tramoCoeficienteEditable);
|
|
||||||
ibxKm1.setReadonly(!tramoCoeficienteEditable);
|
|
||||||
cboCoeficiente2.setDisabled(!tramoCoeficienteEditable);
|
|
||||||
ibxKm2.setReadonly(!tramoCoeficienteEditable);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
row.appendChild(cboVia);
|
|
||||||
|
|
||||||
// Cell Venda
|
|
||||||
final Combobox cboVenda = new Combobox();
|
|
||||||
cboVenda.setId(cboVenda.getUuid());
|
|
||||||
cboVenda.setReadonly(true);
|
|
||||||
cboVenda.setWidth("100%");
|
|
||||||
cboVenda.setConstraint("no empty");
|
|
||||||
|
|
||||||
ListModelList listCboVenda = new ListModelList();
|
|
||||||
|
|
||||||
final Comboitem cbiSim = new Comboitem("Sim");
|
|
||||||
cbiSim.setValue("Sim");
|
|
||||||
|
|
||||||
final Comboitem cbiNao = new Comboitem("Não");
|
|
||||||
cbiNao.setValue("Não");
|
|
||||||
|
|
||||||
listCboVenda.add(cbiSim.getValue());
|
|
||||||
listCboVenda.add(cbiNao.getValue());
|
|
||||||
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getPermiteVenda() == null && this.getId().equalsIgnoreCase("gridrutasecuenciaida")){
|
|
||||||
listCboVenda.addSelection(cbiSim.getValue());
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(Boolean.TRUE);
|
|
||||||
} else if (this.getId().equalsIgnoreCase("gridrutasecuenciavolta")){
|
|
||||||
if(secuenciaRutaTramoCoeficienteVO.getPermiteVenda() == null ){
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(Boolean.TRUE);
|
|
||||||
listCboVenda.addSelection(cbiSim.getValue());
|
|
||||||
}else{
|
|
||||||
listCboVenda.addSelection(secuenciaRutaTramoCoeficienteVO.getPermiteVenda()?cbiSim.getValue():cbiNao.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cboVenda.setModel(listCboVenda);
|
|
||||||
|
|
||||||
cboVenda.addEventListener(Events.ON_CHANGE, new EventListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(Event evt) throws Exception {
|
|
||||||
if (cboVenda.getSelectedItem().getValue().equals(cbiSim.getValue())){
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(Boolean.TRUE);
|
|
||||||
} else if (cboVenda.getSelectedItem().getValue().equals(cbiNao.getValue())){
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setPermiteVenda(Boolean.FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
row.appendChild(cboVenda);
|
|
||||||
|
|
||||||
boolean esTramoEditable = (secuenciaRutaTramoCoeficienteVO.getTramoId() == null);
|
|
||||||
boolean esTramoServicioEditable = (secuenciaRutaTramoCoeficienteVO.getTramoServicioId() == null);
|
|
||||||
boolean esTramoCoeficienteEditable = (secuenciaRutaTramoCoeficienteVO.getOrgaoTramoId() == null);
|
|
||||||
|
|
||||||
// Cell Kms Real
|
|
||||||
dKmsReal.setReadonly(!esTramoEditable);
|
|
||||||
dataBinder.addBinding(dKmsReal, "value", row.getUuid() + ".kmReal", null, null, "save",
|
|
||||||
"com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null);
|
"com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null);
|
||||||
row.appendChild(dKmsReal);
|
return dKmsReal;
|
||||||
|
}
|
||||||
|
|
||||||
// Cell Tiempo Recorrido
|
private Label criaCellDestino(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
Hbox hbox = new Hbox();
|
return criaLabel(secuenciaRutaTramoCoeficienteVO.getDestino().getCveparada()
|
||||||
|
+ " - " + secuenciaRutaTramoCoeficienteVO.getDestino().getDescparada());
|
||||||
|
}
|
||||||
|
|
||||||
spHora.setWidth("40px");
|
private Label criaCellOrigem(SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
spHora.setConstraint("max 99,no negative,no empty");
|
return criaLabel(secuenciaRutaTramoCoeficienteVO.getOrigen().getCveparada()
|
||||||
spHora.setReadonly(!esTramoServicioEditable);
|
+ " - " + secuenciaRutaTramoCoeficienteVO.getOrigen().getDescparada());
|
||||||
spHora.setButtonVisible(esTramoServicioEditable);
|
}
|
||||||
|
|
||||||
hbox.appendChild(spHora);
|
private Intbox criaCellSequencia(final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO) {
|
||||||
Label lbl = new Label(":");
|
Intbox ibxSumSecuencia = new Intbox(secuenciaRutaTramoCoeficienteVO.getSecuencia());
|
||||||
hbox.appendChild(lbl);
|
ibxSumSecuencia.setWidth("50%");
|
||||||
|
ibxSumSecuencia.setReadonly(true);
|
||||||
|
return ibxSumSecuencia;
|
||||||
|
}
|
||||||
|
|
||||||
spMinuto.setWidth("40px");
|
private Label criaLabel(String titulo) {
|
||||||
spMinuto.setConstraint("max 59,no negative,no empty");
|
Label lblDestino = new Label(titulo);
|
||||||
spMinuto.setReadonly(!esTramoServicioEditable);
|
lblDestino.setWidth("80%");
|
||||||
spMinuto.setButtonVisible(esTramoServicioEditable);
|
return lblDestino;
|
||||||
hbox.appendChild(spMinuto);
|
|
||||||
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido() != null) {
|
|
||||||
HoraSistema hora = secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido();
|
|
||||||
spHora.setValue(hora.getHora());
|
|
||||||
spMinuto.setValue(hora.getMinuto());
|
|
||||||
}
|
|
||||||
dataBinder.addBinding(spHora, "value", row.getUuid() + ".tiempoRecorrido.hora", null, null, "save", null, null, null, null);
|
|
||||||
dataBinder.addBinding(spMinuto, "value", row.getUuid() + ".tiempoRecorrido.minuto", null, null, "save", null, null, null, null);
|
|
||||||
row.appendChild(hbox);
|
|
||||||
|
|
||||||
// Cell ID Tramo
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getTramoId() != null) {
|
|
||||||
lblID.setValue(secuenciaRutaTramoCoeficienteVO.getTramoId().toString());
|
|
||||||
} else {
|
|
||||||
lblID.setValue("");
|
|
||||||
}
|
|
||||||
row.appendChild(lblID);
|
|
||||||
|
|
||||||
// Coeficiente tarifário 1
|
|
||||||
|
|
||||||
cboCoeficiente1.setId(cboCoeficiente1.getUuid());
|
|
||||||
cboCoeficiente1.setWidth("99%");
|
|
||||||
|
|
||||||
ListModelList lmlCoeficiente = getListCoeficienteCombobox();
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa1() != null) {
|
|
||||||
lmlCoeficiente.addSelection(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa1());
|
|
||||||
}
|
|
||||||
cboCoeficiente1.setModel(lmlCoeficiente);
|
|
||||||
cboCoeficiente1.setConstraint("no empty");
|
|
||||||
cboCoeficiente1.setDisabled(!esTramoCoeficienteEditable);
|
|
||||||
cboCoeficiente1.setReadonly(true);
|
|
||||||
cboCoeficiente1.addEventListener(Events.ON_CHANGE, new EventListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(Event arg0) throws Exception {
|
|
||||||
if (cboCoeficiente1.getSelectedItem() == null) {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1(null);
|
|
||||||
} else {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1((CoeficienteTarifa) cboCoeficiente1.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
row.appendChild(cboCoeficiente1);
|
|
||||||
// Km 1 do coeficiente 1
|
|
||||||
ibxKm1.setValueBigDecimal((secuenciaRutaTramoCoeficienteVO.getKmCoeficiente1() != null) ?
|
|
||||||
secuenciaRutaTramoCoeficienteVO.getKmCoeficiente1() : BigDecimal.ZERO);
|
|
||||||
|
|
||||||
ibxKm1.setWidth("80%");
|
|
||||||
ibxKm1.setReadonly(!esTramoCoeficienteEditable);
|
|
||||||
dataBinder.addBinding(ibxKm1, "value", row.getUuid() + ".kmCoeficiente1", null, null,
|
|
||||||
"save", "com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null);
|
|
||||||
row.appendChild(ibxKm1);
|
|
||||||
// Coeficiente tarifário 2
|
|
||||||
cboCoeficiente2.setId(cboCoeficiente2.getUuid());
|
|
||||||
cboCoeficiente2.setWidth("99%");
|
|
||||||
cboCoeficiente2.setDisabled(!esTramoCoeficienteEditable);
|
|
||||||
cboCoeficiente2.setReadonly(true);
|
|
||||||
ListModelList lmlCoeficiente2 = getListCoeficienteCombobox();
|
|
||||||
if (secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2() != null) {
|
|
||||||
lmlCoeficiente2.addSelection(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2());
|
|
||||||
}
|
|
||||||
cboCoeficiente2.setModel(lmlCoeficiente2);
|
|
||||||
cboCoeficiente2.addEventListener(Events.ON_CHANGE, new EventListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(Event arg0) throws Exception {
|
|
||||||
if (cboCoeficiente2.getSelectedItem() == null) {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2(null);
|
|
||||||
} else {
|
|
||||||
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2((CoeficienteTarifa) cboCoeficiente2.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
row.appendChild(cboCoeficiente2);
|
|
||||||
// Km 2 do coeficiente 2
|
|
||||||
ibxKm2.setValueBigDecimal((secuenciaRutaTramoCoeficienteVO.getKmCoeficiente2() != null) ?
|
|
||||||
secuenciaRutaTramoCoeficienteVO.getKmCoeficiente2() : BigDecimal.ZERO);
|
|
||||||
ibxKm2.setWidth("80%");
|
|
||||||
ibxKm2.setReadonly(!esTramoCoeficienteEditable);
|
|
||||||
dataBinder.addBinding(ibxKm2, "value", row.getUuid() + ".kmCoeficiente2", null, null,
|
|
||||||
"save", "com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null);
|
|
||||||
row.appendChild(ibxKm2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -545,5 +509,86 @@ public class GridRutaTramoCoeficiente extends Grid implements RowRenderer, Rende
|
||||||
public void setLsCoeficientes(List<CoeficienteTarifa> lsCoeficientes) {
|
public void setLsCoeficientes(List<CoeficienteTarifa> lsCoeficientes) {
|
||||||
this.lsCoeficientes = lsCoeficientes;
|
this.lsCoeficientes = lsCoeficientes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final class EventListenerComboVia implements EventListener {
|
||||||
|
private final Combobox cboVia;
|
||||||
|
private final Spinner spHora;
|
||||||
|
private final Spinner spMinuto;
|
||||||
|
private final Label lblID;
|
||||||
|
private final MyCustomTextboxDecimal ibxKm2;
|
||||||
|
private final Combobox cboCoeficiente1;
|
||||||
|
private final SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO;
|
||||||
|
private final MyCustomTextboxDecimal ibxKm1;
|
||||||
|
private final Combobox cboCoeficiente2;
|
||||||
|
private final MyCustomTextboxDecimal dKmsReal;
|
||||||
|
|
||||||
|
private EventListenerComboVia(Combobox cboVia, Spinner spHora, Spinner spMinuto, Label lblID, MyCustomTextboxDecimal ibxKm2, Combobox cboCoeficiente1, SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO, MyCustomTextboxDecimal ibxKm1, Combobox cboCoeficiente2, MyCustomTextboxDecimal dKmsReal) {
|
||||||
|
this.cboVia = cboVia;
|
||||||
|
this.spHora = spHora;
|
||||||
|
this.spMinuto = spMinuto;
|
||||||
|
this.lblID = lblID;
|
||||||
|
this.ibxKm2 = ibxKm2;
|
||||||
|
this.cboCoeficiente1 = cboCoeficiente1;
|
||||||
|
this.secuenciaRutaTramoCoeficienteVO = secuenciaRutaTramoCoeficienteVO;
|
||||||
|
this.ibxKm1 = ibxKm1;
|
||||||
|
this.cboCoeficiente2 = cboCoeficiente2;
|
||||||
|
this.dKmsReal = dKmsReal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event evt) throws Exception {
|
||||||
|
if (cboVia.getSelectedItem() != null) {
|
||||||
|
|
||||||
|
BigDecimal kmRealAntigo = secuenciaRutaTramoCoeficienteVO.getKmReal();
|
||||||
|
HoraSistema tiempoRecorridoAntigo = secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido();
|
||||||
|
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setVia((Via) cboVia.getSelectedItem().getValue());
|
||||||
|
llenarTramo(secuenciaRutaTramoCoeficienteVO);
|
||||||
|
|
||||||
|
boolean tramoEditable = (secuenciaRutaTramoCoeficienteVO.getTramoId() == null);
|
||||||
|
boolean tramoCoeficienteEditable = (secuenciaRutaTramoCoeficienteVO.getOrgaoTramoId() == null);
|
||||||
|
boolean tramoServicioEditable = (secuenciaRutaTramoCoeficienteVO.getTramoServicioId() == null);
|
||||||
|
|
||||||
|
if (!tramoEditable) {// cuando el tramo no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos valores
|
||||||
|
dKmsReal.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmReal());
|
||||||
|
} else {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setKmReal(kmRealAntigo);
|
||||||
|
}
|
||||||
|
|
||||||
|
lblID.setValue((secuenciaRutaTramoCoeficienteVO.getTramoId() != null) ? secuenciaRutaTramoCoeficienteVO.getTramoId().toString() : "");
|
||||||
|
|
||||||
|
if (!tramoServicioEditable) {// cuando el tramoServicio no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos valores
|
||||||
|
spHora.setValue(secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido().getHora());
|
||||||
|
spMinuto.setValue(secuenciaRutaTramoCoeficienteVO.getTiempoRecorrido().getMinuto());
|
||||||
|
} else {
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setTiempoRecorrido(tiempoRecorridoAntigo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tramoCoeficienteEditable) {
|
||||||
|
cboCoeficiente1.setText(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa1().getDescCoeficiente());
|
||||||
|
ibxKm1.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmCoeficiente1());
|
||||||
|
|
||||||
|
cboCoeficiente2.setSelectedIndex(-1);
|
||||||
|
ibxKm2.setValueBigDecimal(BigDecimal.ZERO);
|
||||||
|
|
||||||
|
if (secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2() != null) {
|
||||||
|
cboCoeficiente2.setText(secuenciaRutaTramoCoeficienteVO.getCoeficienteTarifa2().getDescCoeficiente());
|
||||||
|
ibxKm2.setValueBigDecimal(secuenciaRutaTramoCoeficienteVO.getKmCoeficiente2());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dKmsReal.setReadonly(!tramoEditable);
|
||||||
|
spHora.setReadonly(!tramoServicioEditable);
|
||||||
|
spHora.setButtonVisible(tramoServicioEditable);
|
||||||
|
spMinuto.setReadonly(!tramoServicioEditable);
|
||||||
|
spMinuto.setButtonVisible(tramoServicioEditable);
|
||||||
|
cboCoeficiente1.setDisabled(!tramoCoeficienteEditable);
|
||||||
|
ibxKm1.setReadonly(!tramoCoeficienteEditable);
|
||||||
|
cboCoeficiente2.setDisabled(!tramoCoeficienteEditable);
|
||||||
|
ibxKm2.setReadonly(!tramoCoeficienteEditable);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue