Commit 00e6fa5c0ab47b7149e3738757161a0536a61f84
Exists in
master
Merge branch 'tarefa-3815' into adm-1.16.0
Showing
20 changed files
with
1367 additions
and
5 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/RequisicaoConsumoDao.java
... | ... | @@ -2,6 +2,7 @@ package br.com.centralit.api.dao; |
2 | 2 | |
3 | 3 | import java.util.Calendar; |
4 | 4 | import java.util.Collection; |
5 | +import java.util.List; | |
5 | 6 | |
6 | 7 | import br.com.centralit.api.model.EstruturaOrganizacional; |
7 | 8 | import br.com.centralit.api.model.MaterialConsumo; |
... | ... | @@ -110,4 +111,10 @@ public interface RequisicaoConsumoDao extends CitGenericDAO { |
110 | 111 | * @return |
111 | 112 | */ |
112 | 113 | RequisicaoConsumo findRequisicaoAnteriorPorMaterial(MaterialConsumo materialConsumo, EstruturaOrganizacional unidadeRequisitante); |
114 | + | |
115 | + Object[] getRequisicaoForReport(Long requisicaoId); | |
116 | + List<Object> getResumoContabilForReport(Long requisicaoId,boolean isFIFO); | |
117 | + List<Object> getMateriaisForReport(Long requisicaoId,boolean isFIFO); | |
118 | + String findtipoStatusRequisicaoPorMaterial(Long requisicaoId); | |
119 | + | |
113 | 120 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/RequisicaoConsumoItemDao.java
... | ... | @@ -6,6 +6,7 @@ import java.util.List; |
6 | 6 | import br.com.centralit.api.model.EstruturaOrganizacional; |
7 | 7 | import br.com.centralit.api.model.MaterialConsumo; |
8 | 8 | import br.com.centralit.api.model.RequisicaoConsumo; |
9 | +import br.com.centralit.api.model.RequisicaoConsumoItem; | |
9 | 10 | import br.com.centralit.framework.dao.arquitetura.CitGenericDAO; |
10 | 11 | import br.com.centralit.framework.model.Dominio; |
11 | 12 | |
... | ... | @@ -27,4 +28,6 @@ public interface RequisicaoConsumoItemDao extends CitGenericDAO { |
27 | 28 | */ |
28 | 29 | Long findRequisicaoAnteriorPorMaterial(MaterialConsumo materialConsumo, EstruturaOrganizacional unidadeRequisitante, Dominio statusFinalizado, Dominio statusParcialmenteAtendida, Dominio statusAtendida); |
29 | 30 | |
31 | + List<RequisicaoConsumoItem> listarRequisicaoCosumoItemByIdRequisicao(Long requisicaoId); | |
32 | + | |
30 | 33 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/RequisicaoConsumoDaoHibernate.java
... | ... | @@ -281,4 +281,92 @@ public class RequisicaoConsumoDaoHibernate extends CitGenericDAOImpl implements |
281 | 281 | |
282 | 282 | return this.searchUnique(searchSeven); |
283 | 283 | } |
284 | + | |
285 | + @Override | |
286 | + public String findtipoStatusRequisicaoPorMaterial(Long requisicaoId) { | |
287 | + return (String)singleResultNativeQuery("select nome from alm_requisicaoconsumo req left join dominio as dominio on dominio.id = req.tipostatusrequisicao_id where req.id = "+requisicaoId); | |
288 | + } | |
289 | + | |
290 | + @Override | |
291 | + public Object[] getRequisicaoForReport(Long requisicaoId){ | |
292 | + StringBuilder sql = new StringBuilder(); | |
293 | + sql.append("select req_c.numerorequisicao as numerorequisicao,alm.nome as almoxarifado,requisitante.nome as unidadereq,locale.nome as enderecour,"); | |
294 | + sql.append(" usuario.nome as requisitante,c_custo.descricao as centrocustos,req_c.datacriacao as cadem,req_c.datafinalizacaoatendimento as atendidaem from alm_requisicaoconsumo req_c"); | |
295 | + sql.append(" left join estruturaorganizacional alm on req_c.almoxarifado_id = alm.id"); | |
296 | + sql.append(" left join estruturaorganizacional requisitante on req_c.unidadeRequisitante_id = requisitante.id"); | |
297 | + sql.append(" left join localizacao locale on requisitante.localizacao_id = locale.id"); | |
298 | + sql.append(" left join centrocusto c_custo on req_c.centrocusto_id = c_custo.id"); | |
299 | + sql.append(" left join seguranca_usuario usuario on req_c.autor_id = usuario.id"); | |
300 | + sql.append(" where req_c.id = ").append(requisicaoId); | |
301 | + | |
302 | + return (Object[]) singleResultNativeQuery(sql.toString()); | |
303 | + } | |
304 | + | |
305 | + @Override | |
306 | + public List<Object> getResumoContabilForReport(Long requisicaoId,boolean isFIFO) { | |
307 | + StringBuilder sql = new StringBuilder(); | |
308 | + sql.append("select distinct contac.codigo,contac.descricao, rc_item.quantidade,"); | |
309 | + | |
310 | + if(isFIFO) | |
311 | + sql.append("fifo.valorUnitario"); | |
312 | + else | |
313 | + sql.append("mat_estoque.valorUnitarioMedio"); | |
314 | + | |
315 | + sql.append(" from alm_requisicaoconsumo req_c"); | |
316 | + sql.append(" left join estruturaorganizacional alm on req_c.organizacao_id = alm.id"); | |
317 | + sql.append(" left join alm_rc_item rc_item on rc_item.requisicaoConsumo_id = req_c.id"); | |
318 | + sql.append(" left join alm_materialconsumo mat_c on rc_item.materialconsumo_id = mat_c.id"); | |
319 | + sql.append(" left join material mat on mat_c.id = mat.id"); | |
320 | + | |
321 | + if(isFIFO) | |
322 | + sql.append(" left join alm_me_fifoitem fifo on fifo.material_id = mat.id"); | |
323 | + else | |
324 | + sql.append(" left join alm_materialestoque mat_estoque on mat_estoque.material_id = mat.id"); | |
325 | + | |
326 | + sql.append(" left join contacontabil contac on mat.contacontabil_id = contac.id"); | |
327 | + sql.append(" where req_c.id = ").append(requisicaoId); | |
328 | + | |
329 | + if(isFIFO) | |
330 | + sql.append(" and fifo.valorUnitario is not null"); | |
331 | + | |
332 | + sql.append(" and rc_item.quantidadeatendida is not null"); | |
333 | + sql.append(" order by contac.descricao"); | |
334 | + | |
335 | + return (List<Object>) resultListNativeQuery(sql.toString()); | |
336 | + } | |
337 | + | |
338 | + @Override | |
339 | + public List<Object> getMateriaisForReport(Long requisicaoId,boolean isFIFO) { | |
340 | + | |
341 | + StringBuilder sql = new StringBuilder(); | |
342 | + sql.append("select distinct mat.descricao,umedi.sigla,entrada_item.datavalidade,rc_item.quantidade, rc_item.quantidadeatendida,"); | |
343 | + | |
344 | + if(isFIFO) | |
345 | + sql.append("fifo.valorUnitario"); | |
346 | + else | |
347 | + sql.append("mat_estoque.valorUnitarioMedio"); | |
348 | + | |
349 | + sql.append(" from alm_requisicaoconsumo req_c"); | |
350 | + sql.append(" left join estruturaorganizacional alm on req_c.organizacao_id = alm.id"); | |
351 | + sql.append(" left join alm_rc_item rc_item on rc_item.requisicaoConsumo_id = req_c.id"); | |
352 | + sql.append(" left join alm_materialconsumo mat_c on rc_item.materialconsumo_id = mat_c.id"); | |
353 | + sql.append(" left join material mat on mat_c.id = mat.id"); | |
354 | + sql.append(" left join alm_en_entradaitem entrada_item on entrada_item.material_id = mat.id"); | |
355 | + sql.append(" left join alm_me_localestoque local_estoque on local_estoque.id = entrada_item.materialLocalEstoque_id"); | |
356 | + | |
357 | + if(isFIFO) | |
358 | + sql.append(" left join alm_me_fifoitem fifo on fifo.material_id = mat.id"); | |
359 | + else | |
360 | + sql.append(" left join alm_materialestoque mat_estoque on mat_estoque.material_id = mat.id"); | |
361 | + | |
362 | + sql.append(" left join unidademedida umedi on umedi.id = mat_c.unidadearmazenamento_id"); | |
363 | + sql.append(" where req_c.id =").append(requisicaoId); | |
364 | + | |
365 | + if(isFIFO) | |
366 | + sql.append("and fifo.quantidadeRestante > 0"); | |
367 | + | |
368 | + sql.append(" order by mat.descricao"); | |
369 | + | |
370 | + return (List<Object>) resultListNativeQuery(sql.toString()); | |
371 | + } | |
284 | 372 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/RequisicaoConsumoItemDaoHibernate.java
... | ... | @@ -153,6 +153,14 @@ public class RequisicaoConsumoItemDaoHibernate extends CitGenericDAOImpl impleme |
153 | 153 | return new HashSet<Long>(idsRequisicoesConsumoComAtendimentos); |
154 | 154 | |
155 | 155 | } |
156 | + | |
157 | + @Override | |
158 | + public List<RequisicaoConsumoItem> listarRequisicaoCosumoItemByIdRequisicao(Long requisicaoId){ | |
159 | + SearchSeven searchSeven = new SearchSeven(RequisicaoConsumoItem.class); | |
160 | + | |
161 | + searchSeven.addFilterIn("requisicaoConsumo.id",requisicaoId); | |
162 | + return this.search(searchSeven,RequisicaoConsumoItem.class); | |
163 | + } | |
156 | 164 | |
157 | 165 | /** |
158 | 166 | * {@inheritDoc} | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/RequisicaoConsumoItemService.java
... | ... | @@ -42,5 +42,7 @@ public interface RequisicaoConsumoItemService extends GenericService<RequisicaoC |
42 | 42 | * @return |
43 | 43 | */ |
44 | 44 | public Long findRequisicaoAnteriorPorMaterial(MaterialConsumo materialConsumo, EstruturaOrganizacional unidadeRequisitante); |
45 | + | |
46 | + List<RequisicaoConsumoItem> listarRequisicaoCosumoItemByIdRequisicao(Long requisicaoId); | |
45 | 47 | |
46 | 48 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/RequisicaoConsumoService.java
... | ... | @@ -2,11 +2,13 @@ package br.com.centralit.api.service; |
2 | 2 | |
3 | 3 | import java.util.Calendar; |
4 | 4 | import java.util.Collection; |
5 | +import java.util.List; | |
5 | 6 | |
6 | 7 | import br.com.centralit.api.model.EstruturaOrganizacional; |
7 | 8 | import br.com.centralit.api.model.MaterialConsumo; |
8 | 9 | import br.com.centralit.api.model.RequisicaoConsumo; |
9 | 10 | import br.com.centralit.api.viewHelper.RequisicaoVH; |
11 | +import br.com.centralit.framework.model.Dominio; | |
10 | 12 | import br.com.centralit.framework.service.arquitetura.GenericService; |
11 | 13 | |
12 | 14 | /** |
... | ... | @@ -121,4 +123,8 @@ public interface RequisicaoConsumoService extends GenericService<RequisicaoConsu |
121 | 123 | */ |
122 | 124 | RequisicaoConsumo findRequisicaoAnteriorPorMaterial(MaterialConsumo materialConsumo, EstruturaOrganizacional unidadeRequisitante); |
123 | 125 | |
126 | + Object[] getRequisicaoForReport(Long requisicaoId); | |
127 | + List<Object> getResumoContabilForReport(Long requisicaoId,boolean isFIFO); | |
128 | + List<Object> getMateriaisForReport(Long requisicaoId,boolean isFIFO); | |
129 | + String findtipoStatusRequisicaoPorMaterial(Long requisicaoId); | |
124 | 130 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/RequisicaoConsumoItemServiceImpl.java
... | ... | @@ -148,4 +148,10 @@ public class RequisicaoConsumoItemServiceImpl extends GenericServiceImpl<Requisi |
148 | 148 | return this.requisicaoConsumoItemDao.findRequisicaoAnteriorPorMaterial(materialConsumo, unidadeRequisitante, statusFinalizado, statusParcialmenteAtendida, statusAtendida); |
149 | 149 | } |
150 | 150 | |
151 | + | |
152 | + @Override | |
153 | + public List<RequisicaoConsumoItem> listarRequisicaoCosumoItemByIdRequisicao(Long requisicaoId) { | |
154 | + return requisicaoConsumoItemDao.listarRequisicaoCosumoItemByIdRequisicao(requisicaoId); | |
155 | + } | |
156 | + | |
151 | 157 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/RequisicaoConsumoServiceImpl.java
... | ... | @@ -512,4 +512,23 @@ public class RequisicaoConsumoServiceImpl extends GenericServiceImpl<RequisicaoC |
512 | 512 | entity.setNumeroRequisicao(codigo); |
513 | 513 | } |
514 | 514 | |
515 | + @Override | |
516 | + public Object[] getRequisicaoForReport(Long requisicaoId) { | |
517 | + return requisicaoConsumoDao.getRequisicaoForReport(requisicaoId); | |
518 | + } | |
519 | + | |
520 | + @Override | |
521 | + public List<Object> getResumoContabilForReport(Long requisicaoId,boolean isFIFO) { | |
522 | + return requisicaoConsumoDao.getResumoContabilForReport(requisicaoId,isFIFO); | |
523 | + } | |
524 | + | |
525 | + @Override | |
526 | + public List<Object> getMateriaisForReport(Long requisicaoId,boolean isFIFO) { | |
527 | + return requisicaoConsumoDao.getMateriaisForReport(requisicaoId,isFIFO); | |
528 | + } | |
529 | + | |
530 | + @Override | |
531 | + public String findtipoStatusRequisicaoPorMaterial(Long requisicaoId) { | |
532 | + return requisicaoConsumoDao.findtipoStatusRequisicaoPorMaterial(requisicaoId); | |
533 | + } | |
515 | 534 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/viewHelper/BeanReportVH.java
0 → 100644
... | ... | @@ -0,0 +1,38 @@ |
1 | +package br.com.centralit.api.viewHelper; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; | |
6 | + | |
7 | +public class BeanReportVH { | |
8 | + | |
9 | + private byte[] logo; | |
10 | + private String titulo1; | |
11 | + private String titulo2; | |
12 | + private String titulo3; | |
13 | + | |
14 | + public byte[] getLogo() { | |
15 | + return logo; | |
16 | + } | |
17 | + public void setLogo(byte[] logo) { | |
18 | + this.logo = logo; | |
19 | + } | |
20 | + public String getTitulo1() { | |
21 | + return titulo1; | |
22 | + } | |
23 | + public void setTitulo1(String titulo1) { | |
24 | + this.titulo1 = titulo1; | |
25 | + } | |
26 | + public String getTitulo2() { | |
27 | + return titulo2; | |
28 | + } | |
29 | + public void setTitulo2(String titulo2) { | |
30 | + this.titulo2 = titulo2; | |
31 | + } | |
32 | + public String getTitulo3() { | |
33 | + return titulo3; | |
34 | + } | |
35 | + public void setTitulo3(String titulo3) { | |
36 | + this.titulo3 = titulo3; | |
37 | + } | |
38 | +} | |
0 | 39 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/BeanMaterial.java
0 → 100644
... | ... | @@ -0,0 +1,96 @@ |
1 | +package br.com.centralit.controller; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | + | |
5 | +import br.com.centralit.framework.util.Util; | |
6 | +import br.com.centralit.framework.util.UtilDate; | |
7 | + | |
8 | +public class BeanMaterial { | |
9 | + private Integer item = 0; | |
10 | + private String nome; | |
11 | + private String unidade; | |
12 | + private String dataValidade; | |
13 | + private String endereco; | |
14 | + private BigDecimal qtdeSolicitada; | |
15 | + private BigDecimal qtdeFornecida; | |
16 | + private BigDecimal qtdeEstoque; | |
17 | + private BigDecimal valorTotal; | |
18 | + private BigDecimal valorUnitario; | |
19 | + | |
20 | + public BeanMaterial(Object[] objArray) { | |
21 | + | |
22 | + this.nome = (String) objArray[0]; | |
23 | + this.unidade = (String) objArray[1]; | |
24 | + this.dataValidade = UtilDate.formatarData(objArray[2]); | |
25 | + this.qtdeSolicitada = (BigDecimal) objArray[3]; | |
26 | + this.qtdeFornecida = (BigDecimal) objArray[4]; | |
27 | + this.valorUnitario = (BigDecimal) objArray[5]; | |
28 | + setValorTotal(valorUnitario); | |
29 | + } | |
30 | + | |
31 | + public Integer getItem() { | |
32 | + return item; | |
33 | + } | |
34 | + | |
35 | + public void setItem(Integer item){ | |
36 | + this.item = item; | |
37 | + } | |
38 | + | |
39 | + public String getNome() { | |
40 | + return nome; | |
41 | + } | |
42 | + | |
43 | + public String getUnidade() { | |
44 | + return unidade; | |
45 | + } | |
46 | + | |
47 | + public String getDataValidade() { | |
48 | + return dataValidade; | |
49 | + } | |
50 | + | |
51 | + public String getEndereco() { | |
52 | + return endereco; | |
53 | + } | |
54 | + | |
55 | + public Integer getQtdeSolicitada() { | |
56 | + return qtdeSolicitada != null ? qtdeSolicitada.intValue() : null; | |
57 | + } | |
58 | + | |
59 | + public BigDecimal getQtdeSolicitadaBD() { | |
60 | + return qtdeSolicitada; | |
61 | + } | |
62 | + | |
63 | + public Integer getQtdeFornecida() { | |
64 | + return qtdeFornecida != null ? qtdeFornecida.intValue() : null; | |
65 | + } | |
66 | + | |
67 | + public String getValorTotal() { | |
68 | + return "R$ "+Util.convertBigDecimalToString(valorTotal); | |
69 | + } | |
70 | + | |
71 | + public void setValorTotal(BigDecimal valorUnitario) { | |
72 | + this.valorUnitario = valorUnitario; | |
73 | + this.valorTotal = valorUnitario.multiply(getQtdeSolicitadaBD()); | |
74 | + } | |
75 | + | |
76 | + public String getValorUnitario() { | |
77 | + return "R$ "+Util.convertBigDecimalToString(valorUnitario); | |
78 | + } | |
79 | + | |
80 | + public BigDecimal getValorUnitarioBD() { | |
81 | + return valorUnitario; | |
82 | + } | |
83 | + | |
84 | + public void setValorUnitario(BigDecimal valorUnitario) { | |
85 | + this.valorUnitario = valorUnitario; | |
86 | + } | |
87 | + | |
88 | + public BigDecimal getQtdeEstoque() { | |
89 | + return qtdeEstoque; | |
90 | + } | |
91 | + | |
92 | + @Override | |
93 | + public boolean equals(Object obj) { | |
94 | + return obj != null && obj instanceof BeanMaterial ? ((BeanMaterial)obj).getNome().equals(this.nome) : false; | |
95 | + } | |
96 | +} | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/BeanRequisicaoSubReport.java
0 → 100644
... | ... | @@ -0,0 +1,92 @@ |
1 | +package br.com.centralit.controller; | |
2 | + | |
3 | +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; | |
4 | +import br.com.centralit.framework.util.UtilDate; | |
5 | + | |
6 | +public class BeanRequisicaoSubReport { | |
7 | + | |
8 | + private String numeroRequisicao; | |
9 | + private String almoxarifado; | |
10 | + private String unidadeReq; | |
11 | + private String enderecoUR; | |
12 | + private String requisitante; | |
13 | + private String atendidaPor; | |
14 | + private String atendidaEm; | |
15 | + private String cadEm; | |
16 | + private String centroCustos; | |
17 | + private Boolean isAsterisco; | |
18 | + private JRBeanCollectionDataSource materiais; | |
19 | + private JRBeanCollectionDataSource resumoContabil; | |
20 | + | |
21 | + public BeanRequisicaoSubReport(Object[] objArray) { | |
22 | + this.numeroRequisicao = (String) objArray[0]; | |
23 | + this.almoxarifado = (String) objArray[1]; | |
24 | + this.unidadeReq = (String) objArray[2]; | |
25 | + this.enderecoUR = (String) objArray[3]; | |
26 | + this.requisitante = (String) objArray[4]; | |
27 | + this.centroCustos = (String) objArray[5]; | |
28 | + this.cadEm = UtilDate.formatarData(objArray[6]); | |
29 | + this.atendidaEm = UtilDate.formatarData(objArray[7]); | |
30 | + } | |
31 | + | |
32 | + public String getNumeroRequisicao() { | |
33 | + return numeroRequisicao; | |
34 | + } | |
35 | + | |
36 | + public String getAlmoxarifado() { | |
37 | + return almoxarifado; | |
38 | + } | |
39 | + | |
40 | + public String getUnidadeReq() { | |
41 | + return unidadeReq; | |
42 | + } | |
43 | + | |
44 | + public String getEnderecoUR() { | |
45 | + return enderecoUR; | |
46 | + } | |
47 | + | |
48 | + public String getRequisitante() { | |
49 | + return requisitante; | |
50 | + } | |
51 | + | |
52 | + public String getAtendidaPor() { | |
53 | + return atendidaPor; | |
54 | + } | |
55 | + | |
56 | + public String getAtendidaEm() { | |
57 | + return atendidaEm; | |
58 | + } | |
59 | + | |
60 | + public String getCadEm() { | |
61 | + return cadEm; | |
62 | + } | |
63 | + | |
64 | + public String getCentroCustos() { | |
65 | + return centroCustos; | |
66 | + } | |
67 | + | |
68 | + public JRBeanCollectionDataSource getMateriais() { | |
69 | + return materiais; | |
70 | + } | |
71 | + | |
72 | + public void setMateriais(JRBeanCollectionDataSource materiais) { | |
73 | + this.materiais = materiais; | |
74 | + } | |
75 | + | |
76 | + public Boolean getIsAsterisco() { | |
77 | + return isAsterisco; | |
78 | + } | |
79 | + | |
80 | + public void setIsAsterisco(Boolean isAsterisco) { | |
81 | + this.isAsterisco = isAsterisco; | |
82 | + } | |
83 | + | |
84 | + public JRBeanCollectionDataSource getResumoContabil() { | |
85 | + return resumoContabil; | |
86 | + } | |
87 | + | |
88 | + public void setResumoContabil(JRBeanCollectionDataSource resumoContabil) { | |
89 | + this.resumoContabil = resumoContabil; | |
90 | + } | |
91 | + | |
92 | +} | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/BeanSubReportContaContabil.java
0 → 100644
... | ... | @@ -0,0 +1,55 @@ |
1 | +package br.com.centralit.controller; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | + | |
5 | +import br.com.centralit.framework.util.Util; | |
6 | + | |
7 | +public class BeanSubReportContaContabil { | |
8 | + private String conta; | |
9 | + private String codigo; | |
10 | + private BigDecimal qtde; | |
11 | + private BigDecimal valorUnitario; | |
12 | + private BigDecimal valorTotal; | |
13 | + | |
14 | + public BeanSubReportContaContabil(Object[] objArray) { | |
15 | + this.codigo = (String)objArray[0]; | |
16 | + this.conta = (String)objArray[1]; | |
17 | + this.qtde = (BigDecimal)objArray[2]; | |
18 | + this.valorUnitario = (BigDecimal)objArray[3]; | |
19 | + } | |
20 | + | |
21 | + public String getConta() { | |
22 | + return codigo+" - "+conta; | |
23 | + } | |
24 | + public Integer getQtde() { | |
25 | + return qtde.intValue(); | |
26 | + } | |
27 | + public BigDecimal getQtdeBD() { | |
28 | + return qtde; | |
29 | + } | |
30 | + public void setQtde(BigDecimal qtde) { | |
31 | + this.qtde = qtde; | |
32 | + } | |
33 | + | |
34 | + public BigDecimal getValorTotal() { | |
35 | + valorTotal = valorUnitario.multiply(qtde); | |
36 | + return valorTotal; | |
37 | + } | |
38 | + public String getCodigo() { | |
39 | + return codigo; | |
40 | + } | |
41 | + | |
42 | + public BigDecimal getValorUnitario() { | |
43 | + return valorUnitario; | |
44 | + } | |
45 | + | |
46 | + public void setValorUnitario(BigDecimal valorUnitario) { | |
47 | + this.valorUnitario = valorUnitario; | |
48 | + } | |
49 | + | |
50 | + @Override | |
51 | + public boolean equals(Object obj) { | |
52 | + return obj != null && obj instanceof BeanSubReportContaContabil ? ((BeanSubReportContaContabil)obj).getCodigo().equals(this.getCodigo()) : false; | |
53 | + } | |
54 | + | |
55 | +} | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/ReportGuiaRemessaAtendimentoConsumoController.java
0 → 100644
... | ... | @@ -0,0 +1,245 @@ |
1 | +package br.com.centralit.controller; | |
2 | + | |
3 | +import java.io.ByteArrayOutputStream; | |
4 | +import java.io.IOException; | |
5 | +import java.io.InputStream; | |
6 | +import java.math.BigDecimal; | |
7 | +import java.sql.SQLException; | |
8 | +import java.util.ArrayList; | |
9 | +import java.util.HashMap; | |
10 | +import java.util.List; | |
11 | +import java.util.Map; | |
12 | + | |
13 | +import javax.servlet.http.HttpServletResponse; | |
14 | + | |
15 | +import net.sf.jasperreports.engine.JRException; | |
16 | +import net.sf.jasperreports.engine.JasperCompileManager; | |
17 | +import net.sf.jasperreports.engine.JasperFillManager; | |
18 | +import net.sf.jasperreports.engine.JasperPrint; | |
19 | +import net.sf.jasperreports.engine.JasperReport; | |
20 | +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; | |
21 | +import net.sf.jasperreports.engine.design.JasperDesign; | |
22 | +import net.sf.jasperreports.engine.xml.JRXmlLoader; | |
23 | + | |
24 | +import org.springframework.beans.factory.annotation.Autowired; | |
25 | +import org.springframework.security.core.context.SecurityContextHolder; | |
26 | +import org.springframework.stereotype.Controller; | |
27 | +import org.springframework.web.bind.annotation.RequestMapping; | |
28 | +import org.springframework.web.bind.annotation.RequestMethod; | |
29 | +import org.springframework.web.bind.annotation.RequestParam; | |
30 | +import org.springframework.web.bind.annotation.ResponseBody; | |
31 | + | |
32 | +import br.com.centralit.api.model.Entrada; | |
33 | +import br.com.centralit.api.service.ConfiguracaoParametroSistemaService; | |
34 | +import br.com.centralit.api.service.ConfiguracaoService; | |
35 | +import br.com.centralit.api.service.DominioService; | |
36 | +import br.com.centralit.api.service.EstruturaOrganizacionalService; | |
37 | +import br.com.centralit.api.service.InternacionalizacaoService; | |
38 | +import br.com.centralit.api.service.RequisicaoConsumoService; | |
39 | +import br.com.centralit.api.service.UsuarioService; | |
40 | +import br.com.centralit.api.viewHelper.BeanReportVH; | |
41 | +import br.com.centralit.framework.controller.GenericController; | |
42 | +import br.com.centralit.framework.controller.ReportController; | |
43 | +import br.com.centralit.framework.exception.BusinessException; | |
44 | +import br.com.centralit.framework.model.Dominio; | |
45 | +import br.com.centralit.framework.model.Usuario; | |
46 | +import br.com.centralit.framework.util.UtilDataBase; | |
47 | +import br.com.centralit.framework.util.UtilObjeto; | |
48 | + | |
49 | +/** | |
50 | + * <p><img src="http://centralit.com.br/images/logo_central.png"></p> | |
51 | + * | |
52 | + * <p><b>Company: </b> Central IT - Governança Corporativa - </p> | |
53 | + * | |
54 | + * @author joyfas.silva - (<a href="mailto:joyfas.silva@centralit.com.br">joyfas.silva@centralit.com.br</a>) | |
55 | + * | |
56 | + */ | |
57 | +@Controller | |
58 | +@RequestMapping("/rest/guiaRemessa") | |
59 | +public class ReportGuiaRemessaAtendimentoConsumoController extends GenericController<Entrada> { | |
60 | + | |
61 | + /** Atributo usuarioService. */ | |
62 | + @Autowired | |
63 | + private UsuarioService usuarioService; | |
64 | + | |
65 | + /** Atributo dominioService. */ | |
66 | + @Autowired | |
67 | + private DominioService dominioService; | |
68 | + | |
69 | + /** Atributo almoxarifadoService. */ | |
70 | + @Autowired | |
71 | + private EstruturaOrganizacionalService estruturaOrganizacionalService; | |
72 | + | |
73 | + /** Atributo internacionalizacaoService. */ | |
74 | + @Autowired | |
75 | + private InternacionalizacaoService internacionalizacaoService; | |
76 | + | |
77 | + @Autowired | |
78 | + private RequisicaoConsumoService requisicaoConsumoService; | |
79 | + | |
80 | + @Autowired | |
81 | + private ConfiguracaoService configuracaoService; | |
82 | + | |
83 | + @Autowired | |
84 | + private ConfiguracaoParametroSistemaService configuracaoParametroSistemaService; | |
85 | + | |
86 | + @Autowired | |
87 | + private ReportController reportController; | |
88 | + | |
89 | + private boolean is_FIFO; | |
90 | + private final String FIFO = "1"; | |
91 | + | |
92 | + /** Atributo idioma. */ | |
93 | + Dominio idioma; | |
94 | + | |
95 | + /** | |
96 | + * Retorna o valor do atributo <code>idioma</code> | |
97 | + * | |
98 | + * @return <code>Dominio</code> | |
99 | + */ | |
100 | + public Dominio getIdioma() { | |
101 | + if(!UtilObjeto.isReferencia(idioma)){ | |
102 | + idioma = this.dominioService.findByChaveAndCodigo("tipoIdioma", Dominio.TIPO_IDIOMA_PT_BR_CODIGO); | |
103 | + } | |
104 | + return idioma; | |
105 | + } | |
106 | + | |
107 | + /** | |
108 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
109 | + * | |
110 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
111 | + * | |
112 | + * Método responsável por | |
113 | + * | |
114 | + * @author joyfas.silva - (<a href="mailto:joyfas.silva@centralit.com.br">joyfas.silva@centralit.com.br</a>) | |
115 | + * | |
116 | + * @param idEstruturaOrganizacional | |
117 | + * @param download | |
118 | + * @param response | |
119 | + * @throws SQLException | |
120 | + * @throws JRException | |
121 | + * @throws IOException | |
122 | + */ | |
123 | + @RequestMapping(method = RequestMethod.GET, value = "/imprimirRelatorio") | |
124 | + @ResponseBody | |
125 | + public void gerarPdfConsumoPorPeriodo(@RequestParam(value = "requisicaoIds", required = false) Long[] requisicaoIds, | |
126 | + @RequestParam(value = "download") boolean download, HttpServletResponse response) throws SQLException, JRException, IOException { | |
127 | + | |
128 | + ByteArrayOutputStream baos = null; | |
129 | + InputStream input = null; | |
130 | + InputStream inputSub = null; | |
131 | + try { | |
132 | + is_FIFO = configuracaoParametroSistemaService.getParametro("TIPO_AVALIACAO_MONETARIA_ESTOQUE").getValor().equals(FIFO); | |
133 | + | |
134 | + Usuario usuarioLogado = (Usuario) usuarioService.find(((Usuario) SecurityContextHolder.getContext().getAuthentication().getPrincipal() ).getId()); | |
135 | + Long organizacaoId = usuarioLogado.getOrganizacao().getId(); | |
136 | + input = this.getClass().getResourceAsStream("/reports/templatePaisagemRepeat.jrxml"); | |
137 | + inputSub = this.getClass().getResourceAsStream("/reports/guiaRemessaAtendimentoConsumoMaterial.jrxml"); | |
138 | + String titulo = this.internacionalizacaoService.getTranslate("ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA", this.getIdioma()); | |
139 | + | |
140 | + JasperDesign jasperDesign = JRXmlLoader.load(input); | |
141 | + JasperDesign jasperDesignSub = JRXmlLoader.load(inputSub); | |
142 | + | |
143 | + JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); | |
144 | + JasperReport jasperReportSub = JasperCompileManager.compileReport(jasperDesignSub); | |
145 | + | |
146 | + Map<String, Object> parameters = new HashMap<String, Object>(); | |
147 | + parameters.put("TITULO", titulo); | |
148 | + parameters.put("SUBREPORT_DIR", jasperReportSub); | |
149 | + | |
150 | + BeanReportVH bean = new BeanReportVH(); | |
151 | + | |
152 | + bean.setLogo(configuracaoService.getConfiguracao(organizacaoId).getAnexoImagem().getAnexo()); | |
153 | + bean.setTitulo1(configuracaoParametroSistemaService.getParametro("RELATORIO_PRIMEIRO_TITULO", organizacaoId).getValor()); | |
154 | + bean.setTitulo2(configuracaoParametroSistemaService.getParametro("RELATORIO_SEGUNDO_TITULO", organizacaoId).getValor()); | |
155 | + bean.setTitulo3(configuracaoParametroSistemaService.getParametro("RELATORIO_TERCEIRO_TITULO", organizacaoId).getValor()); | |
156 | + | |
157 | + List<BeanRequisicaoSubReport> beanReqSubList = new ArrayList<BeanRequisicaoSubReport>(); | |
158 | + | |
159 | + for(Long reqId : requisicaoIds){ | |
160 | + boolean isFinalizada = requisicaoConsumoService.findtipoStatusRequisicaoPorMaterial(reqId).equals("FINALIZADA"); | |
161 | + | |
162 | + BeanRequisicaoSubReport beanSubReport = new BeanRequisicaoSubReport(requisicaoConsumoService.getRequisicaoForReport(reqId)); | |
163 | + beanSubReport.setMateriais(getMateriais(reqId)); | |
164 | + if(isFinalizada) | |
165 | + beanSubReport.setResumoContabil(getResumoContabil(reqId)); | |
166 | + | |
167 | + beanSubReport.setIsAsterisco(!isFinalizada); | |
168 | + | |
169 | + beanReqSubList.add(beanSubReport); | |
170 | + } | |
171 | + | |
172 | + parameters.put("BEAN_SUB_REPORT",new JRBeanCollectionDataSource(beanReqSubList)); | |
173 | + | |
174 | + List<BeanReportVH> beans = new ArrayList<BeanReportVH>(); | |
175 | + beans.add(bean); | |
176 | + JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JRBeanCollectionDataSource(beans)); | |
177 | + | |
178 | + // Responsavel por verificar a presenca de dados no relatorio | |
179 | + reportController.gerarRelatorio(download, "pdf", jasperPrint, response, baos, titulo, true); | |
180 | + | |
181 | + } catch (JRException jre) { | |
182 | + throw new RuntimeException(jre); | |
183 | + } catch (Exception e) { | |
184 | + throw new BusinessException(); | |
185 | + } finally { | |
186 | + UtilDataBase.closeResources(input, inputSub, baos); | |
187 | + } | |
188 | + } | |
189 | + | |
190 | + private JRBeanCollectionDataSource getMateriais(Long requisicaoId){ | |
191 | + List<Object> result; | |
192 | + final List<BeanMaterial> materiais = new ArrayList<BeanMaterial>(); | |
193 | + List<BeanMaterial> materiaisResult = new ArrayList<BeanMaterial>(); | |
194 | + Integer index = 1; | |
195 | + result = requisicaoConsumoService.getMateriaisForReport(requisicaoId,is_FIFO); | |
196 | + | |
197 | + for(Object obj : result) | |
198 | + materiais.add(new BeanMaterial((Object[]) obj)); | |
199 | + | |
200 | + for(BeanMaterial mat : materiais) | |
201 | + if(!materiaisResult.contains(mat)){ | |
202 | + mat.setItem(index++); | |
203 | + materiaisResult.add(mat); | |
204 | + } | |
205 | + | |
206 | + return new JRBeanCollectionDataSource(materiaisResult); | |
207 | + } | |
208 | + | |
209 | + private void calcularFIFOMateriais(final List<BeanMaterial> materiais, BeanMaterial material,BigDecimal qtdFalta) { | |
210 | + for(BeanMaterial mat : materiais) | |
211 | + if(material.getNome().equals(mat.getNome()) && material.getQtdeEstoque().compareTo(mat.getQtdeEstoque()) >=0) | |
212 | + if(mat.getQtdeEstoque().compareTo(qtdFalta) < 0){ | |
213 | + material.setValorUnitario(material.getValorUnitarioBD().add(mat.getValorUnitarioBD())); | |
214 | + material.setValorUnitario(material.getValorUnitarioBD().divide(new BigDecimal(2))); | |
215 | + qtdFalta = qtdFalta.subtract(mat.getQtdeEstoque()); | |
216 | + calcularFIFOMateriais(materiais, material, qtdFalta); | |
217 | + }else{ | |
218 | + material.setValorUnitario(material.getValorUnitarioBD().add(mat.getValorUnitarioBD())); | |
219 | + material.setValorUnitario(material.getValorUnitarioBD().divide(new BigDecimal(2))); | |
220 | + } | |
221 | + | |
222 | + } | |
223 | + | |
224 | + private JRBeanCollectionDataSource getResumoContabil(Long requisicaoId){ | |
225 | + | |
226 | + List<Object> result = requisicaoConsumoService.getResumoContabilForReport(requisicaoId,is_FIFO); | |
227 | + | |
228 | + final List<BeanSubReportContaContabil> contas = new ArrayList<BeanSubReportContaContabil>(); | |
229 | + List<BeanSubReportContaContabil> contasResult = new ArrayList<BeanSubReportContaContabil>(); | |
230 | + | |
231 | + for(Object obj : result) | |
232 | + contas.add(new BeanSubReportContaContabil((Object[])obj)); | |
233 | + BeanSubReportContaContabil temp; | |
234 | + | |
235 | + for(BeanSubReportContaContabil conta : contas) | |
236 | + if(contasResult.contains(conta)){ | |
237 | + temp = contasResult.get(contasResult.size() -1); | |
238 | + temp.setQtde(temp.getQtdeBD().add(conta.getQtdeBD())); | |
239 | + temp.setValorUnitario(temp.getValorUnitario().add(conta.getValorUnitario())); | |
240 | + }else | |
241 | + contasResult.add(conta); | |
242 | + | |
243 | + return contasResult.isEmpty() ? null : new JRBeanCollectionDataSource(contasResult); | |
244 | + } | |
245 | +} | |
0 | 246 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/listener/StartupListenerAlmoxarifado.java
... | ... | @@ -288,7 +288,7 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
288 | 288 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.QUANTIDADE_REQUERIDA", "Quantidade requerida", dominio, modulo)); |
289 | 289 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DADOS_ATENDIMENTO", "Dados do atendimento", dominio, modulo)); |
290 | 290 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.SITUACAO_ESTORNO", "Situação estorno", dominio, modulo)); |
291 | - | |
291 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA", "Guia de remessa", dominio, modulo)); | |
292 | 292 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.VALORUNITARIOMEDIO", "Valor unitário médio", dominio, modulo)); |
293 | 293 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.RESTOMEDIO", "Resto médio", dominio, modulo)); |
294 | 294 | ... | ... |
cit-almoxarifado-web/src/main/resources/reports/guiaRemessaAtendimentoConsumoMaterial.jrxml
0 → 100644
... | ... | @@ -0,0 +1,634 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="guiaRemessa" pageWidth="802" pageHeight="555" orientation="Landscape" columnWidth="802" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="ad8f14cf-4bc6-4008-beb0-a366c90e1c3f"> | |
3 | + <property name="ireport.zoom" value="1.3636363636363635"/> | |
4 | + <property name="ireport.x" value="0"/> | |
5 | + <property name="ireport.y" value="0"/> | |
6 | + <style name="table"> | |
7 | + <box> | |
8 | + <pen lineWidth="1.0" lineColor="#000000"/> | |
9 | + </box> | |
10 | + </style> | |
11 | + <style name="table_TH" mode="Opaque" backcolor="#F0F8FF"> | |
12 | + <box> | |
13 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
14 | + </box> | |
15 | + </style> | |
16 | + <style name="table_CH" mode="Opaque" backcolor="#BFE1FF"> | |
17 | + <box> | |
18 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
19 | + </box> | |
20 | + </style> | |
21 | + <style name="table_TD" mode="Opaque" backcolor="#FFFFFF"> | |
22 | + <box> | |
23 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
24 | + </box> | |
25 | + </style> | |
26 | + <style name="table 1"> | |
27 | + <box> | |
28 | + <pen lineWidth="1.0" lineColor="#000000"/> | |
29 | + </box> | |
30 | + </style> | |
31 | + <style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF"> | |
32 | + <box> | |
33 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
34 | + </box> | |
35 | + </style> | |
36 | + <style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF"> | |
37 | + <box> | |
38 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
39 | + </box> | |
40 | + </style> | |
41 | + <style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF"> | |
42 | + <box> | |
43 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
44 | + </box> | |
45 | + </style> | |
46 | + <style name="table 2"> | |
47 | + <box> | |
48 | + <pen lineWidth="1.0" lineColor="#000000"/> | |
49 | + </box> | |
50 | + </style> | |
51 | + <style name="table 2_TH" mode="Opaque" backcolor="#C3CFD9"> | |
52 | + <box> | |
53 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
54 | + </box> | |
55 | + </style> | |
56 | + <style name="table 2_CH" mode="Opaque" backcolor="#E6F3FF"> | |
57 | + <box> | |
58 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
59 | + </box> | |
60 | + </style> | |
61 | + <style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF"> | |
62 | + <box> | |
63 | + <pen lineWidth="0.5" lineColor="#000000"/> | |
64 | + </box> | |
65 | + </style> | |
66 | + <subDataset name="materiais" uuid="b41cbe9c-3e55-4766-aa1c-a4fd2f482b42"> | |
67 | + <parameter name="is_asterisco" class="java.lang.Boolean"/> | |
68 | + <field name="item" class="java.lang.Integer"/> | |
69 | + <field name="nome" class="java.lang.String"/> | |
70 | + <field name="unidade" class="java.lang.String"/> | |
71 | + <field name="dataValidade" class="java.lang.String"/> | |
72 | + <field name="endereco" class="java.lang.String"/> | |
73 | + <field name="qtdeSolicitada" class="java.lang.Integer"/> | |
74 | + <field name="qtdeFornecida" class="java.lang.Integer"/> | |
75 | + <field name="valorTotal" class="java.lang.String"/> | |
76 | + <field name="valorUnitario" class="java.lang.String"/> | |
77 | + </subDataset> | |
78 | + <subDataset name="resumoContabil" uuid="19bcb161-6822-4c00-aef7-cd1b122f60ba"> | |
79 | + <field name="conta" class="java.lang.String"/> | |
80 | + <field name="qtde" class="java.lang.Integer"/> | |
81 | + <field name="valorTotal" class="java.math.BigDecimal"/> | |
82 | + <variable name="qtdeTotal" class="java.lang.Integer" incrementType="Report" calculation="Sum"> | |
83 | + <variableExpression><![CDATA[$V{qtdeTotal}+$F{qtde}]]></variableExpression> | |
84 | + <initialValueExpression><![CDATA[0]]></initialValueExpression> | |
85 | + </variable> | |
86 | + <variable name="total" class="java.math.BigDecimal" calculation="Sum"> | |
87 | + <variableExpression><![CDATA[$V{total}.add($F{valorTotal})]]></variableExpression> | |
88 | + <initialValueExpression><![CDATA[new BigDecimal(0)]]></initialValueExpression> | |
89 | + </variable> | |
90 | + </subDataset> | |
91 | + <parameter name="idContaContabil" class="java.lang.Long" isForPrompting="false"/> | |
92 | + <parameter name="organizacaoNome" class="java.lang.String" isForPrompting="false"/> | |
93 | + <parameter name="almoxarifado" class="java.lang.String" isForPrompting="false"/> | |
94 | + <parameter name="dataReferenciaAnterior" class="java.util.Date" isForPrompting="false"/> | |
95 | + <parameter name="dataReferencia" class="java.util.Date" isForPrompting="false"/> | |
96 | + <parameter name="idAlmoxarifado" class="java.lang.Long" isForPrompting="false"/> | |
97 | + <parameter name="idsContas" class="java.util.Collection" isForPrompting="false"/> | |
98 | + <parameter name="siglaOrganizacao" class="java.lang.String"/> | |
99 | + <parameter name="codigoOrganizacao" class="java.lang.String"/> | |
100 | + <parameter name="SUBREPORT_GUIA_REMESSA_DIR" class="java.lang.Object"/> | |
101 | + <queryString language="SQL"> | |
102 | + <![CDATA[]]> | |
103 | + </queryString> | |
104 | + <field name="numeroRequisicao" class="java.lang.String"/> | |
105 | + <field name="almoxarifado" class="java.lang.String"/> | |
106 | + <field name="unidadeReq" class="java.lang.String"/> | |
107 | + <field name="enderecoUR" class="java.lang.String"/> | |
108 | + <field name="requisitante" class="java.lang.String"/> | |
109 | + <field name="atendidaPor" class="java.lang.String"/> | |
110 | + <field name="atendidaEm" class="java.lang.String"/> | |
111 | + <field name="cadEm" class="java.lang.String"/> | |
112 | + <field name="centroCustos" class="java.lang.String"/> | |
113 | + <field name="materiais" class="java.lang.Object"/> | |
114 | + <field name="isAsterisco" class="java.lang.Boolean"/> | |
115 | + <field name="resumoContabil" class="java.lang.Object"/> | |
116 | + <variable name="conta_COUNT" class="java.lang.Integer"> | |
117 | + <initialValueExpression><![CDATA[1]]></initialValueExpression> | |
118 | + </variable> | |
119 | + <group name="materiais"> | |
120 | + <groupExpression><![CDATA[$F{resumoContabil}]]></groupExpression> | |
121 | + <groupHeader> | |
122 | + <band height="36"> | |
123 | + <componentElement> | |
124 | + <reportElement key="tableMateriais" style="table 1" x="0" y="0" width="792" height="35" uuid="663710cd-ac4c-4c98-befa-db08105f0c5c"/> | |
125 | + <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> | |
126 | + <datasetRun subDataset="materiais" uuid="4dc261e1-e4b1-4d0b-87fd-854cc68a637f"> | |
127 | + <datasetParameter name="is_asterisco"> | |
128 | + <datasetParameterExpression><![CDATA[$F{isAsterisco}]]></datasetParameterExpression> | |
129 | + </datasetParameter> | |
130 | + <dataSourceExpression><![CDATA[$F{materiais}]]></dataSourceExpression> | |
131 | + </datasetRun> | |
132 | + <jr:column width="30" uuid="32eac3fb-5bb0-47e2-8ac0-1510fe6d3b93"> | |
133 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
134 | + <staticText> | |
135 | + <reportElement x="0" y="0" width="30" height="20" uuid="6a82e4b9-97a3-4deb-9c67-ff34a061c723"/> | |
136 | + <box> | |
137 | + <topPen lineWidth="0.25"/> | |
138 | + <leftPen lineWidth="0.25"/> | |
139 | + <bottomPen lineWidth="0.25"/> | |
140 | + <rightPen lineWidth="0.25"/> | |
141 | + </box> | |
142 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
143 | + <font size="7" isBold="true"/> | |
144 | + </textElement> | |
145 | + <text><![CDATA[Item]]></text> | |
146 | + </staticText> | |
147 | + </jr:columnHeader> | |
148 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
149 | + <textField isBlankWhenNull="true"> | |
150 | + <reportElement x="0" y="0" width="30" height="15" uuid="8f392b5f-0287-426d-8d4d-66ad222cc7c6"/> | |
151 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
152 | + <font size="6"/> | |
153 | + </textElement> | |
154 | + <textFieldExpression><![CDATA[$F{item}]]></textFieldExpression> | |
155 | + </textField> | |
156 | + </jr:detailCell> | |
157 | + </jr:column> | |
158 | + <jr:column width="240" uuid="49d7e8f1-6312-4e39-b7e8-5ff3c9520ef6"> | |
159 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
160 | + <staticText> | |
161 | + <reportElement x="0" y="0" width="240" height="20" uuid="07b3c8c8-6b4c-4b03-b629-2e3626c73d7d"/> | |
162 | + <box> | |
163 | + <topPen lineWidth="0.25"/> | |
164 | + <leftPen lineWidth="0.25"/> | |
165 | + <bottomPen lineWidth="0.25"/> | |
166 | + <rightPen lineWidth="0.25"/> | |
167 | + </box> | |
168 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
169 | + <font size="7" isBold="true"/> | |
170 | + </textElement> | |
171 | + <text><![CDATA[Material]]></text> | |
172 | + </staticText> | |
173 | + </jr:columnHeader> | |
174 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
175 | + <textField isBlankWhenNull="true"> | |
176 | + <reportElement x="0" y="0" width="240" height="15" uuid="3efc718c-fef2-460e-934f-d150c89928d9"/> | |
177 | + <textElement verticalAlignment="Middle"> | |
178 | + <font size="6"/> | |
179 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
180 | + </textElement> | |
181 | + <textFieldExpression><![CDATA[$F{nome}]]></textFieldExpression> | |
182 | + </textField> | |
183 | + </jr:detailCell> | |
184 | + </jr:column> | |
185 | + <jr:column width="35" uuid="af1b98ab-913c-4035-b700-ae6ac7e71f8c"> | |
186 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
187 | + <staticText> | |
188 | + <reportElement x="0" y="0" width="35" height="20" uuid="d4923108-f0db-437c-a10a-16a60e2db1dc"/> | |
189 | + <box> | |
190 | + <topPen lineWidth="0.25"/> | |
191 | + <leftPen lineWidth="0.25"/> | |
192 | + <bottomPen lineWidth="0.25"/> | |
193 | + <rightPen lineWidth="0.25"/> | |
194 | + </box> | |
195 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
196 | + <font size="7" isBold="true"/> | |
197 | + </textElement> | |
198 | + <text><![CDATA[U.M.]]></text> | |
199 | + </staticText> | |
200 | + </jr:columnHeader> | |
201 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
202 | + <textField isBlankWhenNull="true"> | |
203 | + <reportElement x="0" y="0" width="35" height="15" uuid="af268cec-71ab-4745-9eab-3bdee187591f"/> | |
204 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
205 | + <font size="6"/> | |
206 | + </textElement> | |
207 | + <textFieldExpression><![CDATA[$F{unidade}]]></textFieldExpression> | |
208 | + </textField> | |
209 | + </jr:detailCell> | |
210 | + </jr:column> | |
211 | + <jr:column width="50" uuid="9d7c0d4d-9017-4922-b5bd-e194538240bf"> | |
212 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
213 | + <staticText> | |
214 | + <reportElement x="0" y="0" width="50" height="20" uuid="071de778-0f13-4d02-845b-a8b591cf0f2b"/> | |
215 | + <box> | |
216 | + <topPen lineWidth="0.25"/> | |
217 | + <leftPen lineWidth="0.25"/> | |
218 | + <bottomPen lineWidth="0.25"/> | |
219 | + <rightPen lineWidth="0.25"/> | |
220 | + </box> | |
221 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
222 | + <font size="7" isBold="true"/> | |
223 | + </textElement> | |
224 | + <text><![CDATA[Data validade]]></text> | |
225 | + </staticText> | |
226 | + </jr:columnHeader> | |
227 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
228 | + <textField isBlankWhenNull="true"> | |
229 | + <reportElement x="0" y="0" width="50" height="15" uuid="25eefc27-dcea-4276-9bf0-c1a425f8bc94"/> | |
230 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
231 | + <font size="6"/> | |
232 | + </textElement> | |
233 | + <textFieldExpression><![CDATA[$F{dataValidade}]]></textFieldExpression> | |
234 | + </textField> | |
235 | + </jr:detailCell> | |
236 | + </jr:column> | |
237 | + <jr:column width="215" uuid="ae9b8fd9-a3bb-4c4d-a102-5dd4b3c2701c"> | |
238 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
239 | + <staticText> | |
240 | + <reportElement x="0" y="0" width="215" height="20" uuid="6307f0e6-98c7-479a-afd7-5526098b7d5d"/> | |
241 | + <box> | |
242 | + <topPen lineWidth="0.25"/> | |
243 | + <leftPen lineWidth="0.25"/> | |
244 | + <bottomPen lineWidth="0.25"/> | |
245 | + <rightPen lineWidth="0.25"/> | |
246 | + </box> | |
247 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
248 | + <font size="7" isBold="true"/> | |
249 | + </textElement> | |
250 | + <text><![CDATA[Endereço de estoque]]></text> | |
251 | + </staticText> | |
252 | + </jr:columnHeader> | |
253 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
254 | + <textField isBlankWhenNull="true"> | |
255 | + <reportElement x="0" y="0" width="215" height="15" uuid="05c8acc7-057b-40b9-b0ea-670988a4a290"/> | |
256 | + <textElement verticalAlignment="Middle"> | |
257 | + <font size="6"/> | |
258 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
259 | + </textElement> | |
260 | + <textFieldExpression><![CDATA[$F{endereco}]]></textFieldExpression> | |
261 | + </textField> | |
262 | + </jr:detailCell> | |
263 | + </jr:column> | |
264 | + <jr:column width="50" uuid="d6944932-7af7-49b0-b50d-25f864a12426"> | |
265 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
266 | + <staticText> | |
267 | + <reportElement x="0" y="0" width="50" height="20" uuid="6a38d7fe-f724-48d5-882c-0f78397d292e"/> | |
268 | + <box> | |
269 | + <topPen lineWidth="0.25"/> | |
270 | + <leftPen lineWidth="0.25"/> | |
271 | + <bottomPen lineWidth="0.25"/> | |
272 | + <rightPen lineWidth="0.25"/> | |
273 | + </box> | |
274 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
275 | + <font size="7" isBold="true"/> | |
276 | + </textElement> | |
277 | + <text><![CDATA[Qtde. Solicitada]]></text> | |
278 | + </staticText> | |
279 | + </jr:columnHeader> | |
280 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
281 | + <textField isBlankWhenNull="true"> | |
282 | + <reportElement x="0" y="0" width="50" height="15" uuid="9df71db8-615c-4687-8aca-b32fa594d024"/> | |
283 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
284 | + <font size="6"/> | |
285 | + </textElement> | |
286 | + <textFieldExpression><![CDATA[$F{qtdeSolicitada}]]></textFieldExpression> | |
287 | + </textField> | |
288 | + </jr:detailCell> | |
289 | + </jr:column> | |
290 | + <jr:column width="50" uuid="6d8c04d9-a0d0-4b4e-b0e8-20bab6e04581"> | |
291 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
292 | + <staticText> | |
293 | + <reportElement x="0" y="0" width="50" height="20" uuid="bf197c3e-0291-4337-844f-7596439415a3"/> | |
294 | + <box> | |
295 | + <topPen lineWidth="0.25"/> | |
296 | + <leftPen lineWidth="0.25"/> | |
297 | + <bottomPen lineWidth="0.25"/> | |
298 | + <rightPen lineWidth="0.25"/> | |
299 | + </box> | |
300 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
301 | + <font size="7" isBold="true"/> | |
302 | + </textElement> | |
303 | + <text><![CDATA[Qtde. Fornecida]]></text> | |
304 | + </staticText> | |
305 | + </jr:columnHeader> | |
306 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
307 | + <textField isBlankWhenNull="true"> | |
308 | + <reportElement x="0" y="0" width="50" height="15" uuid="91b75ca6-6a5a-4903-a11f-a0800906eb6a"/> | |
309 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
310 | + <font size="6"/> | |
311 | + </textElement> | |
312 | + <textFieldExpression><![CDATA[$F{qtdeFornecida}]]></textFieldExpression> | |
313 | + </textField> | |
314 | + </jr:detailCell> | |
315 | + </jr:column> | |
316 | + <jr:column width="70" uuid="04b2e9e5-8727-4d8c-b587-b5877584771a"> | |
317 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
318 | + <textField isBlankWhenNull="true"> | |
319 | + <reportElement x="0" y="0" width="70" height="20" uuid="d3204721-2c8f-4b99-9450-70a37ab78679"/> | |
320 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
321 | + <font size="7" isBold="true"/> | |
322 | + </textElement> | |
323 | + <textFieldExpression><![CDATA[($P{is_asterisco} ? "* " : "")+"Preço Unitário"]]></textFieldExpression> | |
324 | + </textField> | |
325 | + </jr:columnHeader> | |
326 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
327 | + <textField isBlankWhenNull="true"> | |
328 | + <reportElement x="0" y="0" width="70" height="15" uuid="4d95e71b-73a7-4e94-be39-57451e9e8bab"/> | |
329 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
330 | + <font size="6"/> | |
331 | + </textElement> | |
332 | + <textFieldExpression><![CDATA[$F{valorUnitario}]]></textFieldExpression> | |
333 | + </textField> | |
334 | + </jr:detailCell> | |
335 | + </jr:column> | |
336 | + <jr:column width="70" uuid="0c419f29-aeb5-4812-ae92-e8e864d4b849"> | |
337 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
338 | + <textField isBlankWhenNull="true"> | |
339 | + <reportElement x="0" y="0" width="70" height="20" uuid="989b5504-7203-4adb-830e-c2a96f9222e7"/> | |
340 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
341 | + <font size="7" isBold="true"/> | |
342 | + </textElement> | |
343 | + <textFieldExpression><![CDATA[($P{is_asterisco} ? "* " : "")+"Preço Total"]]></textFieldExpression> | |
344 | + </textField> | |
345 | + </jr:columnHeader> | |
346 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
347 | + <textField isBlankWhenNull="true"> | |
348 | + <reportElement x="0" y="0" width="70" height="15" uuid="9e154b4d-b942-4dba-bfc9-b35e739b1b4b"/> | |
349 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
350 | + <font size="6"/> | |
351 | + </textElement> | |
352 | + <textFieldExpression><![CDATA[$F{valorTotal}]]></textFieldExpression> | |
353 | + </textField> | |
354 | + </jr:detailCell> | |
355 | + </jr:column> | |
356 | + </jr:table> | |
357 | + </componentElement> | |
358 | + </band> | |
359 | + </groupHeader> | |
360 | + </group> | |
361 | + <group name="resumoContabil"> | |
362 | + <groupHeader> | |
363 | + <band height="33"> | |
364 | + <staticText> | |
365 | + <reportElement x="0" y="10" width="792" height="20" uuid="044fb4cf-5b85-485e-9a98-20bcd9832b67"> | |
366 | + <printWhenExpression><![CDATA[$F{isAsterisco}]]></printWhenExpression> | |
367 | + </reportElement> | |
368 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
369 | + <font size="8" isBold="true"/> | |
370 | + </textElement> | |
371 | + <text><![CDATA[Obs.: Os campos destacados com asterisco (*) calculados com base nos valores dos materiais existentes no estoque no momento da emissão.]]></text> | |
372 | + </staticText> | |
373 | + </band> | |
374 | + </groupHeader> | |
375 | + </group> | |
376 | + <pageHeader> | |
377 | + <band height="135" splitType="Stretch"> | |
378 | + <staticText> | |
379 | + <reportElement x="0" y="0" width="100" height="20" uuid="87057140-c4e0-4c73-81eb-700716699a0f"/> | |
380 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
381 | + <font size="8" isBold="true"/> | |
382 | + </textElement> | |
383 | + <text><![CDATA[Nº da Requisição:]]></text> | |
384 | + </staticText> | |
385 | + <staticText> | |
386 | + <reportElement x="0" y="20" width="100" height="20" uuid="f5bc98b8-399c-4ea6-b192-51dbf6f7d7e9"/> | |
387 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
388 | + <font size="8" isBold="true"/> | |
389 | + </textElement> | |
390 | + <text><![CDATA[Almoxarifado:]]></text> | |
391 | + </staticText> | |
392 | + <staticText> | |
393 | + <reportElement x="0" y="40" width="100" height="20" uuid="85307cfd-f956-4534-b35b-e5869934c654"/> | |
394 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
395 | + <font size="8" isBold="true"/> | |
396 | + </textElement> | |
397 | + <text><![CDATA[Unidade Requisitante:]]></text> | |
398 | + </staticText> | |
399 | + <staticText> | |
400 | + <reportElement x="0" y="80" width="100" height="20" uuid="2ffa5bcc-8da7-4e3d-aadc-82d094e263b4"/> | |
401 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
402 | + <font size="8" isBold="true"/> | |
403 | + </textElement> | |
404 | + <text><![CDATA[Requisitante:]]></text> | |
405 | + </staticText> | |
406 | + <staticText> | |
407 | + <reportElement x="0" y="60" width="100" height="20" uuid="3cf88e36-304b-4cc3-a275-ebfa63482260"/> | |
408 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
409 | + <font size="8" isBold="true"/> | |
410 | + </textElement> | |
411 | + <text><![CDATA[Endereço UR:]]></text> | |
412 | + </staticText> | |
413 | + <staticText> | |
414 | + <reportElement x="0" y="100" width="100" height="20" uuid="5fb694fb-75f2-4234-9726-80e93be059ee"/> | |
415 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
416 | + <font size="8" isBold="true"/> | |
417 | + </textElement> | |
418 | + <text><![CDATA[Atendida por:]]></text> | |
419 | + </staticText> | |
420 | + <staticText> | |
421 | + <reportElement x="502" y="80" width="100" height="20" uuid="cadf4f2e-5bca-4ee8-ba0d-c3b148ceac37"/> | |
422 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
423 | + <font size="8" isBold="true"/> | |
424 | + </textElement> | |
425 | + <text><![CDATA[Cadastrada em:]]></text> | |
426 | + </staticText> | |
427 | + <staticText> | |
428 | + <reportElement x="502" y="100" width="100" height="20" uuid="9555e22c-a226-48c1-bf77-388dcffe28e7"/> | |
429 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
430 | + <font size="8" isBold="true"/> | |
431 | + </textElement> | |
432 | + <text><![CDATA[Atendida em:]]></text> | |
433 | + </staticText> | |
434 | + <staticText> | |
435 | + <reportElement x="502" y="20" width="100" height="20" uuid="4efb31d9-0a78-4a73-b42c-274eb16f8d20"/> | |
436 | + <textElement textAlignment="Left" verticalAlignment="Middle"> | |
437 | + <font size="8" isBold="true"/> | |
438 | + </textElement> | |
439 | + <text><![CDATA[Centro de Custos:]]></text> | |
440 | + </staticText> | |
441 | + <textField> | |
442 | + <reportElement x="100" y="0" width="350" height="20" uuid="97371b67-bccf-4f59-aa9c-b25a1279d267"/> | |
443 | + <textElement verticalAlignment="Middle"> | |
444 | + <font size="7"/> | |
445 | + </textElement> | |
446 | + <textFieldExpression><![CDATA[$F{numeroRequisicao}]]></textFieldExpression> | |
447 | + </textField> | |
448 | + <textField isBlankWhenNull="false"> | |
449 | + <reportElement x="100" y="40" width="350" height="20" uuid="397711d6-6cee-4c2a-8727-5fc982811989"/> | |
450 | + <textElement verticalAlignment="Middle"> | |
451 | + <font size="7"/> | |
452 | + </textElement> | |
453 | + <textFieldExpression><![CDATA[$F{unidadeReq}]]></textFieldExpression> | |
454 | + </textField> | |
455 | + <textField isBlankWhenNull="true"> | |
456 | + <reportElement x="100" y="20" width="350" height="20" uuid="10275748-fd7e-4ce2-b633-5fd91f05bb7c"/> | |
457 | + <textElement verticalAlignment="Middle"> | |
458 | + <font size="7"/> | |
459 | + </textElement> | |
460 | + <textFieldExpression><![CDATA[$F{almoxarifado}]]></textFieldExpression> | |
461 | + </textField> | |
462 | + <textField isBlankWhenNull="false"> | |
463 | + <reportElement x="100" y="60" width="350" height="20" uuid="a1b593d3-7e8b-429a-bef4-2825da1973c1"/> | |
464 | + <textElement verticalAlignment="Middle"> | |
465 | + <font size="7"/> | |
466 | + </textElement> | |
467 | + <textFieldExpression><![CDATA[$F{enderecoUR}]]></textFieldExpression> | |
468 | + </textField> | |
469 | + <textField isBlankWhenNull="true"> | |
470 | + <reportElement x="100" y="80" width="350" height="20" uuid="e3006bfa-12ea-4521-a4c8-077e649035cd"/> | |
471 | + <textElement verticalAlignment="Middle"> | |
472 | + <font size="7"/> | |
473 | + </textElement> | |
474 | + <textFieldExpression><![CDATA[$F{requisitante}]]></textFieldExpression> | |
475 | + </textField> | |
476 | + <textField isBlankWhenNull="true"> | |
477 | + <reportElement x="100" y="100" width="350" height="20" uuid="7a3d51bd-bcf4-4b30-b071-8bff41b5974f"/> | |
478 | + <textElement verticalAlignment="Middle"> | |
479 | + <font size="7"/> | |
480 | + </textElement> | |
481 | + <textFieldExpression><![CDATA[$F{atendidaPor}]]></textFieldExpression> | |
482 | + </textField> | |
483 | + <textField isBlankWhenNull="true"> | |
484 | + <reportElement x="602" y="20" width="129" height="20" uuid="5705a304-10df-4b44-aaed-ca21ddb25a01"/> | |
485 | + <textElement verticalAlignment="Middle"> | |
486 | + <font size="7"/> | |
487 | + </textElement> | |
488 | + <textFieldExpression><![CDATA[$F{centroCustos}]]></textFieldExpression> | |
489 | + </textField> | |
490 | + <textField isBlankWhenNull="true"> | |
491 | + <reportElement x="602" y="80" width="129" height="20" uuid="56af897a-6f5e-41e1-839f-f89a8774bec7"/> | |
492 | + <textElement verticalAlignment="Middle"> | |
493 | + <font size="7"/> | |
494 | + </textElement> | |
495 | + <textFieldExpression><![CDATA[$F{cadEm}]]></textFieldExpression> | |
496 | + </textField> | |
497 | + <textField isBlankWhenNull="true"> | |
498 | + <reportElement x="602" y="100" width="129" height="20" uuid="91f7b413-be6f-4ee9-968f-1322e9a9d70f"/> | |
499 | + <textElement verticalAlignment="Middle"> | |
500 | + <font size="7"/> | |
501 | + </textElement> | |
502 | + <textFieldExpression><![CDATA[$F{atendidaEm}]]></textFieldExpression> | |
503 | + </textField> | |
504 | + </band> | |
505 | + </pageHeader> | |
506 | + <detail> | |
507 | + <band height="35"> | |
508 | + <componentElement> | |
509 | + <reportElement key="tableReqConsumo" x="0" y="0" width="792" height="35" uuid="65880be5-7337-44c9-a237-b2e3763d6486"> | |
510 | + <printWhenExpression><![CDATA[$F{resumoContabil} != null]]></printWhenExpression> | |
511 | + </reportElement> | |
512 | + <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> | |
513 | + <datasetRun subDataset="resumoContabil" uuid="dd0fb9e3-744d-4899-b809-621ff05e9a14"> | |
514 | + <dataSourceExpression><![CDATA[$F{resumoContabil}]]></dataSourceExpression> | |
515 | + </datasetRun> | |
516 | + <jr:column width="620" uuid="cce1ea6a-ea5e-43d0-84a3-37aff9de55dc"> | |
517 | + <jr:tableHeader height="20" rowSpan="1"> | |
518 | + <staticText> | |
519 | + <reportElement x="0" y="0" width="620" height="20" uuid="df40478a-bd91-4c6d-8d00-ebce15910536"/> | |
520 | + <textElement textAlignment="Right" verticalAlignment="Middle"> | |
521 | + <font size="8" isBold="true"/> | |
522 | + <paragraph rightIndent="20"/> | |
523 | + </textElement> | |
524 | + <text><![CDATA[Resumo Contábil]]></text> | |
525 | + </staticText> | |
526 | + </jr:tableHeader> | |
527 | + <jr:tableFooter height="20" rowSpan="1"> | |
528 | + <staticText> | |
529 | + <reportElement x="0" y="0" width="620" height="20" uuid="786957a5-30dc-46c8-b5e1-5ae33c35c5c6"/> | |
530 | + <textElement textAlignment="Right" verticalAlignment="Middle"> | |
531 | + <font size="7" isBold="true"/> | |
532 | + <paragraph rightIndent="20"/> | |
533 | + </textElement> | |
534 | + <text><![CDATA[Total:]]></text> | |
535 | + </staticText> | |
536 | + </jr:tableFooter> | |
537 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
538 | + <staticText> | |
539 | + <reportElement x="0" y="0" width="620" height="20" uuid="2b77dbbf-8f25-4a06-816b-89555e84ed7f"/> | |
540 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
541 | + <font size="7" isBold="true"/> | |
542 | + </textElement> | |
543 | + <text><![CDATA[Conta]]></text> | |
544 | + </staticText> | |
545 | + </jr:columnHeader> | |
546 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
547 | + <textField isBlankWhenNull="false"> | |
548 | + <reportElement x="0" y="0" width="620" height="15" uuid="bd3664f4-2ef4-43e5-91e0-ae4c59c351e4"/> | |
549 | + <textElement verticalAlignment="Middle"> | |
550 | + <font size="6"/> | |
551 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
552 | + </textElement> | |
553 | + <textFieldExpression><![CDATA[$F{conta}]]></textFieldExpression> | |
554 | + </textField> | |
555 | + </jr:detailCell> | |
556 | + </jr:column> | |
557 | + <jr:column width="90" uuid="8cc2e90c-eea0-464a-b96a-b867f0c5951b"> | |
558 | + <jr:tableFooter height="20" rowSpan="1"> | |
559 | + <textField isBlankWhenNull="false"> | |
560 | + <reportElement x="0" y="0" width="90" height="20" uuid="ce82fcaf-5986-45f6-a460-ff6aa53d7aad"/> | |
561 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
562 | + <font size="7" isBold="true"/> | |
563 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
564 | + </textElement> | |
565 | + <textFieldExpression><![CDATA[$V{qtdeTotal}]]></textFieldExpression> | |
566 | + </textField> | |
567 | + </jr:tableFooter> | |
568 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
569 | + <staticText> | |
570 | + <reportElement x="0" y="0" width="90" height="20" uuid="52599d8d-8cdd-44e2-aef4-6fbbce24d92c"/> | |
571 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
572 | + <font size="7" isBold="true"/> | |
573 | + </textElement> | |
574 | + <text><![CDATA[Qtde. Fornecidda]]></text> | |
575 | + </staticText> | |
576 | + </jr:columnHeader> | |
577 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
578 | + <textField isBlankWhenNull="false"> | |
579 | + <reportElement x="0" y="0" width="90" height="15" uuid="95659977-c871-4394-b21c-95946d6b7fe5"/> | |
580 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
581 | + <font size="6"/> | |
582 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
583 | + </textElement> | |
584 | + <textFieldExpression><![CDATA[$F{qtde}]]></textFieldExpression> | |
585 | + </textField> | |
586 | + </jr:detailCell> | |
587 | + </jr:column> | |
588 | + <jr:column width="100" uuid="a068dbe5-4914-4bb5-8179-d3a398d0e1f4"> | |
589 | + <jr:tableFooter height="20" rowSpan="1"> | |
590 | + <textField pattern="¤ #,##0.00" isBlankWhenNull="false"> | |
591 | + <reportElement x="0" y="0" width="100" height="20" uuid="544e5550-889a-40ef-8bdf-79bc1d3eb604"/> | |
592 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
593 | + <font size="7" isBold="true"/> | |
594 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
595 | + </textElement> | |
596 | + <textFieldExpression><![CDATA[$V{total}.add( $F{valorTotal} )]]></textFieldExpression> | |
597 | + </textField> | |
598 | + </jr:tableFooter> | |
599 | + <jr:columnHeader style="table 1" height="20" rowSpan="1"> | |
600 | + <staticText> | |
601 | + <reportElement x="0" y="0" width="100" height="20" uuid="6b40bbc3-2e03-4680-b985-d8a6f14852e4"/> | |
602 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
603 | + <font size="7" isBold="true"/> | |
604 | + </textElement> | |
605 | + <text><![CDATA[Preço Total]]></text> | |
606 | + </staticText> | |
607 | + </jr:columnHeader> | |
608 | + <jr:detailCell style="table 1" height="15" rowSpan="1"> | |
609 | + <textField pattern="¤ #,##0.00" isBlankWhenNull="false"> | |
610 | + <reportElement x="0" y="0" width="100" height="15" uuid="c39c96e3-153e-480f-98ee-4cc47a654598"/> | |
611 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
612 | + <font size="6"/> | |
613 | + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/> | |
614 | + </textElement> | |
615 | + <textFieldExpression><![CDATA[$F{valorTotal}]]></textFieldExpression> | |
616 | + </textField> | |
617 | + </jr:detailCell> | |
618 | + </jr:column> | |
619 | + </jr:table> | |
620 | + </componentElement> | |
621 | + </band> | |
622 | + </detail> | |
623 | + <noData> | |
624 | + <band height="23"> | |
625 | + <staticText> | |
626 | + <reportElement x="0" y="0" width="802" height="20" uuid="6231a352-8cc9-4707-94df-02bc89aae8dd"/> | |
627 | + <textElement textAlignment="Center" verticalAlignment="Middle"> | |
628 | + <font isBold="true"/> | |
629 | + </textElement> | |
630 | + <text><![CDATA[Seção vazia]]></text> | |
631 | + </staticText> | |
632 | + </band> | |
633 | + </noData> | |
634 | +</jasperReport> | ... | ... |
cit-almoxarifado-web/src/main/resources/reports/templatePaisagemRepeat.jrxml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | -<!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2 --> | |
3 | -<!-- 2016-05-12T11:39:19 --> | |
4 | 2 | <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="templatePaisagem" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2a9bde7e-349d-4f0b-b96c-98310606be6f"> |
5 | - <property name="ireport.zoom" value="1.8150000000000004"/> | |
3 | + <property name="ireport.zoom" value="1.6500000000000004"/> | |
6 | 4 | <property name="ireport.x" value="0"/> |
7 | 5 | <property name="ireport.y" value="0"/> |
8 | 6 | <parameter name="ORGANIZACAO_ID" class="java.lang.Long" isForPrompting="false"> |
... | ... | @@ -15,6 +13,7 @@ |
15 | 13 | <parameterDescription><![CDATA[Parametros do SubReport]]></parameterDescription> |
16 | 14 | </parameter> |
17 | 15 | <parameter name="TITULO" class="java.lang.String"/> |
16 | + <parameter name="BEAN_SUB_REPORT" class="java.lang.Object"/> | |
18 | 17 | <queryString> |
19 | 18 | <![CDATA[select aImagem.anexo as logo, |
20 | 19 | (select param.valor from configuracaoparametrosistema param where param.configuracao_id = conf.id and param.chave = 'RELATORIO_PRIMEIRO_TITULO') as titulo1, |
... | ... | @@ -71,12 +70,22 @@ from anexoimagem aImagem right join configuracao conf on aImagem.configuracao_id |
71 | 70 | <detail> |
72 | 71 | <band height="53"> |
73 | 72 | <subreport> |
74 | - <reportElement positionType="Float" x="0" y="0" width="802" height="53" uuid="f31a4070-ef73-4065-aee8-7cea1e4d1ada"/> | |
73 | + <reportElement positionType="Float" x="0" y="0" width="802" height="53" uuid="f31a4070-ef73-4065-aee8-7cea1e4d1ada"> | |
74 | + <printWhenExpression><![CDATA[$P{REPORT_CONNECTION} != null]]></printWhenExpression> | |
75 | + </reportElement> | |
75 | 76 | <parametersMapExpression><![CDATA[$P{SUBREPORT_PARAMETERS_MAP}]]></parametersMapExpression> |
76 | 77 | <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> |
77 | 78 | <subreportExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportExpression> |
78 | 79 | </subreport> |
79 | 80 | </band> |
81 | + <band height="53"> | |
82 | + <subreport> | |
83 | + <reportElement positionType="Float" x="0" y="0" width="802" height="53" uuid="f31a4070-ef73-4065-aee8-7cea1e4d1ada"/> | |
84 | + <parametersMapExpression><![CDATA[$P{SUBREPORT_PARAMETERS_MAP}]]></parametersMapExpression> | |
85 | + <dataSourceExpression><![CDATA[$P{BEAN_SUB_REPORT}]]></dataSourceExpression> | |
86 | + <subreportExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportExpression> | |
87 | + </subreport> | |
88 | + </band> | |
80 | 89 | </detail> |
81 | 90 | <columnFooter> |
82 | 91 | <band height="50"/> | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/AtendimentoRequisicaoConsumoListController.js
... | ... | @@ -87,5 +87,27 @@ citApp.controller('AtendimentoRequisicaoConsumoListController', ['$scope', 'Aten |
87 | 87 | $scope.iniciarAtendimento = function(){ |
88 | 88 | angular.element('#editAtendimentoRequisicaoConsumo').scope().prepararAtendimentoRequisicoes($scope.listaSelecionados); |
89 | 89 | }; |
90 | + | |
91 | + //METODO REFERENTE AO RELATORIO | |
92 | + $scope.gerar = function() { | |
93 | + | |
94 | + if($scope.listaSelecionados.length == 0 || $scope.listaSelecionados.length > 1) | |
95 | + $scope.showAlert("warning", $translate.instant("MSG.SELECIONE_UM_ITEM_PARA_RELATORIO") + " ", false ); | |
96 | + else{ | |
97 | + var ids = ''; | |
98 | + for(var i=0 ; i < $scope.listaSelecionados.length ; i++){ | |
99 | + ids += $scope.listaSelecionados[i].id; | |
100 | + if(i < ($scope.listaSelecionados.length -1)) | |
101 | + ids +=','; | |
102 | + } | |
103 | + | |
104 | + | |
105 | + ids = ids.split(','); | |
106 | + | |
107 | + $scope.url = '/cit-almoxarifado-web/rest/guiaRemessa/imprimirRelatorio?requisicaoIds='+ ids; | |
108 | + | |
109 | + $scope.visualizarRelatorio($scope.url, $translate.instant("ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA")); | |
110 | + } | |
111 | + }; | |
90 | 112 | |
91 | 113 | }]); |
92 | 114 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/RequisicaoConsumoListController.js
... | ... | @@ -80,5 +80,21 @@ citApp.controller('RequisicaoConsumoListController', ['$scope', 'RequisicaoConsu |
80 | 80 | } |
81 | 81 | |
82 | 82 | }; |
83 | + | |
84 | + //METODO REFERENTE AO RELATORIO | |
85 | + $scope.gerar = function() { | |
86 | + | |
87 | + if(!$scope.requisicaoConsumoChecked){ | |
88 | + | |
89 | + $scope.showAlert("warning", $translate.instant("MSG.SELECIONE_UM_ITEM_PARA_RELATORIO") + " ", false ); | |
90 | + | |
91 | + } else{ | |
92 | + | |
93 | + $scope.url = '/cit-almoxarifado-web/rest/guiaRemessa/imprimirRelatorio?requisicaoIds='+ $scope.requisicaoConsumoChecked.id; | |
94 | + | |
95 | + $scope.visualizarRelatorio($scope.url, $translate.instant("ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA")); | |
96 | + | |
97 | + } | |
98 | + }; | |
83 | 99 | |
84 | 100 | }]); |
85 | 101 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/atendimentoRequisicaoConsumoList.html
... | ... | @@ -8,6 +8,14 @@ |
8 | 8 | <translate>ALMOXARIFADO.LABEL.INICIAR_ATENDIMENTO</translate> |
9 | 9 | </button> |
10 | 10 | |
11 | + <button title="{{$translate.instant('ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA')}}" | |
12 | + alt="{{$translate.instant('ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA')}}" | |
13 | + class="btn btn-clear" type="button" ng-disabled="false" | |
14 | + ng-click="gerar();"> | |
15 | + <i class="fa fa-print"></i> | |
16 | + <translate>ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA</translate> | |
17 | + </button> | |
18 | + | |
11 | 19 | <button ng-show="listaSelecionados.length == 1" class="btn btn-clear" ng-click="abrirVisualizar(false);"> |
12 | 20 | <i class="fa fa-search blue"></i> |
13 | 21 | <translate>LABEL.VISUALIZAR</translate> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/requisicaoConsumo/requisicaoConsumoList.html
... | ... | @@ -23,6 +23,14 @@ |
23 | 23 | <translate>LABEL.REMOVER</translate> |
24 | 24 | </button> |
25 | 25 | |
26 | + <button title="{{$translate.instant('ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA')}}" | |
27 | + alt="{{$translate.instant('ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA')}}" | |
28 | + class="btn btn-clear" type="button" ng-disabled="false" | |
29 | + ng-click="gerar();"> | |
30 | + <i class="fa fa-print"></i> | |
31 | + <translate>ALMOXARIFADO.LABEL.RELATORIO_GUIA_REMESSA</translate> | |
32 | + </button> | |
33 | + | |
26 | 34 | <span class="divider-vertical"></span> |
27 | 35 | |
28 | 36 | <filtros ng-filter="filterCriteria" ng-workspace="workspace"></filtros> | ... | ... |