Commit 72a273f2506a621e0ed72929443c4eadfe99c871

Authored by Bruno Noronha
1 parent 6d811d7c
Exists in master and in 1 other branch 3.1

filtros csv

src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
@@ -46,7 +46,6 @@ @@ -46,7 +46,6 @@
46 array_push( $filtroLocais, $locais->getIdLocal() ); 46 array_push( $filtroLocais, $locais->getIdLocal() );
47 } 47 }
48 48
49 -  
50 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') 49 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso')
51 ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); 50 ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
52 51
@@ -74,17 +73,16 @@ @@ -74,17 +73,16 @@
74 public function faturamentoCsvAction(Request $request) 73 public function faturamentoCsvAction(Request $request)
75 { 74 {
76 75
77 - $form = $this->createForm( new LogPesquisaType() ); 76 + $dataInicio = $request->get('dtAcaoInicio');
  77 + $dataFim = $request->get('dtAcaoFim');
78 78
79 - $form->bind( $request );  
80 - $data = $form->getData();  
81 - $filtroLocais = array(); // Inicializa array com locais a pesquisar  
82 - foreach ( $data['idLocal'] as $locais ) {  
83 - array_push( $filtroLocais, $locais->getIdLocal() ); 79 + $filtroLocais = $_POST;
  80 +
  81 + foreach ( $filtroLocais as $locais ) {
84 } 82 }
85 83
86 $printers = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') 84 $printers = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso')
87 - ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); 85 + ->faturamentoCsv( $dataInicio, $dataFim, $filtroLocais);
88 86
89 // Gera CSV 87 // Gera CSV
90 $reader = new ArrayReader($printers); 88 $reader = new ArrayReader($printers);