Commit 3b71ed4503e44e198e871ce89bdf5c903fba71ac
Exists in
master
Merge branch 'tarefa-3943' into tarefa-4530
# Conflicts: # cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoController.js # cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/dialog_add_materiais.html
Showing
21 changed files
with
1196 additions
and
532 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/MaterialLocalEstoque.java
... | ... | @@ -91,7 +91,7 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
91 | 91 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
92 | 92 | private UnidadeMedida unidadeMedidaEntrada; |
93 | 93 | |
94 | - @JsonView({ Views.MaterialLocalEstoqueView.class }) | |
94 | + @JsonView({ Views.GenericView.class }) | |
95 | 95 | private Boolean localPrincipal; |
96 | 96 | |
97 | 97 | /** | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/EntradaAlmoxarifadoService.java
1 | 1 | package br.com.centralit.api.service; |
2 | 2 | |
3 | -import java.util.List; | |
4 | 3 | import java.util.Map; |
5 | 4 | |
6 | 5 | import br.com.centralit.api.model.EntradaAlmoxarifado; |
... | ... | @@ -10,6 +9,20 @@ public interface EntradaAlmoxarifadoService extends GenericService<EntradaAlmoxa |
10 | 9 | |
11 | 10 | Map<String, String> buscaValoresDocumentoEntrada(Long idEntrada); |
12 | 11 | |
12 | + /** | |
13 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
14 | + * | |
15 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
16 | + * | |
17 | + * Método responsável por concluir uma entrada do almoxarifado | |
18 | + * | |
19 | + * @author geovane.filho | |
20 | + * | |
21 | + * @param entradaAlmoxarifado | |
22 | + * @return | |
23 | + */ | |
24 | + EntradaAlmoxarifado concluir(EntradaAlmoxarifado entradaAlmoxarifado); | |
25 | + | |
13 | 26 | } |
14 | 27 | |
15 | 28 | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/MovimentoEstoqueService.java
... | ... | @@ -209,4 +209,18 @@ public interface MovimentoEstoqueService extends GenericService<MovimentoEstoque |
209 | 209 | */ |
210 | 210 | public Collection<MovimentoEstoque> findAllByClasseReferencia(Dominio classeReferencia, Long idReferencia); |
211 | 211 | |
212 | + /** | |
213 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | |
214 | + * | |
215 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | |
216 | + * | |
217 | + * Método responsável por buscar todos os códigos das operações de atendimentos e baixas que ocorreram com materiais da entrada passada como referência | |
218 | + * | |
219 | + * @author geovane.filho | |
220 | + * | |
221 | + * @param idEntrada | |
222 | + * @return | |
223 | + */ | |
224 | + String buscarMovimentosSaidaComMateriaisDaEntrada(Long idEntrada); | |
225 | + | |
212 | 226 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/EntradaAlmoxarifadoServiceImpl.java
1 | 1 | package br.com.centralit.api.service.impl; |
2 | 2 | |
3 | +import java.util.Calendar; | |
3 | 4 | import java.util.HashMap; |
4 | 5 | import java.util.Map; |
5 | 6 | |
... | ... | @@ -9,7 +10,6 @@ import org.springframework.stereotype.Service; |
9 | 10 | import org.springframework.validation.Validator; |
10 | 11 | |
11 | 12 | import br.com.centralit.api.dao.EntradaAlmoxarifadoDao; |
12 | -import br.com.centralit.api.model.BemAlmoxarifadoCaracteristica; | |
13 | 13 | import br.com.centralit.api.model.EntradaAlmoxarifado; |
14 | 14 | import br.com.centralit.api.model.EntradaAlmoxarifadoDocumento; |
15 | 15 | import br.com.centralit.api.model.EntradaAlmoxarifadoItem; |
... | ... | @@ -27,6 +27,7 @@ import br.com.centralit.api.service.MovimentoEstoqueService; |
27 | 27 | import br.com.centralit.api.service.ParceiroService; |
28 | 28 | import br.com.centralit.api.service.UnidadeMedidaService; |
29 | 29 | import br.com.centralit.api.service.UsuarioService; |
30 | +import br.com.centralit.api.service.validation.EntradaAlmoxarifadoAllValidator; | |
30 | 31 | import br.com.centralit.framework.exception.BusinessException; |
31 | 32 | import br.com.centralit.framework.exception.CodigoErro; |
32 | 33 | import br.com.centralit.framework.model.Dominio; |
... | ... | @@ -68,12 +69,6 @@ public class EntradaAlmoxarifadoServiceImpl extends GenericServiceImpl<EntradaAl |
68 | 69 | /** Atributo VALIDACAO_DATA_FORA_REFERENCIA_EXCLUSAO_ENTRADA. */ |
69 | 70 | private static final String VALIDACAO_DATA_FORA_REFERENCIA_EXCLUSAO_ENTRADA = "VALIDACAO.DATA_FORA_REFERENCIA_EXCLUSAO_ENTRADA"; |
70 | 71 | |
71 | - /** Atributo VALIDACAO_DATA_RECEBIMENTO. */ | |
72 | - private static final String VALIDACAO_DATA_RECEBIMENTO = "VALIDACAO.DATA_RECEBIMENTO"; | |
73 | - | |
74 | - /** Atributo MSG_MN019. */ | |
75 | - private static final String MSG_MN019 = "MSG.MN019"; | |
76 | - | |
77 | 72 | /** Atributo entradaAlmoxarifadoDao. */ |
78 | 73 | private EntradaAlmoxarifadoDao entradaAlmoxarifadoDao; |
79 | 74 | |
... | ... | @@ -109,42 +104,53 @@ public class EntradaAlmoxarifadoServiceImpl extends GenericServiceImpl<EntradaAl |
109 | 104 | |
110 | 105 | @Autowired |
111 | 106 | private ConfiguracaoParametroSistemaService configuracaoParametroSistemaService; |
107 | + | |
108 | + private Validator validatorBasic; | |
109 | + | |
110 | + private Validator validatorAll; | |
112 | 111 | |
113 | 112 | /** |
114 | 113 | * Responsável pela criação de novas instâncias desta classe. |
115 | 114 | * |
116 | 115 | * @param entradaAlmoxarifadoDao |
117 | - * @param validator | |
116 | + * @param validatorBasic | |
118 | 117 | */ |
119 | 118 | @Autowired |
120 | - public EntradaAlmoxarifadoServiceImpl( EntradaAlmoxarifadoDao entradaAlmoxarifadoDao, @Qualifier("entradaAlmoxarifadoValidator") Validator validator ) { | |
119 | + public EntradaAlmoxarifadoServiceImpl( EntradaAlmoxarifadoDao entradaAlmoxarifadoDao, @Qualifier("entradaAlmoxarifadoBasicValidator") Validator validatorBasic ) { | |
121 | 120 | |
122 | 121 | this.dao = entradaAlmoxarifadoDao; |
123 | 122 | this.entradaAlmoxarifadoDao = entradaAlmoxarifadoDao; |
124 | - this.validator = validator; | |
123 | + this.validatorBasic = validatorBasic; | |
124 | + | |
125 | + EntradaAlmoxarifadoAllValidator entradaAlmoxarifadoAllValidator = new EntradaAlmoxarifadoAllValidator(this, movimentoEstoqueService); | |
126 | + | |
127 | + this.validatorAll = entradaAlmoxarifadoAllValidator; | |
128 | + | |
129 | + this.validator = entradaAlmoxarifadoAllValidator; | |
125 | 130 | } |
126 | 131 | |
127 | 132 | /** |
128 | 133 | * |
129 | 134 | */ |
130 | 135 | @Override |
131 | - public EntradaAlmoxarifado save(EntradaAlmoxarifado entity) { | |
132 | - | |
133 | - this.validarEntidade(entity, this.validator); | |
134 | - | |
135 | - this.montarEntidade(entity); | |
136 | - | |
137 | - this.validarDataContabil(entity); | |
138 | - | |
139 | - this.validarDataRecebimento(entity); | |
136 | + public EntradaAlmoxarifado save(EntradaAlmoxarifado entrada) { | |
137 | + | |
138 | + this.validarEntidade(entrada, this.validatorBasic); | |
139 | + | |
140 | + // validação de se a data contabil esta dentro do mes referencia | |
141 | + Calendar dataContabil = null; | |
142 | + if(UtilObjeto.isReferencia(entrada.getDataContabil())){ | |
143 | + dataContabil = Calendar.getInstance(); | |
144 | + dataContabil.setTime(entrada.getDataContabil().getTime()); | |
145 | + } | |
146 | + | |
147 | + this.montarEntidade(entrada); | |
140 | 148 | |
141 | - EntradaAlmoxarifado entradaAlmoxarifado = (EntradaAlmoxarifado) this.entradaAlmoxarifadoDao.save(entity); | |
149 | + EntradaAlmoxarifado entradaAlmoxarifado = (EntradaAlmoxarifado) this.entradaAlmoxarifadoDao.save(entrada); | |
142 | 150 | |
143 | 151 | configurarNotaRecebimento(entradaAlmoxarifado); |
144 | 152 | |
145 | - entity.setCodigo(String.valueOf(entradaAlmoxarifado.getNotaRecebimento())); | |
146 | - | |
147 | - this.movimentoEstoqueService.gerarMovimento(entradaAlmoxarifado); | |
153 | + entrada.setCodigo(String.valueOf(entradaAlmoxarifado.getNotaRecebimento())); | |
148 | 154 | |
149 | 155 | return entradaAlmoxarifado; |
150 | 156 | } |
... | ... | @@ -154,54 +160,55 @@ public class EntradaAlmoxarifadoServiceImpl extends GenericServiceImpl<EntradaAl |
154 | 160 | * |
155 | 161 | * @author wilker.machado |
156 | 162 | * |
157 | - * @param entity | |
163 | + * @param entrada | |
158 | 164 | */ |
159 | - private void montarEntidade(EntradaAlmoxarifado entity) { | |
165 | + private void montarEntidade(EntradaAlmoxarifado entrada) { | |
160 | 166 | |
161 | - entity.setAlmoxarifado(this.estruturaOrganizacionalService.find(entity.getAlmoxarifado().getId())); | |
167 | + entrada.setAlmoxarifado(this.estruturaOrganizacionalService.find(entrada.getAlmoxarifado().getId())); | |
162 | 168 | |
163 | - entity.setFornecedor((Fornecedor) this.parceiroService.find(entity.getFornecedor().getId())); | |
169 | + entrada.setFornecedor((Fornecedor) this.parceiroService.find(entrada.getFornecedor().getId())); | |
164 | 170 | |
165 | - entity.setDominioTipoEntrada(this.dominioService.find(entity.getDominioTipoEntrada().getId())); | |
171 | + entrada.setDominioTipoEntrada(this.dominioService.find(entrada.getDominioTipoEntrada().getId())); | |
166 | 172 | |
167 | - entity.setDominioTipoRecebimento(this.dominioService.find(entity.getDominioTipoRecebimento().getId())); | |
173 | + entrada.setDominioTipoRecebimento(this.dominioService.find(entrada.getDominioTipoRecebimento().getId())); | |
168 | 174 | |
169 | - entity.setDominioFinalidade(this.dominioService.findByChaveAndCodigo("tipoFinalidadeMaterial", entity.getDominioFinalidade().getCodigo())); | |
175 | + entrada.setDominioFinalidade(this.dominioService.findByChaveAndCodigo("tipoFinalidadeMaterial", entrada.getDominioFinalidade().getCodigo())); | |
170 | 176 | |
171 | - if(UtilObjeto.isReferencia(entity.getUnidadeRequisitante()) && UtilObjeto.isReferencia(entity.getUnidadeRequisitante().getId())){ | |
177 | + if(UtilObjeto.isReferencia(entrada.getUnidadeRequisitante()) && UtilObjeto.isReferencia(entrada.getUnidadeRequisitante().getId())){ | |
172 | 178 | |
173 | - entity.setUnidadeRequisitante(this.estruturaOrganizacionalService.find(entity.getUnidadeRequisitante().getId())); | |
179 | + entrada.setUnidadeRequisitante(this.estruturaOrganizacionalService.find(entrada.getUnidadeRequisitante().getId())); | |
174 | 180 | |
175 | 181 | } |
176 | 182 | |
177 | - for (EntradaAlmoxarifadoItem entradaAlmoxarifadoItem : entity.getEntradasItem()) { | |
183 | + for (EntradaAlmoxarifadoItem entradaAlmoxarifadoItem : entrada.getEntradasItem()) { | |
178 | 184 | |
179 | 185 | entradaAlmoxarifadoItem.setMaterial(this.materialConsumoService.find(entradaAlmoxarifadoItem.getMaterial().getId())); |
180 | 186 | |
181 | 187 | entradaAlmoxarifadoItem.setUnidadeMedidaEntrada(this.unidadeMedidaService.find(entradaAlmoxarifadoItem.getUnidadeMedidaEntrada().getId())); |
182 | 188 | |
183 | - entradaAlmoxarifadoItem.setEntrada(entity); | |
189 | + entradaAlmoxarifadoItem.setEntrada(entrada); | |
184 | 190 | |
185 | - for (BemAlmoxarifadoCaracteristica bemAlmoxarifadoCaracteristica : entradaAlmoxarifadoItem.getCaracteristicas()) { | |
191 | + //TODO Arrumar caracteristicas | |
192 | + /*for (BemAlmoxarifadoCaracteristica bemAlmoxarifadoCaracteristica : entradaAlmoxarifadoItem.getCaracteristicas()) { | |
186 | 193 | |
187 | 194 | bemAlmoxarifadoCaracteristica.setMaterialCaracteristica(this.materialCaracteristicaService.find(bemAlmoxarifadoCaracteristica.getMaterialCaracteristica().getId())); |
188 | 195 | |
189 | 196 | bemAlmoxarifadoCaracteristica.setCaracteristica(bemAlmoxarifadoCaracteristica.getMaterialCaracteristica().getCaracteristica()); |
190 | 197 | |
191 | 198 | bemAlmoxarifadoCaracteristica.setEntradaItem(entradaAlmoxarifadoItem); |
192 | - } | |
199 | + }*/ | |
193 | 200 | |
194 | 201 | } |
195 | 202 | |
196 | - for (EntradaAlmoxarifadoObservacao entradaObservacao : entity.getObservacoes()) { | |
203 | + for (EntradaAlmoxarifadoObservacao entradaObservacao : entrada.getObservacoes()) { | |
197 | 204 | |
198 | 205 | entradaObservacao.setAutor(this.usuarioService.find(entradaObservacao.getAutor().getId())); |
199 | 206 | |
200 | - entradaObservacao.setEntrada(entity); | |
207 | + entradaObservacao.setEntrada(entrada); | |
201 | 208 | |
202 | 209 | } |
203 | 210 | |
204 | - for (EntradaAlmoxarifadoDocumento entradaDocumento : entity.getDocumentos()) { | |
211 | + for (EntradaAlmoxarifadoDocumento entradaDocumento : entrada.getDocumentos()) { | |
205 | 212 | |
206 | 213 | entradaDocumento.setDominioTipoDocumento(this.dominioService.find(entradaDocumento.getDominioTipoDocumento().getId())); |
207 | 214 | |
... | ... | @@ -210,38 +217,13 @@ public class EntradaAlmoxarifadoServiceImpl extends GenericServiceImpl<EntradaAl |
210 | 217 | entradaDocumento.setEmitente(this.parceiroService.find(entradaDocumento.getEmitente().getId())); |
211 | 218 | } |
212 | 219 | |
213 | - entradaDocumento.setEntrada(entity); | |
220 | + entradaDocumento.setEntrada(entrada); | |
214 | 221 | } |
215 | - | |
216 | - } | |
217 | - | |
218 | - /** | |
219 | - * Método responsável por validar se a data de recebimento e menor que a data de cadastro da entrada | |
220 | - * | |
221 | - * @author wilker.machado | |
222 | - * | |
223 | - * @param entrada | |
224 | - */ | |
225 | - private void validarDataRecebimento(EntradaAlmoxarifado entrada) { | |
226 | - | |
227 | - if (UtilDate.isPrimeiraDataMenorSegundaData(entrada.getDataReferencia(), entrada.getDataRecebimento())) { | |
228 | - | |
229 | - throw new BusinessException(VALIDACAO_DATA_RECEBIMENTO, CodigoErro.REGRA_NEGOCIO.getValue()); | |
230 | - } | |
231 | - } | |
232 | - | |
233 | - /** | |
234 | - * Método responsável por validação de se a data contabil esta dentro do mes referencia | |
235 | - * | |
236 | - * @author wilker.machado | |
237 | - * | |
238 | - * @param entrada | |
239 | - */ | |
240 | - private void validarDataContabil(EntradaAlmoxarifado entrada) { | |
241 | - | |
242 | - if (!UtilDate.isDentroMes(entrada.getDataContabil(), entrada.getAlmoxarifado().getOrganizacao().getDataReferenciaVigente())) { | |
243 | - | |
244 | - throw new BusinessException(MSG_MN019, CodigoErro.REGRA_NEGOCIO.getValue()); | |
222 | + | |
223 | + if (UtilObjeto.isReferencia(entrada.getDataContabil())) { | |
224 | + entrada.setIsContabilizada(Boolean.TRUE); | |
225 | + } else { | |
226 | + entrada.setIsContabilizada(Boolean.FALSE); | |
245 | 227 | } |
246 | 228 | } |
247 | 229 | |
... | ... | @@ -332,4 +314,11 @@ public class EntradaAlmoxarifadoServiceImpl extends GenericServiceImpl<EntradaAl |
332 | 314 | return listaValoresDocumento; |
333 | 315 | } |
334 | 316 | |
317 | + @Override | |
318 | + public EntradaAlmoxarifado concluir(EntradaAlmoxarifado entradaAlmoxarifado) { | |
319 | + | |
320 | + // TODO Auto-generated method stub | |
321 | + return null; | |
322 | + } | |
323 | + | |
335 | 324 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/MovimentoEstoqueServiceImpl.java
... | ... | @@ -8,6 +8,7 @@ import java.util.HashMap; |
8 | 8 | import java.util.List; |
9 | 9 | import java.util.Map; |
10 | 10 | |
11 | +import org.apache.commons.lang.NotImplementedException; | |
11 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
12 | 13 | import org.springframework.beans.factory.annotation.Qualifier; |
13 | 14 | import org.springframework.security.core.context.SecurityContextHolder; |
... | ... | @@ -577,4 +578,9 @@ public class MovimentoEstoqueServiceImpl extends GenericServiceImpl<MovimentoEst |
577 | 578 | return this.movimentoEstoqueDao.findAllByClasseReferencia(classeReferencia, idReferencia); |
578 | 579 | } |
579 | 580 | |
581 | + @Override | |
582 | + public String buscarMovimentosSaidaComMateriaisDaEntrada(Long idEntrada) { | |
583 | + throw new NotImplementedException(); | |
584 | + } | |
585 | + | |
580 | 586 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/validation/EntradaAlmoxarifadoAllValidator.java
0 → 100644
... | ... | @@ -0,0 +1,97 @@ |
1 | +package br.com.centralit.api.service.validation; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | + | |
5 | +import org.springframework.beans.factory.annotation.Autowired; | |
6 | +import org.springframework.stereotype.Component; | |
7 | +import org.springframework.validation.Errors; | |
8 | +import org.springframework.validation.ValidationUtils; | |
9 | +import org.springframework.validation.Validator; | |
10 | + | |
11 | +import br.com.centralit.api.model.EntradaAlmoxarifado; | |
12 | +import br.com.centralit.api.model.EntradaAlmoxarifadoItem; | |
13 | +import br.com.centralit.api.service.EntradaAlmoxarifadoService; | |
14 | +import br.com.centralit.api.service.MovimentoEstoqueService; | |
15 | +import br.com.centralit.framework.exception.CodigoErro; | |
16 | +import br.com.centralit.framework.util.UtilColecao; | |
17 | +import br.com.centralit.framework.util.UtilDate; | |
18 | +import br.com.centralit.framework.util.UtilObjeto; | |
19 | + | |
20 | +@Component("entradaAlmoxarifadoAllValidator") | |
21 | +public class EntradaAlmoxarifadoAllValidator implements Validator { | |
22 | + | |
23 | + @Autowired | |
24 | + private EntradaAlmoxarifadoService entradaAlmoxarifadoService; | |
25 | + | |
26 | + @Autowired | |
27 | + private MovimentoEstoqueService movimentoEstoqueService; | |
28 | + | |
29 | + public EntradaAlmoxarifadoAllValidator() { | |
30 | + | |
31 | + super(); | |
32 | + } | |
33 | + | |
34 | + public EntradaAlmoxarifadoAllValidator(EntradaAlmoxarifadoService entradaAlmoxarifadoService, MovimentoEstoqueService movimentoEstoqueService ) { | |
35 | + super(); | |
36 | + this.entradaAlmoxarifadoService = entradaAlmoxarifadoService; | |
37 | + this.movimentoEstoqueService = movimentoEstoqueService; | |
38 | + } | |
39 | + | |
40 | + @Override | |
41 | + public boolean supports(Class<?> clazz) { | |
42 | + | |
43 | + return EntradaAlmoxarifado.class.isAssignableFrom(clazz); | |
44 | + } | |
45 | + | |
46 | + @Override | |
47 | + public void validate(Object target, Errors errors) { | |
48 | + | |
49 | + ValidationUtils.rejectIfEmpty(errors, "dataContabil", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DATA_CONTABILIZACAO"); | |
50 | + | |
51 | + EntradaAlmoxarifado entrada = (EntradaAlmoxarifado) target; | |
52 | + | |
53 | + EntradaAlmoxarifado entradaOld = this.entradaAlmoxarifadoService.find(entrada.getId()); | |
54 | + | |
55 | + if (UtilObjeto.isReferencia(entradaOld.getDataContabil())) { | |
56 | + String codigosMovimentos = this.movimentoEstoqueService.buscarMovimentosSaidaComMateriaisDaEntrada(entradaOld.getId()); | |
57 | + boolean alteracaoData = false; | |
58 | + | |
59 | + if (!UtilObjeto.isReferencia(entrada.getDataContabil())) { | |
60 | + alteracaoData = true; | |
61 | + } else if (!UtilDate.compareCalendar(entrada.getDataContabil(), entradaOld.getDataContabil())) { | |
62 | + alteracaoData = true; | |
63 | + } | |
64 | + | |
65 | + if (alteracaoData && !codigosMovimentos.isEmpty()) { | |
66 | + errors.rejectValue("dataContabil", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.VALIDACAO.DATA_CONTABIL_ALTERADA_SAIDAS"); | |
67 | + } | |
68 | + } | |
69 | + | |
70 | + if (UtilObjeto.isReferencia(entrada.getDataContabil())) { | |
71 | + | |
72 | + if (UtilColecao.isVazio(entrada.getDocumentos())) { | |
73 | + errors.rejectValue("documentos", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "CORPORATIVO.LABEL.ASSOCIAR_DOCUMENTOS"); | |
74 | + } | |
75 | + | |
76 | + BigDecimal valorTotalItens = new BigDecimal(0L); | |
77 | + | |
78 | + // repetição para verificar a soma de todos os itens da entrada e igual ao valor da nota | |
79 | + int item = 1; | |
80 | + for (EntradaAlmoxarifadoItem entradaItem : entrada.getEntradasItem()) { | |
81 | + if(entradaItem.getQuantidade() == null || entradaItem.getQuantidade() == BigDecimal.ZERO){ | |
82 | + errors.rejectValue("entradasItem", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(),"VALIDACAO.QUANTIDADE_MAIOR_ZERO"); | |
83 | + } | |
84 | + //TODO validacaoBensCaracteristicasObrigatorias(errors, entradaItem, item); | |
85 | + valorTotalItens = valorTotalItens.add(entradaItem.getValorTotal()); | |
86 | + item++; | |
87 | + } | |
88 | + | |
89 | + // verificar se os valores da nota e da soma dos itens sao iguais, caso nao seja e lançada uma exceção | |
90 | + if (UtilObjeto.isReferencia(entrada.getValorTotalNota()) && valorTotalItens.compareTo(entrada.getValorTotalNota()) != 0) { | |
91 | + errors.rejectValue("valorTotalNota", CodigoErro.VALIDACAO_CAMPOS.getValue().toString(), "ALMOXARIFADO.VALIDACAO.NOTA_FISCAL_IGUAL_VALOR_INFORMADO"); | |
92 | + } | |
93 | + } | |
94 | + | |
95 | + } | |
96 | +} | |
97 | + | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/validation/EntradaAlmoxarifadoBasicValidator.java
0 → 100644
... | ... | @@ -0,0 +1,61 @@ |
1 | +package br.com.centralit.api.service.validation; | |
2 | + | |
3 | +import org.springframework.stereotype.Component; | |
4 | +import org.springframework.validation.Errors; | |
5 | +import org.springframework.validation.ValidationUtils; | |
6 | +import org.springframework.validation.Validator; | |
7 | + | |
8 | +import br.com.centralit.api.model.EntradaAlmoxarifado; | |
9 | +import br.com.centralit.api.model.EntradaAlmoxarifadoItem; | |
10 | +import br.com.centralit.framework.exception.CodigoErro; | |
11 | +import br.com.centralit.framework.util.UtilColecao; | |
12 | +import br.com.centralit.framework.util.UtilDate; | |
13 | +import br.com.centralit.framework.util.UtilObjeto; | |
14 | + | |
15 | +@Component("entradaAlmoxarifadoBasicValidator") | |
16 | +public class EntradaAlmoxarifadoBasicValidator implements Validator { | |
17 | + | |
18 | + @Override | |
19 | + public boolean supports(Class<?> clazz) { | |
20 | + | |
21 | + return EntradaAlmoxarifado.class.isAssignableFrom(clazz); | |
22 | + } | |
23 | + | |
24 | + @Override | |
25 | + public void validate(Object target, Errors errors) { | |
26 | + | |
27 | + ValidationUtils.rejectIfEmpty(errors, "almoxarifado", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ALMOXARIFADO"); | |
28 | + | |
29 | + ValidationUtils.rejectIfEmpty(errors, "fornecedor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.FORNECEDOR"); | |
30 | + | |
31 | + ValidationUtils.rejectIfEmpty(errors, "dominioTipoEntrada", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ENTRADA"); | |
32 | + | |
33 | + ValidationUtils.rejectIfEmpty(errors, "dominioTipoRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_RECEBIMENTO"); | |
34 | + | |
35 | + ValidationUtils.rejectIfEmpty(errors, "dataRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.DATA_RECEBIMENTO"); | |
36 | + | |
37 | + ValidationUtils.rejectIfEmpty(errors, "valorTotalNota", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.VALOR_TOTAL_NOTA"); | |
38 | + | |
39 | + ValidationUtils.rejectIfEmpty(errors, "dominioFinalidade", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.FINALIDADE"); | |
40 | + | |
41 | + EntradaAlmoxarifado entrada = (EntradaAlmoxarifado) target; | |
42 | + | |
43 | + if (UtilDate.isPrimeiraDataMenorSegundaData(entrada.getDataReferencia(), entrada.getDataRecebimento())) { | |
44 | + errors.rejectValue("dataRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "VALIDACAO.DATA_RECEBIMENTO"); | |
45 | + } | |
46 | + | |
47 | + if (UtilObjeto.isReferencia(entrada.getDataContabil())) { | |
48 | + if (!UtilDate.isDentroMes(entrada.getDataContabil(), entrada.getAlmoxarifado().getOrganizacao().getDataReferenciaVigente())) { | |
49 | + errors.rejectValue("dataContabil", CodigoErro.REGRA_NEGOCIO.getValue().toString(), "MSG.MN019"); | |
50 | + } | |
51 | + } | |
52 | + | |
53 | + ValidationUtils.rejectIfEmpty(errors, "valorTotalNota", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.VALOR_TOTAL_NOTA"); | |
54 | + | |
55 | + if (UtilColecao.isVazio(entrada.getEntradasItem())) { | |
56 | + errors.rejectValue("entradasItem", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.MATERIAIS"); | |
57 | + } | |
58 | + | |
59 | + } | |
60 | +} | |
61 | + | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/validation/EntradaAlmoxarifadoValidator.java
... | ... | @@ -1,39 +0,0 @@ |
1 | -package br.com.centralit.api.service.validation; | |
2 | - | |
3 | -import org.springframework.stereotype.Component; | |
4 | -import org.springframework.validation.Errors; | |
5 | -import org.springframework.validation.ValidationUtils; | |
6 | -import org.springframework.validation.Validator; | |
7 | - | |
8 | -import br.com.centralit.api.model.EntradaAlmoxarifado; | |
9 | -import br.com.centralit.framework.exception.CodigoErro; | |
10 | - | |
11 | -@Component("entradaAlmoxarifadoValidator") | |
12 | -public class EntradaAlmoxarifadoValidator implements Validator { | |
13 | - | |
14 | - @Override | |
15 | - public boolean supports(Class<?> clazz) { | |
16 | - | |
17 | - return EntradaAlmoxarifado.class.isAssignableFrom(clazz); | |
18 | - } | |
19 | - | |
20 | - @Override | |
21 | - public void validate(Object target, Errors errors) { | |
22 | - | |
23 | - ValidationUtils.rejectIfEmpty(errors, "almoxarifado", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ALMOXARIFADO"); | |
24 | - | |
25 | - ValidationUtils.rejectIfEmpty(errors, "dataRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.DATA_RECEBIMENTO"); | |
26 | - | |
27 | - ValidationUtils.rejectIfEmpty(errors, "dataContabil", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.DATA_CONTABILIZACAO"); | |
28 | - | |
29 | - ValidationUtils.rejectIfEmpty(errors, "dominioTipoEntrada", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_ENTRADA"); | |
30 | - | |
31 | - ValidationUtils.rejectIfEmpty(errors, "dominioTipoRecebimento", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.TIPO_RECEBIMENTO"); | |
32 | - | |
33 | - ValidationUtils.rejectIfEmpty(errors, "fornecedor", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.FORNECEDOR"); | |
34 | - | |
35 | - ValidationUtils.rejectIfEmpty(errors, "valorTotalNota", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.VALOR_TOTAL_NOTA"); | |
36 | - | |
37 | - } | |
38 | -} | |
39 | - |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/EntradaAlmoxarifadoController.java
... | ... | @@ -106,5 +106,11 @@ public class EntradaAlmoxarifadoController extends GenericController<EntradaAlmo |
106 | 106 | |
107 | 107 | return responseBody; |
108 | 108 | } |
109 | + | |
110 | + @RequestMapping(method = RequestMethod.POST, value = "/concluir") | |
111 | + @ResponseBody | |
112 | + public ResponseBodyWrapper concluir(@RequestBody EntradaAlmoxarifado entradaAlmoxarifado) { | |
113 | + return new ResponseBodyWrapper(this.entradaAlmoxarifadoService.concluir(entradaAlmoxarifado), getEditView()); | |
114 | + } | |
109 | 115 | |
110 | 116 | } | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/listener/StartupListenerAlmoxarifado.java
... | ... | @@ -253,7 +253,7 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
253 | 253 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DATA_FIM_REQUISICAO", "Data final requisição", dominio, modulo)); |
254 | 254 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DATA_INICIAL_REQUISICAO", "Data inicial requisição", dominio, modulo)); |
255 | 255 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DESTINO", "Destino", dominio, modulo)); |
256 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENTRADA_ESTOQUE", "Ent. no estoque", dominio, modulo)); | |
256 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENTRADA_ESTOQUE", "Ent. no estoque (Qnt.)", dominio, modulo)); | |
257 | 257 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ESTRUTURA_ORGANIZACAO", "Estrutura Organizacional - Órgão", dominio, modulo)); |
258 | 258 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.LIMITE_ESTOQUE", "Limite de estoque", dominio, modulo)); |
259 | 259 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.LOCAL_ESTOQUE", "Local estoque", dominio, modulo)); |
... | ... | @@ -293,14 +293,23 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
293 | 293 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.RESTOMEDIO", "Resto médio", dominio, modulo)); |
294 | 294 | |
295 | 295 | //Endereco Estoque |
296 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE", "Endereço de Estoque", dominio, modulo)); | |
297 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_SUPERIOR", "Endereço Superior", dominio, modulo)); | |
298 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_SUPERIOR_DESCRICAO", "Desc. Endereço Superior", dominio, modulo)); | |
299 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ACOMODA_MATERIAL", "Acomoda Materiais", dominio, modulo)); | |
296 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE", "Endereço de estoque", dominio, modulo)); | |
297 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_SUPERIOR", "Endereço superior", dominio, modulo)); | |
298 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_SUPERIOR_DESCRICAO", "Desc. endereço superior", dominio, modulo)); | |
299 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ACOMODA_MATERIAL", "Acomoda materiais", dominio, modulo)); | |
300 | 300 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_TODOS_MATERIAL", "Adicionar endereço para todos os materiais", dominio, modulo)); |
301 | 301 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.MATERAIS_VINCULADOS", "Existe materiais vinculados a este endereço", dominio, modulo)); |
302 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_VINCULADO_SUPERIOR", "Endereço de Estoque: ", dominio, modulo)); | |
302 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_VINCULADO_SUPERIOR", "Endereço de estoque: ", dominio, modulo)); | |
303 | 303 | |
304 | + //Entrada de materiais | |
305 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DADOS_ENTRADA", "Dados da entrada", dominio, modulo)); | |
306 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DOCUMENTOS", "Documentos", dominio, modulo)); | |
307 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.VALOR_TOTAL_MATERIAL_SUBTOTAL", "Valor total do material (Subtotal)", dominio, modulo)); | |
308 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.UN_MEDIDA", "Un. medida", dominio, modulo)); | |
309 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA", "Concluir entrada", dominio, modulo)); | |
310 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA_BTN", "Concluir", dominio, modulo)); | |
311 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.CONCLUIR_E_CONTABILIZAR_ENTRADA", "Concluir e contabilizar", dominio, modulo)); | |
312 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.CONCLUIR_E_DESCONTABILIZAR_ENTRADA", "Concluir e descontabilizar", dominio, modulo)); | |
304 | 313 | } |
305 | 314 | |
306 | 315 | private void gerarValidacao(Dominio dominio, Modulo modulo, List<Internacionalizacao> internacionalizacaoList) { |
... | ... | @@ -328,6 +337,8 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
328 | 337 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.VALIDACAO.ENDERECO_ESTOQUE_IS_SUPERIOR_REMOVER", "O endereço de estoque a ser removido, foi vinculado como superior a outros endereço. Caso prossiga com a operação, também será removido todos os endereços vinculados a este. Deseja continuar?", dominio, modulo)); |
329 | 338 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.VALIDACAO.ENDERECO_ESTOQUE_TODOS_MATERIAIS", "A definição de endereço de estoque para todos os materias não poderá ser desfeita após salvar o registro. Deseja realmente adicionar este endereço para todos os materiais?", dominio, modulo)); |
330 | 339 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.VALIDACAO.ENDERECO_ESTOQUE_VINCULO_CICLICO", "Não é permitido vincular o endereço de estoque superior, pois este endereço tem como endereço superior o registro que está sendo alterado. Favor remover ou escolher outro endereço de estoque superior.", dominio, modulo)); |
340 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.VALIDACAO.ENTRADA_DESCONTABILIZACAO_COM_SAIDAS", "Você não pode descontabilizar esta entrada pois existem as seguintes saídas com materiais da mesma: ", dominio, modulo)); | |
341 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.VALIDACAO.DATA_CONTABIL_ALTERADA_SAIDAS", "Você não pode alterar a data de contabilização após realizar atendimentos e baixas em materiais desta entrada!", dominio, modulo)); | |
331 | 342 | } |
332 | 343 | |
333 | 344 | private void gerarMensagem(Dominio dominio, Modulo modulo, List<Internacionalizacao> internacionalizacaoList) { |
... | ... | @@ -344,6 +355,9 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
344 | 355 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.DATA_BAIXA_FORA_REFERENCIA_VIGENTE", "Data de conclusão tem que estar dentro da referência vigente", dominio, modulo)); |
345 | 356 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.REQUISICAO_DIFERENTE_NAO_CONCLUIDA_PRONTA_ATENDIMENTO", "Somente requisições de consumo com status Não concluída e Pronta para atendimento pode ser editada!", dominio, modulo)); |
346 | 357 | internacionalizacaoList.add(new Internacionalizacao("MSG.EXISTE_REQUISICAO_DISPONIVEL_CENTROCUSTO_ALMOXARIFADO_UR", "Centro de custo, almoxarifado, unidade requisitante e materiais de consumo estão presentes na requisição: ", dominio, modulo)); |
358 | + | |
359 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.ENTRADA_CONTABILIZADA", "Entrada contabilizada com sucesso!", dominio, modulo)); | |
360 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.ENTRADA_DESCONTABILIZADA", "Entrada descontabilizada com sucesso!", dominio, modulo)); | |
347 | 361 | } |
348 | 362 | } |
349 | 363 | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoController.js
1 | 1 | 'use strict'; |
2 | 2 | |
3 | 3 | citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUploader', 'EntradaAlmoxarifadoRepository', 'EstruturaOrganizacionalAlmoxarifadoRepository', '$translate', '$timeout', |
4 | - 'DominioRepository', 'FornecedorRepository', 'MaterialConsumoRepository', 'EntradaAlmoxarifadoItemRepository', | |
5 | - function EntradaAlmoxarifadoController($scope, $filter, FileUploader, EntradaAlmoxarifadoRepository, EstruturaOrganizacionalAlmoxarifadoRepository, $translate, $timeout, | |
6 | - DominioRepository , FornecedorRepository, MaterialConsumoRepository, | |
7 | - EntradaAlmoxarifadoItemRepository) { | |
4 | + 'DominioRepository', 'FornecedorRepository', 'MaterialConsumoRepository', 'EntradaAlmoxarifadoItemRepository', 'MaterialLocalEstoqueRepository', | |
5 | + 'MovimentoEstoqueRepository', | |
6 | + function EntradaAlmoxarifadoController($scope, $filter, FileUploader, EntradaAlmoxarifadoRepository, EstruturaOrganizacionalAlmoxarifadoRepository, | |
7 | + $translate, $timeout, DominioRepository , FornecedorRepository, MaterialConsumoRepository, EntradaAlmoxarifadoItemRepository, | |
8 | + MaterialLocalEstoqueRepository, MovimentoEstoqueRepository) { | |
8 | 9 | |
9 | - $scope.TIPO_NUMERICO_INTEIRO = 1; | |
10 | - $scope.TIPO_NUMERICO_DECIMAL = 2; | |
11 | 10 | var CODIGO_DOMINIO_TIPO_RECEBIMENTO_COMPRA_ORCAMENTARIA = 1; |
12 | 11 | |
13 | 12 | $scope.entradaAlmoxarifado = {}; |
13 | + | |
14 | + $scope.entradaAlmoxarifadoOriginal = {}; | |
15 | + $scope.edit = true; | |
14 | 16 | |
15 | 17 | /** |
16 | 18 | * Inicializa as datas do formulario de cadastro como data padrao hoje. |
17 | 19 | */ |
18 | 20 | $scope.resetFormInicializarDatas = function(){ |
21 | + $scope.resetForm(); | |
19 | 22 | // Obtem estrutura almoxarifado padrao |
20 | 23 | EstruturaOrganizacionalAlmoxarifadoRepository.getAlmoxarifadoPadrao($scope.usuarioLogado.organizacao.id).then(function(result){ |
21 | 24 | $scope.estruturaAlmoxarifadoPadrao = {}; |
... | ... | @@ -24,7 +27,6 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
24 | 27 | } |
25 | 28 | $scope.resetForm(); |
26 | 29 | $scope.entradaAlmoxarifado.dataRecebimento = $filter('date')(new Date(), "dd/MM/yyyy"); |
27 | - $scope.entradaAlmoxarifado.dataContabil = $filter('date')(new Date(), "dd/MM/yyyy"); | |
28 | 30 | }); |
29 | 31 | }; |
30 | 32 | |
... | ... | @@ -33,15 +35,19 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
33 | 35 | // Limpa formulário para novo cadastro |
34 | 36 | $scope.resetForm = function() { |
35 | 37 | $scope.limparEntradaAlmoxarifado(); |
38 | + | |
39 | + $scope.listaEntradaItemSelecao = []; | |
40 | + | |
41 | + $scope.atualizarListaSizeSelectEntradaItem(); | |
36 | 42 | $scope.edit = true; |
37 | 43 | $timeout(function(){ |
38 | 44 | $scope.entradaAlmoxarifadoForm.$submitted = false; |
39 | 45 | $scope.entradaAlmoxarifadoForm.$setPristine(); |
40 | 46 | |
41 | 47 | // limpar observações |
42 | - if($scope.entradaObservacaoForm['observacao.descricao']) { | |
43 | - $scope.entradaObservacaoForm['observacao.descricao'].$setViewValue(''); | |
44 | - $scope.entradaObservacaoForm['observacao.descricao'].$render(); | |
48 | + if($scope.entradaAlmoxarifadoForm.observacoesForm['observacao.descricao']) { | |
49 | + $scope.entradaAlmoxarifadoForm.observacoesForm['observacao.descricao'].$setViewValue(''); | |
50 | + $scope.entradaAlmoxarifadoForm.observacoesForm['observacao.descricao'].$render(); | |
45 | 51 | } |
46 | 52 | }); |
47 | 53 | |
... | ... | @@ -54,14 +60,13 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
54 | 60 | dataRecebimento : '', |
55 | 61 | dataContabil : '', |
56 | 62 | documentos : [], |
57 | - entradasIten : [], | |
63 | + entradasItem : [], | |
58 | 64 | dominioTipoEntrada : $scope.dominioTipoEntrada ? $scope.dominioTipoEntrada : null, |
59 | 65 | dominioTipoRecebimento : $scope.dominioTipoRecebimento ? $scope.dominioTipoRecebimento : null, |
60 | 66 | observacoes : [], |
61 | 67 | almoxarifado : $scope.estruturaAlmoxarifadoPadrao.id ? $scope.estruturaAlmoxarifadoPadrao : null, |
62 | 68 | dominioFinalidade : {} |
63 | 69 | }; |
64 | - $scope.entradaItemSelecionado = null; | |
65 | 70 | $scope.valorTotalMateriais = 0.0; |
66 | 71 | |
67 | 72 | DominioRepository.findAllDominio('tipoFinalidadeMaterial').then(function(result) { |
... | ... | @@ -108,20 +113,18 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
108 | 113 | url : '/cit-tabelas-corp-web/rest/anexo/uploadAnexo?idDocumento=' |
109 | 114 | }); |
110 | 115 | |
111 | - $scope.uploaderCaracteristica = new FileUploader({ | |
112 | - autoUpload: false, | |
113 | - queueLimit: 1, | |
114 | - url : '/citgrp-patrimonio-web/rest/entrada/uploadAnexoCaracteristica?idEntradaItem=' | |
115 | - }); | |
116 | - | |
117 | 116 | // Consulta entidade e mostra no formulario |
118 | 117 | $scope.getEntradaAlmoxarifado = function(entradaAlmoxarifado, edit){ |
119 | 118 | $scope.setLoadingGet(true); |
120 | 119 | |
121 | 120 | EntradaAlmoxarifadoRepository.get(entradaAlmoxarifado.id).then(function(result) { |
122 | 121 | $scope.entradaAlmoxarifado = result.originalElement; |
122 | + | |
123 | + $scope.entradaAlmoxarifadoOriginal = angular.copy($scope.entradaAlmoxarifado); | |
124 | + | |
123 | 125 | if($scope.entradaAlmoxarifado.fornecedor){ |
124 | 126 | $scope.entradaAlmoxarifado.fornecedor['pessoa.nome'] = $scope.entradaAlmoxarifado.fornecedor.pessoa.nome; |
127 | + $scope.entradaAlmoxarifadoOriginal.fornecedor['pessoa.nome'] = $scope.entradaAlmoxarifadoOriginal.fornecedor.pessoa.nome; | |
125 | 128 | } |
126 | 129 | |
127 | 130 | $scope.dominiosTipoRecebimento.forEach(function(item){ |
... | ... | @@ -130,9 +133,18 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
130 | 133 | }); |
131 | 134 | |
132 | 135 | $scope.calcularValorTotalMateriais(); |
136 | + $scope.atualizarListaSizeSelectEntradaItem(); | |
133 | 137 | $scope.edit = edit; |
134 | 138 | $scope.setLoading(false); |
135 | 139 | }); |
140 | + | |
141 | + MovimentoEstoqueRepository.buscarMovimentosSaidaComMateriaisDaEntrada($scope.entradaAlmoxarifado.id).then(function(result) { | |
142 | + if (result.saidas) { | |
143 | + $scope.bloquearDataContabil = true; | |
144 | + } else { | |
145 | + $scope.bloquearDataContabil = false; | |
146 | + } | |
147 | + }); | |
136 | 148 | }; |
137 | 149 | |
138 | 150 | $scope.findAutoCompleteAlmoxarifado = function(value){ |
... | ... | @@ -185,16 +197,21 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
185 | 197 | }); |
186 | 198 | |
187 | 199 | $scope.inicializarModalMateriais = function(){ |
200 | +<<<<<<< HEAD | |
188 | 201 | $scope.unidadeMedidaEntrada = {}; |
189 | 202 | $scope.editEntrada = true; |
203 | +======= | |
204 | + $scope.editEntrada = false; | |
205 | + $scope.newEntrada = true; | |
206 | +>>>>>>> tarefa-3943 | |
190 | 207 | $scope.limparModalMateriais(); |
191 | 208 | $scope.$openModal('modal-materiais-consumo.html', 'lg'); |
192 | 209 | }; |
193 | 210 | |
194 | 211 | $scope.limparModalMateriais = function(){ |
195 | - $scope.entradaItem = {}; | |
196 | - $scope.unidadesFixa = false; | |
197 | - $scope.caracteristicas = []; | |
212 | + $scope.entradaItem = { | |
213 | + $validarPrecoMedio : true | |
214 | + }; | |
198 | 215 | $scope.valorUnitario = 0; |
199 | 216 | }; |
200 | 217 | |
... | ... | @@ -204,6 +221,7 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
204 | 221 | }); |
205 | 222 | }; |
206 | 223 | |
224 | +<<<<<<< HEAD | |
207 | 225 | $scope.carregarItensMaterial = function(item){ |
208 | 226 | |
209 | 227 | $scope.entradaItem.quantidade = null; |
... | ... | @@ -224,6 +242,8 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
224 | 242 | |
225 | 243 | }; |
226 | 244 | |
245 | +======= | |
246 | +>>>>>>> tarefa-3943 | |
227 | 247 | // carregar as caracteristicas do material |
228 | 248 | $scope.carregarCaracteristicasGenericas = function(item){ |
229 | 249 | $scope.caracteristicas = []; |
... | ... | @@ -247,6 +267,7 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
247 | 267 | $scope.setLoading(false); |
248 | 268 | } |
249 | 269 | }; |
270 | +<<<<<<< HEAD | |
250 | 271 | |
251 | 272 | $scope.limparCamposMaterial = function(){ |
252 | 273 | |
... | ... | @@ -290,205 +311,290 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
290 | 311 | }); |
291 | 312 | }; |
292 | 313 | |
314 | +======= | |
315 | + | |
316 | +>>>>>>> tarefa-3943 | |
293 | 317 | $scope.addEntradaItem = function(formDialogMateriais) { |
294 | 318 | formDialogMateriais.$submitted = true; |
295 | - $scope.validaAnexo = false; | |
296 | - | |
297 | - $scope.caracteristicas.forEach(function(bemAlmoxarifadoCaracteristica) { | |
298 | - if(bemAlmoxarifadoCaracteristica.materialCaracteristica.caracteristica.dominioTipoDado.nome == 'ARQUIVO'){ | |
299 | - if($scope.uploaderCaracteristica.queue && $scope.uploaderCaracteristica.queue.length > 0){ | |
300 | - bemAlmoxarifadoCaracteristica.uploadAnexo = $scope.uploaderCaracteristica.getNotUploadedItems(); | |
301 | - }else{ | |
302 | - $scope.validaAnexo = true; | |
303 | - } | |
304 | - } | |
305 | - }); | |
306 | - | |
307 | - if(formDialogMateriais.$valid && !$scope.validaAnexo){ | |
308 | 319 | |
309 | - if($scope.entradaItem.$quantidadeEntrada > 0){ | |
320 | + if(formDialogMateriais.$valid){ | |
310 | 321 | |
311 | - if($scope.entradaItem.quantidadeDominioTipoUnidadeEntrada > 0){ | |
312 | - | |
313 | - if($scope.entradaItem.$validarPrecoMedio){ | |
314 | - | |
315 | - var idAlmoxarifado = $scope.entradaAlmoxarifado.almoxarifado ? $scope.entradaAlmoxarifado.almoxarifado.id : null; | |
322 | + if(!$scope.entradaItem.$quantidadeEntrada || $scope.entradaItem.$quantidadeEntrada <= 0){ | |
323 | + $scope.showAlert('error', $translate.instant('VALIDACAO.QUANTIDADE_MAIOR_ZERO')); | |
324 | + return; | |
325 | + } | |
326 | + | |
327 | + if(!$scope.entradaItem.valorTotal || $scope.entradaItem.valorTotal <= 0){ | |
328 | + $scope.showAlert('error', $translate.instant('ADMINISTRACAODEMATERIAIS.VALIDACAO.VALOR_TOTAL_MAIOR_ZERO')); | |
329 | + return; | |
330 | + } | |
331 | + | |
332 | + if($scope.entradaItem.$validarPrecoMedio){ | |
316 | 333 | |
317 | - EntradaAlmoxarifadoItemRepository.validarPrecoMedio($scope.entradaItem.valorUnitario, $scope.entradaItem.material.id, idAlmoxarifado).then(function(result) {}); | |
334 | + var idAlmoxarifado = $scope.entradaAlmoxarifado.almoxarifado ? $scope.entradaAlmoxarifado.almoxarifado.id : null; | |
318 | 335 | |
319 | - } | |
336 | + EntradaAlmoxarifadoItemRepository.validarPrecoMedio($scope.entradaItem.valorUnitario, $scope.entradaItem.material.id, idAlmoxarifado).then(function(result) {}); | |
320 | 337 | |
321 | - $scope.entradaItem.caracteristicas = $scope.caracteristicas; | |
338 | + } | |
322 | 339 | |
323 | - if(!$scope.entradaItem.uuid){ | |
324 | - $scope.entradaItem.uuid = getUuid(); | |
325 | - $scope.entradaAlmoxarifado.entradasIten.push($scope.entradaItem); | |
340 | + if(!$scope.entradaItem.uuid){ | |
341 | + $scope.entradaItem.uuid = getUuid(); | |
342 | + $scope.entradaAlmoxarifado.entradasItem.push($scope.entradaItem); | |
343 | + }else{ | |
344 | + var entradasItemTemp = []; | |
345 | + $scope.entradaAlmoxarifado.entradasItem.forEach(function (entradaItem, $index) { | |
346 | + if(entradaItem.uuid === $scope.entradaItem.uuid){ | |
347 | + entradasItemTemp.push($scope.entradaItem); | |
326 | 348 | }else{ |
327 | - var entradasItemTemp = []; | |
328 | - $scope.entradaAlmoxarifado.entradasIten.forEach(function (entradaItem, $index) { | |
329 | - if(entradaItem.uuid === $scope.entradaItem.uuid){ | |
330 | - entradasItemTemp.push($scope.entradaItem); | |
331 | - }else{ | |
332 | - entradasItemTemp.push(entradaItem); | |
333 | - } | |
334 | - }); | |
335 | - $scope.entradaAlmoxarifado.entradasIten = entradasItemTemp; | |
349 | + entradasItemTemp.push(entradaItem); | |
336 | 350 | } |
351 | + }); | |
352 | + $scope.entradaAlmoxarifado.entradasItem = entradasItemTemp; | |
353 | + } | |
337 | 354 | |
355 | + $scope.calcularValorTotalMateriais(); | |
338 | 356 | |
339 | - $scope.calcularValorTotalMateriais(); | |
340 | - | |
341 | - if($scope.uploaderCaracteristica.queue > 0){ | |
342 | - | |
343 | - $scope.uploaderCaracteristica.clearQueue(); | |
344 | - } | |
345 | - | |
346 | - $scope.$modalInstance.dismiss('cancel'); | |
347 | - } else{ | |
348 | - $scope.showAlert('error', $translate.instant('ALMOXARIFADO.VALIDACAO.UNIDADE_MAIOR_ZERO')); | |
349 | - } | |
350 | - }else{ | |
351 | - $scope.showAlert('error', $translate.instant('VALIDACAO.QUANTIDADE_MAIOR_ZERO')); | |
352 | - } | |
357 | + $scope.$modalInstance.dismiss('cancel'); | |
358 | + $scope.atualizarListaSizeSelectEntradaItem(); | |
353 | 359 | |
354 | 360 | }else{ |
355 | 361 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS')); |
356 | 362 | } |
357 | 363 | |
358 | - $scope.entradaItemSelecionado = null; | |
359 | - | |
360 | 364 | }; |
361 | - | |
362 | - $scope.abrirEntradaItem = function(editar){ | |
363 | - | |
364 | - if($scope.entradaItemSelecionado){ | |
365 | - | |
366 | - $scope.editEntrada = editar; | |
367 | - $scope.entradaItem = clone($scope.entradaItemSelecionado); | |
368 | - $scope.entradaItem.$quantidadeEntrada = $scope.entradaItem.quantidade / $scope.entradaItem.quantidadeDominioTipoUnidadeEntrada; | |
369 | - $scope.unidadesMedidasEntrada = $scope.entradaItem.material.tiposUnidadeMedidaEntrada.map(function(item){ | |
370 | - return item.unidadeMedida; | |
371 | - });; | |
372 | - $scope.caracteristicas = $scope.entradaItem.caracteristicas; | |
373 | - | |
374 | - $scope.caracteristicas.forEach(function(bemPatrimonialCaracteristica) { | |
375 | - if(bemPatrimonialCaracteristica.materialCaracteristica.caracteristica.dominioTipoDado.nome == 'ARQUIVO'){ | |
376 | - $scope.uploaderCaracteristica.queue = clone(bemPatrimonialCaracteristica.uploadAnexo); | |
365 | + | |
366 | + // Seleciona todos os itens da entrada | |
367 | + $scope.checkAllEntradaItem = function(value) { | |
368 | + $scope.listaEntradaItemSelecao = []; | |
369 | + angular.forEach($scope.entradaAlmoxarifado.entradasItem, function (item) { | |
370 | + item.$checked = value; | |
371 | + $scope.listaEntradaItemSelecao.push(item); | |
372 | + }); | |
373 | + if(!value){ | |
374 | + $scope.listaEntradaItemSelecao = []; | |
375 | + } | |
376 | + $scope.atualizarListaSizeSelectEntradaItem(); | |
377 | + }; | |
378 | + | |
379 | + $scope.checkEntradaItem = function(item){ | |
380 | + if(item.$checked){ | |
381 | + $scope.listaEntradaItemSelecao.push(item); | |
382 | + }else{ | |
383 | + $scope.listaEntradaItemSelecao.splice($scope.listaEntradaItemSelecao.indexOf(item), 1); | |
384 | + } | |
385 | + }; | |
386 | + | |
387 | + $scope.atualizarListaSizeSelectEntradaItem = function() { | |
388 | + if(!$scope.listaEntradaItemSize){ | |
389 | + $scope.listaEntradaItemSize = 0; | |
390 | + }; | |
391 | + var lista = $scope.getEntradaItemChecked(); | |
392 | + $scope.listaEntradaItemSize = lista.length; | |
393 | + }; | |
394 | + | |
395 | + // recupera as entradas itens selecionadas | |
396 | + $scope.getEntradaItemChecked = function() { | |
397 | + var entradaItemChecked = []; | |
398 | + | |
399 | + if ($scope.entradaAlmoxarifado.entradasItem) { | |
400 | + for (var i = 0; i < $scope.entradaAlmoxarifado.entradasItem.length; i++) { | |
401 | + if ($scope.entradaAlmoxarifado.entradasItem[i].$checked) { | |
402 | + entradaItemChecked.push(angular.copy($scope.entradaAlmoxarifado.entradasItem[i])); | |
377 | 403 | } |
404 | +<<<<<<< HEAD | |
378 | 405 | }); |
379 | 406 | |
380 | 407 | if($scope.entradaItem.dataValidade && !$scope.entradaItem.id){ |
381 | 408 | $scope.entradaItem.dataValidade = $filter('date')($scope.entradaItem.dataValidade, "dd/MM/yyyy"); |
409 | +======= | |
410 | +>>>>>>> tarefa-3943 | |
382 | 411 | } |
383 | - | |
384 | - $scope.$openModal('modal-materiais-consumo.html', 'lg'); | |
385 | - | |
386 | - }else{ | |
387 | - | |
388 | - $scope.showAlert('warning', editar ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO')); | |
389 | 412 | } |
390 | 413 | |
414 | + return entradaItemChecked; | |
391 | 415 | }; |
392 | 416 | |
393 | - $scope.removerEntradaItem = function(){ | |
394 | - | |
395 | - if($scope.entradaItemSelecionado){ | |
396 | - | |
397 | - var entradaItem = $scope.entradaItemSelecionado; | |
398 | - | |
399 | - if(entradaItem !== undefined){ | |
400 | - | |
401 | - $scope.$openModalConfirm({message: $translate.instant('MSG.DESEJA_EXCLUIR_ITENS'), callback: $scope.excluirEntradaItem, item: entradaItem}); | |
402 | - } | |
417 | + $scope.abrirEntradaItem = function(editar){ | |
418 | + $scope.entradaItem = null; | |
419 | + // recupera os itens de entrada selecionados | |
420 | + var itensSelecionados = $scope.getEntradaItemChecked(); | |
403 | 421 | |
404 | - }else{ | |
422 | + if (itensSelecionados.length > 1) { | |
423 | + $scope.showAlert('warning', editar? $translate.instant('MSG.SELECIONE_APENAS_UM_ITEM_PARA_EDICAO') : $translate.instant('MSG.SELECIONE_APENAS_UM_ITEM_PARA_VISUALIZACAO')); | |
424 | + return; | |
425 | + } | |
405 | 426 | |
406 | - $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_ITEM_EXCLUIR')); | |
427 | + if(itensSelecionados.length === 0) { | |
428 | + $scope.showAlert('warning', editar? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO')); | |
429 | + return; | |
407 | 430 | } |
408 | - }; | |
409 | 431 | |
410 | - $scope.excluirEntradaItem = function(){ | |
411 | - var entradaItemSelecionada = this.item; | |
412 | - if(entradaItemSelecionada.id){ | |
413 | - $scope.setLoadingRemove(true); | |
414 | - EntradaAlmoxarifadoItemRepository.remove(entradaItemSelecionada).then(function() { | |
415 | - $scope.showAlert("success", $translate.instant('MSG.REGISTRO_EXCLUIDO')); | |
416 | - $scope.excluirItemAlmoxarifadoDaLista(entradaItemSelecionada); | |
417 | - $scope.setLoading(false); | |
418 | - }); | |
419 | - }else{ | |
420 | - $scope.excluirItemAlmoxarifadoDaLista(entradaItemSelecionada); | |
421 | - } | |
422 | - | |
423 | - $scope.entradaItemSelecionado = null; | |
432 | + $scope.newEntrada = false; | |
433 | + $scope.editEntrada = editar; | |
434 | + $scope.entradaItem = itensSelecionados[0]; | |
435 | + $scope.entradaItem.$quantidadeEntrada = $scope.entradaItem.quantidade / $scope.entradaItem.unidadeMedidaEntrada.quantidadePadrao; | |
436 | + $scope.unidadesMedidasEntrada = $scope.entradaItem.material.tiposUnidadeMedidaEntrada.map(function(item){ | |
437 | + return item.unidadeMedida; | |
438 | + }); | |
439 | + | |
440 | + if($scope.entradaItem.dataValidade && !$scope.entradaItem.id){ | |
441 | + $scope.entradaItem.dataValidade = $filter('date')($scope.entradaItem.dataValidade, "dd/MM/yyyy"); | |
442 | + } | |
424 | 443 | |
425 | - }; | |
444 | + $scope.$openModal('modal-materiais-consumo.html', 'lg'); | |
445 | + }; | |
426 | 446 | |
427 | - $scope.excluirItemAlmoxarifadoDaLista = function(entradaItemSelecionada){ | |
428 | - var index = 0; | |
429 | - $scope.valorTotalMateriais = 0.0; | |
430 | - $scope.entradaAlmoxarifado.entradasIten.forEach(function (entradaItem, key) { | |
431 | - if(entradaItemSelecionada.uuid === entradaItem.uuid) { | |
432 | - index = key; | |
433 | - } | |
434 | - }); | |
435 | - $scope.entradaAlmoxarifado.entradasIten.splice(index, 1); | |
436 | - $scope.calcularValorTotalMateriais(); | |
437 | - $scope.$modalConfirmInstance.dismiss('cancel'); | |
447 | + $scope.removerEntradaItem = function(){ | |
448 | + // recupera os itens da entrada selecionados | |
449 | + var itensSelecionados = $scope.getEntradaItemChecked(); | |
450 | + | |
451 | + if (itensSelecionados.length > 0) { | |
452 | + $scope.$openModalConfirm({ | |
453 | + message: $translate.instant('MSG.CONFIRMA_EXCLUSAO'), | |
454 | + callback: function() { | |
455 | + | |
456 | + $scope.$modalConfirmInstance.dismiss('cancel'); | |
457 | + | |
458 | + for (var i = 0; i < itensSelecionados.length; i++) { | |
459 | + if (itensSelecionados[i].id) { | |
460 | + EntradaAlmoxarifadoItemRepository.remove(itensSelecionados[i]).then(function(result) { | |
461 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_EXCLUIDO')); | |
462 | + }); | |
463 | + } | |
464 | + } | |
465 | + var itens = []; | |
466 | + for (var i = 0; i < $scope.entradaAlmoxarifado.entradasItem.length; i++) { | |
467 | + if (!$scope.entradaAlmoxarifado.entradasItem[i].$checked) { | |
468 | + itens.push($scope.entradaAlmoxarifado.entradasItem[i]); | |
469 | + } | |
470 | + } | |
471 | + $scope.listaEntradaItemSelecao = []; | |
472 | + $scope.entradaAlmoxarifado.entradasItem = itens; | |
473 | + $scope.atualizarListaSizeSelectEntradaItem(); | |
474 | + $scope.calcularValorTotalMateriais(); | |
475 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_EXCLUIDO')); | |
476 | + } | |
477 | + }); | |
478 | + } else { | |
479 | + $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_AO_MENOS_UM_ITEM_PARA_SER_REMOVIDO')); | |
480 | + } | |
438 | 481 | }; |
439 | 482 | |
440 | 483 | $scope.calcularValorTotalMateriais = function(){ |
441 | 484 | $scope.valorTotalMateriais = 0.0; |
442 | - $scope.entradaAlmoxarifado.entradasIten.forEach(function (entradaItem) { | |
485 | + $scope.entradaAlmoxarifado.entradasItem.forEach(function (entradaItem) { | |
443 | 486 | $scope.valorTotalMateriais = converterMoedaToNumber(entradaItem.valorTotal) + $scope.valorTotalMateriais; |
444 | 487 | }); |
445 | 488 | }; |
489 | + | |
490 | + $scope.saveOrUpdateContabilizar = function(contabilizar) { | |
491 | + | |
492 | + $scope.entradaAlmoxarifado.isEntradaConcluida = true; | |
493 | + $scope.entradaAlmoxarifadoOriginal.isEntradaConcluida = true; | |
494 | + | |
495 | + if (contabilizar) { | |
496 | + $scope.dataContabilFinal = $scope.entradaAlmoxarifado.dataContabil; | |
497 | + $scope.dataContabilFinalBloqueada = $scope.entradaAlmoxarifado.dataContabil; | |
498 | + $scope.$openModal('modal-contabilizar-entrada.html', 'lg'); | |
499 | + } else { | |
500 | + $scope.saveOrUpdate(null); | |
501 | + } | |
502 | + }; | |
446 | 503 | |
447 | 504 | // SALVA O EntradaAlmoxarifado |
448 | - $scope.saveOrUpdate = function(){ | |
505 | + $scope.saveOrUpdate = function(dataContabil){ | |
449 | 506 | $scope.entradaAlmoxarifadoForm.$submitted = true; |
507 | + $scope.entradaAlmoxarifadoForm.dadosEntradaForm.$submitted = true; | |
508 | + $scope.entradaAlmoxarifadoForm.materiaisForm.$submitted = true; | |
509 | + $scope.entradaAlmoxarifadoForm.documentosForm.$submitted = true; | |
510 | + $scope.entradaAlmoxarifadoForm.observacoesForm.$submitted = true; | |
450 | 511 | |
451 | 512 | // validar o formulario, retorna true se o formulario e as regras estiverem OK |
452 | 513 | var formularioValido = validarFormulario($scope.entradaAlmoxarifadoForm); |
453 | 514 | |
454 | 515 | // verifica formulario valido |
455 | - if(formularioValido){ | |
456 | - | |
516 | + if(formularioValido) { | |
457 | 517 | var entradaTemp = { |
458 | - documentos : [] | |
459 | - }; | |
518 | + documentos : [] | |
519 | + }; | |
460 | 520 | |
461 | 521 | // preencher lista de documentos temporarios para verificacao dos anexos. verificar qual anexo e de qual documento pelo numero do documento |
462 | 522 | angular.forEach($scope.entradaAlmoxarifado.documentos, function(documento, key) { |
463 | - | |
464 | - entradaTemp.documentos.push({ | |
465 | - uploadsDocumento : clone(documento.uploadsDocumento), | |
466 | - numero : clone(documento.numero) | |
467 | - }); | |
468 | - | |
469 | - // deleta esse atributo por causa de um erro de ciclo no json | |
470 | - delete documento.uploadsDocumento; | |
523 | + entradaTemp.documentos.push({ | |
524 | + uploadsDocumento : clone(documento.uploadsDocumento), | |
525 | + numero : clone(documento.numero) | |
526 | + }); | |
527 | + //deleta esse atributo por causa de um erro de ciclo no json | |
528 | + delete documento.uploadsDocumento; | |
471 | 529 | }); |
472 | 530 | |
473 | - $scope.setLoadingSalva(true); | |
474 | - | |
475 | - EntradaAlmoxarifadoRepository.save($scope.entradaAlmoxarifado).then(function(result) { | |
476 | - | |
477 | - $scope.entradaAlmoxarifado = result.originalElement; | |
478 | - | |
479 | - $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
480 | - | |
481 | - // depois de salvar a entrada ja tendo uma referencia do id, esse metodo ira salvar os documentos se existir | |
482 | - salvarListaDocumentos(entradaTemp); | |
483 | - | |
484 | - $scope.resetForm(); | |
485 | - | |
531 | + $scope.setLoadingSalva(true); | |
532 | + | |
533 | + EntradaAlmoxarifadoRepository.save($scope.entradaAlmoxarifado).then(function(result) { | |
534 | + $scope.entradaAlmoxarifado = result.originalElement; | |
535 | + | |
536 | + if ($scope.entradaAlmoxarifado.fornecedor) { | |
537 | + $scope.entradaAlmoxarifado.fornecedor['pessoa.nome'] = $scope.entradaAlmoxarifado.fornecedor.pessoa.nome; | |
538 | + } | |
539 | + | |
540 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
541 | + | |
542 | + // depois de salvar a entrada ja tendo uma referencia do id, esse metodo ira salvar os documentos se existir | |
543 | + salvarListaDocumentos(entradaTemp); | |
486 | 544 | $scope.setLoading(false); |
487 | - | |
545 | + | |
546 | + var dataContabilAntiga = angular.copy($scope.entradaAlmoxarifado.dataContabil); | |
547 | + | |
548 | + $scope.setLoadingSalva(true); | |
549 | + | |
550 | + if (dataContabilAntiga && !dataContabil) { | |
551 | + MovimentoEstoqueRepository.buscarMovimentosSaidaComMateriaisDaEntrada($scope.entradaAlmoxarifado.id).then(function(result) { | |
552 | + if (result.saidas) { | |
553 | + $scope.setLoading(false); | |
554 | + $scope.showAlert('warning', $translate.instant('ALMOXARIFADO.VALIDACAO.ENTRADA_DESCONTABILIZACAO_COM_SAIDAS') + result.saidas); | |
555 | + } else { | |
556 | + concluir(dataContabil); | |
557 | + } | |
558 | + }); | |
559 | + } else { | |
560 | + concluir(dataContabil); | |
561 | + } | |
488 | 562 | }); |
489 | - | |
490 | 563 | } |
491 | 564 | }; |
565 | + | |
566 | + var concluir = function(dataContabil) { | |
567 | + var dataContabilAntiga = angular.copy($scope.entradaAlmoxarifado.dataContabil); | |
568 | + var error = true; | |
569 | + $scope.entradaAlmoxarifado.dataContabil = dataContabil; | |
570 | + | |
571 | + $scope.entradaAlmoxarifado.valorTotalNota = converterMoedaToNumber($scope.entradaAlmoxarifado.valorTotalNota); | |
572 | + | |
573 | + EntradaAlmoxarifadoRepository.concluir($scope.entradaAlmoxarifado).then(function(result) { | |
574 | + $scope.resetForm(); | |
575 | + error = false; | |
576 | + $scope.entradaAlmoxarifado = result.originalElement; | |
577 | + $scope.entradaAlmoxarifado.dataRecebimento = $filter('date')($scope.entradaAlmoxarifado.dataRecebimento, "dd/MM/yyyy"); | |
578 | + $scope.entradaAlmoxarifado.dataContabil = $filter('date')($scope.entradaAlmoxarifado.dataContabil, "dd/MM/yyyy"); | |
579 | + $scope.entradaAlmoxarifado.dataReferencia = $filter('date')($scope.entradaAlmoxarifado.dataReferencia, "dd/MM/yyyy"); | |
580 | + if ($scope.entradaAlmoxarifado.fornecedor) { | |
581 | + $scope.entradaAlmoxarifado.fornecedor['pessoa.nome'] = $scope.entradaAlmoxarifado.fornecedor.pessoa.nome; | |
582 | + } | |
583 | + $scope.setLoading(false); | |
584 | + if (dataContabil) { | |
585 | + $scope.showAlert("success", $translate.instant('ALMOXARIFADO.MSG.ENTRADA_CONTABILIZADA')); | |
586 | + $scope.contabilizado = true; | |
587 | + } else { | |
588 | + $scope.showAlert("success", $translate.instant('ALMOXARIFADO.MSG.ENTRADA_DESCONTABILIZADA')); | |
589 | + } | |
590 | + }); | |
591 | + | |
592 | + $timeout(function() { | |
593 | + if (error) { | |
594 | + $scope.entradaAlmoxarifado.dataContabil = dataContabilAntiga; | |
595 | + } | |
596 | + }, 1000); | |
597 | + }; | |
492 | 598 | |
493 | 599 | // metodo utilizado para percorrer a lista de documentos persistidos e verificar com a lista de documentos temporarios para verificacao de qual anexo pertence a qual documento |
494 | 600 | var salvarListaDocumentos = function(entradaTemp){ |
... | ... | @@ -529,20 +635,9 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
529 | 635 | |
530 | 636 | var formularioValido = true; |
531 | 637 | |
532 | - if(!form.$valid || !$scope.entradaAlmoxarifado.entradasIten.length > 0 || !$scope.entradaAlmoxarifado.documentos.length > 0){ | |
638 | + if(!form.$valid || !$scope.entradaAlmoxarifado.entradasItem.length > 0 || !$scope.entradaAlmoxarifado.documentos.length > 0){ | |
533 | 639 | $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS')); |
534 | 640 | formularioValido = false; |
535 | - | |
536 | - }else{ | |
537 | - // validação de valores iguais | |
538 | - if(converterMoedaToNumber($scope.entradaAlmoxarifado.valorTotalNota) !== converterMoedaToNumber($scope.valorTotalMateriais)){ | |
539 | - $scope.showAlert('error', $translate.instant('ALMOXARIFADO.VALIDACAO.NOTA_FISCAL_IGUAL_VALOR_INFORMADO')); | |
540 | - formularioValido = false; | |
541 | - } | |
542 | - if(!$scope.validarDataTransferencia($scope.entradaAlmoxarifado.dataContabil)){ | |
543 | - $scope.showAlert('error', $translate.instant('MSG.MN019')); | |
544 | - formularioValido = false; | |
545 | - } | |
546 | 641 | } |
547 | 642 | |
548 | 643 | return formularioValido; |
... | ... | @@ -687,6 +782,265 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
687 | 782 | } |
688 | 783 | }; |
689 | 784 | //### FIM METODOS RELACIONADOS AOS RELATORIOS DE INVENTARIO ### |
785 | + | |
786 | + //Watch para controlar os tipos de recebimento | |
787 | + $scope.$watch('entradaAlmoxarifado.dominioTipoEntrada', function() { | |
788 | + $timeout(function() { | |
789 | + if ($scope.entradaAlmoxarifado.dominioTipoEntrada && ($scope.entradaAlmoxarifado.dominioTipoEntrada.codigo == 1)) { | |
790 | + $scope.dominiosTipoRecebimento = $scope.dominiosTipoRecebimentoOrcamentaria; | |
791 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento && $scope.entradaAlmoxarifado.dominioTipoRecebimento.codigo != CODIGO_DOMINIO_TIPO_RECEBIMENTO_COMPRA_ORCAMENTARIA) { | |
792 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | |
793 | + } | |
794 | + } else if ($scope.entradaAlmoxarifado.dominioTipoEntrada && ($scope.entradaAlmoxarifado.dominioTipoEntrada.codigo == 2)) { | |
795 | + $scope.dominiosTipoRecebimento = $scope.dominiosTipoRecebimentoExtraOrcamentaria; | |
796 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento && $scope.entradaAlmoxarifado.dominioTipoRecebimento.codigo == CODIGO_DOMINIO_TIPO_RECEBIMENTO_COMPRA_ORCAMENTARIA) { | |
797 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | |
798 | + } | |
799 | + } else { | |
800 | + $scope.dominiosTipoRecebimento = []; | |
801 | + if ($scope.entradaAlmoxarifado.dominioTipoRecebimento) { | |
802 | + delete $scope.entradaAlmoxarifado.dominioTipoRecebimento; | |
803 | + } | |
804 | + } | |
805 | + }); | |
806 | + }); | |
807 | + | |
808 | + //Watch para controlar as definições de material selecionado na modal de adição de materiais | |
809 | + $scope.$watch('entradaItem.material', function() { | |
810 | + $timeout(function() { | |
811 | + if ($scope.newEntrada) { | |
812 | + if (!$scope.entradaItem) { | |
813 | + $scope.entradaItem = { | |
814 | + $validarPrecoMedio : true | |
815 | + }; | |
816 | + } | |
817 | + $scope.entradaItem.quantidade = null; | |
818 | + $scope.entradaItem.valorTotal = null; | |
819 | + $scope.entradaItem.valorUnitario = null; | |
820 | + $scope.entradaItem.unidadeMedidaEntrada = null; | |
821 | + $scope.entradaItem.materialLocalEstoque = null; | |
822 | + $scope.unidadesMedidasEntrada = []; | |
823 | + $scope.enderecosMaterial = []; | |
824 | + } | |
825 | + | |
826 | + if ($scope.entradaItem && $scope.entradaItem.material) { | |
827 | + $scope.unidadesMedidasEntrada = $scope.entradaItem.material.tiposUnidadeMedidaEntrada.map(function(item){ | |
828 | + if (item.isPadrao && !$scope.entradaItem.unidadeMedidaEntrada) { | |
829 | + $scope.entradaItem.unidadeMedidaEntrada = item.unidadeMedida; | |
830 | + } | |
831 | + return item.unidadeMedida; | |
832 | + }); | |
833 | + | |
834 | + MaterialLocalEstoqueRepository.listarMaterialEstoquePorMaterial($scope.entradaItem.material.id).then(function(result) { | |
835 | + $scope.enderecosMaterial = []; | |
836 | + for (var i = 0; i < result.length; i++) { | |
837 | + $scope.enderecosMaterial.push(result[i].originalElement); | |
838 | + | |
839 | + if (result[i].localPrincipal && !$scope.entradaItem.materialLocalEstoque) { | |
840 | + $scope.entradaItem.materialLocalEstoque = result[i].originalElement; | |
841 | + } | |
842 | + } | |
843 | + }); | |
844 | + } | |
845 | + }); | |
846 | + }); | |
847 | + | |
848 | + //Watch para controlar as mudanças da quantidade na entrada de materiais | |
849 | + $scope.$watch('entradaItem.$quantidadeEntrada', function() { | |
850 | + $timeout(function(){ | |
851 | + if ($scope.entradaItem) { | |
852 | + if($scope.entradaItem.$quantidadeEntrada && $scope.entradaItem.unidadeMedidaEntrada){ | |
853 | + $scope.entradaItem.quantidade = $scope.entradaItem.$quantidadeEntrada * $scope.entradaItem.unidadeMedidaEntrada.quantidadePadrao; | |
854 | + } else { | |
855 | + delete $scope.entradaItem.quantidade; | |
856 | + } | |
857 | + if($scope.entradaItem.quantidade && $scope.entradaItem.valorTotal){ | |
858 | + $scope.entradaItem.valorUnitario = $scope.entradaItem.valorTotal / $scope.entradaItem.quantidade; | |
859 | + } else { | |
860 | + delete $scope.entradaItem.valorUnitario; | |
861 | + } | |
862 | + } | |
863 | + }); | |
864 | + }); | |
865 | + | |
866 | + //Watch para controlar as mudanças da unidade de medida na entrada de materiais | |
867 | + $scope.$watch('entradaItem.unidadeMedidaEntrada', function() { | |
868 | + $timeout(function(){ | |
869 | + if ($scope.entradaItem) { | |
870 | + if($scope.entradaItem.$quantidadeEntrada && $scope.entradaItem.unidadeMedidaEntrada){ | |
871 | + $scope.entradaItem.quantidade = $scope.entradaItem.$quantidadeEntrada * $scope.entradaItem.unidadeMedidaEntrada.quantidadePadrao; | |
872 | + } else { | |
873 | + delete $scope.entradaItem.quantidade; | |
874 | + } | |
875 | + } | |
876 | + }); | |
877 | + }); | |
878 | + | |
879 | + //Watch para controlar as mudanças do valor total da entrada de materiais | |
880 | + $scope.$watch('entradaItem.valorTotal', function() { | |
881 | + $timeout(function(){ | |
882 | + if ($scope.entradaItem) { | |
883 | + if($scope.entradaItem.quantidade && $scope.entradaItem.valorTotal){ | |
884 | + $scope.entradaItem.valorUnitario = $scope.entradaItem.valorTotal / $scope.entradaItem.quantidade; | |
885 | + } else { | |
886 | + delete $scope.entradaItem.valorUnitario; | |
887 | + } | |
888 | + } | |
889 | + }); | |
890 | + }); | |
891 | + | |
892 | + | |
893 | + | |
894 | + // ########################################### | |
895 | + // ########################################### DAQUI PARA BAIXO SAO TODOS OS METODOS RELACIONADOS AO WIZARD | |
896 | + // ########################################### | |
897 | + | |
898 | + $scope.templates = [{ name: 'entradaAlmoxarifadoPg1.html', url: '/cit-almoxarifado-web/html/entradaAlmoxarifado/entradaAlmoxarifadoPg1.html', show: true}, | |
899 | + { name: 'entradaAlmoxarifadoPg2.html', url: '/cit-almoxarifado-web/html/entradaAlmoxarifado/entradaAlmoxarifadoPg2.html', show: false}, | |
900 | + { name: 'entradaAlmoxarifadoPg3.html', url: '/cit-almoxarifado-web/html/entradaAlmoxarifado/entradaAlmoxarifadoPg3.html', show: false}, | |
901 | + { name: 'entradaAlmoxarifadoPg4.html', url: '/cit-almoxarifado-web/html/entradaAlmoxarifado/entradaAlmoxarifadoPg4.html', show: false} ]; | |
902 | + | |
903 | + $scope.steps = ['one', 'two', 'three', 'four']; | |
904 | + $scope.step = 0; | |
905 | + | |
906 | +// Verifica se o passo é o primeiro passo do wizard | |
907 | + $scope.isFirstStep = function() { | |
908 | + return $scope.step === 0; | |
909 | + }; | |
910 | + | |
911 | + // Verifica se o passo é o ultimo passo do wizard | |
912 | + $scope.isLastStep = function() { | |
913 | + return $scope.step === ($scope.steps.length - 1); | |
914 | + }; | |
915 | + | |
916 | + // Verifica se o passo é o passo atual do wizard | |
917 | + $scope.isCurrentStep = function(step) { | |
918 | + return $scope.step === step; | |
919 | + }; | |
920 | + | |
921 | + // Utilizado pelo wizard para mudar para o passo desejado | |
922 | + $scope.setCurrentStep = function(step) { | |
923 | + | |
924 | + $scope.setLoadingGet(true); | |
925 | + | |
926 | + if (step <= ($scope.step - 1)) { | |
927 | + $scope.templates[$scope.step].show = false; | |
928 | + $scope.step = step; | |
929 | + $scope.templates[step].show = true; | |
930 | + } else { | |
931 | + if (!$scope.edit) { | |
932 | + $scope.permitidoAvancar = true; | |
933 | + } else { | |
934 | + permiteAvancoFluxo(); | |
935 | + } | |
936 | + | |
937 | + if ($scope.permitidoAvancar) { | |
938 | + $scope.templates[$scope.step].show = false; | |
939 | + $scope.step = step; | |
940 | + $scope.templates[step].show = true; | |
941 | + } | |
942 | + } | |
943 | + | |
944 | + $scope.setLoading(false); | |
945 | + }; | |
946 | + | |
947 | + // Controla se o usuario pode avancar o fluxo no wizard, validando os itens obrigatórios | |
948 | + function permiteAvancoFluxo() { | |
949 | + | |
950 | + $scope.permitidoAvancar = true; | |
951 | + | |
952 | + if ($scope.step === 0) { | |
953 | + if (!validStepDadosEntrada() && $scope.permitidoAvancar) { | |
954 | + $scope.entradaAlmoxarifadoForm.dadosEntradaForm.$submitted = true; | |
955 | + $scope.permitidoAvancar = false; | |
956 | + } | |
957 | + } else if ($scope.step === 1) { | |
958 | + if (!validStepMateriais() && $scope.permitidoAvancar) { | |
959 | + $scope.entradaAlmoxarifadoForm.materiaisForm.$submitted = true; | |
960 | + $scope.permitidoAvancar = false; | |
961 | + } | |
962 | + } else if ($scope.step === 2) { | |
963 | + if (!validStepDocumentos() && $scope.permitidoAvancar) { | |
964 | + $scope.entradaAlmoxarifadoForm.documentosForm.$submitted = true; | |
965 | + $scope.permitidoAvancar = false; | |
966 | + } | |
967 | + } else if ($scope.step === 3) { | |
968 | + $scope.entradaAlmoxarifadoForm.observacoesForm.$submitted = true; | |
969 | + } | |
970 | + | |
971 | + if (!$scope.permitidoAvancar && !$scope.stepValid) { | |
972 | + //Mensagem de erro de campos obrigatorios nao preenchidos | |
973 | + $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | |
974 | + } | |
975 | + }; | |
976 | + | |
977 | +// Recupera o passo atual do wizard | |
978 | + $scope.getCurrentStep = function() { | |
979 | + return $scope.steps[$scope.step]; | |
980 | + }; | |
981 | + | |
982 | + // Faz com o que o wizard retroceda um passo | |
983 | + $scope.handlePrevious = function() { | |
984 | + | |
985 | + $scope.setLoadingGet(true); | |
986 | + | |
987 | + $scope.templates[$scope.step].show = false; | |
988 | + $scope.step -= ($scope.isFirstStep()) ? 0 : 1; | |
989 | + $scope.templates[$scope.step].show = true; | |
990 | + | |
991 | + $scope.setLoading(false); | |
992 | + | |
993 | + }; | |
994 | + | |
995 | + // Faz com o que o wizard avance um passo | |
996 | + $scope.handleNext = function () { | |
997 | + $scope.setLoadingGet(true); | |
998 | + | |
999 | + if(!$scope.edit){ | |
1000 | + $scope.permitidoAvancar = true; | |
1001 | + } else { | |
1002 | + permiteAvancoFluxo(); | |
1003 | + } | |
1004 | + | |
1005 | + if ($scope.permitidoAvancar){ | |
1006 | + $scope.templates[$scope.step].show = false; | |
1007 | + $scope.step += 1; | |
1008 | + $scope.templates[$scope.step].show = true; | |
1009 | + } | |
1010 | + | |
1011 | + $scope.setLoading(false); | |
1012 | + }; | |
1013 | + | |
1014 | + // Funcao especifica que retorna se o formulario de dados da entrada esta valido | |
1015 | + function validStepDadosEntrada() { | |
1016 | + $scope.stepValid = true; | |
1017 | + | |
1018 | + if ($scope.entradaAlmoxarifadoForm.dadosEntradaForm.$invalid) { | |
1019 | + $scope.stepValid = false; | |
1020 | + } | |
1021 | + | |
1022 | + return $scope.stepValid; | |
1023 | + }; | |
1024 | + | |
1025 | + // Funcao especifica que retorna se o formulario de materiais esta valido | |
1026 | + function validStepMateriais() { | |
1027 | + $scope.stepValid = true; | |
1028 | + | |
1029 | + if ($scope.entradaAlmoxarifadoForm.materiaisForm.$invalid || !($scope.entradaAlmoxarifado.entradasItem.length > 0)) { | |
1030 | + $scope.stepValid = false; | |
1031 | + } | |
1032 | + | |
1033 | + return $scope.stepValid; | |
1034 | + }; | |
1035 | + | |
1036 | + //Funcao especifica que retorna se o formulario de documentos esta valido | |
1037 | + function validStepDocumentos() { | |
1038 | + $scope.stepValid = true; | |
1039 | + if ($scope.entradaAlmoxarifadoForm.documentosForm.$invalid || !($scope.entradaAlmoxarifado.documentos.length > 0)) { | |
1040 | + $scope.stepValid = false; | |
1041 | + } | |
1042 | + return $scope.stepValid; | |
1043 | + }; | |
690 | 1044 | |
691 | 1045 | $scope.alternaTipoNumericoUnidadeMedida = function(){ |
692 | 1046 | $scope.entradaItem.$quantidadeEntrada = ''; | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoListController.js
... | ... | @@ -4,7 +4,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa |
4 | 4 | $scope.$showAdvancedFilters = false; |
5 | 5 | |
6 | 6 | $scope.resetForm = function() { |
7 | - angular.element("#editEntradaAlmoxarifado").scope().resetFormInicializarDatas(); | |
7 | + angular.element("#entradaAlmoxarifadoControllerId").scope().resetFormInicializarDatas(); | |
8 | 8 | }; |
9 | 9 | |
10 | 10 | $scope.headers = [ {title : $translate.instant('ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO'), value : 'notaRecebimento' } , |
... | ... | @@ -42,7 +42,7 @@ citApp.controller('EntradaAlmoxarifadoListController', ['$scope', 'EntradaAlmoxa |
42 | 42 | $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); |
43 | 43 | return; |
44 | 44 | } |
45 | - angular.element('#editEntradaAlmoxarifado').scope().getEntradaAlmoxarifado(entradaAlmoxarifado, edit); | |
45 | + angular.element('#entradaAlmoxarifadoControllerId').scope().getEntradaAlmoxarifado(entradaAlmoxarifado, edit); | |
46 | 46 | $scope.$showPageEditWorkspace($scope.workspace); |
47 | 47 | }; |
48 | 48 | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/repository/EntradaAlmoxarifadoRepository.js
... | ... | @@ -4,6 +4,10 @@ citApp.factory('EntradaAlmoxarifadoRepository', ['RestangularAlmoxarifado', 'Abs |
4 | 4 | |
5 | 5 | function EntradaAlmoxarifadoRepository() { |
6 | 6 | AbstractRepository.call(this, restangularAlmoxarifado, 'rest/entradaAlmoxarifado'); |
7 | + | |
8 | + this.concluir = function(entrada) { | |
9 | + return restangularAlmoxarifado.all(this.route + '/concluir').post(entrada); | |
10 | + }; | |
7 | 11 | } |
8 | 12 | |
9 | 13 | AbstractRepository.extend(EntradaAlmoxarifadoRepository); | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/dialog_add_materiais.html
1 | 1 | <ng-form name="formDialogMateriais" autocomplete="off"> |
2 | 2 | <div class="modal-header"> |
3 | - <button class="btn btn-clear" type="button" ng-hide="!editEntrada" ng-click="addEntradaItem(formDialogMateriais)"> | |
3 | + <button class="btn btn-clear" type="button" ng-hide="!editEntrada && !newEntrada" ng-click="addEntradaItem(formDialogMateriais)"> | |
4 | 4 | <i class="fa fa-save green"></i> |
5 | 5 | <translate>{{entradaItem.id ? 'LABEL.SALVAR' : 'LABEL.ADICIONAR'}} </translate> |
6 | 6 | </button> |
... | ... | @@ -13,24 +13,37 @@ |
13 | 13 | |
14 | 14 | <div class="modal-body"> |
15 | 15 | <h2 class="title-modal blue"><translate>ALMOXARIFADO.LABEL.MATERIAIS</translate></h2> |
16 | - <p ng-show="editEntrada"> | |
16 | + <p ng-show="editEntrada || newEntrada"> | |
17 | 17 | <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate> |
18 | 18 | </small> |
19 | 19 | </p> |
20 | + <div class="row"> | |
21 | + <div class="col-md-4"> | |
22 | + <label-input-checkbox ng-model="entradaItem.$validarPrecoMedio" ng-disabled="!editEntrada && !newEntrada" ng-label="ALMOXARIFADO.LABEL.VALIDAR_PRECO_MEDIO" ></label-input-checkbox> | |
23 | + </div> | |
24 | + </div> | |
25 | + | |
20 | 26 | <div class="row"> |
21 | - <div class="col-sm-8"> | |
22 | - <auto-complete ng-find="findMaterial(value)" ng-set-result="carregarItensMaterial(item)" ng-item="item.codigoEDescricao" ng-acao-borracha="limparCamposMaterial()" | |
23 | - ng-id="entradaItem.material" form="formDialogMateriais" ng-label="LABEL.MATERIAL" ng-disabled="!editEntrada" ng-model="entradaItem.material" ng-obrigatorio="edit"></auto-complete> | |
27 | + <br> | |
28 | + <div class="col-sm-6"> | |
29 | + <auto-complete ng-find="findMaterial(value)" ng-set-result="carregarItensMaterial(item)" ng-item="item.codigoEDescricao" ng-id="entradaItem.material" form="formDialogMateriais" | |
30 | + ng-label="LABEL.MATERIAL" ng-disabled="!newEntrada" ng-model="entradaItem.material" ng-obrigatorio="true"> | |
31 | + </auto-complete> | |
24 | 32 | </div> |
25 | - <div ng-show="editEntrada" class="col-sm-4" style="padding-top: 28px;"> | |
26 | - <label> | |
27 | - <input type="checkbox" ng-model="entradaItem.$validarPrecoMedio"/> | |
28 | - <translate>ALMOXARIFADO.LABEL.VALIDAR_PRECO_MEDIO</translate> | |
29 | - </label> | |
33 | + <div class="col-sm-2"> | |
34 | + <label-select ng-id="entradaItem.unidadeMedidaEntrada" ng-label="ALMOXARIFADO.LABEL.UN_MEDIDA" ng-model="entradaItem.unidadeMedidaEntrada" | |
35 | + form="formDialogMateriais" ng-obrigatorio="editEntrada || newEntrada" ng-disabled="!editEntrada && !newEntrada" | |
36 | + ng-custom-options="unidadeMedida as unidadeMedida.sigla for unidadeMedida" track-by="track by unidadeMedida.id" ng-list="unidadesMedidasEntrada"/> | |
37 | + </div> | |
38 | + <div class="col-sm-4"> | |
39 | + <label-select ng-id="entradaItem.materialLocalEstoque.endereco" ng-custom-change="" ng-label="ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE" ng-model="entradaItem.materialLocalEstoque" | |
40 | + form="formDialogMateriais" ng-obrigatorio="editEntrada || newEntrada" ng-disabled="!editEntrada && !newEntrada && !entradaItem.id" | |
41 | + ng-custom-options="materialLocal as materialLocal.endereco.descricao for materialLocal" track-by="track by materialLocal.id" ng-list="enderecosMaterial"/> | |
30 | 42 | </div> |
31 | 43 | </div> |
32 | 44 | |
33 | 45 | <div class="row"> |
46 | +<<<<<<< HEAD | |
34 | 47 | <div class="col-sm-3" ng-show="showDecimal"> |
35 | 48 | <label-input-decimal ng-precisao="decimal" ng-evento-blur="aplicarValidacaoDecimal" ng-custom-maxlength="11" ng-id="entradaItem.$quantidadeEntrada" ng-label="ALMOXARIFADO.LABEL.QUANTIDADE" ng-evento-change="calcularQuantidadeEValores()" ng-obrigatorio="editEntrada" ng-disabled="!editEntrada" form="formDialogMateriais" |
36 | 49 | ng-model="entradaItem.$quantidadeEntrada"/> |
... | ... | @@ -38,37 +51,44 @@ |
38 | 51 | <div class="col-sm-3" ng-show="showInteiro"> |
39 | 52 | <label-input-number ng-custom-maxlength="4" ng-id="entradaItem.$quantidadeEntrada" ng-label="ALMOXARIFADO.LABEL.QUANTIDADE" ng-evento-change="calcularQuantidadeEValores()" ng-obrigatorio="editEntrada" ng-disabled="!editEntrada" form="formDialogMateriais" |
40 | 53 | ng-model="entradaItem.$quantidadeEntrada"/> |
54 | +======= | |
55 | + <div class="col-sm-3"> | |
56 | + <label-input-decimal ng-id="entradaItem.$quantidadeEntrada" ng-label="ALMOXARIFADO.LABEL.QUANTIDADE" ng-obrigatorio="editEntrada || newEntrada" ng-disabled="!editEntrada && !newEntrada" | |
57 | + form="formDialogMateriais" ng-model="entradaItem.$quantidadeEntrada" ng-precisao="tipoNumerico" ng-custom-maxlength="11"/> | |
58 | +>>>>>>> tarefa-3943 | |
41 | 59 | </div> |
60 | + | |
42 | 61 | <div class="col-sm-3"> |
62 | +<<<<<<< HEAD | |
43 | 63 | <label-select ng-id="entradaItem.unidadeMedidaEntrada" ng-custom-change="definirTipoNumerico()" ng-label="LABEL.UNIDADE_MEDIDA" ng-model="entradaItem.unidadeMedidaEntrada" form="formDialogMateriais" ng-obrigatorio="editEntrada" ng-disabled="!editEntrada" |
44 | 64 | ng-custom-options="unidadeMedida as unidadeMedida.sigla for unidadeMedida" track-by="track by unidadeMedida.id" ng-list="unidadesMedidasEntrada"/> |
65 | +======= | |
66 | + <label-input-money ng-id="entradaItem.valorTotal" ng-label="ALMOXARIFADO.LABEL.VALOR_TOTAL_MATERIAL_SUBTOTAL" ng-obrigatorio="editEntrada || newEntrada" | |
67 | + ng-disabled="!editEntrada && !newEntrada" form="formDialogMateriais" ng-model="entradaItem.valorTotal" ng-custom-maxlength="19"/> | |
68 | +>>>>>>> tarefa-3943 | |
45 | 69 | </div> |
70 | + | |
46 | 71 | <div class="col-sm-3"> |
47 | - <label-input-decimal ng-id="entradaItem.quantidadeDominioTipoUnidadeEntrada" ng-evento-change="calcularQuantidadeEValores()" ng-label="ALMOXARIFADO.LABEL.UNIDADES" | |
48 | - ng-obrigatorio="editEntrada" ng-disabled="!editEntrada || unidadesFixa" form="formDialogMateriais" ng-model="entradaItem.quantidadeDominioTipoUnidadeEntrada" ng-custom-maxlength="12"/> | |
72 | + <label-input ng-id="entradaItem.numeroLote" ng-label="ALMOXARIFADO.LABEL.NUMERO_LOTE" ng-obrigatorio="false" ng-disabled="!editEntrada && !newEntrada" form="formDialogMateriais" | |
73 | + ng-model="entradaItem.numeroLote" /> | |
49 | 74 | </div> |
75 | + | |
50 | 76 | <div class="col-sm-3"> |
51 | - <label-input-money ng-id="entradaItem.valorTotal" ng-evento-change="calcularQuantidadeEValores()" ng-label="ALMOXARIFADO.LABEL.SUBTOTAL" ng-obrigatorio="editEntrada" ng-disabled="!editEntrada" form="formDialogMateriais" ng-model="entradaItem.valorTotal" ng-custom-maxlength="19"/> | |
77 | + <label-input-data ng-id="entradaItem.dataValidade" ng-label="ALMOXARIFADO.LABEL.DATA_VALIDADE" ng-obrigatorio="false" ng-disabled="!editEntrada && !newEntrada" | |
78 | + ng-model="entradaItem.dataValidade" form="formDialogMateriais" /> | |
52 | 79 | </div> |
53 | 80 | </div> |
54 | 81 | |
55 | 82 | <div class="row"> |
56 | - <div class="col-sm-4"> | |
57 | - <label-input ng-id="entradaItem.numeroLote" ng-label="ALMOXARIFADO.LABEL.NUMERO_LOTE" ng-obrigatorio="false" ng-disabled="!editEntrada" form="formDialogMateriais" ng-model="entradaItem.numeroLote" /> | |
83 | + <div class="col-sm-3 col-sm-offset-6"> | |
84 | + <label-input-money ng-id="entradaItem.valorUnitario" ng-label="LABEL.VALOR_UNITARIO" ng-disabled="true" form="formDialogMateriais" ng-model="entradaItem.valorUnitario" | |
85 | + ng-precision="2" ng-custom-maxlength="19"/> | |
58 | 86 | </div> |
59 | 87 | <div class="col-sm-3"> |
60 | - <label-input-data ng-id="entradaItem.dataValidade" ng-label="ALMOXARIFADO.LABEL.DATA_VALIDADE" ng-obrigatorio="false" ng-disabled="!editEntrada" ng-model="entradaItem.dataValidade" form="formDialogMateriais" /> | |
61 | - </div> | |
62 | - <div class='col-sm-2'> | |
63 | - <label-input-money ng-id="entradaItem.valorUnitario" ng-label="LABEL.VALOR_UNITARIO" ng-disabled="true" form="formDialogMateriais" ng-model="entradaItem.valorUnitario" ng-precision="2" ng-custom-maxlength="19"/> | |
64 | - </div> | |
65 | - <div class="col-sm-2"> | |
66 | 88 | <label-input ng-id="entradaItem.quantidade" ng-label="ALMOXARIFADO.LABEL.ENTRADA_ESTOQUE" ng-disabled="true" ng-model="entradaItem.quantidade" /> |
67 | 89 | </div> |
68 | - <div class="col-sm-1" style="padding-top: 25px"> | |
69 | - <label>{{entradaItem.material.unidadeArmazenamento.tipoUnidadeMedida.descricao}}</label> | |
70 | - </div> | |
71 | 90 | </div> |
91 | +<<<<<<< HEAD | |
72 | 92 | |
73 | 93 | <fieldset ng-show="caracteristicas.length > 0 || (entradaItem.caracteristicas.length > 0 && !editEntrada)"> |
74 | 94 | <legend> |
... | ... | @@ -183,6 +203,8 @@ |
183 | 203 | </div> |
184 | 204 | </fieldset> |
185 | 205 | |
206 | +======= | |
207 | +>>>>>>> tarefa-3943 | |
186 | 208 | </div> |
187 | 209 | |
188 | 210 | </ng-form> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/dialog_contabilizar_entrada.html
0 → 100644
... | ... | @@ -0,0 +1,35 @@ |
1 | +<ng-form name="formContabilizacao" autocomplete="off"> | |
2 | + <div class="modal-header"> | |
3 | + <button class="btn btn-clear" type="button" ng-click="contabilizar(formContabilizacao, dataContabilFinal);"> | |
4 | + <i class="fa fa-save green"></i> | |
5 | + <translate>ALMOXARIFADO.LABEL.CONCLUIR_E_CONTABILIZAR_ENTRADA</translate> | |
6 | + </button> | |
7 | + | |
8 | + <button title="{{$translate.instant('LABEL.CANCELAR')}}" alt="{{$translate.instant('LABEL.CANCELAR')}}" ng-click="$dismiss('cancel');" class="btn btn-clear" type="button"> | |
9 | + <i class="fa fa-times red"></i> | |
10 | + <translate>LABEL.CANCELAR</translate> | |
11 | + </button> | |
12 | + </div> | |
13 | + | |
14 | + <div class="modal-body"> | |
15 | + <fieldset> | |
16 | + <div class="scrollbar-inner"> | |
17 | + <legend style="font-size: 20px"> | |
18 | + <translate>LABEL.DATA_CONTABILIZACAO</translate> | |
19 | + </legend> | |
20 | + <fieldset> | |
21 | + <div class="row"> | |
22 | + <div ng-if="bloquearDataContabil" class="col-sm-4"> | |
23 | + <label-input-data ng-id="entrada.dataContabil" ng-obrigatorio="true" ng-model="dataContabilFinalBloqueada" ng-label="LABEL.DATA_CONTABILIZACAO" | |
24 | + ng-disabled="bloquearDataContabil" ng-form="formContabilizacao" label-info-tooltip="{{$translate.instant('ALMOXARIFADO.VALIDACAO.DATA_CONTABIL_ALTERADA_SAIDAS')}}"/> | |
25 | + </div> | |
26 | + <div ng-show="!bloquearDataContabil" class="col-sm-4"> | |
27 | + <label-input-data ng-id="dataContabilFinal" ng-obrigatorio="true" ng-model="dataContabilFinal" ng-label="LABEL.DATA_CONTABILIZACAO" ng-disabled="bloquearDataContabil" | |
28 | + ng-form="formContabilizacao" /> | |
29 | + </div> | |
30 | + </div> | |
31 | + </fieldset> | |
32 | + </div> | |
33 | + </fieldset> | |
34 | + </div> | |
35 | +</ng-form> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoEdit.html
1 | -<div id="editEntradaAlmoxarifado" class="page-content clearfix" ng-controller="EntradaAlmoxarifadoController"> | |
2 | - <div class="bar-buttons-action fixed"> | |
3 | - <div class="row"> | |
4 | - <div class="col-sm-8 text-left"> | |
5 | - | |
6 | - <button class="btn btn-clear" ng-click="saveOrUpdate()" ng-show="edit"> | |
7 | - <i class="fa fa-save green"></i> <translate>LABEL.SALVAR</translate> | |
8 | - </button> | |
9 | - | |
10 | - <button class="btn btn-clear" ng-click="resetForm();" ng-show="entradaAlmoxarifado.id === undefined"> | |
11 | - <i class="fa fa-eraser yellow-dark"></i> <translate>LABEL.LIMPAR</translate> | |
12 | - </button> | |
13 | - | |
14 | - <button class="btn btn-clear" ng-click="remove(entradaAlmoxarifado);" ng-show="entradaAlmoxarifado.id !== undefined"> | |
15 | - <i class="fa fa-times red"></i> <translate>LABEL.REMOVER</translate> | |
16 | - </button> | |
17 | - | |
18 | - <button class="btn btn-clear" ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();"> | |
19 | - <i class="fa fa-search"></i> <translate>LABEL.PESQUISAR</translate> | |
20 | - </button> | |
21 | - | |
22 | - </div><!-- .col --> | |
23 | - | |
24 | - <div class="col-sm-4 text-right"> | |
25 | - | |
26 | - <favorito/> | |
27 | - | |
28 | - <help-button workspace="workspace" /> | |
29 | - | |
30 | - </div><!-- .col --> | |
31 | - </div><!-- .row --> | |
32 | - </div><!-- .bar-buttons-action --> | |
33 | - | |
34 | - <breadcrumb ng-workspace="workspace"></breadcrumb> | |
35 | - | |
36 | - <p> | |
37 | - <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | |
38 | - </p> | |
39 | - | |
40 | - <fieldset> | |
1 | +<div class="page-content clearfix" id="entradaAlmoxarifadoControllerId" ng-controller="EntradaAlmoxarifadoController"> | |
2 | + <div class="bar-buttons-action fixed" > | |
3 | + <div class="row"> | |
4 | + <div class="col-sm-9 text-left"> | |
5 | + <div ng-show="edit" class="btn-group dropdown" role="group" dropdown> | |
6 | + <button class="btn btn-clear" ng-if="edit" title="{{$translate.instant('ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA')}}" | |
7 | + alt="{{$translate.instant('ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA')}}" dropdown-toggle type="button"> | |
8 | + <i class="fa fa-save green"></i> <translate>ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA</translate><span class="fa fa-caret-down icon-on-right"></span> | |
9 | + </button> | |
10 | + <ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu"> | |
11 | + <li ng-show="entradaAlmoxarifado.dataContabil === null"> | |
12 | + <a href="#void" ng-click="saveOrUpdateContabilizar(false)" ><i class="fa fa-save orange"></i> <translate>ALMOXARIFADO.LABEL.CONCLUIR_ENTRADA_BTN</translate></a> | |
13 | + </li> | |
14 | + <li> | |
15 | + <a href="#void" ng-click="saveOrUpdateContabilizar(true)" ><i class="fa fa-save green"></i> <translate>ALMOXARIFADO.LABEL.CONCLUIR_E_CONTABILIZAR_ENTRADA</translate></a> | |
16 | + </li> | |
17 | + <li ng-show="entradaAlmoxarifado.dataContabil !== null"> | |
18 | + <a href="#void" ng-click="saveOrUpdateContabilizar(false)" ><i class="fa fa-save orange"></i> <translate>ALMOXARIFADO.LABEL.CONCLUIR_E_DESCONTABILIZAR_ENTRADA</translate></a> | |
19 | + </li> | |
20 | + </ul> | |
21 | + </div> | |
22 | + <button title="{{$translate.instant('LABEL.LIMPAR')}}" alt="{{$translate.instant('LABEL.LIMPAR')}}" class="btn btn-clear" type="button" ng-show="entradaAlmoxarifado.id === undefined" | |
23 | + ng-click="resetForm();" > | |
24 | + <i class="fa fa-eraser yellow-dark"></i> <translate>LABEL.LIMPAR</translate> | |
25 | + </button> | |
26 | + <button | |
27 | + title="{{$translate.instant('LABEL.GERAR_RELATORIO')}}" | |
28 | + alt="{{$translate.instant('LABEL.GERAR_RELATORIO')}}" | |
29 | + class="btn btn-clear" type="button" ng-disabled="false" | |
30 | + ng-click="gerarRelatorioEntradaAlmoxarifado();" ng-if="entradaAlmoxarifado.id"> | |
31 | + <i class="fa fa-print"></i> | |
32 | + <translate>LABEL.GERAR_RELATORIO</translate> | |
33 | + </button> | |
34 | + <button title="{{$translate.instant('LABEL.PESQUISAR')}}" alt="{{$translate.instant('LABEL.PESQUISAR')}}" class="btn btn-clear" type="button" | |
35 | + ng-click="$showPageSearchWorkspace(workspace); atualizarLista('searchEntradaAlmoxarifado');"> | |
36 | + <i class="fa fa-search"></i> <translate>LABEL.PESQUISAR</translate> | |
37 | + </button> | |
38 | + </div> | |
39 | + <!-- .col --> | |
41 | 40 | |
42 | - <legend><translate>ALMOXARIFADO.LABEL.DADOS_ENTRADA_ALMOXARIFADO</translate></legend> | |
43 | - | |
44 | - <form name="entradaAlmoxarifadoForm"> | |
45 | - | |
46 | - <div class="row"> | |
47 | - | |
48 | - <div class="col-md-3"> | |
49 | - | |
50 | - <label-input-number ng-id="entradaAlmoxarifado.notaRecebimento" ng-label="ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO" ng-model="entradaAlmoxarifado.notaRecebimento" ng-obrigatorio="false" ng-disabled="true" /> | |
51 | - | |
52 | - </div> | |
53 | - | |
54 | - <div class="col-md-9"> | |
55 | - | |
56 | - <auto-complete ng-id="entradaAlmoxarifado.almoxarifado" ng-label="ALMOXARIFADO.LABEL.ALMOXARIFADO" ng-model="entradaAlmoxarifado.almoxarifado" form="entradaAlmoxarifadoForm" ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteAlmoxarifado(value)" ng-item="item.nome + ' - ' + item.classificacao" /> | |
57 | - | |
58 | - </div> | |
41 | + <div class="col-sm-3 text-right"> | |
59 | 42 | |
60 | - </div> | |
61 | - | |
62 | - <div class="row"> | |
63 | - | |
64 | - <div class="col-sm-4"> | |
65 | - | |
66 | - <label-input-data ng-id="entradaAlmoxarifado.dataReferencia" ng-label="LABEL.DATA_REGISTRO" ng-obrigatorio="false" ng-disabled="true" ng-model="entradaAlmoxarifado.dataReferencia" form="entradaAlmoxarifadoForm" /> | |
67 | - | |
68 | - </div> | |
69 | - | |
70 | - <div class="col-md-4"> | |
71 | - | |
72 | - <label-input-data ng-id="entradaAlmoxarifado.dataRecebimento" ng-label="ALMOXARIFADO.LABEL.DATA_RECEBIMENTO" ng-model="entradaAlmoxarifado.dataRecebimento" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" ng-disabled="!edit" ng-mode="day" ng-format="dd/MM/yyyy" /> | |
73 | - | |
74 | - </div> | |
75 | - | |
76 | - <div class="col-md-4"> | |
77 | - | |
78 | - <label-input-data ng-id="entradaAlmoxarifado.dataContabilizacao" ng-label="LABEL.DATA_CONTABILIZACAO" ng-model="entradaAlmoxarifado.dataContabil" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" ng-disabled="!edit" ng-mode="day" ng-format="dd/MM/yyyy" /> | |
79 | - | |
80 | - </div> | |
81 | - | |
82 | - </div> | |
83 | - | |
84 | - <div class="row"> | |
85 | - | |
86 | - <div class="col-md-4"> | |
87 | - <label-select ng-id="entradaAlmoxarifado.dominioTipoEntrada" ng-label="LABEL.TIPO_ENTRADA" ng-model="entradaAlmoxarifado.dominioTipoEntrada" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" | |
88 | - ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" track-by="track by dominio.id" ng-list="dominioTipoEntradaList" /> | |
89 | - | |
90 | - </div> | |
43 | + <favorito/> | |
91 | 44 | |
92 | - <div class="col-md-4" ng-if="entradaAlmoxarifado.dominioTipoEntrada.codigo === 1 && edit"> | |
93 | - <label-select ng-id="entradaAlmoxarifado.dominioTipoRecebimentoOrcamentaria" ng-label="LABEL.TIPO_RECEBIMENTO" ng-model="entradaAlmoxarifado.dominioTipoRecebimento" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" | |
94 | - ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" ng-list="dominiosTipoRecebimentoOrcamentaria" track-by="track by dominio.id" /> | |
95 | - | |
96 | - </div> | |
97 | - | |
98 | - <div class="col-sm-4" ng-if="entradaAlmoxarifado.dominioTipoEntrada.codigo === 2 && edit"> | |
99 | - <label-select ng-id="entradaAlmoxarifado.dominioTipoRecebimentoExtra" ng-label="LABEL.TIPO_RECEBIMENTO" ng-model="entradaAlmoxarifado.dominioTipoRecebimento" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" | |
100 | - ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" ng-list="dominiosTipoRecebimentoExtraOrcamentaria" track-by="track by dominio.id" /> | |
101 | - </div> | |
45 | + <help-button workspace="workspace" /> | |
102 | 46 | |
103 | - <div class="col-sm-4" ng-if="!edit"> | |
104 | - <label-select ng-id="entradaAlmoxarifado.dominioTipoRecebimento" ng-label="LABEL.TIPO_RECEBIMENTO" ng-model="entradaAlmoxarifado.dominioTipoRecebimento" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" | |
105 | - ng-disabled="true" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" ng-list="dominiosTipoRecebimento" track-by="track by dominio.id" /> | |
106 | - </div> | |
107 | - | |
108 | - <div class="col-md-4"> | |
109 | - <auto-complete ng-id="entradaAlmoxarifado.fornecedor" ng-label="LABEL.FORNECEDOR" ng-model="entradaAlmoxarifado.fornecedor" form="entradaAlmoxarifadoForm" ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteFornecedor(value)" ng-item="item['pessoa.nome']" /> | |
110 | - </div> | |
111 | - | |
112 | - </div> | |
113 | - | |
114 | - <fieldset> | |
115 | - <legend> | |
116 | - <label ng-class="{'has-error' : entradaAlmoxarifadoForm.$submitted && entradaAlmoxarifado.entradasIten && entradaAlmoxarifado.entradasIten.length < 1}"> | |
117 | - <translate>ALMOXARIFADO.LABEL.MATERIAIS</translate> | |
118 | - <span class='red' ng-if=" edit">*</span> | |
119 | - <i ng-show="entradaAlmoxarifadoForm.$submitted && entradaAlmoxarifado.entradasIten && entradaAlmoxarifado.entradasIten.length < 1" class='fa fa-warning red' tooltip="{{$translate.instant('ALMOXARIFADO.LABEL.MATERIAIS') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i> | |
120 | - </label> | |
121 | - </legend> | |
122 | - | |
123 | - <script type="text/ng-template" id="modal-materiais-consumo.html"> | |
124 | - <div ng-include src="'/cit-almoxarifado-web/html/entradaAlmoxarifado/dialog_add_materiais.html'" /> | |
125 | - </script> | |
126 | - | |
127 | - <div class="row"> | |
128 | - <div class="col-md-3"> | |
129 | - <label-input-radio ng-id="entradaAlmoxarifado.dominioFinalidade.codigo" ng-model="entradaAlmoxarifado.dominioFinalidade.codigo" ng-label="LABEL.FINALIDADE" | |
130 | - ng-obrigatorio="edit" text="descricao" value="codigo" form="entradaAlmoxarifadoForm" ng-disabled="!edit" list="dominiosTipoFinalidade"/> | |
131 | - </div> | |
132 | - <div class="col-md-7" ng-if="entradaAlmoxarifado.dominioFinalidade.codigo == 2"> | |
133 | - <auto-complete ng-id="entradaAlmoxarifado.unidadeRequisitante" ng-label="ALMOXARIFADO.LABEL.UNIDADE_REQUISITANTE" ng-obrigatorio="{{edit}}" | |
134 | - ng-model="entradaAlmoxarifado.unidadeRequisitante" form="entradaAlmoxarifadoForm" ng-disabled="!edit" | |
135 | - ng-find="findEstruturaOrganizacionalUR(value)" ng-item="item.nome + ' - ' + item.classificacao" /> | |
136 | - </div> | |
137 | 47 | </div> |
138 | - | |
139 | - <div class="row"> | |
140 | - | |
141 | - <div class="col-md-3"> | |
142 | - | |
143 | - <label-input-money ng-id="entradaAlmoxarifado.valorTotalNota" ng-label="ALMOXARIFADO.LABEL.VALOR_TOTAL_NOTA" ng-model="entradaAlmoxarifado.valorTotalNota" | |
144 | - form="entradaAlmoxarifadoForm" ng-obrigatorio="edit" ng-precision="2" ng-disabled="!edit" ng-custom-maxlength="19" /> | |
145 | - | |
146 | - </div> | |
147 | - | |
148 | - <div class="col-md-3"> | |
149 | - | |
150 | - <label-input-money ng-id="valorTotalMateriais" ng-label="LABEL.VALOR_TOTAL_INCLUIDO" ng-model="valorTotalMateriais" form="entradaAlmoxarifadoForm" ng-precision="2" ng-disabled="true" ng-custom-maxlength="19"/> | |
151 | - | |
152 | - </div> | |
153 | - | |
154 | - </div> | |
155 | - | |
156 | - </form> | |
157 | - | |
158 | - <div class="row margin-top"> | |
159 | - <div class="col-sm-12"> | |
160 | - <div class="panel panel-default"> | |
161 | - <div class="panel-heading clearfix"> | |
162 | - <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" ng-show="edit" class="btn btn-clear" type="button" ng-click="inicializarModalMateriais();"> | |
163 | - <i class="fa fa-plus-circle yellow-dark"></i> | |
164 | - <translate>LABEL.ADICIONAR</translate> | |
165 | - </button> | |
166 | - <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" ng-click="abrirEntradaItem(false)" > | |
167 | - <i class="fa fa-search blue"></i> | |
168 | - <translate>LABEL.VISUALIZAR</translate> | |
169 | - </button> | |
170 | - | |
171 | - <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-show="edit" class="btn btn-clear" type="button" ng-click="abrirEntradaItem(true)" > | |
172 | - <i class="fa fa-pencil blue"></i> | |
173 | - <translate>LABEL.EDITAR</translate> | |
174 | - </button> | |
48 | + <!-- .col --> | |
49 | + </div> | |
50 | + <!-- .row --> | |
51 | + </div> | |
52 | + | |
53 | + <script type="text/ng-template" id="modal-contabilizar-entrada.html"> | |
54 | + <div ng-include src="'/cit-almoxarifado-web/html/entrada/dialog_contabilizar_entrada.html'" /> | |
55 | + </script> | |
56 | + | |
57 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | |
175 | 58 | |
176 | - <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" ng-show="edit" class="btn btn-clear" type="button" ng-click="removerEntradaItem()"> | |
177 | - <i class="fa fa-times red"></i> | |
178 | - <translate>LABEL.REMOVER</translate> | |
179 | - </button> | |
59 | + <p> | |
60 | + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate> | |
61 | + </small> | |
62 | + </p> | |
180 | 63 | |
181 | - </div><!-- .panel-heading --> | |
182 | - <table class="table table-bordered table-striped"> | |
183 | - <thead> | |
184 | - <tr> | |
185 | - <th width="20px" class="text-center"></th> | |
186 | - <th width="10%" class="text-center"><translate>LABEL.ITEM</translate></th> | |
187 | - <th style="width: 25%;" class="text-center"><translate>LABEL.DESCRICAO_MATERIAL</translate></th> | |
188 | - <th style="width: 15%;" class="text-center"><translate>LABEL.UNIDADE_MEDIDA</translate></th> | |
189 | - <th style="width: 15%;" class="text-center"><translate>ALMOXARIFADO.LABEL.UNIDADES</translate></th> | |
190 | - <th style="width: 15%;" class="text-center"><translate>LABEL.VALOR_UNITARIO</translate></th> | |
191 | - <th style="width: 15%;" class="text-center"><translate>ALMOXARIFADO.LABEL.SUBTOTAL</translate></th> | |
192 | - </tr> | |
193 | - </thead> | |
194 | - <tbody> | |
195 | - <tr ng-hide="entradaAlmoxarifado.entradasIten.length != 0"> | |
196 | - <td colspan="7" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> | |
197 | - </tr> | |
198 | - <tr ng-repeat="entradaItemLista in entradaAlmoxarifado.entradasIten"> | |
199 | - <td class="text-center"><input type="radio" name="entradaItemChecked" ng-value="entradaItemLista" ng-model="$parent.entradaItemSelecionado"/></td> | |
200 | - <td class="text-center">{{$index +1}}</td> | |
201 | - <td class="text-center">{{ entradaItemLista.material.descricao }}</td> | |
202 | - <td class="text-center">{{ entradaItemLista.material.unidadeArmazenamento.descricao }}</td> | |
203 | - <td class="text-center">{{ entradaItemLista.quantidade }}</td> | |
204 | - <td class="text-center">{{ entradaItemLista.valorUnitario | currency:"R$":2}}</td> | |
205 | - <td class="text-center">{{ entradaItemLista.valorTotal | currency}}</td> | |
206 | - </tr> | |
207 | - </tbody> | |
208 | - </table> | |
209 | - </div> | |
64 | + <div class="page-content"> | |
65 | + <fieldset> | |
66 | + <form name="entradaAlmoxarifadoForm" novalidate autocomplete="off"> | |
67 | + <div class="widget-box"> | |
68 | + | |
69 | + <div class="widget-body"> | |
70 | + | |
71 | + <div class="widget-main"> | |
72 | + | |
73 | + <div> | |
74 | + <ul class="wizard-steps"> | |
75 | + <li ng-class="{'active': isCurrentStep(0), 'complete' : !entradaAlmoxarifadoForm.dadosEntradaForm.$invalid, 'incomplete' : (entradaAlmoxarifadoForm.dadosEntradaForm.$submitted && entradaAlmoxarifadoForm.dadosEntradaForm.$invalid)}" | |
76 | + ng-click="setCurrentStep(0)" title="{{$translate.instant('ALMOXARIFADO.LABEL.DADOS_ENTRADA')}}" alt="{{$translate.instant('ALMOXARIFADO.LABEL.DADOS_ENTRADA')}}"> | |
77 | + <span class="step">1</span> | |
78 | + <a href="#void" class="title" style="text-decoration: none;"><translate>ALMOXARIFADO.LABEL.DADOS_ENTRADA</translate></a> | |
79 | + </li> | |
80 | + | |
81 | + <li ng-class="{'active': isCurrentStep(1), 'complete' : ((isCurrentStep(1) || isCurrentStep(2) || isCurrentStep(3)) && !entradaAlmoxarifadoForm.materiaisForm.$invalid && (entradaAlmoxarifado.entradasItem.length > 0)), 'incomplete' : ((entradaAlmoxarifadoForm.materiaisForm.$submitted || step > 1) && (entradaAlmoxarifadoForm.materiaisForm.$invalid || !(entradaAlmoxarifado.entradasItem.length > 0))) && (isCurrentStep(1) || isCurrentStep(2) || isCurrentStep(3))}" | |
82 | + ng-click="setCurrentStep(1)" title="{{$translate.instant('LABEL.MATERIAIS')}}" alt="{{$translate.instant('LABEL.MATERIAIS')}}"> | |
83 | + <span class="step">2</span> | |
84 | + <a href="#void" class="title" style="text-decoration: none;"><translate>LABEL.MATERIAIS</translate></a> | |
85 | + </li> | |
86 | + | |
87 | + <li ng-class="{'active': isCurrentStep(2), 'complete' : ((isCurrentStep(2) || isCurrentStep(3)) && (entradaAlmoxarifado.documentos.length > 0)), 'incomplete' : ((entradaAlmoxarifadoForm.documentosForm.$submitted || step > 2) && !(entradaAlmoxarifado.documentos.length > 0)) && (isCurrentStep(2) || isCurrentStep(3))}" | |
88 | + ng-click="setCurrentStep(2)" title="{{$translate.instant('ALMOXARIFADO.LABEL.DOCUMENTOS')}}" alt="{{$translate.instant('ALMOXARIFADO.LABEL.DOCUMENTOS')}}"> | |
89 | + <span class="step">3</span> | |
90 | + <a href="#void" class="title" style="text-decoration: none;"><translate>ALMOXARIFADO.LABEL.DOCUMENTOS</translate></a> | |
91 | + </li> | |
92 | + | |
93 | + <li ng-class="{'active': isCurrentStep(3), 'complete' : isCurrentStep(3)}" title="{{$translate.instant('LABEL.OBSERVACOES')}}" alt="{{$translate.instant('LABEL.OBSERVACOES')}}" | |
94 | + ng-click="setCurrentStep(3)"> | |
95 | + <span class="step">4</span> | |
96 | + <a href="#void" class="title" style="text-decoration: none;"><translate>LABEL.OBSERVACOES</translate></a> | |
97 | + </li> | |
98 | + </ul> | |
99 | + | |
100 | + </div> | |
101 | + | |
102 | + <hr> | |
103 | + <div ng-repeat="template in templates"> | |
104 | + <div class="slide-frame" ng-include="template.url" ng-show="template.show"></div> | |
105 | + </div> | |
106 | + <hr> | |
107 | + <div> | |
108 | + <button class="btn btn-prev" ng-click="handlePrevious()" ng-hide="isFirstStep()" type="button"> | |
109 | + <i class="ace-icon fa fa-arrow-left"></i> | |
110 | + <translate>LABEL.ANTERIOR</translate> | |
111 | + </button> | |
112 | + | |
113 | + <!-- <button class="btn btn-success btn-next" ng-click="handleNext()" ng-hide="isLastStep()" type="button"> | |
114 | + <translate>LABEL.PROXIMO</translate> | |
115 | + <i ng-class="fa fa-arrow-right icon-on-right"></i></button> --> | |
116 | + | |
117 | + <button class="btn btn-success btn-next" ng-click="handleNext()" ng-hide="isLastStep()" type="button"> | |
118 | + <i class="fa fa-arrow-right icon-on-right"></i> | |
119 | + <translate>LABEL.PROXIMO</translate> | |
120 | + </button> | |
121 | + </div> | |
122 | + </div><!-- /.widget-main --> | |
123 | + </div><!-- /.widget-body --> | |
210 | 124 | </div> |
211 | - <!-- .col --> | |
212 | - </div> | |
213 | - | |
214 | - </fieldset> | |
125 | + </form> | |
126 | + </fieldset> | |
127 | + </div> <!-- /.page-content --> | |
215 | 128 | |
216 | - <componente-associar-documentos ng-documentos="entradaAlmoxarifado.documentos" ng-edit="edit" ng-uploader="uploader" ng-workspace="$parent.workspace" form="entradaAlmoxarifadoForm" ng-obrigatorio="edit"></componente-associar-documentos> | |
217 | - | |
218 | - <form name="entradaObservacaoForm"> | |
219 | - <componente-observacao ng-observacoes="entradaAlmoxarifado.observacoes" ng-hide="false" ng-edit="edit"></componente-observacao> | |
220 | - </form> | |
221 | - | |
222 | - </fieldset> | |
223 | -</div><!-- .page-content --> | |
224 | 129 | \ No newline at end of file |
130 | +</div> | |
225 | 131 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoList.html
... | ... | @@ -14,6 +14,11 @@ |
14 | 14 | <translate>LABEL.VISUALIZAR</translate> |
15 | 15 | </button> |
16 | 16 | |
17 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-click="abrirVisualizar(true);" type="button"> | |
18 | + <i class="fa fa-pencil blue"></i> | |
19 | + <translate>LABEL.EDITAR</translate> | |
20 | + </button> | |
21 | + | |
17 | 22 | <button class="btn btn-clear" ng-click="remove();"> |
18 | 23 | <i class="fa fa-times red"></i> |
19 | 24 | <translate>LABEL.REMOVER</translate> |
... | ... | @@ -43,6 +48,6 @@ |
43 | 48 | |
44 | 49 | <breadcrumb ng-workspace="workspace"></breadcrumb> |
45 | 50 | |
46 | - <list-view ng-lista="entradaAlmoxarifadoList" ng-repository="EntradaAlmoxarifadoRepository" ng-use-custom-remove="false" ng-headers="headers" ng-filter-criteria="filterCriteria" ng-item-selecionado="entradaAlmoxarifadoChecked"></list-view> | |
47 | - | |
51 | + <list-view ng-lista="entradaAlmoxarifadoList" ng-repository="EntradaAlmoxarifadoRepository" ng-use-custom-remove="false" ng-headers="headers" ng-filter-criteria="filterCriteria" | |
52 | + ng-item-selecionado="entradaAlmoxarifadoChecked"></list-view> | |
48 | 53 | </div><!-- .page-content --> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoPg1.html
0 → 100644
... | ... | @@ -0,0 +1,61 @@ |
1 | +<ng-form name="dadosEntradaForm" novalidate autocomplete="off"> | |
2 | + <div class="page-content"> | |
3 | + <fieldset> | |
4 | + <legend> | |
5 | + <translate>ALMOXARIFADO.LABEL.DADOS_ENTRADA</translate> | |
6 | + </legend> | |
7 | + | |
8 | + <div class="row"> | |
9 | + <div class="col-md-5"> | |
10 | + <auto-complete ng-id="entradaAlmoxarifado.almoxarifado" ng-label="ALMOXARIFADO.LABEL.ALMOXARIFADO" ng-model="entradaAlmoxarifado.almoxarifado" form="dadosEntradaForm" | |
11 | + ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteAlmoxarifado(value)" ng-item="item.nome + ' - ' + item.classificacao"/> | |
12 | + </div> | |
13 | + <div class="col-md-4"> | |
14 | + <auto-complete ng-id="entradaAlmoxarifado.fornecedor" ng-label="LABEL.FORNECEDOR" ng-model="entradaAlmoxarifado.fornecedor" form="dadosEntradaForm" | |
15 | + ng-obrigatorio="{{edit}}" ng-disabled="!edit" ng-find="findAutoCompleteFornecedor(value)" ng-item="item['pessoa.nome']" /> | |
16 | + </div> | |
17 | + <div class="col-md-3"> | |
18 | + <label-input-number ng-id="entradaAlmoxarifado.notaRecebimento" ng-label="ALMOXARIFADO.LABEL.NOTA_RECEBIMENTO" ng-model="entradaAlmoxarifado.notaRecebimento" | |
19 | + ng-obrigatorio="false" ng-disabled="true"/> | |
20 | + </div> | |
21 | + </div> | |
22 | + | |
23 | + <div class="row"> | |
24 | + <div class="col-md-4"> | |
25 | + <label-select ng-id="entradaAlmoxarifado.dominioTipoEntrada" ng-label="LABEL.TIPO_ENTRADA" ng-model="entradaAlmoxarifado.dominioTipoEntrada" form="dadosEntradaForm" | |
26 | + ng-obrigatorio="edit" ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" track-by="track by dominio.id" | |
27 | + ng-list="dominioTipoEntradaList" /> | |
28 | + </div> | |
29 | + | |
30 | + <div class="col-md-4" ng-if="edit"> | |
31 | + <label-select ng-id="entradaAlmoxarifado.dominioTipoRecebimento" ng-label="LABEL.TIPO_RECEBIMENTO" ng-model="entradaAlmoxarifado.dominioTipoRecebimento" | |
32 | + form="dadosEntradaForm" ng-obrigatorio="edit" ng-disabled="!edit" ng-custom-options="dominio.originalElement as dominio.descricao for dominio" | |
33 | + ng-list="dominiosTipoRecebimento" track-by="track by dominio.id" /> | |
34 | + </div> | |
35 | + | |
36 | + <div class="col-md-4"> | |
37 | + <label-input-data ng-id="entradaAlmoxarifado.dataRecebimento" ng-label="ALMOXARIFADO.LABEL.DATA_RECEBIMENTO" ng-model="entradaAlmoxarifado.dataRecebimento" form="dadosEntradaForm" | |
38 | + ng-obrigatorio="edit" ng-disabled="!edit" ng-mode="day" ng-format="dd/MM/yyyy" /> | |
39 | + </div> | |
40 | + </div> | |
41 | + | |
42 | + <div class="row"> | |
43 | + <div class="col-md-4"> | |
44 | + <label-input-radio ng-id="entradaAlmoxarifado.dominioFinalidade.codigo" ng-model="entradaAlmoxarifado.dominioFinalidade.codigo" ng-label="LABEL.FINALIDADE" | |
45 | + ng-obrigatorio="edit" text="descricao" value="codigo" form="entradaAlmoxarifadoForm" ng-disabled="true" list="dominiosTipoFinalidade"/> | |
46 | + </div> | |
47 | + | |
48 | + <div class="col-sm-4"> | |
49 | + <label-input-data ng-id="entradaAlmoxarifado.dataReferencia" ng-label="LABEL.DATA_REGISTRO" ng-obrigatorio="false" ng-disabled="true" ng-model="entradaAlmoxarifado.dataReferencia" | |
50 | + form="dadosEntradaForm" /> | |
51 | + </div> | |
52 | + | |
53 | + <div class="col-md-4"> | |
54 | + <label-input-data ng-id="entradaAlmoxarifado.dataContabilizacao" ng-label="LABEL.DATA_CONTABILIZACAO" ng-model="entradaAlmoxarifado.dataContabil" form="dadosEntradaForm" | |
55 | + ng-obrigatorio="false" ng-disabled="true" ng-mode="day" ng-format="dd/MM/yyyy"/> | |
56 | + </div> | |
57 | + </div> | |
58 | + | |
59 | + </fieldset> | |
60 | + </div> <!-- /.page-content --> | |
61 | +</ng-form> | |
0 | 62 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoPg2.html
0 → 100644
... | ... | @@ -0,0 +1,96 @@ |
1 | +<ng-form name="materiaisForm" novalidate autocomplete="off"> | |
2 | + <div class="page-content"> | |
3 | + <fieldset> | |
4 | + <legend> | |
5 | + <label ng-class="{'has-error' : materiaisForm.$submitted && entradaAlmoxarifado.entradasItem && entradaAlmoxarifado.entradasItem.length < 1}"> | |
6 | + <translate>ALMOXARIFADO.LABEL.MATERIAIS</translate> | |
7 | + <span class='red' ng-if=" edit">*</span> | |
8 | + <i ng-show="materiaisForm.$submitted && entradaAlmoxarifado.entradasItem && entradaAlmoxarifado.entradasItem.length < 1" class='fa fa-warning red' | |
9 | + tooltip="{{$translate.instant('ALMOXARIFADO.LABEL.MATERIAIS') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i> | |
10 | + </label> | |
11 | + </legend> | |
12 | + <script type="text/ng-template" id="modal-materiais-consumo.html"> | |
13 | + <div ng-include src="'/cit-almoxarifado-web/html/entradaAlmoxarifado/dialog_add_materiais.html'" /> | |
14 | + </script> | |
15 | + | |
16 | + <div class="row"> | |
17 | + <div class="col-md-3"> | |
18 | + <label-input-money ng-id="entradaAlmoxarifado.valorTotalNota" ng-label="ALMOXARIFADO.LABEL.VALOR_TOTAL_NOTA" ng-model="entradaAlmoxarifado.valorTotalNota" | |
19 | + form="materiaisForm" ng-obrigatorio="edit" ng-precision="2" ng-disabled="!edit" ng-custom-maxlength="19" /> | |
20 | + </div> | |
21 | + | |
22 | + <div class="col-md-3"> | |
23 | + <label-input-money ng-id="valorTotalMateriais" ng-label="LABEL.VALOR_TOTAL_INCLUIDO" ng-model="valorTotalMateriais" form="materiaisForm" ng-precision="2" | |
24 | + ng-disabled="true" ng-custom-maxlength="19"/> | |
25 | + </div> | |
26 | + | |
27 | + </div> | |
28 | + | |
29 | + <div class="row margin-top"> | |
30 | + <div class="col-sm-12"> | |
31 | + <div class="panel panel-default"> | |
32 | + <div class="panel-heading clearfix"> | |
33 | + <button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" ng-show="edit" class="btn btn-clear" type="button" | |
34 | + ng-click="inicializarModalMateriais();"> | |
35 | + <i class="fa fa-plus-circle yellow-dark"></i> | |
36 | + <translate>LABEL.ADICIONAR</translate> | |
37 | + </button> | |
38 | + <button title="{{$translate.instant('LABEL.VISUALIZAR')}}" alt="{{$translate.instant('LABEL.VISUALIZAR')}}" class="btn btn-clear" type="button" | |
39 | + ng-click="abrirEntradaItem(false)" > | |
40 | + <i class="fa fa-search blue"></i> | |
41 | + <translate>LABEL.VISUALIZAR</translate> | |
42 | + </button> | |
43 | + | |
44 | + <button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" ng-show="edit" class="btn btn-clear" type="button" | |
45 | + ng-click="abrirEntradaItem(true)" > | |
46 | + <i class="fa fa-pencil blue"></i> | |
47 | + <translate>LABEL.EDITAR</translate> | |
48 | + </button> | |
49 | + | |
50 | + <button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" ng-show="edit" class="btn btn-clear" type="button" | |
51 | + ng-click="removerEntradaItem()"> | |
52 | + <i class="fa fa-times red"></i> | |
53 | + <translate>LABEL.REMOVER</translate> | |
54 | + </button> | |
55 | + | |
56 | + </div><!-- .panel-heading --> | |
57 | + <table class="table table-bordered table-striped"> | |
58 | + <thead> | |
59 | + <tr> | |
60 | + <th width="20px" class="text-center"></th> | |
61 | + <th width="7%" class="text-center"><translate>LABEL.ITEM</translate></th> | |
62 | + <th style="width: 20%;" class="text-center"><translate>LABEL.DESCRICAO_MATERIAL</translate></th> | |
63 | + <th style="width: 14%;" class="text-center"><translate>ALMOXARIFADO.LABEL.QUANTIDADE</translate></th> | |
64 | + <th style="width: 15%;" class="text-center"><translate>LABEL.UNIDADE_MEDIDA</translate></th> | |
65 | + <th style="width: 14%;" class="text-center"><translate>ALMOXARIFADO.LABEL.ENTRADA_ESTOQUE</translate></th> | |
66 | + <th style="width: 15%;" class="text-center"><translate>LABEL.VALOR_UNITARIO</translate></th> | |
67 | + <th style="width: 15%;" class="text-center"><translate>ALMOXARIFADO.LABEL.SUBTOTAL</translate></th> | |
68 | + </tr> | |
69 | + </thead> | |
70 | + <tbody> | |
71 | + <tr ng-hide="entradaAlmoxarifado.entradasItem.length != 0"> | |
72 | + <td colspan="8" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> | |
73 | + </tr> | |
74 | + <tr ng-repeat="entradaItemLista in entradaAlmoxarifado.entradasItem"> | |
75 | + <td class="text-center"> | |
76 | + <input type="checkbox" name="entradaItemChecked" ng-model="entradaItemLista.$checked" ng-click="checkEntradaItem(entradaItemLista); atualizarListaSizeSelectEntradaItem()"/> | |
77 | + </td> | |
78 | + <td class="text-center">{{$index +1}}</td> | |
79 | + <td class="text-center">{{ entradaItemLista.material.descricao }}</td> | |
80 | + <td class="text-center">{{ entradaItemLista.quantidade / entradaItemLista.unidadeMedidaEntrada.quantidadePadrao }}</td> | |
81 | + <td class="text-center">{{ entradaItemLista.unidadeMedidaEntrada.descricao }}</td> | |
82 | + <td class="text-center">{{ entradaItemLista.quantidade }}</td> | |
83 | + <td class="text-center">{{ entradaItemLista.valorUnitario | currency:"R$":2}}</td> | |
84 | + <td class="text-center">{{ entradaItemLista.valorTotal | currency}}</td> | |
85 | + </tr> | |
86 | + </tbody> | |
87 | + </table> | |
88 | + </div> | |
89 | + </div> | |
90 | + <!-- .col --> | |
91 | + </div> | |
92 | + | |
93 | + | |
94 | + </fieldset> | |
95 | + </div> <!-- /.page-content --> | |
96 | +</ng-form> | |
0 | 97 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoPg3.html
0 → 100644
... | ... | @@ -0,0 +1,8 @@ |
1 | +<ng-form name="documentosForm" novalidate autocomplete="off"> | |
2 | + <div class="page-content"> | |
3 | + <fieldset> | |
4 | + <componente-associar-documentos ng-documentos="entradaAlmoxarifado.documentos" ng-edit="edit" ng-uploader="uploader" ng-workspace="$parent.workspace" form="documentosForm" | |
5 | + ng-obrigatorio="true"></componente-associar-documentos> | |
6 | + </fieldset> | |
7 | + </div> <!-- /.page-content --> | |
8 | +</ng-form> | |
0 | 9 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoPg4.html
0 → 100644
... | ... | @@ -0,0 +1,12 @@ |
1 | +<ng-form name="observacoesForm" novalidate autocomplete="off"> | |
2 | + <div class="page-content"> | |
3 | + <fieldset> | |
4 | + <legend> | |
5 | + <translate>LABEL.OBSERVACOES</translate> | |
6 | + </legend> | |
7 | + | |
8 | + <componente-observacao ng-observacoes="entradaAlmoxarifado.observacoes" ng-hide="false" ng-edit="edit"></componente-observacao> | |
9 | + | |
10 | + </fieldset> | |
11 | + </div> <!-- /.page-content --> | |
12 | +</ng-form> | |
0 | 13 | \ No newline at end of file | ... | ... |