Commit 1b0091aee2884ed84026ed0faa1ba2a96a0f7ccd

Authored by geovane.filho
1 parent b5091c3f
Exists in master

Redmine #4922 Corrigindo relatórios da entrada de materiais

cit-almoxarifado-web/src/main/resources/reports/entradaMaterialNotaRecebimento.jrxml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2 -->
3   -<!-- 2016-05-16T10:33:33 -->
4 2 <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="entradaMaterialAnaliticoEntrada" language="groovy" pageWidth="802" pageHeight="555" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="5ed15610-1772-4ec5-9238-b8bb4567a519">
5 3 <property name="ireport.zoom" value="1.6500000000000008"/>
6 4 <property name="ireport.x" value="25"/>
... ... @@ -41,8 +39,8 @@
41 39 contacontabil.descricao AS nomeConta,
42 40 sum(entradaalmoxarifadoitem.quantidade) AS quantidade,
43 41 sum(entradaalmoxarifadoitem.valortotal) AS valorTotal
44   -FROM entradaalmoxarifado entradaalmoxarifado
45   - INNER JOIN entradaalmoxarifadoitem entradaalmoxarifadoitem ON entradaalmoxarifadoitem.entrada_id = entradaalmoxarifado.id
  42 +FROM alm_entrada entradaalmoxarifado
  43 + INNER JOIN alm_en_entradaitem entradaalmoxarifadoitem ON entradaalmoxarifadoitem.entrada_id = entradaalmoxarifado.id
