bug#14127
dev:thiago qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@92607 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
dfd5373c0c
commit
88350989f9
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,9 +20,11 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zul.Combobox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
||||
import com.rjconsultores.ventaboletos.entidad.RestriccionPago;
|
||||
import com.rjconsultores.ventaboletos.service.ConfigRestriccionPagoService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
||||
import com.rjconsultores.ventaboletos.service.RestriccionPagoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
@ -49,8 +52,13 @@ public class EditarRestriccionFormaPagoController extends MyGenericForwardCompos
|
|||
private List<RestriccionPago> lsRestriccionPago;
|
||||
private Combobox cmbFormaPago;
|
||||
private Combobox cmbRestriccionFormaPago;
|
||||
private Combobox cmbEmpresa;
|
||||
private List<Empresa> lsEmpresas;
|
||||
private static Logger log = Logger.getLogger(EditarRestriccionFormaPagoController.class);
|
||||
|
||||
@Autowired
|
||||
EmpresaService empresaService;
|
||||
|
||||
public List<FormaPago> getLsFormaPago() {
|
||||
return lsFormaPago;
|
||||
}
|
||||
|
@ -82,7 +90,17 @@ public class EditarRestriccionFormaPagoController extends MyGenericForwardCompos
|
|||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
lsEmpresas = new ArrayList<Empresa>(0);
|
||||
|
||||
Empresa empresa = empresaService.obtenerID(-1);
|
||||
if(empresa == null) {
|
||||
empresa = new Empresa(-1, Labels.getLabel("lb.todas"));
|
||||
}
|
||||
lsEmpresas.add(empresa);
|
||||
lsEmpresas.addAll(UsuarioLogado.getUsuarioLogado().getEmpresa());
|
||||
|
||||
configRestriccionPago = (ConfigRestriccionPago) Executions.getCurrent().getArg().get("configRestriccionPago");
|
||||
|
||||
restriccionFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("configRestriccionFormaPagoList");
|
||||
|
||||
cmbFormaPago.focus();
|
||||
|
@ -91,11 +109,12 @@ public class EditarRestriccionFormaPagoController extends MyGenericForwardCompos
|
|||
public void onClick$btnSalvar(Event ev) {
|
||||
cmbFormaPago.getValue();
|
||||
cmbRestriccionFormaPago.getValue();
|
||||
cmbEmpresa.getValue();
|
||||
|
||||
try {
|
||||
boolean puedoDarDeAlta = configRestriccionPagoService.puedoDarDeAlta(configRestriccionPago);
|
||||
|
||||
List<ConfigRestriccionPago> lsConfig = configRestriccionPagoService.buscar(configRestriccionPago.getFormaPago(), configRestriccionPago.getRestriccion());
|
||||
List<ConfigRestriccionPago> lsConfig = configRestriccionPagoService.buscar(configRestriccionPago.getFormaPago(), configRestriccionPago.getRestriccion(), configRestriccionPago.getEmpresa());
|
||||
|
||||
boolean podeSalvar = false;
|
||||
if (lsConfig.isEmpty()) {
|
||||
|
@ -133,6 +152,7 @@ public class EditarRestriccionFormaPagoController extends MyGenericForwardCompos
|
|||
configRestriccionPago.setActivo(Boolean.TRUE);
|
||||
configRestriccionPago.setFecmodif(Calendar.getInstance().getTime());
|
||||
configRestriccionPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
configRestriccionPago.setEmpresa((Empresa) cmbEmpresa.getSelectedItem().getValue());
|
||||
|
||||
if (configRestriccionPago.getConfigrestriccionId() == null) {
|
||||
configRestriccionPagoService.suscribir(configRestriccionPago);
|
||||
|
@ -182,4 +202,9 @@ public class EditarRestriccionFormaPagoController extends MyGenericForwardCompos
|
|||
log.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresas() {
|
||||
return lsEmpresas;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
@ -21,6 +23,9 @@ public class RenderRestriccionFormaPago implements ListitemRenderer {
|
|||
Listcell lc = new Listcell(configFormaPago.getConfigrestriccionId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configFormaPago.getEmpresa() == null ? Labels.getLabel("lb.todas") : configFormaPago.getEmpresa().getNombempresa());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(configFormaPago.getFormaPago().getDescpago());
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ lb.ate = Hasta
|
|||
lb.dataIni.value = Fecha Ini
|
||||
lb.dataFin.value = Fecha fin
|
||||
lb.empresa = Empresa
|
||||
lb.todas = TODAS
|
||||
lb.puntoventa = Punto Venta
|
||||
|
||||
# Reporte
|
||||
|
|
|
@ -72,6 +72,7 @@ lb.ate = até
|
|||
lb.dataIni.value = Data Inicial
|
||||
lb.dataFin.value = Data Final
|
||||
lb.empresa = Empresa
|
||||
lb.todas = TODAS
|
||||
lb.puntoventa = Ponto de Venda (Agência)
|
||||
|
||||
# Relatório
|
||||
|
|
|
@ -52,6 +52,9 @@
|
|||
image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaRestriccionFormaPagoController.lhId.label')}"
|
||||
sort="auto(configrestriccionId)" />
|
||||
<listheader id="lhEmpresa" image="/gui/img/builder.gif"
|
||||
label="${c:l('lb.empresa')}"
|
||||
sort="auto(empresa.nombempresa)" />
|
||||
<listheader id="lhForma" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaRestriccionFormaPagoController.lhForma.label')}"
|
||||
sort="auto(formaPago.descpago)" />
|
||||
|
|
|
@ -27,6 +27,15 @@
|
|||
<column width="50%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('lb.empresa')}" />
|
||||
<combobox id="cmbEmpresa" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="100%" mold="rounded" buttonVisible="true"
|
||||
model="@{winEditarRestriccionFormaPago$composer.lsEmpresas}"
|
||||
selectedItem="@{winEditarRestriccionFormaPago$composer.configRestriccionPago.empresa}" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label id="lblFormaPago"
|
||||
value="${c:l('busquedaRestriccionFormaPagoController.FormaPago')}" />
|
||||
|
|
Loading…
Reference in New Issue