fixed bug#13109

qua:Marcelo
dev:Thiago

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@89133 d1611594-4594-4d17-8e1d-87c2c4800839
master
frederico 2019-01-22 12:47:11 +00:00
parent 9eb830551b
commit 66d7d2f332
7 changed files with 130 additions and 30 deletions

View File

@ -177,7 +177,6 @@ public class RelatorioGratuidadeARTESP extends Relatorio {
sql.append("JOIN TARIFA T ON r.RUTA_ID = T.RUTA_ID AND b.ORIGEN_ID = T.ORIGEN_ID AND b.DESTINO_ID = T.DESTINO_ID AND b.CLASESERVICIO_ID = T.CLASESERVICIO_ID AND m.MARCA_ID = T.MARCA_ID AND o.ORGAOCONCEDENTE_ID = T.ORGAOCONCEDENTE_ID ");
sql.append("INNER JOIN VIGENCIA_TARIFA vt ON vt.VIGENCIATARIFA_ID = t.VIGENCIATARIFA_ID AND b.FECHORVIAJE BETWEEN vt.FECINICIOVIGENCIA AND vt.FECFINVIGENCIA ");
sql.append("WHERE b.MOTIVOCANCELACION_ID IS NULL ");
sql.append("AND T.ACTIVO = 1 ");
sql.append("AND cd.ACTIVO = 1 ");
sql.append("AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");

View File

@ -17,9 +17,11 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Observable;
@ -48,6 +50,10 @@ import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.ForwardEvent;
import org.zkoss.zk.ui.event.InputEvent;
import org.zkoss.zk.ui.event.SelectEvent;
import org.zkoss.zk.ui.event.UploadEvent;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zkplus.databind.BindingListModel;
@ -62,11 +68,12 @@ import org.zkoss.zul.Doublebox;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Image;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Radio;
import org.zkoss.zul.Row;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.api.Listitem;
import org.zkoss.zul.api.Bandbox;
import org.zkoss.zul.api.Timebox;
import com.rjconsultores.ventaboletos.constantes.Constantes;
@ -253,6 +260,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private MyListbox empresaContaBancariaList;
private Textbox txtChaveAntifraude;
private MyListbox ptovtaAntifraudeList;
private Bandbox bbCategoria;
private List<Categoria> lsCategoriaBloquear;
@ -414,7 +422,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Checkbox checkCartaoAG;
private Checkbox checkBoletoAG;
private Checkbox checkDepositoAG;
private Checkbox checkTodosPuntosVentaAG;
private Checkbox checkPtovtaCatIndEmbarcada;
private Checkbox checkPtovtaCatIndTotalBus;
private MyTextbox txtNumIEPuntoVenta;
private Datebox fecIntegracion;
private Datebox fecInicioAG;
@ -438,6 +447,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Doublebox txtMaximoTaxaConveniencia;
private ConstraintPorcentagemAllowNull ct;
private Set<Object> lsCategoriaSel;
private static final String EMAIL_PATTERN =
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
@ -480,7 +491,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
@Override
public void doAfterCompose(Component comp) throws Exception {
setCt(new ConstraintPorcentagemAllowNull());
setCt(new ConstraintPorcentagemAllowNull());
lsCategoriaSel = new HashSet<Object>();
lsCategoriaBloquear = categoriaService.obtenerTodasCategoriasVisibles();
lsEmpresasBloquear = empresaService.obtenerTodos();
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
@ -503,10 +515,16 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
super.doAfterCompose(comp);
for (Categoria c : lsCategoriaBloquear) {
categoriaList.addItemNovo(c);
}
bbCategoria.addEventListener(Events.ON_CHANGING, new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
autoCompleteBandbox(((InputEvent)event).getValue());
}
});
inserirItensLista(lsCategoriaBloquear);
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
@Override
@ -1405,22 +1423,35 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
}
@SuppressWarnings("unchecked")
public void onClick$btnAdicionarPtovtaCatInd(Event ev) {
if (!categoriaList.getSelectedItems().isEmpty()) {
for (Listitem item : (Set<Listitem>) categoriaList.getSelectedItems()) {
Categoria categoria = (Categoria) item.getValue();
if (!lsCategoriaSel.isEmpty()) {
if(!checkPtovtaCatIndTotalBus.isChecked() &&
!checkPtovtaCatIndTotalBus.isChecked()){
try {
Messagebox.show(Labels.getLabel("editarPuntoVentaController.msg.informartipobloqueio.value"),
Labels.getLabel("editarPuntoVentaController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
} catch (InterruptedException e) {
}
return;
}
for (Object item : lsCategoriaSel) {
Categoria categoria = (Categoria) item;
PtovtaCatInd pto = new PtovtaCatInd();
pto.setCategoria(categoria);
pto.setPuntoVenta(puntoVenta);
pto.setUsuarioBloqueado((Usuario) cmbUsuarioBloq.getSelectedItem().getValue());
pto.setEmpresa((Empresa) cmbUsuarioEmpresa.getSelectedItem().getValue());
pto.setIndEmbarcada(checkPtovtaCatIndEmbarcada.isChecked());
pto.setIndTotalBus(checkPtovtaCatIndTotalBus.isChecked());
if(existePtoVtaCat(pto)){
return;
continue;
}
puntoVenta.addPtovtaCatInd(pto);
@ -3724,4 +3755,37 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
this.categoriaList = categoriaList;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void autoCompleteBandbox(String change) {
categoriaList.clear();
if (StringUtils.isNotEmpty(change)) {
for (Object categoria : lsCategoriaBloquear) {
if (categoria.toString().toUpperCase().contains(change.toUpperCase())) {
categoriaList.addItemNovo(categoria);
}
}
} else {
inserirItensLista(lsCategoriaBloquear);
}
categoriaList.selectItems(new ArrayList(lsCategoriaSel));
}
private void inserirItensLista(Collection<?> itensLista) {
for (Object c : itensLista) {
categoriaList.addItemNovo(c);
}
}
public void onSelect$categoriaList(Event ev){
ForwardEvent fev = (ForwardEvent) ev;
SelectEvent selEv = (SelectEvent) fev.getOrigin();
Listitem i = (Listitem) selEv.getReference();
if(i.isSelected()){
lsCategoriaSel.add(i.getValue());
}else{
lsCategoriaSel.remove(i.getValue());
}
}
}

View File

@ -33,6 +33,10 @@ public class MyListbox extends Listbox {
super.setModel(modelList);
setVflex(Boolean.TRUE);
}
public void clear(){
this.modelList.clear();
}
public boolean addItemNovo(Object item) {
try {

View File

@ -19,6 +19,13 @@ public class RenderPtovtaCatInd implements ListitemRenderer {
lc = new Listcell(pto.getEmpresa().getNombempresa());
lc.setParent(lstm);
lc = new Listcell(pto.getIndTotalBus() != null ? pto.getIndTotalBus() ? "Sim" : "Não" : "Não");
lc.setParent(lstm);
lc = new Listcell(pto.getIndEmbarcada() != null ? pto.getIndEmbarcada() ? "Sim" : "Não" : "Não");
lc.setParent(lstm);
lstm.setAttribute("data", pto);

View File

@ -1483,7 +1483,10 @@ editarPuntoVentaController.lbMostrarCaja.value = Mostrar Caja en el Cierre
editarPuntoVentaController.lbNumeroSitef.value = Numero SITEF
editarPuntoVentaController.lbEmpresaTerceirizada.value = Terceirizada
editarPuntoVentaController.checkPtoVtaEmpresaIndTotalBus.value = Vende TotalBus
editarPuntoVentaController.checkPtoVtaCatIndTotalBus.value = Bloqueia TotalBus
editarPuntoVentaController.checkPtoVtaEmpresaIndEmbarcada.value = Vende Embarcada
editarPuntoVentaController.checkPtoVtaCatIndEmbarcada.value = Bloqueia Embarcada
editarPuntoVentaController.msg.informartipobloqueio.value = Favor informar um tipo de bloqueio.
editarPuntoVentaController.lbparada.value = Parada
editarPuntoVentaController.lbdataAbertura.value = Data de Apertura
editarPuntoVentaController.lbdataFechamento.value = Fecha de Cierre

View File

@ -1599,7 +1599,10 @@ editarPuntoVentaController.lbMostrarCaja.value = Exibir Caixa no Fechamento
editarPuntoVentaController.lbNumeroSitef.value = Número SITEF
editarPuntoVentaController.lbEmpresaTerceirizada.value = Terceirizada
editarPuntoVentaController.checkPtoVtaEmpresaIndTotalBus.value = Vende TotalBus
editarPuntoVentaController.checkPtoVtaCatIndTotalBus.value = Bloqueia TotalBus
editarPuntoVentaController.checkPtoVtaEmpresaIndEmbarcada.value = Vende Embarcada
editarPuntoVentaController.checkPtoVtaCatIndEmbarcada.value = Bloqueia Embarcada
editarPuntoVentaController.msg.informartipobloqueio.value = Favor informar um tipo de bloqueio.
editarPuntoVentaController.lbparada.value = Localidade
editarPuntoVentaController.lbdataAbertura.value = Data de Abertura
editarPuntoVentaController.lbdataFechamento.value = Data de Fechamento

View File

@ -995,10 +995,10 @@
<listheader id="lhFormaPago"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionFormaPagoController.lblFormaPago.value')}" />
<listheader id="lhTotalbus"
<listheader id="lhTotalbusFormaPago"
image="/gui/img/builder.gif"
label="${c:l('editarPuntoVentaController.checkPtoVtaEmpresaIndTotalBus.value')}" />
<listheader id="lhEmbarcada"
<listheader id="lhEmbarcadaFormaPago"
image="/gui/img/builder.gif"
label="${c:l('editarPuntoVentaController.checkPtoVtaEmpresaIndEmbarcada.value')}" />
</listhead>
@ -1582,19 +1582,19 @@
</columns>
<rows>
<row>
<label
value="${c:l('editarPuntoVentaController.label.tipoPassagem')}" />
<bandbox id="bdCategoria">
<bandpopup width="200px">
<listbox id="categoriaList"
checkmark="true" multiple="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox">
</listbox>
</bandpopup>
</bandbox>
</row>
<row>
<row>
<label
value="${c:l('editarPuntoVentaController.label.tipoPassagem')}" />
<bandbox id="bbCategoria" autodrop="true">
<bandpopup width="200px">
<listbox id="categoriaList"
checkmark="true" multiple="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox">
</listbox>
</bandpopup>
</bandbox>
</row>
<row>
<label
value="${c:l('editarPuntoVentaController.label.usuario')}" />
<combobox id="cmbUsuarioBloq"
@ -1610,6 +1610,20 @@
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="70%" mold="rounded" buttonVisible="true" />
</row>
<row>
<label
value="${c:l('editarPuntoVentaController.checkPtoVtaCatIndTotalBus.value')}" />
<checkbox
id="checkPtovtaCatIndTotalBus" checked="true" />
</row>
<row>
<label
value="${c:l('editarPuntoVentaController.checkPtoVtaCatIndEmbarcada.value')}" />
<checkbox
id="checkPtovtaCatIndEmbarcada" checked="true" />
</row>
</rows>
</grid>
<toolbar>
@ -1635,7 +1649,13 @@
label="${c:l('editarPuntoVentaController.label.usuario')}" />
<listheader id="lUsuarioEmpresa"
image="/gui/img/builder.gif"
label="${c:l('editarEmpresaController.window.title')}" />
label="${c:l('editarEmpresaController.window.title')}" />
<listheader id="lhTotalbusCategoria"
image="/gui/img/builder.gif"
label="${c:l('editarPuntoVentaController.checkPtoVtaCatIndTotalBus.value')}" />
<listheader id="lhEmbarcadaCategoria"
image="/gui/img/builder.gif"
label="${c:l('editarPuntoVentaController.checkPtoVtaCatIndEmbarcada.value')}" />
</listhead>
</listbox>
</tabpanel>