fixes bug#13461
dev: Valdevir qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@90343 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c20169af89
commit
7dffcbfd96
|
@ -31,6 +31,8 @@ public class RelatorioVendasBilheteiroSintetico extends Relatorio {
|
||||||
Connection conexao = this.relatorio.getConexao();
|
Connection conexao = this.relatorio.getConexao();
|
||||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
|
|
||||||
|
Boolean isDigitacao = parametros.get("ORGANIZADODIGITACAO")==null? false: (Boolean)parametros.get("ORGANIZADODIGITACAO");
|
||||||
|
|
||||||
sql.append("select ");
|
sql.append("select ");
|
||||||
sql.append(" pv.NUMPUNTOVENTA, us.cveusuario , us.NOMBUSUARIO, tpv.DESCTIPO,");
|
sql.append(" pv.NUMPUNTOVENTA, us.cveusuario , us.NOMBUSUARIO, tpv.DESCTIPO,");
|
||||||
|
@ -38,70 +40,70 @@ public class RelatorioVendasBilheteiroSintetico extends Relatorio {
|
||||||
sql.append(" sum (case when ca.motivocancelacion_id is null then ");
|
sql.append(" sum (case when ca.motivocancelacion_id is null then ");
|
||||||
|
|
||||||
|
|
||||||
Boolean soma = false;
|
Boolean soma = false;
|
||||||
sql.append(" (");
|
sql.append(" (");
|
||||||
if (parametros.get("TARIFA") != null) {
|
if (parametros.get("TARIFA") != null) {
|
||||||
|
soma = true;
|
||||||
|
sql.append(" coalesce(ca.preciopagado,0) ");
|
||||||
|
}
|
||||||
|
if (parametros.get("PEDAGIO") != null) {
|
||||||
|
if (soma) {
|
||||||
|
sql.append(" + coalesce(ca.importepedagio,0) ");
|
||||||
|
} else {
|
||||||
|
sql.append(" coalesce(ca.importepedagio,0) ");
|
||||||
soma = true;
|
soma = true;
|
||||||
sql.append(" coalesce(ca.preciopagado,0) ");
|
|
||||||
}
|
}
|
||||||
if (parametros.get("PEDAGIO") != null) {
|
}
|
||||||
if (soma) {
|
if (parametros.get("TAXADEEMBARQUE") != null) {
|
||||||
sql.append(" + coalesce(ca.importepedagio,0) ");
|
if (soma) {
|
||||||
} else {
|
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
|
||||||
sql.append(" coalesce(ca.importepedagio,0) ");
|
} else {
|
||||||
soma = true;
|
sql.append(" coalesce(ca.importetaxaembarque,0) ");
|
||||||
}
|
soma = true;
|
||||||
}
|
}
|
||||||
if (parametros.get("TAXADEEMBARQUE") != null) {
|
}
|
||||||
if (soma) {
|
if (parametros.get("SEGURO") != null) {
|
||||||
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
|
if (soma) {
|
||||||
} else {
|
sql.append(" + coalesce(ca.importeseguro,0) ");
|
||||||
sql.append(" coalesce(ca.importetaxaembarque,0) ");
|
} else {
|
||||||
soma = true;
|
sql.append(" coalesce(ca.importeseguro,0) ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parametros.get("SEGURO") != null) {
|
sql.append(" ) else 0 end ) vlrVendas, ");
|
||||||
if (soma) {
|
|
||||||
sql.append(" + coalesce(ca.importeseguro,0) ");
|
|
||||||
} else {
|
|
||||||
sql.append(" coalesce(ca.importeseguro,0) ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sql.append(" ) else 0 end ) vlrVendas, ");
|
|
||||||
|
|
||||||
sql.append(" sum (case when ca.motivocancelacion_id is not null then 1 else 0 end) qtdCancelados, ");
|
sql.append(" sum (case when ca.motivocancelacion_id is not null then 1 else 0 end) qtdCancelados, ");
|
||||||
sql.append(" sum (case when ca.motivocancelacion_id is not null then ");
|
sql.append(" sum (case when ca.motivocancelacion_id is not null then ");
|
||||||
|
|
||||||
soma = false;
|
soma = false;
|
||||||
sql.append(" (");
|
sql.append(" (");
|
||||||
if (parametros.get("TARIFA") != null) {
|
if (parametros.get("TARIFA") != null) {
|
||||||
sql.append(" coalesce(ca.preciopagado,0) ");
|
sql.append(" coalesce(ca.preciopagado,0) ");
|
||||||
|
soma = true;
|
||||||
|
}
|
||||||
|
if (parametros.get("PEDAGIO") != null) {
|
||||||
|
if (soma) {
|
||||||
|
sql.append(" + coalesce(ca.importepedagio,0) ");
|
||||||
|
} else {
|
||||||
|
sql.append(" coalesce(ca.importepedagio,0) ");
|
||||||
soma = true;
|
soma = true;
|
||||||
}
|
}
|
||||||
if (parametros.get("PEDAGIO") != null) {
|
}
|
||||||
if (soma) {
|
if (parametros.get("TAXADEEMBARQUE") != null) {
|
||||||
sql.append(" + coalesce(ca.importepedagio,0) ");
|
if (soma) {
|
||||||
} else {
|
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
|
||||||
sql.append(" coalesce(ca.importepedagio,0) ");
|
} else {
|
||||||
soma = true;
|
sql.append(" coalesce(ca.importetaxaembarque,0) ");
|
||||||
}
|
soma = true;
|
||||||
}
|
}
|
||||||
if (parametros.get("TAXADEEMBARQUE") != null) {
|
}
|
||||||
if (soma) {
|
if (parametros.get("SEGURO") != null) {
|
||||||
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
|
if (soma) {
|
||||||
} else {
|
sql.append(" + coalesce(ca.importeseguro,0) ");
|
||||||
sql.append(" coalesce(ca.importetaxaembarque,0) ");
|
} else {
|
||||||
soma = true;
|
sql.append(" coalesce(ca.importeseguro,0) ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parametros.get("SEGURO") != null) {
|
sql.append(" ) else 0 end ) vlrCancelados ");
|
||||||
if (soma) {
|
|
||||||
sql.append(" + coalesce(ca.importeseguro,0) ");
|
|
||||||
} else {
|
|
||||||
sql.append(" coalesce(ca.importeseguro,0) ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sql.append(" ) else 0 end ) vlrCancelados ");
|
|
||||||
|
|
||||||
|
|
||||||
sql.append("from ");
|
sql.append("from ");
|
||||||
|
@ -110,6 +112,13 @@ public class RelatorioVendasBilheteiroSintetico extends Relatorio {
|
||||||
sql.append(" inner join punto_venta pv on pv.puntoventa_id = ca.puntoventa_id ");
|
sql.append(" inner join punto_venta pv on pv.puntoventa_id = ca.puntoventa_id ");
|
||||||
sql.append(" INNER JOIN TIPO_PTOVTA tpv ON tpv.TIPOPTOVTA_ID = pv.TIPOPTOVTA_ID ");
|
sql.append(" INNER JOIN TIPO_PTOVTA tpv ON tpv.TIPOPTOVTA_ID = pv.TIPOPTOVTA_ID ");
|
||||||
sql.append(" join MARCA m on m.marca_id = ca.marca_id ");
|
sql.append(" join MARCA m on m.marca_id = ca.marca_id ");
|
||||||
|
|
||||||
|
if (isDigitacao) {
|
||||||
|
sql.append(" JOIN DIGITA_ITEM_BOLETO dib on ca.TRANSACAO_ID = dib.BOLETO_ID ");
|
||||||
|
sql.append(" LEFT JOIN DIGITA_VENTA dv on dib.DIGITAVENTA_ID = dv.DIGITAVENTA_ID ");
|
||||||
|
sql.append(" LEFT JOIN USUARIO_UBICACION udu on udu.USUARIO_ID = dv.USUARIO_ID and udu.ACTIVO = 1 ");
|
||||||
|
}
|
||||||
|
|
||||||
sql.append("where ");
|
sql.append("where ");
|
||||||
sql.append(" ca.indreimpresion = 0 ");
|
sql.append(" ca.indreimpresion = 0 ");
|
||||||
sql.append(" and ca.feccorte >= :DATA_INICIAL ");
|
sql.append(" and ca.feccorte >= :DATA_INICIAL ");
|
||||||
|
@ -119,8 +128,13 @@ public class RelatorioVendasBilheteiroSintetico extends Relatorio {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parametros.get("NUMPUNTOVENTA") != null && !parametros.get("NUMPUNTOVENTA").toString().contains("-1")) {
|
if (parametros.get("NUMPUNTOVENTA") != null && !parametros.get("NUMPUNTOVENTA").toString().contains("-1")) {
|
||||||
sql.append(" and ca.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
|
if (isDigitacao) {
|
||||||
|
sql.append(" and udu.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
|
||||||
|
}else {
|
||||||
|
sql.append(" and ca.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parametros.get("TIPOPUNTOVENTA_ID") != null && !parametros.get("TIPOPUNTOVENTA_ID").toString().equals("-1")) {
|
if (parametros.get("TIPOPUNTOVENTA_ID") != null && !parametros.get("TIPOPUNTOVENTA_ID").toString().equals("-1")) {
|
||||||
sql.append(" and pv.TIPOPTOVTA_ID = :TIPOPUNTOVENTA_ID ");
|
sql.append(" and pv.TIPOPTOVTA_ID = :TIPOPUNTOVENTA_ID ");
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ import org.zkoss.zul.Checkbox;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
import org.zkoss.zul.Radio;
|
||||||
|
import org.zkoss.zul.Radiogroup;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
@ -90,6 +92,10 @@ public class RelatorioVendasBilheteiroSinteticoController extends MyGenericForwa
|
||||||
private Checkbox checkboxImportepedagio;
|
private Checkbox checkboxImportepedagio;
|
||||||
private Checkbox checkboxImportetaxaembarque;
|
private Checkbox checkboxImportetaxaembarque;
|
||||||
private Checkbox checkboxImporteseguro;
|
private Checkbox checkboxImporteseguro;
|
||||||
|
|
||||||
|
private Radiogroup organizacao;
|
||||||
|
private Radio radBilheteiro;
|
||||||
|
private Radio radDigitacao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
@ -103,6 +109,8 @@ public class RelatorioVendasBilheteiroSinteticoController extends MyGenericForwa
|
||||||
checkboxImportepedagio.setChecked(true);
|
checkboxImportepedagio.setChecked(true);
|
||||||
checkboxImportetaxaembarque.setChecked(true);
|
checkboxImportetaxaembarque.setChecked(true);
|
||||||
checkboxImporteseguro.setChecked(true);
|
checkboxImporteseguro.setChecked(true);
|
||||||
|
|
||||||
|
radBilheteiro.setChecked(true);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -249,6 +257,15 @@ public class RelatorioVendasBilheteiroSinteticoController extends MyGenericForwa
|
||||||
filtro.append(" Todos;");
|
filtro.append(" Todos;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filtro.append(" Organização: ");
|
||||||
|
|
||||||
|
if( radDigitacao.isChecked() ) {
|
||||||
|
filtro.append(radDigitacao.getLabel() + ";");
|
||||||
|
parametros.put("ORGANIZADODIGITACAO", true);
|
||||||
|
}else {
|
||||||
|
filtro.append(radBilheteiro.getLabel() + ";");
|
||||||
|
parametros.put("ORGANIZADODIGITACAO", false);
|
||||||
|
}
|
||||||
|
|
||||||
parametros.put("FILTROS", filtro.toString());
|
parametros.put("FILTROS", filtro.toString());
|
||||||
relatorio = new RelatorioVendasBilheteiroSintetico(parametros, dataSourceRead.getConnection());
|
relatorio = new RelatorioVendasBilheteiroSintetico(parametros, dataSourceRead.getConnection());
|
||||||
|
|
|
@ -754,6 +754,8 @@ relatorioVendasBilheteiroSinteticoController.btnPesquisa.label = Buscar
|
||||||
relatorioVendasBilheteiroSinteticoController.btnLimpar.label = Limpiar
|
relatorioVendasBilheteiroSinteticoController.btnLimpar.label = Limpiar
|
||||||
relatorioVendasBilheteiroSinteticoController.lbNumero.value = Número punto de venta
|
relatorioVendasBilheteiroSinteticoController.lbNumero.value = Número punto de venta
|
||||||
relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value = Agente
|
relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value = Agente
|
||||||
|
relatorioVendasBilheteiroSinteticoController.lbDigitacao.value = Digitacion
|
||||||
|
relatorioVendasBilheteiroSinteticoController.lbOrganizacao.value = Organizado por:
|
||||||
|
|
||||||
#Reporte de Demandas
|
#Reporte de Demandas
|
||||||
relatorioDemandasController.window.title = Reporte de demandas
|
relatorioDemandasController.window.title = Reporte de demandas
|
||||||
|
|
|
@ -793,6 +793,8 @@ relatorioVendasBilheteiroSinteticoController.btnPesquisa.label = Buscar
|
||||||
relatorioVendasBilheteiroSinteticoController.btnLimpar.label = Limpar
|
relatorioVendasBilheteiroSinteticoController.btnLimpar.label = Limpar
|
||||||
relatorioVendasBilheteiroSinteticoController.lbNumero.value = Número Agência
|
relatorioVendasBilheteiroSinteticoController.lbNumero.value = Número Agência
|
||||||
relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value = Bilheteiro
|
relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value = Bilheteiro
|
||||||
|
relatorioVendasBilheteiroSinteticoController.lbDigitacao.value = Digitação
|
||||||
|
relatorioVendasBilheteiroSinteticoController.lbOrganizacao.value = Organizado por:
|
||||||
relatorioVendasBilheteiroSinteticoController.lbCanalVendas.value = Canal Vendas
|
relatorioVendasBilheteiroSinteticoController.lbCanalVendas.value = Canal Vendas
|
||||||
relatorioVendasBilheteiroSinteticoController.erroSemComponenteDePreco = Escolha um componente de preço
|
relatorioVendasBilheteiroSinteticoController.erroSemComponenteDePreco = Escolha um componente de preço
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
<window id="winFiltroRelatorioVendasBilheteiroSintetico"
|
<window id="winFiltroRelatorioVendasBilheteiroSintetico"
|
||||||
apply="${relatorioVendasBilheteiroSinteticoController}"
|
apply="${relatorioVendasBilheteiroSinteticoController}"
|
||||||
contentStyle="overflow:auto" height="320px" width="600px"
|
contentStyle="overflow:auto" height="370px" width="600px"
|
||||||
border="normal">
|
border="normal">
|
||||||
|
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
|
@ -55,6 +55,13 @@
|
||||||
<column width="80%" />
|
<column width="80%" />
|
||||||
</columns>
|
</columns>
|
||||||
<rows>
|
<rows>
|
||||||
|
<row spans="1,1,2">
|
||||||
|
<label value="${c:l('relatorioVendasBilheteiroSinteticoController.lbOrganizacao.value')}" />
|
||||||
|
<radiogroup id="organizacao" width="200px">
|
||||||
|
<radio id="radBilheteiro" label="${c:l('relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value')}" radiogroup="organizacao" />
|
||||||
|
<radio id="radDigitacao" label="${c:l('relatorioVendasBilheteiroSinteticoController.lbDigitacao.value')}" radiogroup="organizacao"/>
|
||||||
|
</radiogroup>
|
||||||
|
</row>
|
||||||
<row spans="1,1,2">
|
<row spans="1,1,2">
|
||||||
<label
|
<label
|
||||||
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbEmpresa.value')}" />
|
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbEmpresa.value')}" />
|
||||||
|
|
Loading…
Reference in New Issue