diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java index 14711e887..f6d74d1e1 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java @@ -214,6 +214,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private List lsEmpresasBloquear; private List lsEmpresas; + private List lsEmpresasFormapago; private List lsEmpresaContaBancarias; private List lsBanco; private List lsTipoPuntoVenta; @@ -251,6 +252,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private Button btnAdicionarEmpresaComissao; private MyComboboxPuntoVenta cmbPuntoVentaPadre; private Combobox cmbFormaPago; + private Combobox cmbEmpresaFormaPago; private Combobox cmbEmpresa; private Combobox cmbEmpresaPtoVta; private Combobox cmbEmpresaPtoVtaUsuarioBancario; @@ -398,7 +400,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { lsBanco = ptovtaBancoService.obtenerTodos(); lsColonia = new ArrayList(); lsNodos = nodoService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + lsEmpresasFormapago = new ArrayList(); + lsEmpresasFormapago.add(empresaService.obtenerID(-1)); + lsEmpresasFormapago.addAll(UsuarioLogado.getUsuarioLogado().getEmpresa()); + lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodosExceto(TipoPuntoVenta.TODOS); lsUsuarioBancario = usuarioBancarioService.obtenerTodos(); lsLogFiles = getLogFiles(); @@ -1587,24 +1594,33 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException { cmbFormaPago.getValue(); - txtCargosExtras.getValue(); + cmbEmpresaFormaPago.getValue(); try { FormaPago formaPago = new FormaPago(); try { formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue(); Boolean achou = Boolean.FALSE; + Empresa empresa = (Empresa) cmbEmpresaFormaPago.getSelectedItem().getValue(); if (formaPago != null) { for (FormaPagoDet fpd : lsFormaPagoDet) { - if (fpd.getFormaPago().getFormapagoId().equals(formaPago.getFormapagoId())) { + if (fpd.getFormaPago().equals(formaPago) && empresa.equals(fpd.getEmpresa())) { achou = Boolean.TRUE; } } if (!achou) { FormaPagoDet fpd = new FormaPagoDet(); - fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue())); + /* + * Mantis #6874 + * fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue())); + */ + fpd.setCargosextras(BigDecimal.ZERO); fpd.setFormaPago(formaPago); fpd.setPuntoVenta(puntoVenta); + if(cmbEmpresaFormaPago.getSelectedItem() != null) { + fpd.setEmpresa(empresa); + } + fpd.setActivo(Boolean.TRUE); fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); fpd.setFecmodif(Calendar.getInstance().getTime()); @@ -2778,5 +2794,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { public void setCmbEmpresasContaBancarias(MyComboboxEstandar cmbEmpresasContaBancarias) { this.cmbEmpresasContaBancarias = cmbEmpresasContaBancarias; + } + + public List getLsEmpresasFormapago() { + return lsEmpresasFormapago; + } + + public void setLsEmpresasFormapago(List lsEmpresasFormapago) { + this.lsEmpresasFormapago = lsEmpresasFormapago; } } \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java index d4a9e1493..b2c457380 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java @@ -18,10 +18,10 @@ public class FormaPagoDetRender implements ListitemRenderer { public void render(Listitem lstm, Object o) throws Exception { FormaPagoDet formaPagoDet = (FormaPagoDet) o; - Listcell lc = new Listcell(formaPagoDet.getFormaPago().getDescpago()); + Listcell lc = new Listcell(formaPagoDet.getEmpresa() != null ? formaPagoDet.getEmpresa().getNombempresa() : ""); lc.setParent(lstm); - lc = new Listcell(formaPagoDet.getCargosextras().toString()); + lc = new Listcell(formaPagoDet.getFormaPago() != null ? formaPagoDet.getFormaPago().getDescpago() : "TODOS"); lc.setParent(lstm); lstm.setAttribute("data", formaPagoDet); diff --git a/web/gui/catalogos/editarPuntoVenta.zul b/web/gui/catalogos/editarPuntoVenta.zul index c161f9186..dd7f6fb81 100644 --- a/web/gui/catalogos/editarPuntoVenta.zul +++ b/web/gui/catalogos/editarPuntoVenta.zul @@ -811,8 +811,8 @@ - - + + @@ -824,6 +824,15 @@ constraint="no empty" model="@{winEditarPuntoVenta$composer.lsFormaPago}" /> + + + @@ -850,12 +860,12 @@ use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" vflex="true" multiple="false"> + - + label="${c:l('editarConfiguracionFormaPagoController.lblFormaPago.value')}" />