Merge branch 'master' into AL-4549
commit
25fc05485d
|
@ -1458,6 +1458,43 @@ public class EditarConvenioController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClick$btnAdicionarPuntoVenta(Event ev) throws InterruptedException {
|
||||||
|
if (cmbPuntoVenta.getSelectedItem() != null) {
|
||||||
|
PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue();
|
||||||
|
|
||||||
|
ConvenioPuntoVenta convenioPuntoVentaToAdd = new ConvenioPuntoVenta();
|
||||||
|
convenioPuntoVentaToAdd.setActivo(Boolean.TRUE);
|
||||||
|
convenioPuntoVentaToAdd.setConvenio(convenio);
|
||||||
|
convenioPuntoVentaToAdd.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
convenioPuntoVentaToAdd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
convenioPuntoVentaToAdd.setPuntoVenta(puntoVenta);
|
||||||
|
|
||||||
|
boolean achou = Boolean.FALSE;
|
||||||
|
for (ConvenioPuntoVenta convenioPuntoVentaInTheList : lsConvenioPuntoVenta) {
|
||||||
|
if (convenioPuntoVentaInTheList.getPuntoVenta().equals(convenioPuntoVentaToAdd.getPuntoVenta()) && convenioPuntoVentaInTheList.getActivo()) {
|
||||||
|
achou = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!achou) {
|
||||||
|
lsConvenioPuntoVenta.add(convenioPuntoVentaToAdd);
|
||||||
|
convenio.setConvenioPuntoVentaList(lsConvenioPuntoVenta);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ConvenioPuntoVenta> tempList = new ArrayList<ConvenioPuntoVenta>();
|
||||||
|
if(lsConvenioPuntoVenta != null) {
|
||||||
|
for (ConvenioPuntoVenta convenioPuntoVenta : lsConvenioPuntoVenta) {
|
||||||
|
if(convenioPuntoVenta.getActivo()) {
|
||||||
|
tempList.add(convenioPuntoVenta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
convenioPuntoVentaList.setData(tempList);
|
||||||
|
cmbPuntoVenta.setSelectedItem(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onClick$btnRemoverPuntoVenta(Event ev) {
|
public void onClick$btnRemoverPuntoVenta(Event ev) {
|
||||||
try {
|
try {
|
||||||
ConvenioPuntoVenta convenioPuntoVentaToRemove = (ConvenioPuntoVenta) convenioPuntoVentaList.getSelected();
|
ConvenioPuntoVenta convenioPuntoVentaToRemove = (ConvenioPuntoVenta) convenioPuntoVentaList.getSelected();
|
||||||
|
|
Loading…
Reference in New Issue