Commit e2f8365a191eb030ca4ba79e1d330991c6445686
1 parent
a5de072e
Exists in
master
[Redmine Atendimento #4216]Alteração timeline empenho (max 100) retirado valor n…
…egativo do valor residual
Showing
2 changed files
with
13 additions
and
10 deletions
Show diff stats
cit-contratos-web/src/main/webapp/assets/js/angular/custom/controller/VisaoContratoController.js
... | ... | @@ -257,6 +257,7 @@ citApp.controller('VisaoContratoController', ['$scope', |
257 | 257 | $scope.valorTotalLiberado = 0; |
258 | 258 | $scope.valorTotalContratoAditivado = $scope.contrato.valorContrato; |
259 | 259 | $scope.porcentagemEmpenho = 0; |
260 | + $scope.valorResidualCalculado = 0; | |
260 | 261 | $scope.setLoadingGet(true); |
261 | 262 | $timeout(function () { |
262 | 263 | |
... | ... | @@ -347,20 +348,16 @@ citApp.controller('VisaoContratoController', ['$scope', |
347 | 348 | } |
348 | 349 | } |
349 | 350 | $scope.porcentagemEmpenho = ($scope.valorTotalEmpenhado * 100) / $scope.valorTotalContratoAditivado; |
351 | + if($scope.porcentagemEmpenho > 100){ | |
352 | + $scope.porcentagemEmpenho = 100; | |
353 | + } | |
354 | + | |
355 | + $scope.valorResidualCalculado = Math.abs($scope.valorTotalContratoAditivado - $scope.valorTotalEmpenhado); | |
350 | 356 | }); |
351 | 357 | } |
352 | 358 | |
353 | 359 | if (evento.tipoEvento && evento.tipoEvento.nome == "ATUALIZA_STATUS") { |
354 | 360 | EventoAtualizacaoStatusRepository.get(evento.id).then(function (result) { |
355 | - if(result.aditivoDeValor){ | |
356 | - if(result.tipoAlteracaoValor.nome == 'ACRESCIMO'){ | |
357 | - $scope.valorTotalContratoAditivado += result.valorAditivo; | |
358 | - }else{ | |
359 | - $scope.valorTotalContratoAditivado -= result.valorAditivo; | |
360 | - } | |
361 | - | |
362 | - } | |
363 | - | |
364 | 361 | for (var k = 0; k < contratoEventos.contratoEventosForScreen.length; k++) { |
365 | 362 | if (contratoEventos.contratoEventosForScreen[k].id == result.id) { |
366 | 363 | contratoEventos.contratoEventosForScreen[k].iconClass = eventoClasses[contratoEventos.contratoEventosForScreen[k].tipoEvento.nome + "_" + result.tipoSituacaoNova.nome].icon; |
... | ... | @@ -394,11 +391,17 @@ citApp.controller('VisaoContratoController', ['$scope', |
394 | 391 | |
395 | 392 | var porcentagem = (totalEmpenho * 100) / contratoEventos.contrato.valorContrato; |
396 | 393 | $scope.porcentagemEmpenho = porcentagem; |
394 | + if($scope.porcentagemEmpenho > 100){ | |
395 | + $scope.porcentagemEmpenho = 100; | |
396 | + } | |
397 | 397 | contratoEventos.contrato.totalEmpenhado = totalEmpenho; |
398 | 398 | contratoEventos.contrato.porcentagemEmpenhado = porcentagem; |
399 | 399 | $scope.contratoEventos.push(contratoEventos); |
400 | 400 | $scope.contrato.dominioSituacaoAtual = contratoEventos.contrato.dominioSituacaoAtual; |
401 | 401 | $scope.valorTotalEmpenhado = totalEmpenho; |
402 | + | |
403 | + $scope.valorResidualCalculado = Math.abs(contratoEventos.contrato.valorContrato - totalEmpenho); | |
404 | + | |
402 | 405 | $scope.dataTerminoContrato = $scope.contrato.ultimaDataVigenciaFinal != undefined ? $scope.contrato.ultimaDataVigenciaFinal : $scope.contrato.dataVigenciaFinal; |
403 | 406 | |
404 | 407 | $scope.eventoFinal = { | ... | ... |
cit-contratos-web/src/main/webapp/html/visaoContrato/visaoContrato.html
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div class="contrato-evento-item-progress-legend-total"> |
111 | - <span class="contrato-evento-item-progress-legend-color"></span> <translate>LABEL.VALOR_RESIDUAL</translate>: {{(valorTotalContratoAditivado - contratoEvento.contrato.totalEmpenhado) | currency}} | |
111 | + <span class="contrato-evento-item-progress-legend-color"></span> <translate>LABEL.VALOR_RESIDUAL</translate>: {{valorResidualCalculado | currency}} | |
112 | 112 | |
113 | 113 | <div align="right"><translate>LABEL.VALOR_TOTAL_CONTRATO</translate>: {{valorTotalContratoAditivado | currency}}</div> |
114 | 114 | </div> | ... | ... |