Commit 111f5cc4370cd4edabf5c6fcea36048ac4b37254

Authored by erick.sato
2 parents 00795e02 5ed8b28f
Exists in master

Merge branch 'adm-1.16.0' of http://ferramentasgo.centralit.com.br:8080/scm/git/…

…cit-grp-almoxarifado into adm-1.16.0
cit-almoxarifado-api/src/main/java/br/com/centralit/api/dao/impl/RequisicaoConsumoDaoHibernate.java
... ... @@ -296,12 +296,13 @@ public class RequisicaoConsumoDaoHibernate extends CitGenericDAOImpl implements
296 296 public Object[] getRequisicaoForReport(Long requisicaoId){
297 297 StringBuilder sql = new StringBuilder();
298 298 sql.append("select req_c.numerorequisicao as numerorequisicao,alm.nome as almoxarifado,requisitante.nome as unidadereq,locale.nome as enderecour,");
299   - sql.append(" usuario.nome as requisitante,c_custo.descricao as centrocustos,req_c.datacriacao as cadem,req_c.datafinalizacaoatendimento as atendidaem from alm_requisicaoconsumo req_c");
  299 + sql.append(" usuautor.nome as requisitante,usueditor.nome as atendidapor,c_custo.descricao as centrocustos,req_c.datacriacao as cadem,req_c.datafinalizacaoatendimento as atendidaem from alm_requisicaoconsumo req_c");
300 300 sql.append(" left join estruturaorganizacional alm on req_c.almoxarifado_id = alm.id");
301 301 sql.append(" left join estruturaorganizacional requisitante on req_c.unidadeRequisitante_id = requisitante.id");
302 302 sql.append(" left join localizacao locale on requisitante.localizacao_id = locale.id");
303 303 sql.append(" left join centrocusto c_custo on req_c.centrocusto_id = c_custo.id");
304   - sql.append(" left join seguranca_usuario usuario on req_c.autor_id = usuario.id");
  304 + sql.append(" left join seguranca_usuario usuautor on req_c.autor_id = usuautor.id");
  305 + sql.append(" left join seguranca_usuario usueditor on req_c.editor_id = usueditor.id");
305 306 sql.append(" where req_c.id = ").append(requisicaoId);
306 307  
307 308 return (Object[]) singleResultNativeQuery(sql.toString());
... ... @@ -310,7 +311,7 @@ public class RequisicaoConsumoDaoHibernate extends CitGenericDAOImpl implements
310 311 @Override
311 312 public List<Object> getResumoContabilForReport(Long requisicaoId,boolean isFIFO) {
312 313 StringBuilder sql = new StringBuilder();
313   - sql.append("select distinct contac.codigo,contac.descricao, rc_item.quantidade,");
  314 + sql.append("select distinct contac.codigo,contac.descricao, rc_item.quantidadeatendida,");
314 315  
315 316 if(isFIFO)
316 317 sql.append("fifo.valorUnitario");
... ...
cit-almoxarifado-api/src/main/java/br/com/centralit/api/model/AtendimentoRequisicaoConsumoItem.java
... ... @@ -61,7 +61,7 @@ import com.fasterxml.jackson.annotation.JsonView;
61 61 @AuditTable(value = "alm_rc_atenditem_aud")
62 62 @Entity
63 63 @Table(name = "alm_rc_atendimentoitem")
64   -@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida" })
  64 +@JsonIgnoreProperties({ "$info", "$verInfo", "$quantidade", "$locaisEstoque", "$hasError", "$somaQtdAtendida", "$hasErrorQtdAtendidaMaiorQtdRequisitada"})
65 65 public class AtendimentoRequisicaoConsumoItem extends PersistentObjectAuditOrganizacao {
66 66  
67 67 /** Atributo serialVersionUID. */
... ...
cit-almoxarifado-web/src/main/java/br/com/centralit/controller/BeanRequisicaoSubReport.java
... ... @@ -24,9 +24,10 @@ public class BeanRequisicaoSubReport {
24 24 this.unidadeReq = (String) objArray[2];
25 25 this.enderecoUR = (String) objArray[3];
26 26 this.requisitante = (String) objArray[4];
27   - this.centroCustos = (String) objArray[5];
28   - this.cadEm = UtilDate.formatarData(objArray[6]);
29   - this.atendidaEm = UtilDate.formatarData(objArray[7]);
  27 + this.atendidaPor = (String) objArray[5];
  28 + this.centroCustos = (String) objArray[6];
  29 + this.cadEm = UtilDate.formatarData(objArray[7]);
  30 + this.atendidaEm = UtilDate.formatarData(objArray[8]);
30 31 }
31 32  
32 33 public String getNumeroRequisicao() {
... ...
cit-almoxarifado-web/src/main/resources/reports/guiaRemessaAtendimentoConsumoMaterial.jrxml
... ... @@ -357,21 +357,180 @@
357 357 </componentElement>
358 358 </band>
359 359 </groupHeader>
360   - </group>
361   - <group name="resumoContabil">
362   - <groupHeader>
363   - <band height="63">
  360 + <groupFooter>
  361 + <band height="21">
  362 + <printWhenExpression><![CDATA[$F{isAsterisco}]]></printWhenExpression>
364 363 <staticText>
365   - <reportElement x="0" y="10" width="792" height="20" uuid="044fb4cf-5b85-485e-9a98-20bcd9832b67">
366   - <printWhenExpression><![CDATA[$F{isAsterisco}]]></printWhenExpression>
367   - </reportElement>
  364 + <reportElement x="0" y="1" width="792" height="20" uuid="044fb4cf-5b85-485e-9a98-20bcd9832b67"/>
368 365 <textElement textAlignment="Left" verticalAlignment="Middle">
369 366 <font size="8" isBold="true"/>
370 367 </textElement>
371 368 <text><![CDATA[Obs.: Os campos destacados com asterisco (*) calculados com base nos valores dos materiais existentes no estoque no momento da emissão.]]></text>
372 369 </staticText>
373 370 </band>
  371 + </groupFooter>
  372 + </group>
  373 + <group name="resumoContabil">
  374 + <groupHeader>
  375 + <band height="39">
  376 + <componentElement>
  377 + <reportElement key="tableResumoContabil" x="0" y="2" width="792" height="35" uuid="65880be5-7337-44c9-a237-b2e3763d6486">
  378 + <printWhenExpression><![CDATA[$F{resumoContabil} != null]]></printWhenExpression>
  379 + </reportElement>
  380 + <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
  381 + <datasetRun subDataset="resumoContabil" uuid="dd0fb9e3-744d-4899-b809-621ff05e9a14">
  382 + <dataSourceExpression><![CDATA[$F{resumoContabil}]]></dataSourceExpression>
  383 + </datasetRun>
  384 + <jr:column width="620" uuid="cce1ea6a-ea5e-43d0-84a3-37aff9de55dc">
  385 + <jr:tableHeader height="30" rowSpan="1">
  386 + <staticText>
  387 + <reportElement x="0" y="0" width="620" height="30" uuid="df40478a-bd91-4c6d-8d00-ebce15910536"/>
  388 + <textElement textAlignment="Right" verticalAlignment="Bottom">
  389 + <font size="8" isBold="true"/>
  390 + <paragraph rightIndent="50"/>
  391 + </textElement>
  392 + <text><![CDATA[Resumo Contábil]]></text>
  393 + </staticText>
  394 + </jr:tableHeader>
  395 + <jr:tableFooter height="20" rowSpan="1">
  396 + <staticText>
  397 + <reportElement x="0" y="0" width="620" height="20" uuid="786957a5-30dc-46c8-b5e1-5ae33c35c5c6"/>
  398 + <textElement textAlignment="Right" verticalAlignment="Middle">
  399 + <font size="7" isBold="true"/>
  400 + <paragraph rightIndent="20"/>
  401 + </textElement>
  402 + <text><![CDATA[Total:]]></text>
  403 + </staticText>
  404 + </jr:tableFooter>
  405 + <jr:columnHeader style="table 1" height="20" rowSpan="1">
  406 + <staticText>
  407 + <reportElement x="0" y="0" width="620" height="20" uuid="2b77dbbf-8f25-4a06-816b-89555e84ed7f"/>
  408 + <textElement textAlignment="Center" verticalAlignment="Middle">
  409 + <font size="7" isBold="true"/>
  410 + </textElement>
  411 + <text><![CDATA[Conta]]></text>
  412 + </staticText>
  413 + </jr:columnHeader>
  414 + <jr:detailCell style="table 1" height="15" rowSpan="1">
  415 + <textField isBlankWhenNull="false">
  416 + <reportElement x="0" y="0" width="620" height="15" uuid="bd3664f4-2ef4-43e5-91e0-ae4c59c351e4"/>
  417 + <textElement verticalAlignment="Middle">
  418 + <font size="6"/>
  419 + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
  420 + </textElement>
  421 + <textFieldExpression><![CDATA[$F{conta}]]></textFieldExpression>
  422 + </textField>
  423 + </jr:detailCell>
  424 + </jr:column>
  425 + <jr:column width="90" uuid="8cc2e90c-eea0-464a-b96a-b867f0c5951b">
  426 + <jr:tableFooter height="20" rowSpan="1">
  427 + <textField isBlankWhenNull="false">
  428 + <reportElement x="0" y="0" width="90" height="20" uuid="ce82fcaf-5986-45f6-a460-ff6aa53d7aad"/>
  429 + <textElement textAlignment="Center" verticalAlignment="Middle">
  430 + <font size="7" isBold="true"/>
  431 + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
  432 + </textElement>
  433 + <textFieldExpression><![CDATA[$V{qtdeTotal}]]></textFieldExpression>
  434 + </textField>
  435 + </jr:tableFooter>
  436 + <jr:columnHeader style="table 1" height="20" rowSpan="1">
  437 + <staticText>
  438 + <reportElement x="0" y="0" width="90" height="20" uuid="52599d8d-8cdd-44e2-aef4-6fbbce24d92c"/>
  439 + <textElement textAlignment="Center" verticalAlignment="Middle">
  440 + <font size="7" isBold="true"/>
  441 + </textElement>
  442 + <text><![CDATA[Qtde. Fornecidda]]></text>
  443 + </staticText>
  444 + </jr:columnHeader>
  445 + <jr:detailCell style="table 1" height="15" rowSpan="1">
  446 + <textField isBlankWhenNull="false">
  447 + <reportElement x="0" y="0" width="90" height="15" uuid="95659977-c871-4394-b21c-95946d6b7fe5"/>
  448 + <textElement textAlignment="Center" verticalAlignment="Middle">
  449 + <font size="6"/>
  450 + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
  451 + </textElement>
  452 + <textFieldExpression><![CDATA[$F{qtde}]]></textFieldExpression>
  453 + </textField>
  454 + </jr:detailCell>
  455 + </jr:column>
  456 + <jr:column width="100" uuid="a068dbe5-4914-4bb5-8179-d3a398d0e1f4">
  457 + <jr:tableFooter height="20" rowSpan="1">
  458 + <textField pattern="¤ #,##0.00" isBlankWhenNull="false">
  459 + <reportElement x="0" y="0" width="100" height="20" uuid="544e5550-889a-40ef-8bdf-79bc1d3eb604"/>
  460 + <textElement textAlignment="Center" verticalAlignment="Middle">
  461 + <font size="7" isBold="true"/>
  462 + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
  463 + </textElement>
  464 + <textFieldExpression><![CDATA[$V{total}]]></textFieldExpression>
  465 + </textField>
  466 + </jr:tableFooter>
  467 + <jr:columnHeader style="table 1" height="20" rowSpan="1">
  468 + <staticText>
  469 + <reportElement x="0" y="0" width="100" height="20" uuid="6b40bbc3-2e03-4680-b985-d8a6f14852e4"/>
  470 + <textElement textAlignment="Center" verticalAlignment="Middle">
  471 + <font size="7" isBold="true"/>
  472 + </textElement>
  473 + <text><![CDATA[Preço Total]]></text>
  474 + </staticText>
  475 + </jr:columnHeader>
  476 + <jr:detailCell style="table 1" height="15" rowSpan="1">
  477 + <textField pattern="¤ #,##0.00" isBlankWhenNull="false">
  478 + <reportElement x="0" y="0" width="100" height="15" uuid="c39c96e3-153e-480f-98ee-4cc47a654598"/>
  479 + <textElement textAlignment="Center" verticalAlignment="Middle">
  480 + <font size="6"/>
  481 + <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
  482 + </textElement>
  483 + <textFieldExpression><![CDATA[$F{valorTotal}]]></textFieldExpression>
  484 + </textField>
  485 + </jr:detailCell>
  486 + </jr:column>
  487 + </jr:table>
  488 + </componentElement>
  489 + </band>
374 490 </groupHeader>
  491 + <groupFooter>
  492 + <band height="130">
  493 + <printWhenExpression><![CDATA[$F{resumoContabil} != null]]></printWhenExpression>
  494 + <staticText>
  495 + <reportElement x="81" y="94" width="220" height="35" uuid="baa5f20e-3c33-4562-aadf-319bbdbd3460">
  496 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  497 + </reportElement>
  498 + <textElement textAlignment="Center">
  499 + <font size="7"/>
  500 + </textElement>
  501 + <text><![CDATA[_________________________________________________
  502 +Responsavel pelo almoxarifado]]></text>
  503 + </staticText>
  504 + <staticText>
  505 + <reportElement x="81" y="39" width="220" height="15" uuid="12f550fc-88a0-4c6a-af2b-5ac08078a262">
  506 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  507 + </reportElement>
  508 + <textElement textAlignment="Center">
  509 + <font size="7"/>
  510 + </textElement>
  511 + <text><![CDATA[Autorizado em: ____ / ____ / ________.]]></text>
  512 + </staticText>
  513 + <staticText>
  514 + <reportElement x="431" y="39" width="280" height="15" uuid="e4a55273-d50a-4f40-a247-d2d07f60c8f2">
  515 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  516 + </reportElement>
  517 + <textElement textAlignment="Center">
  518 + <font size="7"/>
  519 + </textElement>
  520 + <text><![CDATA[Recebi o(s) material (is) acima especificados em: ____ / ____ / ________.]]></text>
  521 + </staticText>
  522 + <staticText>
  523 + <reportElement x="431" y="94" width="280" height="35" uuid="aac6c19a-4ff2-4c08-bc03-7ca32aab5da1">
  524 + <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
  525 + </reportElement>
  526 + <textElement textAlignment="Center">
  527 + <font size="7"/>
  528 + </textElement>
  529 + <text><![CDATA[________________________________________________________
  530 +Nome completo e Assinatura do Recebedor]]></text>
  531 + </staticText>
  532 + </band>
  533 + </groupFooter>
375 534 </group>
376 535 <pageHeader>
377 536 <band height="135" splitType="Stretch">
... ... @@ -474,7 +633,9 @@
474 633 <textFieldExpression><![CDATA[$F{requisitante}]]></textFieldExpression>
475 634 </textField>
476 635 <textField isBlankWhenNull="true">
477   - <reportElement x="100" y="100" width="350" height="20" uuid="7a3d51bd-bcf4-4b30-b071-8bff41b5974f"/>
  636 + <reportElement x="100" y="100" width="350" height="20" uuid="7a3d51bd-bcf4-4b30-b071-8bff41b5974f">
  637 + <printWhenExpression><![CDATA[$F{resumoContabil} != null]]></printWhenExpression>
  638 + </reportElement>
478 639 <textElement verticalAlignment="Middle">
479 640 <font size="7"/>
480 641 </textElement>
... ... @@ -503,123 +664,6 @@
503 664 </textField>
504 665 </band>
505 666 </pageHeader>
506   - <detail>
507   - <band height="35">
508   - <componentElement>
509   - <reportElement key="tableReqConsumo" x="0" y="0" width="792" height="35" uuid="65880be5-7337-44c9-a237-b2e3763d6486">
510   - <printWhenExpression><![CDATA[$F{resumoContabil} != null]]></printWhenExpression>
511   - </reportElement>
512   - <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
513   - <datasetRun subDataset="resumoContabil" uuid="dd0fb9e3-744d-4899-b809-621ff05e9a14">
514   - <dataSourceExpression><![CDATA[$F{resumoContabil}]]></dataSourceExpression>
515   - </datasetRun>
516   - <jr:column width="620" uuid="cce1ea6a-ea5e-43d0-84a3-37aff9de55dc">
517   - <jr:tableHeader height="30" rowSpan="1">
518   - <staticText>
519   - <reportElement x="0" y="0" width="620" height="30" uuid="df40478a-bd91-4c6d-8d00-ebce15910536"/>
520   - <textElement textAlignment="Right" verticalAlignment="Bottom">
521   - <font size="8" isBold="true"/>
522   - <paragraph rightIndent="50"/>
523   - </textElement>
524   - <text><![CDATA[Resumo Contábil]]></text>
525   - </staticText>
526   - </jr:tableHeader>
527   - <jr:tableFooter height="20" rowSpan="1">
528   - <staticText>
529   - <reportElement x="0" y="0" width="620" height="20" uuid="786957a5-30dc-46c8-b5e1-5ae33c35c5c6"/>
530   - <textElement textAlignment="Right" verticalAlignment="Middle">
531   - <font size="7" isBold="true"/>
532   - <paragraph rightIndent="20"/>
533   - </textElement>
534   - <text><![CDATA[Total:]]></text>
535   - </staticText>
536   - </jr:tableFooter>
537   - <jr:columnHeader style="table 1" height="20" rowSpan="1">
538   - <staticText>
539   - <reportElement x="0" y="0" width="620" height="20" uuid="2b77dbbf-8f25-4a06-816b-89555e84ed7f"/>
540   - <textElement textAlignment="Center" verticalAlignment="Middle">
541   - <font size="7" isBold="true"/>
542   - </textElement>
543   - <text><![CDATA[Conta]]></text>
544   - </staticText>
545   - </jr:columnHeader>
546   - <jr:detailCell style="table 1" height="15" rowSpan="1">
547   - <textField isBlankWhenNull="false">
548   - <reportElement x="0" y="0" width="620" height="15" uuid="bd3664f4-2ef4-43e5-91e0-ae4c59c351e4"/>
549   - <textElement verticalAlignment="Middle">
550   - <font size="6"/>
551   - <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
552   - </textElement>
553   - <textFieldExpression><![CDATA[$F{conta}]]></textFieldExpression>
554   - </textField>
555   - </jr:detailCell>
556   - </jr:column>
557   - <jr:column width="90" uuid="8cc2e90c-eea0-464a-b96a-b867f0c5951b">
558   - <jr:tableFooter height="20" rowSpan="1">
559   - <textField isBlankWhenNull="false">
560   - <reportElement x="0" y="0" width="90" height="20" uuid="ce82fcaf-5986-45f6-a460-ff6aa53d7aad"/>
561   - <textElement textAlignment="Center" verticalAlignment="Middle">
562   - <font size="7" isBold="true"/>
563   - <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
564   - </textElement>
565   - <textFieldExpression><![CDATA[$V{qtdeTotal}]]></textFieldExpression>
566   - </textField>
567   - </jr:tableFooter>
568   - <jr:columnHeader style="table 1" height="20" rowSpan="1">
569   - <staticText>
570   - <reportElement x="0" y="0" width="90" height="20" uuid="52599d8d-8cdd-44e2-aef4-6fbbce24d92c"/>
571   - <textElement textAlignment="Center" verticalAlignment="Middle">
572   - <font size="7" isBold="true"/>
573   - </textElement>
574   - <text><![CDATA[Qtde. Fornecidda]]></text>
575   - </staticText>
576   - </jr:columnHeader>
577   - <jr:detailCell style="table 1" height="15" rowSpan="1">
578   - <textField isBlankWhenNull="false">
579   - <reportElement x="0" y="0" width="90" height="15" uuid="95659977-c871-4394-b21c-95946d6b7fe5"/>
580   - <textElement textAlignment="Center" verticalAlignment="Middle">
581   - <font size="6"/>
582   - <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
583   - </textElement>
584   - <textFieldExpression><![CDATA[$F{qtde}]]></textFieldExpression>
585   - </textField>
586   - </jr:detailCell>
587   - </jr:column>
588   - <jr:column width="100" uuid="a068dbe5-4914-4bb5-8179-d3a398d0e1f4">
589   - <jr:tableFooter height="20" rowSpan="1">
590   - <textField pattern="¤ #,##0.00" isBlankWhenNull="false">
591   - <reportElement x="0" y="0" width="100" height="20" uuid="544e5550-889a-40ef-8bdf-79bc1d3eb604"/>
592   - <textElement textAlignment="Center" verticalAlignment="Middle">
593   - <font size="7" isBold="true"/>
594   - <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
595   - </textElement>
596   - <textFieldExpression><![CDATA[$V{total}]]></textFieldExpression>
597   - </textField>
598   - </jr:tableFooter>
599   - <jr:columnHeader style="table 1" height="20" rowSpan="1">
600   - <staticText>
601   - <reportElement x="0" y="0" width="100" height="20" uuid="6b40bbc3-2e03-4680-b985-d8a6f14852e4"/>
602   - <textElement textAlignment="Center" verticalAlignment="Middle">
603   - <font size="7" isBold="true"/>
604   - </textElement>
605   - <text><![CDATA[Preço Total]]></text>
606   - </staticText>
607   - </jr:columnHeader>
608   - <jr:detailCell style="table 1" height="15" rowSpan="1">
609   - <textField pattern="¤ #,##0.00" isBlankWhenNull="false">
610   - <reportElement x="0" y="0" width="100" height="15" uuid="c39c96e3-153e-480f-98ee-4cc47a654598"/>
611   - <textElement textAlignment="Center" verticalAlignment="Middle">
612   - <font size="6"/>
613   - <paragraph leftIndent="2" rightIndent="2" spacingBefore="2"/>
614   - </textElement>
615   - <textFieldExpression><![CDATA[$F{valorTotal}]]></textFieldExpression>
616   - </textField>
617   - </jr:detailCell>
618   - </jr:column>
619   - </jr:table>
620   - </componentElement>
621   - </band>
622   - </detail>
623 667 <noData>
624 668 <band height="23">
625 669 <staticText>
... ...
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/AtendimentoRequisicaoConsumoController.js
... ... @@ -462,7 +462,6 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
462 462 };
463 463  
464 464 $scope.validarQuantidadesAtendidas = function(){
465   - $scope.setLoading(true);
466 465 $scope.atendimentoRequisicaoConsumo.atendimentos = [];
467 466 angular.copy($scope.atendimentos, $scope.atendimentoRequisicaoConsumo.atendimentos);
468 467  
... ... @@ -482,11 +481,8 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
482 481 });
483 482 });
484 483 });
485   - $scope.showAlert("error", result.mensagemErro, " ", false);
486   - $scope.setLoading(false);
487 484 }
488 485  
489   - $scope.setLoading(false);
490 486 });
491 487 }
492 488  
... ... @@ -497,8 +493,7 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
497 493 });
498 494  
499 495 if(atendimentoItem.$somaQtdAtendida > atendimentoItem.requisicaoConsumoItem.quantidade){
500   - atendimentoItem.$hasError = true;
501   - $scope.showAlert("error", $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA'), " ", false);
  496 + atendimentoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada = true;
502 497 }
503 498 }
504 499  
... ... @@ -512,6 +507,7 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
512 507 atendimento.atendimentoRequisicaoConsumoItems.forEach(function(atendimentoItem){
513 508 atendimentoItem.atendimentoRequisicaoConsumoItemEnderecos.forEach(function(itemEndereco){
514 509 atendimentoItem.$hasError = false;
  510 + atendimentoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada = false;
515 511 itemEndereco.$hasError = false;
516 512 });
517 513 });
... ... @@ -666,6 +662,7 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
666 662 $scope.listaEnderecosSelect = angular.copy(enderecosItem);
667 663 }
668 664  
  665 + $scope.listaEnderecosTemp = angular.copy(enderecosAdicionados);
669 666 $scope.listaEnderecosAdicionados = enderecosAdicionados;
670 667 $scope.$openModal('modal-atendimento-item-enderecos.html', 'md');
671 668 }
... ... @@ -714,5 +711,11 @@ citApp.controller( &#39;AtendimentoRequisicaoConsumoController&#39;,
714 711 $scope.showAlert('error', mensagemErro, " ", false);
715 712 }
716 713 }
  714 +
  715 + $scope.cancelarEdicaoModalEnderecos = function(){
  716 + limparLinhasComErro();
  717 + $scope.atendimentoItemEmEdicao.atendimentoRequisicaoConsumoItemEnderecos = $scope.listaEnderecosTemp;
  718 + $scope.$modalInstance.dismiss('cancel');
  719 + }
717 720  
718 721 }]);
... ...
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/atendimentoRequisicaoConsumoEdit.html
... ... @@ -80,14 +80,14 @@
80 80 </h2>
81 81 <div class="widget-toolbar">
82 82 <a href="#void" ng-click="widgetAtendimentoCollapsed = !widgetAtendimentoCollapsed">
83   - <i class="fa" ng-class="{'fa-chevron-up': widgetAtendimentoCollapsed, 'fa-chevron-down': !widgetAtendimentoCollapsed}"></i>
  83 + <i class="fa" ng-class="{'fa-chevron-up': atendimentos.length == 1 ? !widgetAtendimentoCollapsed : widgetAtendimentoCollapsed, 'fa-chevron-down': atendimentos.length == 1 ? widgetAtendimentoCollapsed : !widgetAtendimentoCollapsed}"></i>
84 84 </a>
85   - <a href="#void" style="margin-left: 3px" ng-click="removerRequisicaoDoAtendimento($index)" ng-show="edit">
  85 + <a href="#void" style="margin-left: 3px" ng-click="removerRequisicaoDoAtendimento($index)" ng-show="edit && atendimentos.length > 1">
86 86 <i class="fa fa-trash-o bigger-130 red" tooltip="{{$translate.instant('ALMOXARIFADO.MSG.REMOVER_REQUISICAO_ATENDIMENTO')}}"></i>
87 87 </a>
88 88 </div>
89 89 </div>
90   - <div collapse="!widgetAtendimentoCollapsed" class="widget-body">
  90 + <div collapse="atendimentos.length == 1 ? widgetAtendimentoCollapsed : !widgetAtendimentoCollapsed" class="widget-body">
91 91 <div class="widget-main clearfix">
92 92 <div class="row">
93 93 <div class="col-md-3">
... ... @@ -139,8 +139,8 @@
139 139 </thead>
140 140 <tbody>
141 141 <tr ng-repeat-start="atendimentoRequisicaoConsumoItem in atendimento.atendimentoRequisicaoConsumoItems"
142   - ng-class="atendimentoRequisicaoConsumoItem.$hasError ? 'danger' : ''" ng-hide="atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidade == atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidadeAtendida && !exibirCompletos && edit"
143   - tooltip="{{atendimentoRequisicaoConsumoItem.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : ''}}">
  142 + ng-class="atendimentoRequisicaoConsumoItem.$hasError || atendimentoRequisicaoConsumoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada ? 'danger' : ''" ng-hide="atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidade == atendimentoRequisicaoConsumoItem.requisicaoConsumoItem.quantidadeAtendida && !exibirCompletos && edit"
  143 + tooltip="{{atendimentoRequisicaoConsumoItem.$hasErrorQtdAtendidaMaiorQtdRequisitada ? $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA') : (atendimentoRequisicaoConsumoItem.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : '')}}">
144 144  
145 145 <td class="text-center" ng-show="edit">
146 146 <button type="button" ng-click="atendimentoRequisicaoConsumoItem.$verInfo = !atendimentoRequisicaoConsumoItem.$verInfo">
... ...
cit-almoxarifado-web/src/main/webapp/html/atendimentoRequisicaoConsumo/dialog_atendimento_item_enderecos.html
... ... @@ -8,7 +8,7 @@
8 8  
9 9 <button title="{{$translate.instant('LABEL.CANCELAR')}}"
10 10 alt="{{$translate.instant('LABEL.CANCELAR')}}"
11   - ng-click="$dismiss('cancel');" class="btn btn-clear" type="button">
  11 + ng-click="cancelarEdicaoModalEnderecos()" class="btn btn-clear" type="button">
12 12 <i class="fa fa-times red"></i>
13 13 <translate>LABEL.CANCELAR</translate>
14 14 </button>
... ... @@ -16,6 +16,22 @@
16 16  
17 17 <div class="modal-body">
18 18 <legend style="font-size: 20px">
  19 + <translate>LABEL.MATERIAL</translate>
  20 + </legend>
  21 +
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <input class="form-control" type="text" ng-disabled="true" ng-model="atendimentoItemEmEdicao.material.codigoEDescricao">
  25 + </div>
  26 + </div>
  27 +
  28 + <div class="row">
  29 + <div class="col-md-12">
  30 + &nbsp;
  31 + </div>
  32 + </div>
  33 +
  34 + <legend style="font-size: 20px">
19 35 <translate>ALMOXARIFADO.LABEL.ENDERECOS_ESTOQUE</translate>
20 36 </legend>
21 37  
... ... @@ -49,7 +65,8 @@
49 65 </tr>
50 66 </thead>
51 67 <tbody ng-repeat="atendimentoRequisicaoConsumoItemEndereco in listaEnderecosAdicionados">
52   - <tr ng-class="atendimentoRequisicaoConsumoItemEndereco.$hasError ? 'danger' : ''">
  68 + <tr ng-class="atendimentoRequisicaoConsumoItemEndereco.$hasError || atendimentoRequisicaoConsumoItemEndereco.$hasErrorQtdAtendidaMaiorQtdRequisitada ? 'danger' : ''"
  69 + tooltip="{{atendimentoItemEmEdicao.$hasErrorQtdAtendidaMaiorQtdRequisitada ? $translate.instant('ALMOXARIFADO.VALIDACAO.QUANTIDADE_ATENDIDA_MAIOR_REQUISITADA') : (atendimentoRequisicaoConsumoItemEndereco.$hasError ? $translate.instant('ALMOXARIFADO.VALIDACAO.SOMA_ITENS_ATENDER_MAIOR_ESTOQUE_TOOLTIP') : '')}}">
53 70 <td class="text-center"><input type="checkbox" ng-checked="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" ng-model="atendimentoRequisicaoConsumoItemEndereco.$checkedChBox" /></td>
54 71 <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.endereco.descricao}}</td>
55 72 <td class="text-center">{{atendimentoRequisicaoConsumoItemEndereco.materialLocalEstoque.quantidade}}</td>
... ...