fixed bug #6831 - Alteração para persistir fechamento Conta corrente somente se houver um ponto de venda salvo. Caso não exista os fechamentos conta corrente devem ser persistidos ao salvar o ponto de venda pela primeira vez.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@50061 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
17f664f528
commit
cd9376452e
|
@ -423,6 +423,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
// txtCP.setDisabled(true);
|
// txtCP.setDisabled(true);
|
||||||
puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta");
|
puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta");
|
||||||
|
|
||||||
|
fechamentoParamptovtaList.setItemRenderer(new FechamentoParamptovtaListItemRenderer());
|
||||||
if (puntoVenta.getPuntoventaId() != null) {
|
if (puntoVenta.getPuntoventaId() != null) {
|
||||||
|
|
||||||
puntoVenta = puntoVentaService.obtenerID(puntoVenta.getPuntoventaId());
|
puntoVenta = puntoVentaService.obtenerID(puntoVenta.getPuntoventaId());
|
||||||
|
@ -465,7 +466,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
txtRazonSocial.setValue(puntoVenta.getRazonSocial());
|
txtRazonSocial.setValue(puntoVenta.getRazonSocial());
|
||||||
}
|
}
|
||||||
|
|
||||||
fechamentoParamptovtaList.setItemRenderer(new FechamentoParamptovtaListItemRenderer());
|
|
||||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||||
fechamentoParamptovtaList.setData(params);
|
fechamentoParamptovtaList.setData(params);
|
||||||
}
|
}
|
||||||
|
@ -1349,6 +1350,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if (puntoVenta.getPuntoventaId() == null) {
|
if (puntoVenta.getPuntoventaId() == null) {
|
||||||
puntoVentaService.suscribir(puntoVenta);
|
puntoVentaService.suscribir(puntoVenta);
|
||||||
puntoVentaList.addItemNovo(puntoVenta);
|
puntoVentaList.addItemNovo(puntoVenta);
|
||||||
|
for (Object object : fechamentoParamptovtaList.getListData()) {
|
||||||
|
FechamentoParamptovta fechamentoParamptovta = (FechamentoParamptovta) object;
|
||||||
|
fechamentoParamptovta.setPuntoventa(puntoVenta);
|
||||||
|
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
puntoVentaService.actualizacion(puntoVenta);
|
puntoVentaService.actualizacion(puntoVenta);
|
||||||
puntoVentaList.updateItem(puntoVenta);
|
puntoVentaList.updateItem(puntoVenta);
|
||||||
|
@ -2536,12 +2542,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
if (resp == Messagebox.YES) {
|
if (resp == Messagebox.YES) {
|
||||||
|
|
||||||
FechamentoParamptovta fpp = (FechamentoParamptovta) fechamentoParamptovtaList.getSelected();
|
FechamentoParamptovta fpp = (FechamentoParamptovta) fechamentoParamptovtaList.getSelected();
|
||||||
|
if(puntoVenta!= null && puntoVenta.getPuntoventaId()!= null){
|
||||||
fechamentoParamptovtaService.borrar(fpp);
|
fechamentoParamptovtaService.borrar(fpp);
|
||||||
|
|
||||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||||
fechamentoParamptovtaList.setData(params);
|
fechamentoParamptovtaList.setData(params);
|
||||||
|
}else{
|
||||||
|
fechamentoParamptovtaList.removeItem(fpp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -2596,11 +2604,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
boolean validado = validaFechamentoParamptovta(fechamentoParamptovta);
|
boolean validado = validaFechamentoParamptovta(fechamentoParamptovta);
|
||||||
|
|
||||||
if (validado) {
|
if (validado) {
|
||||||
|
if(puntoVenta!= null && puntoVenta.getPuntoventaId()!=null){
|
||||||
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
||||||
|
|
||||||
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
List<FechamentoParamptovta> params = fechamentoParamptovtaService.buscaParametrosPorPuntoventa(puntoVenta);
|
||||||
fechamentoParamptovtaList.setData(params);
|
fechamentoParamptovtaList.setData(params);
|
||||||
|
}else{
|
||||||
|
fechamentoParamptovtaList.addItemNovo(fechamentoParamptovta);
|
||||||
|
}
|
||||||
resetDadosFechamentoParamptovta();
|
resetDadosFechamentoParamptovta();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue