Merge pull request 'fixes bug#AL-3308' (!331) from AL-3308 into master

Reviewed-on: adm/VentaBoletosAdm#331
Reviewed-by: Célio de Souza Ribeiro JR <celio@rjconsultores.com.br>
master 1.34.12
Gleison da Cruz 2023-11-27 20:47:30 +00:00
commit 578cbb425c
7 changed files with 173 additions and 5 deletions

View File

@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.34.11</version>
<version>1.34.12</version>
<packaging>war</packaging>
<properties>
<modelWeb.version>1.25.0</modelWeb.version>
<flyway.version>1.21.0</flyway.version>
<modelWeb.version>1.25.1</modelWeb.version>
<flyway.version>1.21.1</flyway.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

View File

@ -5,6 +5,7 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
@ -21,6 +22,7 @@ import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Radio;
@ -29,14 +31,19 @@ import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.constantes.Constantes;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa;
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraFormaPago;
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtraPtoVta;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.service.TipoEventoExtraEmpresaService;
import com.rjconsultores.ventaboletos.service.TipoEventoExtraFormaPagoService;
import com.rjconsultores.ventaboletos.service.TipoEventoExtraPtovtaService;
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -45,7 +52,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
/**
*
* @author Rafius
@ -63,6 +69,10 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
private EmpresaService empresaService;
@Autowired
private TipoEventoExtraPtovtaService tipoEventoExtraPtovtaService;
@Autowired
private FormaPagoService formaPagoService;
@Autowired
private TipoEventoExtraFormaPagoService tipoEventoExtraFormaPagoService;
private TipoEventoExtra tipoEventoExtra;
private MyListbox tipoEventoExtraList;
@ -78,10 +88,22 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
private Radio raTipo22;
private MyComboboxEstandar cmbEmpresa;
private MyComboboxPuntoVenta cmbPontoVenda;
/*Forma de Pagamento*/
private List<Empresa> lsEmpresas;
/*Forma de Pagamento*/
private List<Empresa> lsEmpresasFormapago;
private List<FormaPago> lsFormaPago;
private List<TipoEventoExtraFormaPago> lsTipoEventoExtraFormaPago;
private List<com.rjconsultores.ventaboletos.constantes.TipoEventoExtra> lsEventoExtrasConstantes;
private MyComboboxEstandar cmbCveTipoEvento;
private Row rowIndEnviaExcessoDeBagagemSefaz;
/*Forma de Pagamento*/
private Combobox cmbFormaPago;
/*Forma de Pagamento*/
private Combobox cmbEmpresaFormaPago;
private MyListbox formaPagoList;
private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class);
@ -138,6 +160,13 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
}
txtNome.focus();
lsFormaPago = formaPagoService.obtenerTodos();
if (tipoEventoExtra.getTipoeventoextraId() != null) {
lsTipoEventoExtraFormaPago = tipoEventoExtraFormaPagoService.obtenerTodos();
formaPagoList.setData(lsTipoEventoExtraFormaPago);
}
}
public void onClick$btnRemoverEmpresa(Event ev) throws InterruptedException {
@ -306,6 +335,69 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
}
}
public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException {
cmbFormaPago.getValue();
try {
FormaPago formaPago = new FormaPago();
try {
formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue();
Boolean achou = Boolean.FALSE;
if (formaPago != null) {
for (TipoEventoExtraFormaPago fpd : lsTipoEventoExtraFormaPago) {
if (fpd.getFormapago().equals(formaPago)) {
achou = Boolean.TRUE;
}
}
if (!achou&&getTipoEventoExtra()!=null){
TipoEventoExtraFormaPago fpd = new TipoEventoExtraFormaPago();
fpd.setTipoEventoExtra(getTipoEventoExtra());
fpd.setFormaPago(formaPago);
fpd.setActivo(Boolean.TRUE);
fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
fpd.setFecmodif(Calendar.getInstance().getTime());
lsTipoEventoExtraFormaPago.add(fpd);
formaPagoList.setData(lsTipoEventoExtraFormaPago);
formaPagoList.updateItem(fpd);
tipoEventoExtraFormaPagoService.actualizacion(fpd);
} else {
Messagebox.show(
Labels.getLabel("editarPuntoVentaController.MSG.Achou.FormaPago"),
Labels.getLabel("editarTipoEventoExtraController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
}
} catch (Exception e) {
Messagebox.show(
Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"),
Labels.getLabel("editarTipoEventoExtraController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
} catch (Exception ex) {
log.error(ex);
Messagebox.show(
Labels.getLabel("MSG.Error"),
Labels.getLabel("editarTipoEventoExtraController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnApagarFormaPago(Event ev) {
try {
TipoEventoExtraFormaPago fpd = (TipoEventoExtraFormaPago) formaPagoList.getSelected();
if (fpd != null) {
formaPagoList.removeItem(fpd);
lsTipoEventoExtraFormaPago.remove(fpd);
tipoEventoExtraFormaPagoService.borrar(fpd);
}
} catch (Exception ex) {
log.error(ex);
}
}
public List<Empresa> getLsEmpresas() {
return lsEmpresas;
}
@ -330,4 +422,40 @@ public class EditarTipoEventoExtraController extends MyGenericForwardComposer {
this.lsEventoExtrasConstantes = lsEventoExtrasConstantes;
}
private List<Empresa> obterEmpresasUsuarioLogadoComOpcaoTodas() {
List<Empresa> listaEmpresas = new ArrayList<Empresa>();
listaEmpresas.add(empresaService.obtenerID(-1));
listaEmpresas.addAll(UsuarioLogado.getUsuarioLogado().getEmpresa());
return listaEmpresas;
}
public List<Empresa> getLsEmpresasFormapago() {
return lsEmpresasFormapago;
}
public void setLsEmpresasFormapago(List<Empresa> lsEmpresasFormapago) {
this.lsEmpresasFormapago = lsEmpresasFormapago;
}
public List<FormaPago> getLsFormaPago() {
return lsFormaPago;
}
public void setLsFormaPago(List<FormaPago> lsFormaPago) {
this.lsFormaPago = lsFormaPago;
}
public Combobox getCmbFormaPago() {
return cmbFormaPago;
}
public void setCmbFormaPago(Combobox cmbFormaPago) {
this.cmbFormaPago = cmbFormaPago;
}
public MyListbox getFormaPagoList() {
return formaPagoList;
}
}

View File

@ -258,6 +258,7 @@
<value>com.rjconsultores.ventaboletos.entidad.TipoEmpleado</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoEventoExtraEmpresa</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoEventoExtraPtoVta</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoEventoExtraFormaPago</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoMovimiento</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoOcupacion</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoParada</value>

View File

@ -6632,6 +6632,7 @@ editarTipoEventoExtraController.lbCveTipoEvento = Tipo de Evento p/ comissão
editarTipoEventoExtraController.tab.label.agenciasAutorizadas = Agências Autorizadas
editarTipoEventoExtraController.lbAgencia.value = Ponto de Venda
editarTipoEventoExtraController.indEnviaExcessoDeBagagemSefaz.label = Envia o excesso de Bagagem para SEFAZ
editarTipoEventoExtraController.tab.label.formasPagamento = Forma Pagamento
#Pago Motorista
indexController.mniPagoConductor.label = Pagamento Motorista

View File

@ -6674,6 +6674,7 @@ editarTipoEventoExtraController.lbCveTipoEvento = Tipo de Evento p/ comissão
editarTipoEventoExtraController.tab.label.agenciasAutorizadas = Agências Autorizadas
editarTipoEventoExtraController.lbAgencia.value = Ponto de Venda
editarTipoEventoExtraController.indEnviaExcessoDeBagagemSefaz.label = Envia o excesso de Bagagem para SEFAZ
editarTipoEventoExtraController.tab.label.formasPagamento = Forma Pagamento
#Pago Motorista
indexController.mniPagoConductor.label = Pagamento Motorista

View File

@ -58,7 +58,7 @@
id="tabHorario"
label="${c:l('editarPuntoVentaController.tab.label.horario')}" />
<tab
id="tabFormaPago"
id="tabFormaPago"
label="${c:l('indexController.mniFormaPago.label')}" />
<tab
label="${c:l('editarPuntoVentaController.tab.label.recoleccion')}"

View File

@ -35,6 +35,9 @@
<tab
label="${c:l('editarTipoEventoExtraController.tab.label.agenciasAutorizadas')}" />
<tab
label="${c:l('editarTipoEventoExtraController.tab.label.formasPagamento')}" />
</tabs>
<tabpanels>
<tabpanel style="overflow:auto;">
@ -190,6 +193,40 @@
</listhead>
</listbox>
</tabpanel>
<tabpanel> <!-- formas de pagamento -->
<grid fixedLayout="true">
<columns>
<column width="20%" />
<column width="80%" />
</columns>
<rows>
<row>
<label id="lblFormaPago"
value="${c:l('editarFormaPagoController.lbNome.value')}" />
<hbox>
<combobox id="cmbFormaPago"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="80%" mold="rounded" buttonVisible="true"
constraint="no empty"
model="@{winEditarTipoEventoExtra$composer.lsFormaPago}" />
<button id="btnApagarFormaPago" height="20"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarConfiguracionFormaPagoController.btnApagar.tooltiptext')}" />
<button id="btnSalvarFormaPago" height="20"
image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('editarConfiguracionFormaPagoController.btnSalvar.tooltiptext')}" />
</hbox>
</row>
</rows>
</grid>
<listbox id="formaPagoList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" vflex="true" multiple="false">
<listhead sizable="true">
<listheader id="lhFormapago"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionFormaPagoController.lblFormaPago.value')}" />
</listhead>
</listbox>
</tabpanel>
</tabpanels>
</tabbox>
</window>