RelatorioVeiculoMulta.xhtml
7.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:t="http://myfaces.apache.org/tomahawk">
<div id="cadastro">
<h1 style="width:300px"> Relatório de Multas de Veículo</h1>
<fieldset>
<legend>Relatório de Multas de Veículo</legend>
<h:panelGroup id="searchUG" rendered="#{!relatorioBean.mostrarVeiculos}">
<dt><label for="ugList">Órgão:</label></dt>
<dd>
<h:selectOneMenu id="ug" value="#{relatorioBean.orgao}" requiredMessage="Informe a UG" converter="entityConverter">
<c:if test="#{controlBean.administrador}">
<f:selectItem itemLabel="Todos" itemValue="" />
</c:if>
<t:selectItems value="#{ugBean.ugs}" var="ug" itemLabel="#{ug.descricao}" itemValue="#{ug}"/>
<a4j:support event="onchange" action="#{relatorioBean.populateMultas}" reRender="paginaPrincipal" ajaxSingle="true"/>
</h:selectOneMenu>
</dd>
</h:panelGroup>
<br clear="all"/>
<h:panelGroup id="searchMotorista" rendered="false">
<dt><label for="ugList">Motorista:</label></dt>
<dd>
<h:selectOneMenu id="motorista" value="#{relatorioBean.motorista}" requiredMessage="Informe a UG" converter="entityConverter">
<c:if test="#{controlBean.administrador}">
<f:selectItem itemLabel="Todos" itemValue="" />
</c:if>
<t:selectItems value="#{relatorioBean.motoristas}" var="motorista" itemLabel="#{motorista.pessoa.nome}" itemValue="#{motorista}" />
</h:selectOneMenu>
</dd>
</h:panelGroup>
<h:panelGroup id="searchVeiculo" rendered="#{relatorioBean.mostrarVeiculos}">
<dt><label for="ugList">Veículo:</label></dt>
<dd>
<h:selectOneMenu id="veiculo" value="#{relatorioBean.veiculo}" requiredMessage="Informe o veículo" converter="entityConverter">
<c:if test="#{controlBean.administrador}">
<f:selectItem itemLabel="Todos" itemValue="" />
</c:if>
<t:selectItems value="#{relatorioBean.veiculos}" var="veiculo" itemLabel="#{veiculo.placa} #{veiculo.modelo.descricao}" itemValue="#{veiculo}" />
</h:selectOneMenu>
</dd>
</h:panelGroup>
<dt><label for="dataInicio">Data Início:</label></dt>
<dd>
<h:inputText id="dataInicio" value="#{relatorioBean.dtInicial}" required="true"
requiredMessage="Informe a data inicial" styleClass="maskData">
<f:convertDateTime dateStyle="short" pattern="dd/MM/yyyy" timeZone="GMT-03:00"/>
</h:inputText>
<h:message for="dataInicio" styleClass="message"/>
</dd>
<dt><label for="dataFim">Data Fim:</label></dt>
<dd>
<h:inputText id="dataFim" value="#{relatorioBean.dtFinal}" required="true"
requiredMessage="Informe a data final" styleClass="maskData">
<f:convertDateTime dateStyle="short" pattern="dd/MM/yyyy" timeZone="GMT-03:00"/>
</h:inputText>
<h:message for="dataInicio" styleClass="message"/>
</dd>
<dd>
<h:selectOneRadio id="options" value="#{relatorioBean.searchFlag}" style="width:50%">
<f:selectItem itemLabel="Por UG" itemValue="SEARCH_UG" />
<f:selectItem itemLabel="Por veículo" itemValue="SEARCH_VEICULO" />
<a4j:support event="onclick" action="#{relatorioBean.populateOption}" reRender="paginaPrincipal" ajaxSingle="true"/>
</h:selectOneRadio>
</dd>
<h:commandButton action="#{relatorioBean.consultarMultasVeiculo}" value="Consultar">
<a4j:support event="onclick" reRender="dataTable" />
</h:commandButton>
<rich:dataTable id="dataTable" value="#{relatorioBean.entities}" var="r" rowKeyVar="index"
onRowMouseOver="jQuery(this).addClass('trHover')"
onRowMouseOut="jQuery(this).removeClass('trHover')"
rowClasses="even,odd">
<c:if test="#{relatorioBean.entitiesSize == 0}">
<rich:column>
<f:facet name="header">Nenhum registro foi encontrado.</f:facet>
</rich:column>
</c:if>
<c:if test="#{relatorioBean.entitiesSize > 0}">
<rich:column colspan="10" style="font-weight: bold; background:white">
<h:outputText value="Órgão: #{r.orgao.descricao}" rendered="#{relatorioBean.searchFlag == 'SEARCH_UG'}"/>
<h:outputText value="veículo: #{r.veiculo.placa} - #{r.veiculo.modelo.descricao}" rendered="#{relatorioBean.searchFlag == 'SEARCH_VEICULO'}"/>
<h:outputText value="Motorista: #{r.motorista.pessoa.nome}" rendered="#{relatorioBean.searchFlag == 'SEARCH_MOTORISTA'}"/>
</rich:column>
<rich:subTable id="subDataTable" headerClass="subHeader" value="#{r.relatorios}" var="sr" rowKeyVar="k"
rowClasses="odd,even"
onRowMouseOver="jQuery(this).addClass('trHover')"
onRowMouseOut="jQuery(this).removeClass('trHover')">
<rich:column>
<f:facet name="header"><h:outputLabel value="Nº" /></f:facet>
<h:outputText value="#{k+1}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Veículo" /></f:facet>
<h:outputText value="#{sr.multa.veiculo.placa}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Motorista" /></f:facet>
<h:outputText value="#{sr.multa.motorista.pessoa.nome}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Infracão" /></f:facet>
<h:outputText value="#{sr.multa.infracao.descricao}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Gravidade" /></f:facet>
<h:outputText value="#{sr.multa.infracao.gravidade}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Pontos" /></f:facet>
<h:outputText value="#{sr.multa.infracao.pontuacao}" />
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Valor" /></f:facet>
<h:outputText value="#{sr.multa.infracao.valor*sr.multa.infracao.peso}">
<f:convertNumber maxFractionDigits="2"/>
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header"><h:outputLabel value="Data Infracão" /></f:facet>
<h:outputText value="#{sr.multa.dataInfracao}">
<f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT-03:00" />
</h:outputText>
</rich:column>
</rich:subTable>
</c:if>
</rich:dataTable>
<p/>
<a4j:status id="gerarRelatorio">
<f:facet name="start">
<h:panelGroup style="align:center;">
<h:graphicImage value="/images/ajax-loader.gif" height="16" width="16" />
<h:outputText value="Processando..." styleClass="processando" />
</h:panelGroup>
</f:facet>
</a4j:status>
<h:panelGroup rendered="#{relatorioBean.entitiesSize > 0}">
<h:commandLink action="#{relatorioBean.gerarRelatorio}" value="Gerar Relatório" target="blank">
<a4j:support event="onclick" status="gerarRelatorio" reRender="paginaPrincipal" />
</h:commandLink>
</h:panelGroup>
</fieldset>
</div>
</ui:composition>