gleimar 2013-02-05 20:13:00 +00:00
parent 0edc78d4c5
commit f841b0f402
4 changed files with 72 additions and 39 deletions

View File

@ -10,6 +10,8 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -782,19 +784,27 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
cmbPessoa.getValue(); cmbPessoa.getValue();
cmbTipoConta.getValue(); cmbTipoConta.getValue();
cmbPosicao.getValue(); cmbPosicao.getValue();
if (puntoVenta.getPuntoventaId()== null) {
List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue()); List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue());
if (!lsPuntoVenta.isEmpty()) { if (!lsPuntoVenta.isEmpty()) {
boolean exists = CollectionUtils.exists(lsPuntoVenta, new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((PuntoVenta)object).getPuntoventaId().equals(puntoVenta.getPuntoventaId());
}
});
if (!exists){
Messagebox.show( Messagebox.show(
Labels.getLabel("editarPuntoVentaController.registroNumPtoVtaExiste"), Labels.getLabel("editarPuntoVentaController.registroNumPtoVtaExiste"),
Labels.getLabel("editarPuntoVentaController.window.title"), Labels.getLabel("editarPuntoVentaController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION); Messagebox.OK, Messagebox.EXCLAMATION);
return; return;
} }
} }
try { try {

View File

@ -12,6 +12,8 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -260,11 +262,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
} else { } else {
rdNo.setChecked(true); rdNo.setChecked(true);
} }
if(ruta.getIndSentidoIda() != null){ if (ruta.getIndSentidoIda() != null) {
if(ruta.getIndSentidoIda()){ if (ruta.getIndSentidoIda()) {
radIda.setChecked(true); radIda.setChecked(true);
radVolta.setChecked(false); radVolta.setChecked(false);
}else{ } else {
radIda.setChecked(false); radIda.setChecked(false);
radVolta.setChecked(true); radVolta.setChecked(true);
} }
@ -589,17 +591,25 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
public void onClick$btnSalvar(Event ev) throws InterruptedException { public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtPrefixo.getValue(); txtPrefixo.getValue();
if (ruta.getRutaId()== null) {
List<Ruta> lsRuta = rutaService.buscarNumRuta(txtNumRuta.getValue()); List<Ruta> lsRuta = rutaService.buscarNumRuta(txtNumRuta.getValue());
if (!lsRuta.isEmpty()) { if (!lsRuta.isEmpty()) {
boolean exists = CollectionUtils.exists(lsRuta, new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((Ruta) object).getRutaId().equals(ruta.getRutaId());
}
});
if (!exists) {
Messagebox.show( Messagebox.show(
Labels.getLabel("editarCatalogoDeRutaController.registroNumRutaExiste"), Labels.getLabel("editarCatalogoDeRutaController.registroNumRutaExiste"),
Labels.getLabel("editarCatalogoDeRutaController.window.title"), Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION); Messagebox.OK, Messagebox.EXCLAMATION);
return; return;
} }
} }
@ -631,7 +641,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
ruta.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue()); ruta.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue());
ruta.setVentaOffLine(chkVentaOffLine.isChecked()); ruta.setVentaOffLine(chkVentaOffLine.isChecked());
if (rdSi.isChecked()) { if (rdSi.isChecked()) {
ruta.setIndNombreObligatorio(Boolean.TRUE); ruta.setIndNombreObligatorio(Boolean.TRUE);
} else if (rdNo.isChecked()) { } else if (rdNo.isChecked()) {

View File

@ -119,31 +119,45 @@ public class BusquedaPricingController extends MyGenericForwardComposer {
calendar.setTime(fechaInicio.getValue()); calendar.setTime(fechaInicio.getValue());
calendar.set(Calendar.HOUR_OF_DAY,0); calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,1); calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar.set(Calendar.MILLISECOND,0);
calendar1.setTime(fechaFin.getValue()); calendar1.setTime(fechaFin.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23); calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59); calendar1.set(Calendar.MINUTE,59);
pricingSearch.addFilterGreaterOrEqual("pricingVigenciaList.fecinicioviaje", calendar.getTime()).addFilterLessOrEqual("pricingVigenciaList.fecfinviaje",calendar1.getTime()); calendar1.set(Calendar.SECOND,59);
calendar1.set(Calendar.MILLISECOND,999);
pricingSearch.addFilterGreaterOrEqual("pricingVigenciaList.fecinicioviaje", calendar.getTime());
pricingSearch.addFilterLessOrEqual("pricingVigenciaList.fecfinviaje",calendar1.getTime());
}else{ }else{
if (fechaInicio.getValue() != null){ if (fechaInicio.getValue() != null){
calendar.setTime(fechaInicio.getValue()); calendar.setTime(fechaInicio.getValue());
calendar.set(Calendar.HOUR_OF_DAY,0); calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,1); calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar1.setTime(fechaInicio.getValue()); calendar1.setTime(fechaInicio.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23); calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59); calendar1.set(Calendar.MINUTE,59);
calendar1.set(Calendar.SECOND,59);
pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecinicioviaje", calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecinicioviaje",calendar1.getTime()); pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecinicioviaje", calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecinicioviaje",calendar1.getTime());
}else if (fechaFin.getValue() != null){ }else if (fechaFin.getValue() != null){
calendar.setTime(fechaFin.getValue()); calendar.setTime(fechaFin.getValue());
calendar.set(Calendar.HOUR_OF_DAY,23); calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,59); calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar1.setTime(fechaFin.getValue()); calendar1.setTime(fechaFin.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23); calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59); calendar1.set(Calendar.MINUTE,59);
calendar1.set(Calendar.SECOND,59);
pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecfinviaje",calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecfinviaje",calendar1.getTime()); pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecfinviaje",calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecfinviaje",calendar1.getTime());
} }
} }

View File

@ -7,7 +7,7 @@
# <controler>. <id>. <propiedade> = XXX # <controler>. <id>. <propiedade> = XXX
#Versao do VentaBoleto: #Versao do VentaBoleto:
versao = ADM_20130201_1RC104 versao = ADM_20130205_1RC105
# MSG Defaut: # MSG Defaut:
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100 MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100