Commit abc8e5fec305ad2a66c0a5e91d7d6627f0aa70a8
1 parent
92e60813
Exists in
master
redmine #2040 finalizacao relatorio com correcoes de labels
Showing
7 changed files
with
74 additions
and
91 deletions
Show diff stats
citgrp-patrimonio-api/src/main/java/br/com/centralit/api/dao/impl/BemPatrimonialDaoHibernate.java
citgrp-patrimonio-api/src/main/java/br/com/centralit/api/service/impl/TermoResponsabilidadeServiceImpl.java
... | ... | @@ -165,35 +165,16 @@ public class TermoResponsabilidadeServiceImpl extends GenericServiceImpl<TermoRe |
165 | 165 | @Override |
166 | 166 | public TermoResponsabilidade salvarTermoResponsabilidadeUnidade(Long idEstrurtura) { |
167 | 167 | |
168 | - EstruturaOrganizacional estruturaOrganizacional = this.estruturaOrganizacionalService.getReference(idEstrurtura); | |
169 | - | |
170 | - if (UtilObjeto.isReferencia(estruturaOrganizacional)) { | |
171 | - | |
172 | - if (this.bemPatrimonialService.existeBemPatrimonialPorEstrutura(estruturaOrganizacional.getId())) { | |
173 | - | |
174 | - // Garante a data da operacao para data emissão. | |
175 | - Calendar dataEmissao = Calendar.getInstance(); | |
176 | - TermoResponsabilidade termoResponsabilidade = new TermoResponsabilidade(); | |
177 | - termoResponsabilidade.setDataEmissao(dataEmissao); | |
178 | - termoResponsabilidade.setEstruturaOrganizacionalRequisitante(estruturaOrganizacional); | |
179 | - termoResponsabilidade.setDominioTipoMovimentacao(this.dominioService.findByChaveAndCodigo(Dominio.TIPO_MOVIMENTACAO, Dominio.TIPO_MOVIMENTACAO_UNIDADE)); | |
180 | - this.configurarNumeroTermo(termoResponsabilidade); | |
181 | - | |
182 | - TermoResponsabilidade entitySaved = super.save(termoResponsabilidade); | |
183 | - //entitySaved.setNumeroTermo(Long.valueOf(entitySaved.getId().toString().hashCode())); | |
184 | - return entitySaved; | |
185 | - | |
186 | - } else { | |
187 | - | |
188 | - throw new BusinessException("PATRIMONIO.MSG.ESTRUTURA_ORGANIZACIONA_NAO_POSSUI_BEM_PATRMINONIAL", CodigoErro.REGRA_NEGOCIO.getValue()); | |
189 | - | |
190 | - } | |
191 | - | |
192 | - } else { | |
193 | - | |
194 | - throw new BusinessException("PATRIMONIO.MSG.ESTRUTURA_PARA_O_TERMO_NAO_ENCONTRADA", CodigoErro.REGRA_NEGOCIO.getValue()); | |
195 | - | |
196 | - } | |
168 | + // Garante a data da operacao para data emissão. | |
169 | + Calendar dataEmissao = Calendar.getInstance(); | |
170 | + TermoResponsabilidade termoResponsabilidade = new TermoResponsabilidade(); | |
171 | + termoResponsabilidade.setDataEmissao(dataEmissao); | |
172 | + termoResponsabilidade.setEstruturaOrganizacionalRequisitante(this.estruturaOrganizacionalService.getReference(idEstrurtura)); | |
173 | + termoResponsabilidade.setDominioTipoMovimentacao(this.dominioService.findByChaveAndCodigo(Dominio.TIPO_MOVIMENTACAO, Dominio.TIPO_MOVIMENTACAO_UNIDADE)); | |
174 | + this.configurarNumeroTermo(termoResponsabilidade); | |
175 | + | |
176 | + TermoResponsabilidade entitySaved = super.save(termoResponsabilidade); | |
177 | + return entitySaved; | |
197 | 178 | } |
198 | 179 | |
199 | 180 | /** | ... | ... |
citgrp-patrimonio-api/src/main/java/br/com/centralit/api/service/validation/EntradaAllValidator.java
... | ... | @@ -123,7 +123,7 @@ public class EntradaAllValidator implements Validator { |
123 | 123 | |
124 | 124 | if (UtilColecao.isVazio(entrada.getDocumentos())) { |
125 | 125 | |
126 | - errors.rejectValue("documentos", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.ASSOCIAR_DOCUMENTOS"); | |
126 | + errors.rejectValue("documentos", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CORPORATIVO.LABEL.ASSOCIAR_DOCUMENTOS"); | |
127 | 127 | } |
128 | 128 | |
129 | 129 | BigDecimal valorTotalItens = new BigDecimal(0L); |
... | ... | @@ -142,7 +142,7 @@ public class EntradaAllValidator implements Validator { |
142 | 142 | // verificar se os valores da nota e da soma dos itens sao iguais, caso nao seja e lançada uma exceção |
143 | 143 | if (UtilObjeto.isReferencia(entrada.getValorTotalNota()) && valorTotalItens.compareTo(entrada.getValorTotalNota())!=0) { |
144 | 144 | |
145 | - errors.rejectValue("valorTotalNota", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "VALIDACAO.NOTA_FISCAL_IGUAL_VALOR_INFORMADO"); | |
145 | + errors.rejectValue("valorTotalNota", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "ALMOXARIFADO.VALIDACAO.NOTA_FISCAL_IGUAL_VALOR_INFORMADO"); | |
146 | 146 | } |
147 | 147 | } |
148 | 148 | } | ... | ... |
citgrp-patrimonio-web/src/main/java/br/com/centralit/controller/ReportTermoResponsabilidadeController.java
... | ... | @@ -5,6 +5,7 @@ import java.io.IOException; |
5 | 5 | import java.io.InputStream; |
6 | 6 | import java.sql.Connection; |
7 | 7 | import java.sql.SQLException; |
8 | +import java.text.SimpleDateFormat; | |
8 | 9 | import java.util.Date; |
9 | 10 | import java.util.HashMap; |
10 | 11 | import java.util.Map; |
... | ... | @@ -38,6 +39,7 @@ import br.com.centralit.framework.exception.BusinessException; |
38 | 39 | import br.com.centralit.framework.model.Dominio; |
39 | 40 | import br.com.centralit.framework.model.Usuario; |
40 | 41 | import br.com.centralit.framework.util.UtilDataBase; |
42 | +import br.com.centralit.framework.util.UtilDate; | |
41 | 43 | import br.com.centralit.framework.util.UtilObjeto; |
42 | 44 | |
43 | 45 | /** |
... | ... | @@ -182,16 +184,10 @@ public class ReportTermoResponsabilidadeController extends GenericController<Bem |
182 | 184 | parameters.put("SUBREPORT_PARAMETERS_MAP", subReportParameters); |
183 | 185 | parameters.put("REPORT_CONNECTION", conn); |
184 | 186 | parameters.put("idUL",idUL); |
185 | - Date dataReferenciaInicial = new Date(dataReferencia.getYear(), dataReferencia.getMonth(), dataReferencia.getDate()); | |
186 | - dataReferenciaInicial.setHours(23); | |
187 | - dataReferenciaInicial.setMinutes(59); | |
188 | - dataReferenciaInicial.setSeconds(58); | |
189 | - Date dataReferenciaFinal = new Date(dataReferencia.getYear(), dataReferencia.getMonth(), dataReferencia.getDate()); | |
190 | - dataReferenciaFinal.setHours(0); | |
191 | - dataReferenciaFinal.setMinutes(0); | |
192 | - dataReferenciaFinal.setSeconds(0); | |
193 | - parameters.put("dataReferenciaInicial",dataReferenciaInicial); | |
194 | - parameters.put("dataReferenciaFinal",dataReferenciaFinal); | |
187 | + parameters.put("diaReferencia", new SimpleDateFormat("dd").format(dataReferencia)); | |
188 | + parameters.put("mesReferencia", new SimpleDateFormat("MM").format(dataReferencia)); | |
189 | + parameters.put("anoReferencia", new SimpleDateFormat("yyyy").format(dataReferencia)); | |
190 | + parameters.put("dataReferencia", UtilDate.getDataSemHorasString(dataReferencia)); | |
195 | 191 | |
196 | 192 | JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn); |
197 | 193 | ... | ... |
citgrp-patrimonio-web/src/main/resources/reports/termoResponsabilidadeUnidade.jrxml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 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="termoTransferencia" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="20" bottomMargin="20" uuid="0c479051-3a36-4140-9683-aff6988775ce"> |
3 | - <property name="ireport.zoom" value="1.5"/> | |
4 | - <property name="ireport.x" value="0"/> | |
5 | - <property name="ireport.y" value="162"/> | |
3 | + <property name="ireport.zoom" value="3.0"/> | |
4 | + <property name="ireport.x" value="588"/> | |
5 | + <property name="ireport.y" value="1567"/> | |
6 | 6 | <parameter name="SUBREPORT_CABECALHO_DIR" class="java.lang.Object"/> |
7 | 7 | <parameter name="SUBREPORT_PARAMETERS_MAP" class="java.util.Map"/> |
8 | 8 | <parameter name="idTermo" class="java.lang.Long"> |
9 | 9 | <defaultValueExpression><![CDATA[]]></defaultValueExpression> |
10 | 10 | </parameter> |
11 | 11 | <parameter name="organizacao" class="java.lang.String"/> |
12 | - <parameter name="dataReferenciaInicial" class="java.util.Date"> | |
12 | + <parameter name="diaReferencia" class="java.lang.String"> | |
13 | 13 | <defaultValueExpression><![CDATA[]]></defaultValueExpression> |
14 | 14 | </parameter> |
15 | 15 | <parameter name="idUL" class="java.lang.Long"> |
16 | 16 | <defaultValueExpression><![CDATA[]]></defaultValueExpression> |
17 | 17 | </parameter> |
18 | - <parameter name="dataReferenciaFinal" class="java.util.Date"> | |
18 | + <parameter name="mesReferencia" class="java.lang.String"> | |
19 | + <defaultValueExpression><![CDATA[]]></defaultValueExpression> | |
20 | + </parameter> | |
21 | + <parameter name="anoReferencia" class="java.lang.String"> | |
22 | + <defaultValueExpression><![CDATA[]]></defaultValueExpression> | |
23 | + </parameter> | |
24 | + <parameter name="dataReferencia" class="java.lang.String"> | |
19 | 25 | <defaultValueExpression><![CDATA[]]></defaultValueExpression> |
20 | 26 | </parameter> |
21 | 27 | <queryString> |
... | ... | @@ -55,16 +61,6 @@ bp.numeropatrimonial as numeroPatrimonial, |
55 | 61 | dstf.descricao as situacaoFisica, |
56 | 62 | bp.valoraquisicao as valorAquisicao, |
57 | 63 | bp.valorliquido as valorLiquido, |
58 | -(SELECT sum(bp.valorliquido) | |
59 | - FROM termoResponsabilidade t1 | |
60 | - LEFT JOIN estruturaorganizacional eo ON eo.id = t1.unidaderequisitante_id | |
61 | - LEFT JOIN bempatrimonial bp ON bp.unidadeatual_id = eo.id | |
62 | - WHERE t1.id = $P{idTermo}) AS valorTotalLiquido, | |
63 | -(SELECT sum(bp.valoraquisicao) | |
64 | - FROM termoResponsabilidade t2 | |
65 | - LEFT JOIN estruturaorganizacional eo ON eo.id = t2.unidaderequisitante_id | |
66 | - LEFT JOIN bempatrimonial bp ON bp.unidadeatual_id = eo.id | |
67 | - WHERE t2.id = $P{idTermo}) AS valorTotalAquisicao, | |
68 | 64 | (SELECT array_to_string(ARRAY( |
69 | 65 | SELECT CONCAT(CASE WHEN (dominio.codigo = 6 and descricaodominio.descricao IS NOT NULL) THEN CONCAT(caracteristica.descricao, ': ', descricaodominio.descricao, ' - ') |
70 | 66 | WHEN (dominio.codigo <> 6 and valormaterialcaracteristica IS NOT NULL) THEN CONCAT(caracteristica.descricao, ': ', valormaterialcaracteristica, ' - ') |
... | ... | @@ -93,10 +89,10 @@ select t.bempatrimonial_id from |
93 | 89 | where t.unidadedestino_id = $P{idUL} AND t.datainativo is null |
94 | 90 | ) as t |
95 | 91 | where |
96 | -t.dataIni <= $P{dataReferenciaInicial}::timestamp without time zone | |
92 | +t.dataIni <= (TO_TIMESTAMP($P{anoReferencia}||'-'||$P{mesReferencia}||'-'||$P{diaReferencia}||' 23:59:59','YYYY-MM-DD HH24:MI:SS')::timestamp without time zone) | |
97 | 93 | AND |
98 | 94 | ( |
99 | -T.DATAFIM >= $P{dataReferenciaFinal}::timestamp without time zone | |
95 | +T.DATAFIM >= (TO_TIMESTAMP($P{anoReferencia}||'-'||$P{mesReferencia}||'-'||$P{diaReferencia}||' 00:00:00','YYYY-MM-DD HH24:MI:SS')::timestamp without time zone) | |
100 | 96 | OR T.DATAFIM IS NULL |
101 | 97 | ) |
102 | 98 | )]]> |
... | ... | @@ -115,9 +111,13 @@ OR T.DATAFIM IS NULL |
115 | 111 | <field name="situacaofisica" class="java.lang.String"/> |
116 | 112 | <field name="valoraquisicao" class="java.math.BigDecimal"/> |
117 | 113 | <field name="valorliquido" class="java.math.BigDecimal"/> |
118 | - <field name="valortotalliquido" class="java.math.BigDecimal"/> | |
119 | - <field name="valortotalaquisicao" class="java.math.BigDecimal"/> | |
120 | 114 | <field name="caracteristicas" class="java.lang.String"/> |
115 | + <variable name="valorAquisicaoTotal" class="java.math.BigDecimal" calculation="Sum"> | |
116 | + <variableExpression><![CDATA[$F{valoraquisicao}]]></variableExpression> | |
117 | + </variable> | |
118 | + <variable name="valorLiquidoTotal" class="java.math.BigDecimal" calculation="Sum"> | |
119 | + <variableExpression><![CDATA[$F{valorliquido}]]></variableExpression> | |
120 | + </variable> | |
121 | 121 | <group name="Termo"> |
122 | 122 | <groupExpression><![CDATA[$P{idTermo}]]></groupExpression> |
123 | 123 | <groupHeader> |
... | ... | @@ -214,14 +214,14 @@ OR T.DATAFIM IS NULL |
214 | 214 | <textElement verticalAlignment="Middle" markup="styled"> |
215 | 215 | <font size="10" isBold="false"/> |
216 | 216 | </textElement> |
217 | - <textFieldExpression><![CDATA["<b>U.A.: </b> " + ( $F{parent} != null ? $F{estruturaparent} : $F{estruturaatualcodigo} + " - " + $F{estruturaparentnome})]]></textFieldExpression> | |
217 | + <textFieldExpression><![CDATA["<b>U.A.: </b> " + ( $F{parent} != null ? $F{estruturaparent} : $F{estruturaatualcodigo} + " - " + ($F{estruturaparentnome} != null ? $F{estruturaparentnome} : $F{estruturaatual}) ) ]]></textFieldExpression> | |
218 | 218 | </textField> |
219 | 219 | <textField pattern="dd/MM/yyyy"> |
220 | - <reportElement x="236" y="134" width="339" height="20" uuid="df31cb08-1ba4-4a57-a74c-6a01dfb7dca0"/> | |
220 | + <reportElement x="236" y="134" width="234" height="20" uuid="df31cb08-1ba4-4a57-a74c-6a01dfb7dca0"/> | |
221 | 221 | <textElement verticalAlignment="Middle" markup="styled"> |
222 | 222 | <font size="10"/> |
223 | 223 | </textElement> |
224 | - <textFieldExpression><![CDATA["<b>Data: </b>" + new SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date())]]></textFieldExpression> | |
224 | + <textFieldExpression><![CDATA["<b>Data: </b>" + $P{dataReferencia}]]></textFieldExpression> | |
225 | 225 | </textField> |
226 | 226 | <textField isBlankWhenNull="true"> |
227 | 227 | <reportElement x="0" y="210" width="575" height="20" uuid="7c3e1682-daf5-41b0-b36c-3e515f61351a"/> |
... | ... | @@ -275,11 +275,11 @@ OR T.DATAFIM IS NULL |
275 | 275 | </box> |
276 | 276 | <textElement textAlignment="Right" verticalAlignment="Middle"> |
277 | 277 | <font size="8"/> |
278 | - <paragraph rightIndent="3"/> | |
278 | + <paragraph rightIndent="3" spacingAfter="2"/> | |
279 | 279 | </textElement> |
280 | 280 | <textFieldExpression><![CDATA[$F{valoraquisicao}]]></textFieldExpression> |
281 | 281 | </textField> |
282 | - <textField isStretchWithOverflow="true" pattern="#,##0.00"> | |
282 | + <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> | |
283 | 283 | <reportElement stretchType="RelativeToTallestObject" x="509" y="0" width="66" height="20" uuid="49e6b325-2ff2-4e1e-9cdf-b428c8758844"/> |
284 | 284 | <box> |
285 | 285 | <pen lineWidth="0.5"/> |
... | ... | @@ -290,7 +290,7 @@ OR T.DATAFIM IS NULL |
290 | 290 | </box> |
291 | 291 | <textElement textAlignment="Right" verticalAlignment="Middle"> |
292 | 292 | <font size="8"/> |
293 | - <paragraph rightIndent="3"/> | |
293 | + <paragraph rightIndent="3" spacingAfter="2"/> | |
294 | 294 | </textElement> |
295 | 295 | <textFieldExpression><![CDATA[$F{valorliquido}]]></textFieldExpression> |
296 | 296 | </textField> |
... | ... | @@ -473,8 +473,8 @@ OR T.DATAFIM IS NULL |
473 | 473 | </lastPageFooter> |
474 | 474 | <summary> |
475 | 475 | <band height="15" splitType="Stretch"> |
476 | - <textField pattern="#,##0.00"> | |
477 | - <reportElement x="509" y="0" width="66" height="15" uuid="f289f8a4-a0bf-4dfb-b215-4b930d61645d"/> | |
476 | + <staticText> | |
477 | + <reportElement x="370" y="0" width="66" height="15" uuid="4cc1dbc7-45bc-4061-9c5c-8c0838f12c13"/> | |
478 | 478 | <box leftPadding="0" rightPadding="5"> |
479 | 479 | <pen lineWidth="1.0"/> |
480 | 480 | <topPen lineWidth="1.0"/> |
... | ... | @@ -482,15 +482,12 @@ OR T.DATAFIM IS NULL |
482 | 482 | <bottomPen lineWidth="1.0"/> |
483 | 483 | <rightPen lineWidth="1.0"/> |
484 | 484 | </box> |
485 | - <textElement textAlignment="Right" verticalAlignment="Middle"> | |
486 | - <font size="8"/> | |
487 | - </textElement> | |
488 | - <textFieldExpression><![CDATA[$F{valortotalliquido}]]></textFieldExpression> | |
489 | - </textField> | |
490 | - <textField pattern="#,##0.00"> | |
491 | - <reportElement x="436" y="0" width="73" height="15" uuid="ea2584d5-fab7-4341-afda-7a19d18b3c6f"/> | |
492 | - <box leftPadding="0" rightPadding="5"> | |
493 | - <pen lineWidth="1.0"/> | |
485 | + <textElement textAlignment="Right"/> | |
486 | + <text><![CDATA[Total (R$)]]></text> | |
487 | + </staticText> | |
488 | + <textField pattern="#,##0.00" isBlankWhenNull="true"> | |
489 | + <reportElement x="436" y="0" width="73" height="15" uuid="8edb7008-d9dd-4dc4-b5be-029756c2e33b"/> | |
490 | + <box> | |
494 | 491 | <topPen lineWidth="1.0"/> |
495 | 492 | <leftPen lineWidth="1.0"/> |
496 | 493 | <bottomPen lineWidth="1.0"/> |
... | ... | @@ -498,21 +495,25 @@ OR T.DATAFIM IS NULL |
498 | 495 | </box> |
499 | 496 | <textElement textAlignment="Right" verticalAlignment="Middle"> |
500 | 497 | <font size="8"/> |
498 | + <paragraph rightIndent="2" spacingAfter="2"/> | |
501 | 499 | </textElement> |
502 | - <textFieldExpression><![CDATA[$F{valortotalaquisicao}]]></textFieldExpression> | |
500 | + <textFieldExpression><![CDATA[$V{valorAquisicaoTotal}]]></textFieldExpression> | |
503 | 501 | </textField> |
504 | - <staticText> | |
505 | - <reportElement x="370" y="0" width="66" height="15" uuid="4cc1dbc7-45bc-4061-9c5c-8c0838f12c13"/> | |
506 | - <box leftPadding="0" rightPadding="5"> | |
502 | + <textField pattern="#,##0.00" isBlankWhenNull="true"> | |
503 | + <reportElement x="509" y="0" width="66" height="15" uuid="cb6e9a2a-b173-41b7-8f63-b93f25d01224"/> | |
504 | + <box> | |
507 | 505 | <pen lineWidth="1.0"/> |
508 | 506 | <topPen lineWidth="1.0"/> |
509 | 507 | <leftPen lineWidth="1.0"/> |
510 | 508 | <bottomPen lineWidth="1.0"/> |
511 | 509 | <rightPen lineWidth="1.0"/> |
512 | 510 | </box> |
513 | - <textElement textAlignment="Right"/> | |
514 | - <text><![CDATA[Total (R$)]]></text> | |
515 | - </staticText> | |
511 | + <textElement textAlignment="Right" verticalAlignment="Middle"> | |
512 | + <font size="8"/> | |
513 | + <paragraph rightIndent="2"/> | |
514 | + </textElement> | |
515 | + <textFieldExpression><![CDATA[$V{valorLiquidoTotal}]]></textFieldExpression> | |
516 | + </textField> | |
516 | 517 | </band> |
517 | 518 | </summary> |
518 | 519 | <noData> | ... | ... |
citgrp-patrimonio-web/src/main/webapp/assets/js/angular/custom/controller/EmissaoTermoResponsabilidadeController.js
... | ... | @@ -4,7 +4,7 @@ citApp.controller('EmissaoTermoResponsabilidadeController', ['$scope', '$filter' |
4 | 4 | |
5 | 5 | $scope.codigoTipoMovimentacao = null; |
6 | 6 | |
7 | - $scope.tiposMovimentacao = [{codigo : 1, descricao : 'Termo de Estrutura'}, {codigo : 2, descricao : 'Termo de detentor'}]; | |
7 | + $scope.tiposMovimentacao = [{codigo : 1, descricao : 'Termo de estrutura'}, {codigo : 2, descricao : 'Termo de detentor'}]; | |
8 | 8 | |
9 | 9 | $scope.resetForm = function(){ |
10 | 10 | |
... | ... | @@ -47,7 +47,13 @@ citApp.controller('EmissaoTermoResponsabilidadeController', ['$scope', '$filter' |
47 | 47 | }); |
48 | 48 | }; |
49 | 49 | |
50 | - $scope.setEstrutura = function() { | |
50 | + $scope.setEstrutura = function(item) { | |
51 | + if(item && item.id){ | |
52 | + EstruturaOrganizacionalRepository.listarEstruturaOrganizacionalAdministrativaPorUL(item.id).then(function(result){ | |
53 | + if(result && result.originalElement && result.originalElement.id) | |
54 | + $scope.estruturaOrganizacional = result; | |
55 | + }); | |
56 | + } | |
51 | 57 | $scope.estruturaOrganizacionalLocalizadora = null; |
52 | 58 | $scope.colaborador = null; |
53 | 59 | }; |
... | ... | @@ -92,7 +98,7 @@ citApp.controller('EmissaoTermoResponsabilidadeController', ['$scope', '$filter' |
92 | 98 | //verifica se o formulario está valido para salvar |
93 | 99 | if($scope.emissaoTermoResponsabilidadeForm.$valid){ |
94 | 100 | |
95 | - if(!isDataReferenciaValida()){ | |
101 | + if($scope.codigoTipoMovimentacao && $scope.codigoTipoMovimentacao == 1 && !isDataReferenciaValida()){ | |
96 | 102 | $scope.showAlert('error', $translate.instant('PATRIMONIO.MSG.VALIDACAO_DATA_FUTURA'), " ", false); |
97 | 103 | return; |
98 | 104 | } | ... | ... |
citgrp-patrimonio-web/src/main/webapp/html/emissaoTermoResponsabilidade/emissaoTermoResponsabilidadeEdit.html
... | ... | @@ -46,14 +46,14 @@ |
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <div class='row' ng-show="codigoTipoMovimentacao == 1"> |
49 | - <div class="col-sm-6 col-sm-offset-3"> | |
49 | + <div class="col-sm-4 col-sm-offset-3"> | |
50 | 50 | <auto-complete ng-find="findEstruturaOrganizacionalAdministrativa(value)" ng-item="item.codigoENome + ' - ' + item.classificacao" |
51 | 51 | ng-id="estruturaOrganizacional" ng-label="PATRIMONIO.LABEL.UNIDADE_ADMINISTRATIVA" ng-model="estruturaOrganizacional" |
52 | 52 | form="emissaoTermoResponsabilidadeForm" ng-set-result="setEstrutura()"></auto-complete> |
53 | 53 | |
54 | 54 | <auto-complete ng-find="findEstruturaOrganizacionalLocalizadoraPorEstrutura(value)" ng-item="item.codigoENome + ' - ' + item.classificacao" |
55 | 55 | ng-id="estruturaOrganizacionalLocalizadora" ng-label="PATRIMONIO.LABEL.UNIDADE_LOCALIZADORA_BENS" ng-model="estruturaOrganizacionalLocalizadora" |
56 | - form="emissaoTermoResponsabilidadeForm" ng-set-result="setEstrutura()" ng-obrigatorio="{{codigoTipoMovimentacao == 1}}"></auto-complete> | |
56 | + form="emissaoTermoResponsabilidadeForm" ng-set-result="setEstrutura(item)" ng-obrigatorio="{{codigoTipoMovimentacao == 1}}"></auto-complete> | |
57 | 57 | </div> |
58 | 58 | <div class="col-sm-3"> |
59 | 59 | </div> |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | <div class='row' ng-show="codigoTipoMovimentacao == 2"> |
66 | 66 | <div class="col-sm-3"> |
67 | 67 | </div> |
68 | - <div class="col-sm-6"> | |
68 | + <div class="col-sm-4"> | |
69 | 69 | <auto-complete ng-find="findColaborador(value)" ng-item="item.pessoa.nome + ' - ' + item.estruturaOrganizacional.nome" |
70 | 70 | ng-id="colaborador" ng-label="PATRIMONIO.LABEL.DETENTOR" ng-model="colaborador" form="emissaoTermoResponsabilidadeForm" |
71 | 71 | ng-set-result="setColaborador()" ng-obrigatorio="{{codigoTipoMovimentacao == 2}}"></auto-complete> | ... | ... |