Commit 52fb4b556cd038d6f2e5e0285b928f173e2145f5
Exists in
master
Merge branch 'adm-1.15.0' into tarefa-3943
Showing
31 changed files
with
905 additions
and
25 deletions
Show diff stats
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/MovimentoEstoqueDao.java
... | ... | @@ -148,4 +148,6 @@ public interface MovimentoEstoqueDao extends CitGenericDAO { |
148 | 148 | * @return |
149 | 149 | */ |
150 | 150 | public Collection<MovimentoEstoque> findAllByClasseReferencia(Dominio classeReferencia, Long idReferencia); |
151 | + | |
152 | + MovimentoEstoque findUltimoMovimentoPorIdMaterialIdLocalEstoque(Long idMaterial, Long idLocalEstoque); | |
151 | 153 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/TransferenciaEnderecoEstoqueDao.java
0 → 100644
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/MovimentoEstoqueDaoHibernate.java
... | ... | @@ -258,4 +258,16 @@ public class MovimentoEstoqueDaoHibernate extends CitGenericDAOImpl implements M |
258 | 258 | |
259 | 259 | return search(search); |
260 | 260 | } |
261 | + | |
262 | + @Override | |
263 | + public MovimentoEstoque findUltimoMovimentoPorIdMaterialIdLocalEstoque(Long idMaterial, Long idLocalEstoque) { | |
264 | + SearchSeven search = new SearchSeven(); | |
265 | + | |
266 | + search.addFilterEqual("material.id", idMaterial); | |
267 | + search.addFilterEqual("materialLocalEstoque.id", idLocalEstoque); | |
268 | + search.addSortDesc("id"); | |
269 | + search.setMaxResults(1); | |
270 | + | |
271 | + return this.searchUnique(search); | |
272 | + } | |
261 | 273 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/TransferenciaEnderecoEstoqueDaoHibernate.java
0 → 100644
... | ... | @@ -0,0 +1,16 @@ |
1 | +package br.com.centralit.api.dao.impl; | |
2 | + | |
3 | +import org.springframework.stereotype.Repository; | |
4 | + | |
5 | +import br.com.centralit.api.dao.TransferenciaEnderecoEstoqueDao; | |
6 | +import br.com.centralit.api.model.TransferenciaEnderecoEstoque; | |
7 | +import br.com.centralit.framework.dao.arquitetura.CitGenericDAOImpl; | |
8 | + | |
9 | +@Repository("transferenciaEnderecoEstoqueDao") | |
10 | +public class TransferenciaEnderecoEstoqueDaoHibernate extends CitGenericDAOImpl implements TransferenciaEnderecoEstoqueDao { | |
11 | + | |
12 | + public TransferenciaEnderecoEstoqueDaoHibernate() { | |
13 | + super(TransferenciaEnderecoEstoque.class); | |
14 | + } | |
15 | + | |
16 | +} | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/EnderecoEstoque.java
... | ... | @@ -70,14 +70,14 @@ public class EnderecoEstoque extends PersistentObjectAuditOrganizacao { |
70 | 70 | |
71 | 71 | /** Atributo entrada. */ |
72 | 72 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
73 | - @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class }) | |
73 | + @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
74 | 74 | private Estoque estoque; |
75 | 75 | |
76 | 76 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
77 | 77 | private Estoque estoqueInativo; |
78 | 78 | |
79 | 79 | @Column(length = 30, nullable = false, updatable = false, unique = true) |
80 | - @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class }) | |
80 | + @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
81 | 81 | private String codigo; |
82 | 82 | |
83 | 83 | @Column(name = "sigla", length = 30, updatable = true) |
... | ... | @@ -85,11 +85,11 @@ public class EnderecoEstoque extends PersistentObjectAuditOrganizacao { |
85 | 85 | private String sigla; |
86 | 86 | |
87 | 87 | @Column(name = "descricao", length = 400, nullable = false) |
88 | - @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class }) | |
88 | + @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
89 | 89 | private String descricao; |
90 | 90 | |
91 | 91 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
92 | - @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class }) | |
92 | + @JsonView({ ViewsAdmMateriais.EnderecoEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
93 | 93 | private EnderecoEstoque endeEstoqSuperior; |
94 | 94 | |
95 | 95 | @Column(name = "acomodaMaterial") | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/Estoque.java
... | ... | @@ -71,7 +71,7 @@ public class Estoque extends PersistentObjectAuditOrganizacao { |
71 | 71 | /** Atributo almoxarifado. */ |
72 | 72 | @OneToOne(fetch = FetchType.LAZY, optional = false) |
73 | 73 | @JsonView({ ViewsAdmMateriais.LocalEstoqueAutoCompleteView.class, |
74 | - ViewsAlmoxarifado.ConfiguracaoRessuprimentoEditView.class, Views.MaterialConsultaInfo.class, ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class }) | |
74 | + ViewsAlmoxarifado.ConfiguracaoRessuprimentoEditView.class, Views.MaterialConsultaInfo.class, ViewsAdmMateriais.EnderecoEstoqueView.class, Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
75 | 75 | private EstruturaOrganizacional almoxarifado; |
76 | 76 | |
77 | 77 | /** Atributo locais. */ | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/MaterialLocalEstoque.java
... | ... | @@ -15,6 +15,7 @@ import org.hibernate.envers.Audited; |
15 | 15 | |
16 | 16 | import com.fasterxml.jackson.annotation.JsonView; |
17 | 17 | |
18 | +import br.com.centralit.api.framework.json.ViewsAdmMateriais; | |
18 | 19 | import br.com.centralit.framework.json.Views; |
19 | 20 | import br.com.centralit.framework.model.arquitetura.PersistentObjectAuditOrganizacao; |
20 | 21 | |
... | ... | @@ -67,7 +68,7 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
67 | 68 | |
68 | 69 | /** Atributo materialEstoque. */ |
69 | 70 | @ManyToOne(fetch = FetchType.LAZY, optional = false, cascade = CascadeType.PERSIST) |
70 | - @JsonView({ Views.MaterialLocalEstoqueView.class }) | |
71 | + @JsonView({ Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
71 | 72 | private MaterialEstoque materialEstoque; |
72 | 73 | |
73 | 74 | /** Atributo materialEstoqueInativo. */ |
... | ... | @@ -76,18 +77,22 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
76 | 77 | |
77 | 78 | /** Atributo endereco. */ |
78 | 79 | @ManyToOne(fetch = FetchType.LAZY, optional = false) |
79 | - @JsonView({ Views.MaterialLocalEstoqueView.class }) | |
80 | + @JsonView({ Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
80 | 81 | private EnderecoEstoque endereco; |
81 | 82 | |
82 | 83 | /** Atributo enderecoInativo. */ |
83 | 84 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
84 | 85 | private EnderecoEstoque enderecoInativo; |
85 | 86 | |
87 | + @JsonView({ Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
88 | + private BigDecimal capacidade; | |
89 | + | |
86 | 90 | /** Atributo quantidade. */ |
87 | - @JsonView({ Views.MaterialLocalEstoqueView.class }) | |
91 | + @JsonView({ Views.MaterialLocalEstoqueView.class, ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
88 | 92 | private BigDecimal quantidade; |
89 | 93 | |
90 | 94 | /** Atributo unidadeMedidaEntrada. */ |
95 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
91 | 96 | @ManyToOne(fetch = FetchType.LAZY, optional = true) |
92 | 97 | private UnidadeMedida unidadeMedidaEntrada; |
93 | 98 | |
... | ... | @@ -242,4 +247,12 @@ public class MaterialLocalEstoque extends PersistentObjectAuditOrganizacao { |
242 | 247 | this.localPrincipal = localPrincipal; |
243 | 248 | } |
244 | 249 | |
250 | + public BigDecimal getCapacidade() { | |
251 | + return capacidade; | |
252 | + } | |
253 | + | |
254 | + public void setCapacidade(BigDecimal capacidade) { | |
255 | + this.capacidade = capacidade; | |
256 | + } | |
257 | + | |
245 | 258 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/TransferenciaEnderecoEstoque.java
0 → 100644
... | ... | @@ -0,0 +1,161 @@ |
1 | +package br.com.centralit.api.model; | |
2 | + | |
3 | +import java.math.BigDecimal; | |
4 | +import java.util.Calendar; | |
5 | + | |
6 | +import javax.persistence.Column; | |
7 | +import javax.persistence.Entity; | |
8 | +import javax.persistence.FetchType; | |
9 | +import javax.persistence.GeneratedValue; | |
10 | +import javax.persistence.GenerationType; | |
11 | +import javax.persistence.Id; | |
12 | +import javax.persistence.ManyToOne; | |
13 | +import javax.persistence.OneToOne; | |
14 | +import javax.persistence.Table; | |
15 | +import javax.persistence.Temporal; | |
16 | +import javax.persistence.TemporalType; | |
17 | + | |
18 | +import org.hibernate.envers.Audited; | |
19 | + | |
20 | +import com.fasterxml.jackson.annotation.JsonView; | |
21 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
22 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
23 | + | |
24 | +import br.com.centralit.api.framework.json.ViewsAdmMateriais; | |
25 | +import br.com.centralit.framework.json.JsonCalendarSimpleDateDeserializer; | |
26 | +import br.com.centralit.framework.json.JsonCalendarSimpleDateSerializer; | |
27 | +import br.com.centralit.framework.json.Views; | |
28 | +import br.com.centralit.framework.model.arquitetura.PersistentObjectAuditOrganizacao; | |
29 | + | |
30 | +/** | |
31 | + * | |
32 | + * <p> | |
33 | + * <img src="http://centralit.com.br/images/logo_central.png"> | |
34 | + * </p> | |
35 | + * | |
36 | + * <p> | |
37 | + * <b>Company: </b> Central IT - Governança Corporativa - | |
38 | + * </p> | |
39 | + * | |
40 | + * <p> | |
41 | + * <b>Title: </b> | |
42 | + * </p> | |
43 | + * | |
44 | + * <p> | |
45 | + * <b>Description: </b> | |
46 | + * </p> | |
47 | + * | |
48 | + * <p> | |
49 | + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a> | |
50 | + * </p> | |
51 | + * | |
52 | + * <p> | |
53 | + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a> | |
54 | + * </p> | |
55 | + * | |
56 | + * @since 09/05/2016 - 09:14:17 | |
57 | + * | |
58 | + * @version 1.0.0 | |
59 | + * | |
60 | + * @author erick.sato | |
61 | + * | |
62 | + */ | |
63 | +@Audited | |
64 | +@Entity | |
65 | +@Table(name = "alm_ee_transferencia") | |
66 | +public class TransferenciaEnderecoEstoque extends PersistentObjectAuditOrganizacao { | |
67 | + | |
68 | + /** | |
69 | + * | |
70 | + */ | |
71 | + private static final long serialVersionUID = 1L; | |
72 | + | |
73 | + /** Atributo id. */ | |
74 | + @Id | |
75 | + @GeneratedValue(strategy = GenerationType.AUTO) | |
76 | + @JsonView({ Views.GenericView.class }) | |
77 | + private Long id; | |
78 | + | |
79 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) | |
80 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
81 | + private EstruturaOrganizacional almoxarifado; | |
82 | + | |
83 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) | |
84 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
85 | + private MaterialLocalEstoque enderecoEstoqueOrigem; | |
86 | + | |
87 | + @ManyToOne(fetch = FetchType.LAZY, optional = false) | |
88 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
89 | + private MaterialLocalEstoque enderecoEstoqueDestino; | |
90 | + | |
91 | + @OneToOne(fetch = FetchType.LAZY, optional = false) | |
92 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
93 | + private MaterialConsumo material; | |
94 | + | |
95 | + @Column(name = "dataTransferencia", nullable = false) | |
96 | + @Temporal(TemporalType.TIMESTAMP) | |
97 | + @JsonSerialize(using = JsonCalendarSimpleDateSerializer.class) | |
98 | + @JsonDeserialize(using = JsonCalendarSimpleDateDeserializer.class) | |
99 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
100 | + private Calendar dataTransferencia; | |
101 | + | |
102 | + @JsonView({ ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class }) | |
103 | + private BigDecimal quantidade; | |
104 | + | |
105 | + public Long getId() { | |
106 | + return id; | |
107 | + } | |
108 | + | |
109 | + public void setId(Long id) { | |
110 | + this.id = id; | |
111 | + } | |
112 | + | |
113 | + public EstruturaOrganizacional getAlmoxarifado() { | |
114 | + return almoxarifado; | |
115 | + } | |
116 | + | |
117 | + public void setAlmoxarifado(EstruturaOrganizacional almoxarifado) { | |
118 | + this.almoxarifado = almoxarifado; | |
119 | + } | |
120 | + | |
121 | + public MaterialConsumo getMaterial() { | |
122 | + return material; | |
123 | + } | |
124 | + | |
125 | + public void setMaterial(MaterialConsumo material) { | |
126 | + this.material = material; | |
127 | + } | |
128 | + | |
129 | + public Calendar getDataTransferencia() { | |
130 | + return dataTransferencia; | |
131 | + } | |
132 | + | |
133 | + public void setDataTransferencia(Calendar dataTransferencia) { | |
134 | + this.dataTransferencia = dataTransferencia; | |
135 | + } | |
136 | + | |
137 | + public BigDecimal getQuantidade() { | |
138 | + return quantidade; | |
139 | + } | |
140 | + | |
141 | + public void setQuantidade(BigDecimal quantidade) { | |
142 | + this.quantidade = quantidade; | |
143 | + } | |
144 | + | |
145 | + public MaterialLocalEstoque getEnderecoEstoqueOrigem() { | |
146 | + return enderecoEstoqueOrigem; | |
147 | + } | |
148 | + | |
149 | + public void setEnderecoEstoqueOrigem(MaterialLocalEstoque enderecoEstoqueOrigem) { | |
150 | + this.enderecoEstoqueOrigem = enderecoEstoqueOrigem; | |
151 | + } | |
152 | + | |
153 | + public MaterialLocalEstoque getEnderecoEstoqueDestino() { | |
154 | + return enderecoEstoqueDestino; | |
155 | + } | |
156 | + | |
157 | + public void setEnderecoEstoqueDestino(MaterialLocalEstoque enderecoEstoqueDestino) { | |
158 | + this.enderecoEstoqueDestino = enderecoEstoqueDestino; | |
159 | + } | |
160 | + | |
161 | +} | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/MovimentoEstoqueService.java
... | ... | @@ -208,6 +208,8 @@ public interface MovimentoEstoqueService extends GenericService<MovimentoEstoque |
208 | 208 | * @return |
209 | 209 | */ |
210 | 210 | public Collection<MovimentoEstoque> findAllByClasseReferencia(Dominio classeReferencia, Long idReferencia); |
211 | + | |
212 | + MovimentoEstoque findUltimoMovimentoPorIdMaterialIdLocalEstoque(Long idMaterial, Long idLocalEstoque); | |
211 | 213 | |
212 | 214 | /** |
213 | 215 | * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/TransferenciaEnderecoEstoqueService.java
0 → 100644
... | ... | @@ -0,0 +1,9 @@ |
1 | +package br.com.centralit.api.service; | |
2 | + | |
3 | +import br.com.centralit.api.model.TransferenciaEnderecoEstoque; | |
4 | +import br.com.centralit.framework.service.arquitetura.GenericService; | |
5 | + | |
6 | +public interface TransferenciaEnderecoEstoqueService extends GenericService<TransferenciaEnderecoEstoque, Long> { | |
7 | + | |
8 | + | |
9 | +} | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/EnderecoEstoqueServiceImpl.java
... | ... | @@ -133,8 +133,8 @@ public class EnderecoEstoqueServiceImpl extends GenericServiceImpl<EnderecoEstoq |
133 | 133 | MaterialLocalEstoque materialLocalEstoque = new MaterialLocalEstoque(); |
134 | 134 | materialLocalEstoque.setMaterialEstoque(materialEstoque); |
135 | 135 | materialLocalEstoque.setEndereco(enderecoEstoque); |
136 | - materialLocalEstoque.setQuantidade(new BigDecimal("9999999999")); | |
137 | - materialLocalEstoque.setLocalPrincipal(Boolean.TRUE); | |
136 | + materialLocalEstoque.setCapacidade(new BigDecimal("9999999999")); | |
137 | + materialLocalEstoque.setLocalPrincipal(Boolean.FALSE); | |
138 | 138 | this.materialLocalEstoqueService.save(materialLocalEstoque); |
139 | 139 | } |
140 | 140 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/InicializarAlmoxarifadoServiceImpl.java
... | ... | @@ -201,6 +201,13 @@ public class InicializarAlmoxarifadoServiceImpl extends UtilStartup{ |
201 | 201 | menuEnderecoEstoque.setIncludes(filesMenuFileEnderecoEstoque); |
202 | 202 | this.menuService.mergeIfNotExist(menuEnderecoEstoque); |
203 | 203 | |
204 | + // Menu Transferencia Endereco Estoque | |
205 | + Pagina pgTransferenciaEnderecoEstoque = new Pagina("Transferência de endereço de estoque", "/cit-almoxarifado-web/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoque.html"); | |
206 | + pgTransferenciaEnderecoEstoque = this.paginaService.saveIfNotExist(pgTransferenciaEnderecoEstoque); | |
207 | + Menu menuTransferenciaEnderecoEstoque = new Menu("Transferência de endereço de estoque", pgTransferenciaEnderecoEstoque, menuAlmoxarifado, null, 9, null, null, null, null, moduloSelecionado); | |
208 | + List<MenuFile> filesMenuFileTransferenciaEnderecoEstoque = this.gerarArquivosMenu(menuTransferenciaEnderecoEstoque, CIT_ALMOXARIFADO_WEB_ANGULAR_CUSTOM, "TransferenciaEnderecoEstoque", true, true, true); | |
209 | + menuTransferenciaEnderecoEstoque.setIncludes(filesMenuFileTransferenciaEnderecoEstoque); | |
210 | + this.menuService.mergeIfNotExist(menuTransferenciaEnderecoEstoque); | |
204 | 211 | |
205 | 212 | /* |
206 | 213 | * Paginas e menus relatorios Submenu Relatórios almoxarifado | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/MovimentoEstoqueServiceImpl.java
... | ... | @@ -601,6 +601,11 @@ public class MovimentoEstoqueServiceImpl extends GenericServiceImpl<MovimentoEst |
601 | 601 | } |
602 | 602 | |
603 | 603 | @Override |
604 | + public MovimentoEstoque findUltimoMovimentoPorIdMaterialIdLocalEstoque(Long idMaterial, Long idLocalEstoque) { | |
605 | + return this.movimentoEstoqueDao.findUltimoMovimentoPorIdMaterialIdLocalEstoque(idMaterial, idLocalEstoque); | |
606 | + } | |
607 | + | |
608 | + @Override | |
604 | 609 | public String buscarMovimentosSaidaComMateriaisDaEntrada(Long idEntrada) { |
605 | 610 | Dominio idioma = this.dominioService.findByChaveAndCodigo("tipoIdioma", Dominio.TIPO_IDIOMA_PT_BR_CODIGO); |
606 | 611 | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/impl/TransferenciaEnderecoEstoqueServiceImpl.java
0 → 100644
... | ... | @@ -0,0 +1,83 @@ |
1 | +package br.com.centralit.api.service.impl; | |
2 | + | |
3 | +import java.text.SimpleDateFormat; | |
4 | + | |
5 | +import org.springframework.beans.factory.annotation.Autowired; | |
6 | +import org.springframework.beans.factory.annotation.Qualifier; | |
7 | +import org.springframework.stereotype.Service; | |
8 | +import org.springframework.validation.Validator; | |
9 | + | |
10 | +import br.com.centralit.api.dao.TransferenciaEnderecoEstoqueDao; | |
11 | +import br.com.centralit.api.model.MovimentoEstoque; | |
12 | +import br.com.centralit.api.model.TransferenciaEnderecoEstoque; | |
13 | +import br.com.centralit.api.service.DominioService; | |
14 | +import br.com.centralit.api.service.InternacionalizacaoService; | |
15 | +import br.com.centralit.api.service.MovimentoEstoqueService; | |
16 | +import br.com.centralit.api.service.TransferenciaEnderecoEstoqueService; | |
17 | +import br.com.centralit.framework.exception.BusinessException; | |
18 | +import br.com.centralit.framework.exception.CodigoErro; | |
19 | +import br.com.centralit.framework.model.Dominio; | |
20 | +import br.com.centralit.framework.service.arquitetura.GenericServiceImpl; | |
21 | +import br.com.centralit.framework.util.UtilObjeto; | |
22 | + | |
23 | +@Service("transferenciaEnderecoEstoqueService") | |
24 | +public class TransferenciaEnderecoEstoqueServiceImpl extends GenericServiceImpl<TransferenciaEnderecoEstoque, Long> implements TransferenciaEnderecoEstoqueService { | |
25 | + | |
26 | + private TransferenciaEnderecoEstoqueDao transferenciaEnderecoEstoqueDao; | |
27 | + | |
28 | + @Autowired | |
29 | + private MovimentoEstoqueService movimentoEstoqueService; | |
30 | + | |
31 | + @Autowired | |
32 | + private InternacionalizacaoService internacionalizacaoService; | |
33 | + | |
34 | + @Autowired | |
35 | + private DominioService dominioService; | |
36 | + | |
37 | + private Dominio idioma; | |
38 | + | |
39 | + private Dominio getIdioma() { | |
40 | + if(!UtilObjeto.isReferencia(idioma)){ | |
41 | + idioma = this.dominioService.findByChaveAndCodigo("tipoIdioma", Dominio.TIPO_IDIOMA_PT_BR_CODIGO); | |
42 | + } | |
43 | + return idioma; | |
44 | + } | |
45 | + | |
46 | + @Autowired | |
47 | + public TransferenciaEnderecoEstoqueServiceImpl(TransferenciaEnderecoEstoqueDao transferenciaEnderecoEstoqueDao, @Qualifier("transferenciaEnderecoEstoqueValidator") Validator validator) { | |
48 | + this.dao = transferenciaEnderecoEstoqueDao; | |
49 | + this.transferenciaEnderecoEstoqueDao = transferenciaEnderecoEstoqueDao; | |
50 | + this.validator = validator; | |
51 | + } | |
52 | + | |
53 | + public TransferenciaEnderecoEstoque save(TransferenciaEnderecoEstoque transferenciaEnderecoEstoque){ | |
54 | + | |
55 | + this.validarEntidade(transferenciaEnderecoEstoque, this.validator); | |
56 | + | |
57 | + MovimentoEstoque ultimoMovimentoEstoque = this.movimentoEstoqueService.findUltimoMovimentoPorIdMaterialIdLocalEstoque(transferenciaEnderecoEstoque.getMaterial().getId(), transferenciaEnderecoEstoque.getEnderecoEstoqueDestino().getId()); | |
58 | + if(ultimoMovimentoEstoque != null && transferenciaEnderecoEstoque.getDataTransferencia().after(ultimoMovimentoEstoque.getDataMovimento())){ | |
59 | + String validacaoDataTransferencia = this.internacionalizacaoService.getTranslate("ALMOXARIFADO.MSG.TRANSFERENCIA_NEGADA_DATA_INFERIOR_ULTIMA_MOVIMENTACAO", this.getIdioma()); | |
60 | + validacaoDataTransferencia = String.format(validacaoDataTransferencia, new SimpleDateFormat("dd/MM/yyyy").format(ultimoMovimentoEstoque.getDataMovimento().getTime())); | |
61 | + throw new BusinessException(validacaoDataTransferencia, CodigoErro.REGRA_NEGOCIO.getValue()); | |
62 | + } | |
63 | + | |
64 | + //TODO ERICK Criar movimento baixa estoque origem | |
65 | + //this.movimentoEstoqueService.gerarMovimentoBaixa(baixaAlmoxarifado); | |
66 | + | |
67 | + this.transferenciaEnderecoEstoqueDao.save(transferenciaEnderecoEstoque); | |
68 | + | |
69 | + //TODO ERICK Criar movimento estoque destino ADD MATERIAL | |
70 | + //this.movimentoEstoqueService.gerarMovimento(EntradaAlmoxarifado); | |
71 | + | |
72 | + return transferenciaEnderecoEstoque; | |
73 | + } | |
74 | + | |
75 | + @Override | |
76 | + public boolean removeById(Long id) { | |
77 | + //TODO ERICK validar se houve movimentacao | |
78 | + //TODO ERICK remover movimento origem | |
79 | + //TODO ERICK remover movimento destino | |
80 | + return super.removeById(id); | |
81 | + } | |
82 | + | |
83 | +} | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/validation/MaterialLocalEstoqueValidator.java
... | ... | @@ -22,7 +22,7 @@ public class MaterialLocalEstoqueValidator implements Validator { |
22 | 22 | |
23 | 23 | ValidationUtils.rejectIfEmpty(errors, "endereco", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE"); |
24 | 24 | |
25 | - ValidationUtils.rejectIfEmpty(errors, "quantidade", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CAPACIDADE"); | |
25 | + ValidationUtils.rejectIfEmpty(errors, "capacidade", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.CAPACIDADE"); | |
26 | 26 | |
27 | 27 | } |
28 | 28 | } | ... | ... |
cit-almoxarifado-api/src/main/java/br/com/centralit/api/service/validation/TransferenciaEnderecoEstoqueValidator.java
0 → 100644
... | ... | @@ -0,0 +1,48 @@ |
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.TransferenciaEnderecoEstoque; | |
9 | +import br.com.centralit.framework.exception.BusinessException; | |
10 | +import br.com.centralit.framework.exception.CodigoErro; | |
11 | + | |
12 | +@Component("transferenciaEnderecoEstoqueValidator") | |
13 | +public class TransferenciaEnderecoEstoqueValidator implements Validator { | |
14 | + | |
15 | + @Override | |
16 | + public boolean supports(Class<?> clazz) { | |
17 | + | |
18 | + return TransferenciaEnderecoEstoque.class.isAssignableFrom(clazz); | |
19 | + } | |
20 | + | |
21 | + @Override | |
22 | + public void validate(Object target, Errors errors) { | |
23 | + | |
24 | + ValidationUtils.rejectIfEmpty(errors, "almoxarifado", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ALMOXARIFADO"); | |
25 | + | |
26 | + ValidationUtils.rejectIfEmpty(errors, "material", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "LABEL.MATERIAL"); | |
27 | + | |
28 | + ValidationUtils.rejectIfEmpty(errors, "dataTransferencia", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.DATA_TRANSFERENCIA"); | |
29 | + | |
30 | + ValidationUtils.rejectIfEmpty(errors, "enderecoEstoqueOrigem", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_ORIGEM"); | |
31 | + | |
32 | + ValidationUtils.rejectIfEmpty(errors, "enderecoEstoqueDestino", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_DESTINO"); | |
33 | + | |
34 | + ValidationUtils.rejectIfEmpty(errors, "quantidade", CodigoErro.VALIDACAO_CAMPOS_OBRIGATORIOS.getValue().toString(), "ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERENCIA"); | |
35 | + | |
36 | + TransferenciaEnderecoEstoque transferenciaEnderecoEstoque = (TransferenciaEnderecoEstoque)target; | |
37 | + | |
38 | + if(transferenciaEnderecoEstoque.getEnderecoEstoqueDestino().getQuantidade().add(transferenciaEnderecoEstoque.getQuantidade()).doubleValue() > transferenciaEnderecoEstoque.getEnderecoEstoqueDestino().getCapacidade().doubleValue()){ | |
39 | + throw new BusinessException("ALMOXARIFADO.MSG.TRANSFERENCIA_ULTRAPASSA_CAPACIDADE_LIMITE_ENDERECO_ESTOQUE", CodigoErro.REGRA_NEGOCIO.getValue()); | |
40 | + } | |
41 | + | |
42 | + if(transferenciaEnderecoEstoque.getQuantidade().doubleValue() > transferenciaEnderecoEstoque.getEnderecoEstoqueOrigem().getQuantidade().doubleValue()){ | |
43 | + throw new BusinessException("ALMOXARIFADO.MSG.TRANSFERENCIA_ULTRAPASSA_QUANTIDADE_SALDO_ENDERECO_ESTOQUE_ORIGEM", CodigoErro.REGRA_NEGOCIO.getValue()); | |
44 | + } | |
45 | + | |
46 | + } | |
47 | +} | |
48 | + | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/TransferenciaEnderecoEstoqueController.java
0 → 100644
... | ... | @@ -0,0 +1,31 @@ |
1 | +package br.com.centralit.controller; | |
2 | + | |
3 | +import org.springframework.beans.factory.annotation.Autowired; | |
4 | +import org.springframework.stereotype.Controller; | |
5 | +import org.springframework.web.bind.annotation.RequestMapping; | |
6 | + | |
7 | +import br.com.centralit.api.framework.json.ViewsAdmMateriais; | |
8 | +import br.com.centralit.api.framework.json.ViewsAdmMateriais.TransferenciaEnderecoEstoqueView; | |
9 | +import br.com.centralit.api.model.TransferenciaEnderecoEstoque; | |
10 | +import br.com.centralit.api.service.TransferenciaEnderecoEstoqueService; | |
11 | +import br.com.centralit.framework.controller.GenericController; | |
12 | + | |
13 | +@Controller | |
14 | +@RequestMapping("/rest/transferenciaEnderecoEstoque") | |
15 | +public class TransferenciaEnderecoEstoqueController extends GenericController<TransferenciaEnderecoEstoque>{ | |
16 | + | |
17 | + private TransferenciaEnderecoEstoqueService transferenciaEnderecoEstoqueService; | |
18 | + | |
19 | + @Autowired | |
20 | + public TransferenciaEnderecoEstoqueController(TransferenciaEnderecoEstoqueService transferenciaEnderecoEstoqueService) { | |
21 | + super(transferenciaEnderecoEstoqueService); | |
22 | + this.transferenciaEnderecoEstoqueService = transferenciaEnderecoEstoqueService; | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public Class<TransferenciaEnderecoEstoqueView> getEditView() { | |
27 | + | |
28 | + return ViewsAdmMateriais.TransferenciaEnderecoEstoqueView.class; | |
29 | + } | |
30 | + | |
31 | +} | ... | ... |
cit-almoxarifado-web/src/main/java/br/com/centralit/listener/StartupListenerAlmoxarifado.java
... | ... | @@ -300,6 +300,13 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
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 | 302 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_VINCULADO_SUPERIOR", "Endereço de estoque: ", dominio, modulo)); |
303 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DATA_TRANSFERENCIA", "Data da transferência", dominio, modulo)); | |
304 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_ORIGEM", "Endereço estoque origem", dominio, modulo)); | |
305 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_DESTINO", "Endereço estoque destino", dominio, modulo)); | |
306 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERENCIA", "Quantidade a transferir", dominio, modulo)); | |
307 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERIDA", "Quantidade transferida", dominio, modulo)); | |
308 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.SALDO_ENDERECO", "Saldo no endereço", dominio, modulo)); | |
309 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.TRANSFERENCIA_ENDERECO_ESTOQUE", "Transferência de endereço de estoque", dominio, modulo)); | |
303 | 310 | |
304 | 311 | //Entrada de materiais |
305 | 312 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.LABEL.DADOS_ENTRADA", "Dados da entrada", dominio, modulo)); |
... | ... | @@ -360,8 +367,14 @@ public class StartupListenerAlmoxarifado extends UtilStartup implements Applicat |
360 | 367 | 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)); |
361 | 368 | 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)); |
362 | 369 | 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)); |
363 | - | |
364 | - internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.ENTRADA_CONTABILIZADA", "Entrada contabilizada com sucesso!", dominio, modulo)); | |
370 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.INFORME_ALMOXARIFADO", "Informe o almoxarifado.", dominio, modulo)); | |
371 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.MATERIAL_SEM_VINCULO_ALMOXARIFADO", "Material não tem vínculo com o almoxarifado informado.", dominio, modulo)); | |
372 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.MATERIAL_VINCULADO_SOMENTE_UM_ENDERECO_TRANSFERENCIA_NEGADA", "Material possui somente um endereço cadastrado, portanto não é permitido realizar a transferência.", dominio, modulo)); | |
373 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.TRANSFERENCIA_ULTRAPASSA_CAPACIDADE_LIMITE_ENDERECO_ESTOQUE", "Não foi possível realizar a transfência. A quantidade escolhida somada ao saldo do material no estoque ultrapassa a capacidade suportada pelo endereço de estoque destino.", dominio, modulo)); | |
374 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.TRANSFERENCIA_NEGADA_DATA_INFERIOR_ULTIMA_MOVIMENTACAO", "Não foi possível realizar a transfência. Existe uma movimentação do material nesse estoque posterior a data de transferência informada. Data de transferência deve ser superior a %s.", dominio, modulo)); | |
375 | + internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.TRANSFERENCIA_ULTRAPASSA_QUANTIDADE_SALDO_ENDERECO_ESTOQUE_ORIGEM", "Não foi possível realizar a transfência. A quantidade escolhida ultrapassa a quantidade disponível para transferir do endereço de estoque de origem.", dominio, modulo)); | |
376 | + | |
377 | + ' internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.ENTRADA_CONTABILIZADA", "Entrada contabilizada com sucesso!", dominio, modulo)); | |
365 | 378 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.ENTRADA_DESCONTABILIZADA", "Entrada descontabilizada com sucesso!", dominio, modulo)); |
366 | 379 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.SELECIONE_UM_ITEM_PARA_DEFINIR_CARAC", "Selecione um item para definir suas características!", dominio, modulo)); |
367 | 380 | internacionalizacaoList.add(new Internacionalizacao("ALMOXARIFADO.MSG.MATERIAL_NAO_POSSUI_CARACTERISTICAS", "Material não possui características cadastradas.", dominio, modulo)); | ... | ... |
cit-almoxarifado-web/src/main/resources/reports/entradaAlmoxarifado.jrxml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | +<!-- Created with Jaspersoft Studio version 6.2.1.final using JasperReports Library version 6.2.1 --> | |
3 | +<!-- 2016-05-09T14:37:46 --> | |
2 | 4 | <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="entradaAlmoxarifado" language="groovy" pageWidth="802" pageHeight="555" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="466976dd-5993-46ca-9d09-1a18f2ff2878"> |
3 | 5 | <property name="ireport.zoom" value="1.0"/> |
4 | 6 | <property name="ireport.x" value="0"/> |
... | ... | @@ -74,11 +76,11 @@ FROM entradaalmoxarifado ea |
74 | 76 | eai.quantidade as quantidade, |
75 | 77 | eai.valorunitario as valorUnitario, |
76 | 78 | eai.valortotal as valorTotal |
77 | -FROM entradaalmoxarifado ea | |
79 | +FROM alm_entrada ea | |
78 | 80 | INNER JOIN dominio d ON d.id = ea.dominiotipoentrada_id |
79 | 81 | INNER JOIN parceiro parceiro ON parceiro.id = ea.fornecedor_id |
80 | 82 | INNER JOIN pessoa p ON p.id = parceiro.pessoa_id |
81 | - INNER JOIN entradaalmoxarifadoitem eai ON eai.entrada_id = ea.id | |
83 | + INNER JOIN alm_en_entradaitem eai ON eai.entrada_id = ea.id | |
82 | 84 | INNER JOIN material m ON m.id = eai.material_id AND $X{IN,m.id,idsMateriais} |
83 | 85 | WHERE ea.almoxarifado_id = $P{idAlmoxarifado} |
84 | 86 | AND ea.datarecebimento BETWEEN (TO_TIMESTAMP($P{dataInicio},'YYYY-MM-DD HH24:MI:SS')::timestamp without time zone) AND (TO_TIMESTAMP($P{dataFim},'YYYY-MM-DD HH24:MI:SS')::timestamp without time zone) | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EnderecoEstoqueListController.js
... | ... | @@ -68,7 +68,7 @@ citApp.controller('EnderecoEstoqueListController', ['$scope', 'EnderecoEstoqueRe |
68 | 68 | $scope.removeEnderecoEstoque = function(){ |
69 | 69 | |
70 | 70 | if(!$scope.enderecoEstoqueChecked) { |
71 | - $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | |
71 | + $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_ITEM_EXCLUIR') ); | |
72 | 72 | return; |
73 | 73 | } |
74 | 74 | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoController.js
... | ... | @@ -233,6 +233,27 @@ citApp.controller('EntradaAlmoxarifadoController', ['$scope', '$filter', 'FileUp |
233 | 233 | return result; |
234 | 234 | }); |
235 | 235 | }; |
236 | + | |
237 | + $scope.dominioTipoRecebimentoListTemp = []; | |
238 | + $scope.alterarListaDominioTipoRecebimento = function(dominioTipoEntrada){ | |
239 | + if(dominioTipoEntrada){ | |
240 | + var codigo = dominioTipoEntrada.codigo; | |
241 | + | |
242 | + if(codigo === 1){ | |
243 | + $scope.dominioTipoRecebimentoListTemp = $scope.dominiosTipoRecebimentoOrcamentaria; | |
244 | + }else if(codigo === 2){ | |
245 | + $scope.dominioTipoRecebimentoListTemp = $scope.dominiosTipoRecebimentoExtraOrcamentaria; | |
246 | + }else{ | |
247 | + $scope.dominioTipoRecebimentoListTemp = []; | |
248 | + } | |
249 | + }else{ | |
250 | + $scope.dominioTipoRecebimentoListTemp = []; | |
251 | + } | |
252 | + | |
253 | + if($scope.relatorioEntradaAlmoxarifado && $scope.relatorioEntradaAlmoxarifado.dominioTipoRecebimento){ | |
254 | + delete $scope.relatorioEntradaAlmoxarifado.dominioTipoRecebimento; | |
255 | + } | |
256 | + } | |
236 | 257 | |
237 | 258 | // carregar as caracteristicas do material |
238 | 259 | $scope.carregarCaracteristicasGenericas = function(item){ | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/RequisicaoConsumoController.js
... | ... | @@ -244,6 +244,10 @@ citApp.controller('RequisicaoConsumoController', ['$scope', '$filter', 'Requisic |
244 | 244 | $scope.diasCompletos = []; |
245 | 245 | |
246 | 246 | $scope.URPossuiCatalogo = false; |
247 | + | |
248 | + $scope.listaRequisicaoConsumoItens = []; | |
249 | + | |
250 | + $scope.listaAtendimento = []; | |
247 | 251 | |
248 | 252 | $scope.requisicaoConsumo = { |
249 | 253 | unidadeRequisitante : null, |
... | ... | @@ -283,7 +287,8 @@ citApp.controller('RequisicaoConsumoController', ['$scope', '$filter', 'Requisic |
283 | 287 | } |
284 | 288 | |
285 | 289 | $scope.edit = edit; |
286 | - | |
290 | + $scope.changeListRequisicaoConsumoItem(); | |
291 | + $scope.changeListAtendimentoRequisicao(); | |
287 | 292 | $scope.setLoadingGet(false); |
288 | 293 | |
289 | 294 | }); |
... | ... | @@ -347,7 +352,7 @@ citApp.controller('RequisicaoConsumoController', ['$scope', '$filter', 'Requisic |
347 | 352 | |
348 | 353 | $scope.requisicaoConsumo.requisicaoConsumoItens.push({materialConsumo : item, $TIPO_DECIMAL : item.unidadeArmazenamento.tipoNumerico.codigo === 1 ? 0 : 2}); |
349 | 354 | |
350 | - | |
355 | + $scope.changeListRequisicaoConsumoItem(); | |
351 | 356 | $timeout(function(){ |
352 | 357 | |
353 | 358 | $scope.requisicaoConsumoItem = null; |
... | ... | @@ -538,5 +543,36 @@ citApp.controller('RequisicaoConsumoController', ['$scope', '$filter', 'Requisic |
538 | 543 | $scope.apresentarInfoAtendimentoItem = function(atendimento){ |
539 | 544 | atendimento.$verInfo = !atendimento.$verInfo; |
540 | 545 | }; |
546 | + | |
547 | + $scope.filterCriteria = { | |
548 | + start : 1, | |
549 | + limit : 5, | |
550 | + }; | |
551 | + | |
552 | + $scope.filterCriteria2 = { | |
553 | + start : 1, | |
554 | + limit : 5, | |
555 | + }; | |
556 | + | |
557 | + $scope.changeListRequisicaoConsumoItem = function (){ | |
558 | + | |
559 | + $scope.listaRequisicaoConsumoItens = []; | |
560 | + var pagina = (($scope.filterCriteria.start - 1) * $scope.filterCriteria.limit); | |
561 | + $scope.listaRequisicaoConsumoItens = $scope.requisicaoConsumo.requisicaoConsumoItens.slice(pagina,(pagina + $scope.filterCriteria.limit)); | |
562 | + $scope.totalPages = $scope.requisicaoConsumo.requisicaoConsumoItens.length/$scope.filterCriteria.limit; | |
563 | + $scope.totalItens = $scope.requisicaoConsumo.requisicaoConsumoItens.length; | |
564 | + | |
565 | + }; | |
566 | + | |
567 | + $scope.changeListAtendimentoRequisicao = function (){ | |
568 | + $scope.listaAtendimento = []; | |
569 | + if($scope.atendimentos && $scope.atendimentos.length > 0){ | |
570 | + var pagina = (($scope.filterCriteria2.start - 1) * $scope.filterCriteria2.limit); | |
571 | + $scope.listaAtendimento = $scope.atendimentos.slice(pagina,(pagina + $scope.filterCriteria2.limit)); | |
572 | + $scope.totalPages2 = $scope.atendimentos.length/$scope.filterCriteria2.limit; | |
573 | + $scope.totalItens2 = $scope.atendimentos.length; | |
574 | + } | |
575 | + | |
576 | + }; | |
541 | 577 | |
542 | 578 | }]); |
543 | 579 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/TransferenciaEnderecoEstoqueController.js
0 → 100644
... | ... | @@ -0,0 +1,147 @@ |
1 | +'use strict'; | |
2 | + | |
3 | +citApp.controller('TransferenciaEnderecoEstoqueController', ['$scope', 'TransferenciaEnderecoEstoqueRepository', '$translate', '$timeout', | |
4 | + 'EstruturaOrganizacionalAlmoxarifadoRepository','MaterialRepository', 'MaterialLocalEstoqueRepository', | |
5 | + function TransferenciaEnderecoEstoqueController($scope, TransferenciaEnderecoEstoqueRepository, $translate, $timeout, | |
6 | + EstruturaOrganizacionalAlmoxarifadoRepository, MaterialRepository, MaterialLocalEstoqueRepository) { | |
7 | + | |
8 | + $scope.resetForm = function() { | |
9 | + $scope.transferenciaEnderecoEstoque = {}; | |
10 | + EstruturaOrganizacionalAlmoxarifadoRepository.getAlmoxarifadoPadrao($scope.usuarioLogado.organizacao.id).then(function(result){ | |
11 | + $scope.estruturaAlmoxarifadoPadrao = {}; | |
12 | + if(result.originalElement.estruturaOrganizacional){ | |
13 | + $scope.transferenciaEnderecoEstoque = { almoxarifado : result.originalElement.estruturaOrganizacional}; | |
14 | + } | |
15 | + $scope.edit = true; | |
16 | + $timeout(function(){ | |
17 | + $scope.transferenciaEnderecoEstoqueForm.$submitted = false; | |
18 | + $scope.transferenciaEnderecoEstoqueForm.$setPristine(); | |
19 | + }); | |
20 | + }); | |
21 | + }; | |
22 | + | |
23 | + // Atualiza pagina de pesquisa | |
24 | + $scope.atualizaPaginaPesquisa = function () { | |
25 | + angular.element('#searchTransferenciaEnderecoEstoque').scope().fetchResult(); | |
26 | + }; | |
27 | + | |
28 | + function validarDataTransferencia() { | |
29 | + | |
30 | + var dataTransferencia; | |
31 | + try { | |
32 | + dataTransferencia = angular.copy(converterStringEmDate($scope.transferenciaEnderecoEstoque.dataTransferencia)); | |
33 | + } catch(err) { | |
34 | + dataTransferencia = angular.copy($scope.transferenciaEnderecoEstoque.dataTransferencia); | |
35 | + } | |
36 | + var dataVigencia = converterStringEmDate($scope.usuarioLogado.organizacao.dataReferenciaVigente); | |
37 | + dataTransferencia.setDate(1); | |
38 | + dataVigencia.setDate(1); | |
39 | + | |
40 | + return dataTransferencia.getTime() == dataVigencia.getTime(); | |
41 | + } | |
42 | + | |
43 | + $scope.saveOrUpdate = function(){ | |
44 | + $scope.transferenciaEnderecoEstoqueForm.$submitted = true; | |
45 | + if($scope.transferenciaEnderecoEstoqueForm.$valid){ | |
46 | + if(validarDataTransferencia()){ | |
47 | + $scope.setLoadingSalva(true); | |
48 | + | |
49 | + TransferenciaEnderecoEstoqueRepository.save($scope.transferenciaEnderecoEstoque).then(function(result) { | |
50 | + $scope.transferenciaEnderecoEstoque = result.originalElement; | |
51 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_SALVO')); | |
52 | + $scope.transferenciaEnderecoEstoqueForm.$submitted = false; | |
53 | + | |
54 | + $scope.$showPageSearchWorkspace($scope.workspace); | |
55 | + angular.element('#searchTransferenciaEnderecoEstoque').scope().fetchResult(); | |
56 | + | |
57 | + }); | |
58 | + $scope.setLoading(false); | |
59 | + } else { | |
60 | + $scope.setLoading(false); | |
61 | + $scope.showAlert("error", $translate.instant("MSG.MN006")); | |
62 | + } | |
63 | + }else{ | |
64 | + $scope.showAlert('error', $translate.instant('VALIDACAO.ALERTA_OBRIGATORIOS'), " ", false); | |
65 | + } | |
66 | + }; | |
67 | + | |
68 | + $scope.getTransferenciaEnderecoEstoque = function(transferenciaEnderecoEstoque, edit){ | |
69 | + $scope.setLoadingGet(true); | |
70 | + | |
71 | + TransferenciaEnderecoEstoqueRepository.get(transferenciaEnderecoEstoque.id).then(function(result) { | |
72 | + $scope.transferenciaEnderecoEstoque = result.originalElement; | |
73 | + $scope.buscarEnderecosMaterialAlmoxarifado($scope.transferenciaEnderecoEstoque.material); | |
74 | + $scope.edit = edit; | |
75 | + $scope.setLoading(false); | |
76 | + }); | |
77 | + }; | |
78 | + | |
79 | + $scope.findAutoCompleteAlmoxarifado = function(value){ | |
80 | + return EstruturaOrganizacionalAlmoxarifadoRepository.listarEstruturasOrganizacionaisAlmoxarifadoPorOrganizacao(value, $scope.usuarioLogado.organizacao.id).then(function(result) { | |
81 | + return result; | |
82 | + }); | |
83 | + }; | |
84 | + | |
85 | + $scope.findAutoCompleteMaterialEstoque = function(value){ | |
86 | + return MaterialRepository.findMaterialConsumo(value).then(function(result) { | |
87 | + return result; | |
88 | + }); | |
89 | + }; | |
90 | + | |
91 | + $scope.buscarEnderecosMaterialAlmoxarifado = function(item){ | |
92 | + $scope.transferenciaEnderecoEstoque.material = item; | |
93 | + if(!$scope.transferenciaEnderecoEstoque.almoxarifado){ | |
94 | + $scope.showAlert("warning", $translate.instant("ALMOXARIFADO.MSG.INFORME_ALMOXARIFADO")); | |
95 | + return; | |
96 | + } | |
97 | + $scope.listEnderecoEstoqueOrigem = []; | |
98 | + $scope.setLoadingGet(true); | |
99 | + MaterialLocalEstoqueRepository.buscarLocaisEstoquePorIdMaterialIdAlmoxarifado($scope.transferenciaEnderecoEstoque.material.id, $scope.transferenciaEnderecoEstoque.almoxarifado.id).then(function(result) { | |
100 | + if(result){ | |
101 | + if(result.length > 1){ | |
102 | + angular.forEach(result, function(materialLocalEstoque) { | |
103 | + if(materialLocalEstoque.localPrincipal){ | |
104 | + $scope.transferenciaEnderecoEstoque.enderecoEstoqueOrigem = materialLocalEstoque.originalElement; | |
105 | + } | |
106 | + if(!materialLocalEstoque.quantidade){ | |
107 | + materialLocalEstoque.originalElement.quantidade = 0; | |
108 | + } | |
109 | + $scope.listEnderecoEstoqueOrigem.push(materialLocalEstoque.originalElement); | |
110 | + }); | |
111 | + $scope.carregarListaDestino(); | |
112 | + $scope.setLoading(false); | |
113 | + }else{ | |
114 | + $scope.transferenciaEnderecoEstoque.material = null; | |
115 | + $scope.showAlert("warning", $translate.instant("ALMOXARIFADO.MSG.MATERIAL_VINCULADO_SOMENTE_UM_ENDERECO_TRANSFERENCIA_NEGADA")); | |
116 | + $scope.setLoading(false); | |
117 | + return; | |
118 | + } | |
119 | + | |
120 | + }else{ | |
121 | + $scope.setLoading(false); | |
122 | + $scope.showAlert("warning", $translate.instant("ALMOXARIFADO.MSG.MATERIAL_SEM_VINCULO_ALMOXARIFADO")); | |
123 | + return; | |
124 | + } | |
125 | + }); | |
126 | + }; | |
127 | + | |
128 | + $scope.carregarListaDestino = function(){ | |
129 | + $scope.listEnderecoEstoqueDestino = []; | |
130 | + $timeout(function(){ | |
131 | + angular.forEach($scope.listEnderecoEstoqueOrigem, function(materialLocalEstoque) { | |
132 | + if($scope.transferenciaEnderecoEstoque.enderecoEstoqueOrigem && materialLocalEstoque.id != $scope.transferenciaEnderecoEstoque.enderecoEstoqueOrigem.id){ | |
133 | + $scope.listEnderecoEstoqueDestino.push(materialLocalEstoque); | |
134 | + } | |
135 | + }); | |
136 | + }); | |
137 | + }; | |
138 | + | |
139 | + $scope.limparForm = function(cleanAlmoxarifado){ | |
140 | + if(cleanAlmoxarifado){ | |
141 | + $scope.transferenciaEnderecoEstoque = {}; | |
142 | + }else{ | |
143 | + $scope.transferenciaEnderecoEstoque = { almoxarifado : $scope.transferenciaEnderecoEstoque.almoxarifado}; | |
144 | + } | |
145 | + }; | |
146 | + | |
147 | +}]); | |
0 | 148 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/TransferenciaEnderecoEstoqueListController.js
0 → 100644
... | ... | @@ -0,0 +1,67 @@ |
1 | +'use strict'; | |
2 | + | |
3 | +citApp.controller('TransferenciaEnderecoEstoqueListController', ['$scope', 'TransferenciaEnderecoEstoqueRepository', '$translate', '$timeout', 'DominioRepository', | |
4 | + function TransferenciaEnderecoEstoqueListController($scope, TransferenciaEnderecoEstoqueRepository, $translate, $timeout, DominioRepository) { | |
5 | + $scope.$showAdvancedFilters = false; | |
6 | + | |
7 | + $scope.resetForm = function() { | |
8 | + angular.element("#editTransferenciaEnderecoEstoque").scope().resetForm(); | |
9 | + }; | |
10 | + | |
11 | + $scope.headers = [ | |
12 | + {title : $translate.instant('ALMOXARIFADO.LABEL.ALMOXARIFADO'), value : 'almoxarifado.nome', tamanho : 15} , | |
13 | + {title : $translate.instant('LABEL.MATERIAL'), value : 'material.descricao' }, | |
14 | + {title : $translate.instant('ALMOXARIFADO.LABEL.DATA_TRANSFERENCIA'), value : 'dataTransferencia', filter : 'dateBR' }, | |
15 | + {title : $translate.instant('ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_ORIGEM'), value : 'enderecoEstoqueOrigem.endereco.descricao'}, | |
16 | + {title : $translate.instant('ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_DESTINO'), value : 'enderecoEstoqueDestino.endereco.descricao'}, | |
17 | + {title : $translate.instant('ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERIDA'), value : 'quantidade'} | |
18 | + ]; | |
19 | + | |
20 | + $scope.filterCriteria = { | |
21 | + start : 1, | |
22 | + dir : 'asc', | |
23 | + sort : 'id', | |
24 | + limit : 10, | |
25 | + fields: ['id', 'almoxarifado.nome', 'material.descricao', 'dataTransferencia', 'enderecoEstoqueOrigem.endereco.descricao', 'enderecoEstoqueDestino.endereco.descricao', 'quantidade'], | |
26 | + filters : [ {type: 'numeric', field: 'id', comparison: 'in', notFilter : true}, | |
27 | + {type : 'string', field : 'almoxarifado.nome' } , | |
28 | + {type : 'string', field : 'material.descricao' } , | |
29 | + {type : 'data-range', field : 'dataTransferencia' } , | |
30 | + {type : 'string', field : 'enderecoEstoqueOrigem.endereco.descricao' }, | |
31 | + {type : 'string', field : 'enderecoEstoqueDestino.endereco.descricao' }, | |
32 | + {type : 'numeric-range', field : 'quantidade' } | |
33 | + ] | |
34 | + }; | |
35 | + | |
36 | + $scope.abrirVisualizar = function(edit){ | |
37 | + var transferenciaEnderecoEstoque = $scope.transferenciaEnderecoEstoqueChecked; | |
38 | + | |
39 | + if(!transferenciaEnderecoEstoque) { | |
40 | + $scope.showAlert('warning', $translate.instant('MSG.SELECIONE_ITEM_EXCLUIR') ); | |
41 | + return; | |
42 | + } | |
43 | + angular.element('#editTransferenciaEnderecoEstoque').scope().getTransferenciaEnderecoEstoque(transferenciaEnderecoEstoque, edit); | |
44 | + $scope.$showPageEditWorkspace($scope.workspace); | |
45 | + }; | |
46 | + | |
47 | + $scope.removeTransferenciaEnderecoEstoque = function(){ | |
48 | + if(!$scope.transferenciaEnderecoEstoqueChecked) { | |
49 | + $scope.showAlert('warning', !edit ? $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_VISUALIZACAO') : $translate.instant('MSG.SELECIONE_UM_ITEM_PARA_EDICAO')); | |
50 | + return; | |
51 | + } | |
52 | + $scope.$openModalConfirm({ | |
53 | + message: $translate.instant('MSG.CONFIRMA_EXCLUSAO'), | |
54 | + callback: function () { | |
55 | + TransferenciaEnderecoEstoqueRepository.remove($scope.transferenciaEnderecoEstoqueChecked).then(function() { | |
56 | + | |
57 | + $scope.$modalConfirmInstance.dismiss('cancel'); | |
58 | + $scope.showAlert("success", $translate.instant('MSG.REGISTRO_EXCLUIDO')); | |
59 | + angular.element('#searchTransferenciaEnderecoEstoque').scope().fetchResult(); | |
60 | + | |
61 | + }); | |
62 | + } | |
63 | + }); | |
64 | + }; | |
65 | + | |
66 | + | |
67 | +}]); | |
0 | 68 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/repository/EnderecoEstoqueRepository.js
... | ... | @@ -16,7 +16,7 @@ citApp.factory('EnderecoEstoqueRepository', ['RestangularAlmoxarifado', 'Abstrac |
16 | 16 | this.listarEnderecosEstoque = function(value, idAlmoxarifado) { |
17 | 17 | return restangularAlmoxarifado.one(this.route + "/listarEnderecosEstoque").get({"value": value, "idAlmoxarifado" : idAlmoxarifado}).then(); |
18 | 18 | }; |
19 | - | |
19 | + | |
20 | 20 | } |
21 | 21 | |
22 | 22 | AbstractRepository.extend(EnderecoEstoqueRepository); | ... | ... |
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/repository/TransferenciaEnderecoEstoqueRepository.js
0 → 100644
... | ... | @@ -0,0 +1,13 @@ |
1 | +'use strict'; | |
2 | + | |
3 | +citApp.factory('TransferenciaEnderecoEstoqueRepository', ['RestangularAlmoxarifado', 'AbstractRepository', function (restangularAlmoxarifado, AbstractRepository) { | |
4 | + | |
5 | + function TransferenciaEnderecoEstoqueRepository() { | |
6 | + AbstractRepository.call(this, restangularAlmoxarifado, 'rest/transferenciaEnderecoEstoque'); | |
7 | + | |
8 | + } | |
9 | + | |
10 | + AbstractRepository.extend(TransferenciaEnderecoEstoqueRepository); | |
11 | + | |
12 | + return new TransferenciaEnderecoEstoqueRepository(); | |
13 | +}]); | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/relatorioEntradaAlmoxarifado.html
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | <div class='row'> |
68 | 68 | <div class="col-sm-3 col-sm-offset-3"> |
69 | 69 | <label-select ng-id="relatorioEntradaAlmoxarifado.dominioTipoEntrada" ng-label="LABEL.TIPO_ENTRADA" |
70 | - ng-model="relatorioEntradaAlmoxarifado.dominioTipoEntrada" | |
70 | + ng-model="relatorioEntradaAlmoxarifado.dominioTipoEntrada" ng-custom-change="alterarListaDominioTipoRecebimento(model)" | |
71 | 71 | ng-obrigatorio="false" ng-disabled="false" form="formRelatorioEntradaAlmoxarifado" ng-list="dominioTipoEntradaList" |
72 | 72 | ng-custom-options="dominio.originalElement as dominio.descricao for dominio" track-by="track by dominio.id" /> |
73 | 73 | </div> |
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 | <div class="col-md-3"> |
76 | 76 | <label-select ng-id="relatorioEntradaAlmoxarifado.dominioTipoRecebimento" ng-label="LABEL.TIPO_RECEBIMENTO" |
77 | 77 | ng-model="relatorioEntradaAlmoxarifado.dominioTipoRecebimento" |
78 | - ng-obrigatorio="false" ng-disabled="false" form="formRelatorioEntradaAlmoxarifado" ng-list="dominiosTipoRecebimento" | |
78 | + ng-obrigatorio="false" ng-disabled="false" form="formRelatorioEntradaAlmoxarifado" ng-list="dominioTipoRecebimentoListTemp" | |
79 | 79 | ng-custom-options="dominio.originalElement as dominio.descricao for dominio" track-by="track by dominio.id" /> |
80 | 80 | </div> |
81 | 81 | </div> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/requisicaoConsumo/requisicaoConsumoEdit.html
... | ... | @@ -182,7 +182,7 @@ |
182 | 182 | </tr> |
183 | 183 | </thead> |
184 | 184 | <tbody> |
185 | - <tr ng-repeat="requisicaoConsumoItem in requisicaoConsumo.requisicaoConsumoItens"> | |
185 | + <tr ng-repeat="requisicaoConsumoItem in listaRequisicaoConsumoItens"> | |
186 | 186 | |
187 | 187 | <td class="text-center"> |
188 | 188 | <input type="radio" name="requisicaoConsumoItemChecked" ng-value="requisicaoConsumoItem" |
... | ... | @@ -210,6 +210,28 @@ |
210 | 210 | <td colspan="4" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td> |
211 | 211 | </tr> |
212 | 212 | </tbody> |
213 | + <tfoot> | |
214 | + <tr> | |
215 | + <td colspan="5"> | |
216 | + <div class="row"> | |
217 | + <div class="col-sm-4 table-showing"> | |
218 | + <translate>LABEL.MOSTRANDO</translate> | |
219 | + {{totalItens > zero ? filterCriteria.start : zero}} | |
220 | + <translate>LABEL.ATE</translate> | |
221 | + {{filterCriteria.limit > totalItens ? totalItens : filterCriteria.limit}} | |
222 | + <translate>LABEL.DE</translate> | |
223 | + ({{totalItens}}) | |
224 | + </div><!-- .col --> | |
225 | + <div class="col-sm-8 text-right"> | |
226 | + | |
227 | + <pagination rotate="true" max-size="10" total-items="totalItens" num-pages="totalPages" ng-model="filterCriteria.start" items-per-page="filterCriteria.limit" | |
228 | + class="pagination-sm" boundary-links="true" ng-change="changeListRequisicaoConsumoItem()" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | |
229 | + | |
230 | + </div><!-- .col --> | |
231 | + </div><!-- .row --> | |
232 | + </td> | |
233 | + </tr> | |
234 | + </tfoot> | |
213 | 235 | </table> |
214 | 236 | </div> |
215 | 237 | </div> |
... | ... | @@ -231,18 +253,18 @@ |
231 | 253 | <thead> |
232 | 254 | <tr> |
233 | 255 | <th width="5%" class="text-center"> </th> |
234 | - <th class="text-center"><translate>ALMOXARIFADO.LABEL.NUMERO_ATENDIMENTO</translate></th> | |
256 | + <th class="text-center"><requisicaoConsumo.requisicaoConsumoItens.length</translate></th> | |
235 | 257 | <th class="text-center"><translate>ALMOXARIFADO.LABEL.DATA_ATENDIMENTO</translate></th> |
236 | 258 | </tr> |
237 | 259 | </thead> |
238 | 260 | <tbody> |
239 | - <tr ng-repeat-start="atendimento in atendimentos"> | |
261 | + <tr ng-repeat-start="atendimento in listaAtendimento"> | |
240 | 262 | <td class="text-center"> |
241 | 263 | <button type="button" ng-click="apresentarInfoAtendimentoItem(atendimento)"> |
242 | 264 | <i class="ace-icon fa {{atendimento.$verInfo ? 'fa-minus' : 'fa-plus'}} bigger-125"></i> |
243 | 265 | </button> |
244 | 266 | </td> |
245 | - <td class="text-center">{{atendimento.numeroAtendimento}}</td> | |
267 | + <td class="teRequisicaoConsumoItemnto.numeroAtendimento}}</td> | |
246 | 268 | <td class="text-center">{{atendimento.dataAtendimento}}</td> |
247 | 269 | </tr> |
248 | 270 | <tr ng-show="atendimento.$verInfo == true" class="table-subgrid" ng-repeat-end> |
... | ... | @@ -266,6 +288,28 @@ |
266 | 288 | </td> |
267 | 289 | </tr> |
268 | 290 | </tbody> |
291 | + <tfoot> | |
292 | + <tr> | |
293 | + <td colspan="5"> | |
294 | + <div class="row"> | |
295 | + <div class="col-sm-4 table-showing"> | |
296 | + <translate>LABEL.MOSTRANDO</translate> | |
297 | + {{totalItens2 > zero ? filterCriteria2.start : zero}} | |
298 | + <translate>LABEL.ATE</translate> | |
299 | + {{filterCriteria2.limit > totalItens2 ? totalItens2 : filterCriteria2.limit}} | |
300 | + <translate>LABEL.DE</translate> | |
301 | + ({{totalItens2}}) | |
302 | + </div><!-- .col --> | |
303 | + <div class="col-sm-8 text-right"> | |
304 | + | |
305 | + <pagination rotate="true" max-size="10" total-items="totalItens2" num-pages="totalPages2" ng-model="filterCriteria2.start" items-per-page="filterCriteria2.limit" | |
306 | + class="pagination-sm" boundary-links="true" ng-change="changeListAtendimentoRequisicao()" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination> | |
307 | + | |
308 | + </div><!-- .col --> | |
309 | + </div><!-- .row --> | |
310 | + </td> | |
311 | + </tr> | |
312 | + </tfoot> | |
269 | 313 | </table> |
270 | 314 | </div> |
271 | 315 | </fieldset> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoque.html
0 → 100644
... | ... | @@ -0,0 +1,2 @@ |
1 | +<div ng-include src="'/cit-almoxarifado-web/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoqueList.html'" ng-show="workspace.$showSearch"></div> | |
2 | +<div ng-include src="'/cit-almoxarifado-web/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoqueEdit.html'" ng-show="workspace.$showEdit"></div> | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoqueEdit.html
0 → 100644
... | ... | @@ -0,0 +1,95 @@ |
1 | +<div id="editTransferenciaEnderecoEstoque" class="page-content clearfix" ng-controller="TransferenciaEnderecoEstoqueController"> | |
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-show="!edit" ng-click="edit = true"> --> | |
11 | +<!-- <i class="fa fa-pencil blue"></i> --> | |
12 | +<!-- <translate>LABEL.EDITAR</translate> --> | |
13 | +<!-- </button> --> | |
14 | + | |
15 | + <button class="btn btn-clear" ng-click="remove(transferenciaEnderecoEstoque);" ng-show="transferenciaEnderecoEstoque.id !== undefined"> | |
16 | + <i class="fa fa-times red"></i> <translate>LABEL.REMOVER</translate> | |
17 | + </button> | |
18 | + | |
19 | + <button class="btn btn-clear" ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();"> | |
20 | + <i class="fa fa-search"></i> <translate>LABEL.PESQUISAR</translate> | |
21 | + </button> | |
22 | + | |
23 | + </div><!-- .col --> | |
24 | + | |
25 | + <div class="col-sm-4 text-right"> | |
26 | + | |
27 | + <favorito/> | |
28 | + | |
29 | + <help-button workspace="workspace" /> | |
30 | + | |
31 | + </div><!-- .col --> | |
32 | + </div><!-- .row --> | |
33 | + </div><!-- .bar-buttons-action --> | |
34 | + | |
35 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | |
36 | + | |
37 | + <form name="transferenciaEnderecoEstoqueForm" novalidate autocomplete="off"> | |
38 | + <p> | |
39 | + <small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small> | |
40 | + </p> | |
41 | + | |
42 | + <fieldset> | |
43 | + | |
44 | + <legend><translate>ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE</translate></legend> | |
45 | + | |
46 | + <div class="row"> | |
47 | + <div class="col-md-6"> | |
48 | + <auto-complete ng-id="transferenciaEnderecoEstoque.almoxarifado" ng-label="ALMOXARIFADO.LABEL.ALMOXARIFADO" ng-model="transferenciaEnderecoEstoque.almoxarifado" form="transferenciaEnderecoEstoqueForm" ng-obrigatorio="true" ng-disabled="!edit" ng-find="findAutoCompleteAlmoxarifado(value)" ng-item="item.nome" ng-acao-borracha="limparForm(true)"/> | |
49 | + </div> | |
50 | + <div class="col-md-6"> | |
51 | + <auto-complete ng-id="transferenciaEnderecoEstoque.material" ng-label="LABEL.MATERIAL" ng-model="transferenciaEnderecoEstoque.material" form="transferenciaEnderecoEstoqueForm" ng-obrigatorio="true" ng-disabled="!edit" ng-find="findAutoCompleteMaterialEstoque(value)" ng-item="item.descricao" ng-set-result="buscarEnderecosMaterialAlmoxarifado(item)" ng-acao-borracha="limparForm(false)"/> | |
52 | + </div> | |
53 | + </div> | |
54 | + | |
55 | + <div class="row"> | |
56 | + <div class="col-md-6"> | |
57 | + <label-select ng-model="transferenciaEnderecoEstoque.enderecoEstoqueOrigem" ng-label="ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_ORIGEM" ng-list="listEnderecoEstoqueOrigem" ng-custom-options="materialLocalEstoque as materialLocalEstoque.endereco.descricao for materialLocalEstoque" track-by="track by materialLocalEstoque.endereco.id" ng-obrigatorio="true" ng-disabled="!edit" form="transferenciaEnderecoEstoqueForm" ng-custom-change="carregarListaDestino()"></label-select> | |
58 | + </div> | |
59 | + <div class="col-md-3"> | |
60 | + <label-input-number ng-show="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo != 2" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.quantidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.quantidade" ng-type="text" ng-label="ALMOXARIFADO.LABEL.SALDO_ENDERECO" form="transferenciaEnderecoEstoqueForm" ng-disabled="true"/> | |
61 | + <label-input-decimal ng-show="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo == 2" ng-precisao="decimal" ng-custom-maxlength="11" ng-evento-blur="aplicarValidacaoDecimal" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.quantidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.quantidade" ng-label="ALMOXARIFADO.LABEL.SALDO_ENDERECO" ng-disabled="true" form="transferenciaEnderecoEstoqueForm"/> | |
62 | + </div> | |
63 | + <div class="col-md-3"> | |
64 | + <label-input-number ng-show="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo != 2" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.capacidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.capacidade" ng-type="text" ng-label="LABEL.CAPACIDADE" form="transferenciaEnderecoEstoqueForm" ng-disabled="true"/> | |
65 | + <label-input-decimal ng-show="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo == 2" ng-precisao="decimal" ng-custom-maxlength="11" ng-evento-blur="aplicarValidacaoDecimal" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.capacidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.capacidade" ng-label="LABEL.CAPACIDADE" ng-disabled="true" form="transferenciaEnderecoEstoqueForm"/> | |
66 | + </div> | |
67 | + </div> | |
68 | + | |
69 | + <div class="row"> | |
70 | + <div class="col-md-6"> | |
71 | + <label-select ng-model="transferenciaEnderecoEstoque.enderecoEstoqueDestino" ng-label="ALMOXARIFADO.LABEL.ENDERECO_ESTOQUE_DESTINO" ng-list="listEnderecoEstoqueDestino" ng-custom-options="materialLocalEstoque as materialLocalEstoque.endereco.descricao for materialLocalEstoque" track-by="track by materialLocalEstoque.endereco.id" ng-obrigatorio="true" ng-disabled="!edit || edit && !transferenciaEnderecoEstoque.enderecoEstoqueOrigem" form="transferenciaEnderecoEstoqueForm"></label-select> | |
72 | + </div> | |
73 | + <div class="col-md-3"> | |
74 | + <label-input-number ng-show="transferenciaEnderecoEstoque.enderecoEstoqueDestino.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo != 2" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueDestino.quantidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueDestino.quantidade" ng-type="text" ng-label="ALMOXARIFADO.LABEL.SALDO_ENDERECO" form="transferenciaEnderecoEstoqueForm" ng-disabled="true"/> | |
75 | + <label-input-decimal ng-show="transferenciaEnderecoEstoque.enderecoEstoqueDestino.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo == 2" ng-precisao="decimal" ng-custom-maxlength="11" ng-evento-blur="aplicarValidacaoDecimal" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueOrigem.quantidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueDestino.quantidade" ng-label="ALMOXARIFADO.LABEL.SALDO_ENDERECO" ng-disabled="true" form="transferenciaEnderecoEstoqueForm"/> | |
76 | + </div> | |
77 | + <div class="col-md-3"> | |
78 | + <label-input-number ng-show="transferenciaEnderecoEstoque.enderecoEstoqueDestino.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo != 2" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueDestino.capacidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueDestino.capacidade" ng-type="text" ng-label="LABEL.CAPACIDADE" form="transferenciaEnderecoEstoqueForm" ng-disabled="true"/> | |
79 | + <label-input-decimal ng-show="transferenciaEnderecoEstoque.enderecoEstoqueDestino.materialEstoque.material.unidadeArmazenamento.tipoNumerico.codigo == 2" ng-precisao="decimal" ng-custom-maxlength="11" ng-evento-blur="aplicarValidacaoDecimal" ng-id="transferenciaEnderecoEstoque.enderecoEstoqueDestino.capacidade" ng-model="transferenciaEnderecoEstoque.enderecoEstoqueDestino.capacidade" ng-label="LABEL.CAPACIDADE" ng-disabled="true" form="transferenciaEnderecoEstoqueForm"/> | |
80 | + </div> | |
81 | + </div> | |
82 | + | |
83 | + <div class="row"> | |
84 | + <div class="col-md-6"> | |
85 | + <label-input-number ng-show="transferenciaEnderecoEstoque.material.unidadeArmazenamento.tipoNumerico.codigo != 2" ng-id="transferenciaEnderecoEstoque.quantidade" ng-model="transferenciaEnderecoEstoque.quantidade" ng-custom-maxlength="4" ng-type="text" ng-label="ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERENCIA" ng-obrigatorio="true" form="transferenciaEnderecoEstoqueForm" ng-disabled="!edit || edit && !transferenciaEnderecoEstoque.enderecoEstoqueDestino"/> | |
86 | + <label-input-decimal ng-show="transferenciaEnderecoEstoque.material.unidadeArmazenamento.tipoNumerico.codigo == 2" ng-precisao="decimal" ng-custom-maxlength="11" ng-evento-blur="aplicarValidacaoDecimal" ng-id="transferenciaEnderecoEstoque.quantidade" ng-model="transferenciaEnderecoEstoque.quantidade" ng-label="ALMOXARIFADO.LABEL.QUANTIDADE_TRANSFERENCIA" ng-obrigatorio="true" form="transferenciaEnderecoEstoqueForm"/> | |
87 | + </div> | |
88 | + <div class="col-sm-6"> | |
89 | + <label-input-data ng-id="transferenciaEnderecoEstoque.dataTransferencia" form="transferenciaEnderecoEstoqueForm" ng-disabled="!edit" ng-label="ALMOXARIFADO.LABEL.DATA_TRANSFERENCIA" ng-obrigatorio="edit" ng-model="transferenciaEnderecoEstoque.dataTransferencia" /> | |
90 | + </div> | |
91 | + </div> | |
92 | + | |
93 | + </fieldset> | |
94 | + </form> | |
95 | +</div><!-- .page-content --> | |
0 | 96 | \ No newline at end of file | ... | ... |
cit-almoxarifado-web/src/main/webapp/html/transferenciaEnderecoEstoque/transferenciaEnderecoEstoqueList.html
0 → 100644
... | ... | @@ -0,0 +1,46 @@ |
1 | +<div id="searchTransferenciaEnderecoEstoque" class="page-content" ng-controller="TransferenciaEnderecoEstoqueListController"> | |
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="$showPageEditWorkspace(workspace); resetForm();"> | |
7 | + <i class="fa fa-plus-circle yellow-dark"></i> | |
8 | + <translate>LABEL.CADASTRAR</translate> | |
9 | + </button> | |
10 | + | |
11 | + <button class="btn btn-clear" ng-click="abrirVisualizar(false);"> | |
12 | + <i class="fa fa-search blue"></i> | |
13 | + <translate>LABEL.VISUALIZAR</translate> | |
14 | + </button> | |
15 | + | |
16 | +<!-- <button class="btn btn-clear" ng-click="abrirVisualizar(true);"> --> | |
17 | +<!-- <i class="fa fa-pencil blue"></i> --> | |
18 | +<!-- <translate>LABEL.EDITAR</translate> --> | |
19 | +<!-- </button> --> | |
20 | + | |
21 | + <button class="btn btn-clear" ng-click="removeTransferenciaEnderecoEstoque();"> | |
22 | + <i class="fa fa-times red"></i> | |
23 | + <translate>LABEL.REMOVER</translate> | |
24 | + </button> | |
25 | + | |
26 | + <span class="divider-vertical"></span> | |
27 | + | |
28 | + <filtros ng-filter="filterCriteria" ng-workspace="workspace"></filtros> | |
29 | + | |
30 | + </div><!-- .col --> | |
31 | + | |
32 | + <div class="col-sm-4 text-right"> | |
33 | + | |
34 | + <favorito/> | |
35 | + | |
36 | + <help-button workspace="workspace" /> | |
37 | + | |
38 | + </div><!-- .col --> | |
39 | + </div><!-- .row --> | |
40 | + </div><!-- .bar-buttons-action --> | |
41 | + | |
42 | + <breadcrumb ng-workspace="workspace"></breadcrumb> | |
43 | + | |
44 | + <list-view ng-lista="transferenciaEnderecoEstoqueList" ng-repository="TransferenciaEnderecoEstoqueRepository" ng-headers="headers" ng-exibir-boolean-sim-nao="true" ng-filter-criteria="filterCriteria" ng-item-selecionado="transferenciaEnderecoEstoqueChecked"></list-view> | |
45 | + | |
46 | +</div><!-- .page-content --> | ... | ... |