Commit 03f19ad90bfab46a94c5d0f35f92021ad109939d
Exists in
master
Merge branch 'adm-1.16.0' of http://ferramentasgo.centralit.com.br:8080/scm/git/…
…cit-grp-almoxarifado into adm-1.16.0
Showing
3 changed files
with
13 additions
and
8 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/MovimentoEstoqueDaoHibernate.java
| ... | ... | @@ -181,8 +181,7 @@ public class MovimentoEstoqueDaoHibernate extends CitGenericDAOImpl implements M |
| 181 | 181 | Map<String, Object> parametros = new HashMap<String, Object>(); |
| 182 | 182 | StringBuilder sql = new StringBuilder(); |
| 183 | 183 | |
| 184 | - sql.append("select atendimento.dataAtendimento, "); | |
| 185 | - sql.append(" (select sum(quantidade) from alm_rc_at_item_endereco where alm_rc_at_item_endereco.at_req_consumoitem_id = atendimentoItem.id) as quantidade "); | |
| 184 | + sql.append("select atendimento.dataAtendimento, me.quantidade as quantidade "); | |
| 186 | 185 | sql.append(" from alm_me_movimentoestoque me "); |
| 187 | 186 | sql.append(" inner join dominio dominio on dominio.id = me.dominioClasseReferencia_id "); |
| 188 | 187 | sql.append(" left join alm_rc_atendimentoitem atendimentoItem on atendimentoItem.id = me.idClasseReferencia "); |
| ... | ... | @@ -195,6 +194,8 @@ public class MovimentoEstoqueDaoHibernate extends CitGenericDAOImpl implements M |
| 195 | 194 | parametros.put("codigoDominio", DominioMaterial.REFERENCIA_ATENDIMENTO_ALMOXARIFADO_ITEM); |
| 196 | 195 | parametros.put("chaveDominio", "classeReferencia"); |
| 197 | 196 | |
| 197 | + sql.append(" and me.datainativo is null "); | |
| 198 | + | |
| 198 | 199 | sql.append(" and me.material_id = :materialConsumoId "); |
| 199 | 200 | parametros.put("materialConsumoId", materialConsumo.getId()); |
| 200 | 201 | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/MovimentoEstoqueServiceImpl.java
| ... | ... | @@ -575,7 +575,7 @@ public class MovimentoEstoqueServiceImpl extends GenericServiceImpl<MovimentoEst |
| 575 | 575 | |
| 576 | 576 | } else { |
| 577 | 577 | |
| 578 | - result = result.add(listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE] != null ? (BigDecimal) listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE] : BigDecimal.ZERO); | |
| 578 | + result = result.add(listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE] != null ? ((BigDecimal) listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE]).multiply(new BigDecimal(-1)) : BigDecimal.ZERO); | |
| 579 | 579 | |
| 580 | 580 | } |
| 581 | 581 | } |
| ... | ... | @@ -647,7 +647,7 @@ public class MovimentoEstoqueServiceImpl extends GenericServiceImpl<MovimentoEst |
| 647 | 647 | mapaDeMesesPorQuantidade.put(chave, new ArrayList<BigDecimal>()); |
| 648 | 648 | } |
| 649 | 649 | |
| 650 | - BigDecimal valor = (BigDecimal) listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE]; | |
| 650 | + BigDecimal valor = ((BigDecimal) listaPropriedades[ATENDIMENTO_REQUISICAO_CONSUMO_ITEM_QUANTIDADE]).multiply(new BigDecimal(-1)); | |
| 651 | 651 | |
| 652 | 652 | mapaDeMesesPorQuantidade.get(chave).add(valor); |
| 653 | 653 | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/atendimentoRequisicaoConsumoEdit.html
| ... | ... | @@ -61,12 +61,12 @@ |
| 61 | 61 | ng-model="atendimentoRequisicaoConsumo.dataAtendimento" form="atendimentoRequisicaoConsumoForm" ng-obrigatorio="true" |
| 62 | 62 | ng-show="edit" ng-mode="day" ng-format="dd/MM/yyyy" /> |
| 63 | 63 | </div> |
| 64 | - <div class="col-md-6" ng-if="atendimentos.length == 1"> | |
| 64 | + <div class="col-md-6" ng-if="atendimentos.length == 1 && edit"> | |
| 65 | 65 | <p> |
| 66 | 66 | <small><span class="red" ><translate>ALMOXARIFADO.MSG.INFO_ATENDIMENTO_INICIADO</translate></span></small> |
| 67 | 67 | </p> |
| 68 | 68 | </div> |
| 69 | - <div class="col-md-6" ng-if="atendimentos.length > 1"> | |
| 69 | + <div class="col-md-6" ng-if="atendimentos.length > 1 && edit"> | |
| 70 | 70 | <p> |
| 71 | 71 | <small><span class="red"><translate>ALMOXARIFADO.MSG.INFO_ATENDIMENTOS_INICIADOS</translate></span></small> |
| 72 | 72 | </p> |
| ... | ... | @@ -167,9 +167,13 @@ |
| 167 | 167 | ng-custom-options="atendimentoRequisicaoConsumoItemEndereco as atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.endereco.descricao for atendimentoRequisicaoConsumoItemEndereco"></label-select> |
| 168 | 168 | </td> |
| 169 | 169 | <td ng-show="atendimentoRequisicaoConsumoItem.atendimentoRequisicaoConsumoItemEnderecos.length > 1"> |
| 170 | - <translate>ALMOXARIFADO.LABEL.MULTIPLOS_ENDERECOS</translate> | |
| 170 | + <a style="cursor: pointer;" | |
| 171 | + ng-click="openModalEnderecosMaterial(atendimentoRequisicaoConsumoItem.$locaisEstoque, atendimentoRequisicaoConsumoItem.atendimentoRequisicaoConsumoItemEnderecos, atendimento, atendimentoRequisicaoConsumoItem)"> | |
| 172 | + <translate>ALMOXARIFADO.LABEL.MULTIPLOS_ENDERECOS</translate> | |
| 173 | + </a> | |
| 171 | 174 | </td> |
| 172 | - <td style="padding-left: 8px; text-align: right;"> | |
| 175 | + <td style="padding-left: 8px; text-align: right;" | |
| 176 | + ng-show="atendimentoRequisicaoConsumoItem.atendimentoRequisicaoConsumoItemEnderecos.length <= 1 && edit"> | |
| 173 | 177 | <i class="fa fa-plus green" style="cursor: pointer;" |
| 174 | 178 | ng-click="openModalEnderecosMaterial(atendimentoRequisicaoConsumoItem.$locaisEstoque, atendimentoRequisicaoConsumoItem.atendimentoRequisicaoConsumoItemEnderecos, atendimento, atendimentoRequisicaoConsumoItem)" |
| 175 | 179 | tooltip="{{$translate.instant('ALMOXARIFADO.MSG.ATENDER_MAIS_DE_UM_ENDERECO')}}"/> | ... | ... |