46 44 INNER JOIN material material ON material.id = entradaalmoxarifadoitem.material_id
47 45 LEFT JOIN contacontabil contacontabil ON material.contacontabil_id = contacontabil.id
48 46 WHERE entradaalmoxarifado.id = $P{idEntrada}
... ...
cit-almoxarifado-web/src/main/webapp/assets/js/angular/custom/controller/EntradaAlmoxarifadoController.js
... ... @@ -761,87 +761,11 @@ citApp.controller(&#39;EntradaAlmoxarifadoController&#39;, [&#39;$scope&#39;, &#39;$filter&#39;, &#39;FileUp
761 761  
762 762  
763 763 $scope.resetFormRelatorioEntradaAlmoxarifado();
764   -
765   - //FUNCAO QUE GERA RELATORIO DE ENTRADAS POR PERIODO
766   - $scope.gerarRelatorioEntrada = function() {
767   - $scope.formRelatorioEntradaAlmoxarifado.$submitted = true;
768   - if($scope.formRelatorioEntradaAlmoxarifado.$invalid){
769   - $scope.showAlert('error', $translate.instant('MSG.MN001'));
770   - } else{
771   - var dataInicio = $scope.relatorioEntradaAlmoxarifado.dataReferenciaInicial;
772   - var dataFim = $scope.relatorioEntradaAlmoxarifado.dataReferenciaFinal;
773   -
774   - $scope.url = '/cit-almoxarifado-web/rest/relatorioEntrada/imprimirRelatorio?';
775   -
776   - if(isPeriodoValido(dataInicio, dataFim)){
777   - if(isPeriodoInferiorDozeMeses(dataInicio, dataFim)){
778   -
779   - $scope.url += 'dataInicio=' + dataInicio + '&dataFim=' + dataFim;
780   - $scope.url += '&idAlmoxarifado=' + $scope.relatorioEntradaAlmoxarifado.almoxarifado.id;
781   -
782   - if($scope.relatorioEntradaAlmoxarifado.dominioTipoEntrada != null){
783   - $scope.url += '&idTipoEntrada=' + $scope.relatorioEntradaAlmoxarifado.dominioTipoEntrada.id;
784   - }
785   -
786   - if($scope.relatorioEntradaAlmoxarifado.dominioTipoRecebimento != null){
787   - $scope.url += '&idTipoRecebimento=' + $scope.relatorioEntradaAlmoxarifado.dominioTipoRecebimento.id;
788   - }
789   -
790   - if($scope.relatorioEntradaAlmoxarifado.materiais != null){
791   - var idsMateriais = "";
792   - var materiais = $scope.relatorioEntradaAlmoxarifado.materiais;
793   - for(var i = 0 ; i < materiais.length ; i++){
794   - if(i==0)
795   - idsMateriais += materiais[i].material.id;
796   - else
797   - idsMateriais += ","+materiais[i].material.id;
798   - }
799   - $scope.url += '&idsMateriais=' + idsMateriais;
800   - }
801   -
802   - $scope.visualizarRelatorio($scope.url, $translate.instant("ALMOXARIFADO.LABEL.TITULO_ENTRADA_ALMOXARIFADO"));
803   -
804   - }
805   - else{
806   - $scope.showAlert("error", $translate.instant("ALMOXARIFADO.VALIDACAO.PERIODO_INVALIDO_INFERIOR_DOZE_MESES") + " ", false );
807   - }
808   - }
809   - else{
810   - $scope.showAlert("error", $translate.instant("VALIDACAO.PERIODO_INVALIDO_DATAINICIO_MAIOR_DATAFIM") + " ", false );
811   - }
812   - }
813   - };
814   -
815   -
816   - //FUNCAO QUE GERA RELATORIO DE ENTRADAS POR MATERIAL ANALITICO POR ENTRADA
817   - $scope.gerarRelatorioEntradaMaterial = function() {
818   - $scope.formRelatorioEntradaAlmoxarifado.$submitted = true;
819   - if($scope.formRelatorioEntradaAlmoxarifado.$invalid){
820   - $scope.showAlert('error', $translate.instant('MSG.MN001'));
821   - } else{
822   - var dataInicio = $scope.relatorioEntradaAlmoxarifado.dataReferenciaInicial;
823   - var dataFim = $scope.relatorioEntradaAlmoxarifado.dataReferenciaFinal;
824   -
825   - $scope.url = '/cit-almoxarifado-web/rest/relatorioEntrada/imprimirRelatorioEntradaMaterialAnalitico?';
826   -
827   - if(isPeriodoValido(dataInicio, dataFim)){
828   - if(isPeriodoInferiorDozeMeses(dataInicio, dataFim)){
829   -
830   - $scope.url += 'dataInicio=' + dataInicio + '&dataFim=' + dataFim;
831   - $scope.url += '&idAlmoxarifado=' + $scope.relatorioEntradaAlmoxarifado.almoxarifado.id;
832   -
833   - $scope.visualizarRelatorio($scope.url, $translate.instant("ALMOXARIFADO.LABEL.TITULO_ENTRADA_MATERIAL_ANALITICO"));
834   -
835   - }
836   - else{
837   - $scope.showAlert("error", $translate.instant("ALMOXARIFADO.VALIDACAO.PERIODO_INVALIDO_INFERIOR_DOZE_MESES") + " ", false );
838   - }
839   - }
840   - else{
841   - $scope.showAlert("error", $translate.instant("VALIDACAO.PERIODO_INVALIDO_DATAINICIO_MAIOR_DATAFIM") + " ", false );
842   - }
843   - }
844   - };
  764 +
  765 + $scope.gerarRelatorio = function(){
  766 + $scope.url = '/cit-almoxarifado-web/rest/relatorioEntrada/notaRecebimento?idEntrada='+ $scope.entradaAlmoxarifado.id;
  767 + $scope.visualizarRelatorio($scope.url, $translate.instant("ALMOXARIFADO.LABEL.TITULO_ENTRADA_MATERIAL_NOTA_RECEBIMENTO"));
  768 + };
845 769  
846 770 //ADICIONA O MATERIAL SELECIONADO
847 771 $scope.setMaterial = function(item){
... ...
cit-almoxarifado-web/src/main/webapp/html/entradaAlmoxarifado/entradaAlmoxarifadoEdit.html
... ... @@ -30,7 +30,7 @@
30 30 title="{{$translate.instant('LABEL.GERAR_RELATORIO')}}"
31 31 alt="{{$translate.instant('LABEL.GERAR_RELATORIO')}}"
32 32 class="btn btn-clear" type="button" ng-disabled="false"
33   - ng-click="gerarRelatorioEntradaAlmoxarifado();" ng-if="entradaAlmoxarifado.id">
  33 + ng-click="gerarRelatorio();" ng-if="entradaAlmoxarifado.id">
34 34 <i class="fa fa-print"></i>
35 35 <translate>LABEL.GERAR_RELATORIO</translate>
36 36 </button>
... ...