Commit 8ca7aa4e203ed07d84845899e5adf2c890a01ed2
1 parent
7843a2e3
Exists in
master
and in
1 other branch
correção de rotas e controlles
Showing
1 changed file
with
5 additions
and
6 deletions
Show diff stats
src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | 54 | ||
| 55 | foreach ($logs as $cont ){ | 55 | foreach ($logs as $cont ){ |
| 56 | $TotalnumComp += $cont['numComp']; | 56 | $TotalnumComp += $cont['numComp']; |
| 57 | - } | 57 | + } |
| 58 | 58 | ||
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -63,6 +63,7 @@ | @@ -63,6 +63,7 @@ | ||
| 63 | 'idioma'=> $locale, | 63 | 'idioma'=> $locale, |
| 64 | 'form' => $form->createView(), | 64 | 'form' => $form->createView(), |
| 65 | 'data' =>$data, | 65 | 'data' =>$data, |
| 66 | + 'filtroLocais' => $filtroLocais, | ||
| 66 | 'logs' => ( isset( $logs ) ? $logs : null ), | 67 | 'logs' => ( isset( $logs ) ? $logs : null ), |
| 67 | 'totalnumcomp' => $TotalnumComp | 68 | 'totalnumcomp' => $TotalnumComp |
| 68 | ) | 69 | ) |
| @@ -72,7 +73,6 @@ | @@ -72,7 +73,6 @@ | ||
| 72 | //botão csv de todas faturamento | 73 | //botão csv de todas faturamento |
| 73 | public function faturamentoCsvAction(Request $request) | 74 | public function faturamentoCsvAction(Request $request) |
| 74 | { | 75 | { |
| 75 | - $em = $this->getDoctrine()->getManager(); | ||
| 76 | 76 | ||
| 77 | $form = $this->createForm( new LogPesquisaType() ); | 77 | $form = $this->createForm( new LogPesquisaType() ); |
| 78 | 78 | ||
| @@ -80,11 +80,11 @@ | @@ -80,11 +80,11 @@ | ||
| 80 | $data = $form->getData(); | 80 | $data = $form->getData(); |
| 81 | $filtroLocais = array(); // Inicializa array com locais a pesquisar | 81 | $filtroLocais = array(); // Inicializa array com locais a pesquisar |
| 82 | foreach ( $data['idLocal'] as $locais ) { | 82 | foreach ( $data['idLocal'] as $locais ) { |
| 83 | - array_push( $filtroLocais, $locais->getIdLocal() ); | 83 | + array_push( $filtroLocais, $locais->getIdLocal() ); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | - $printers = $em->getRepository( 'CacicCommonBundle:LogAcesso') | ||
| 87 | - ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | 86 | + $printers = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso') |
| 87 | + ->faturamentoCsv( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais); | ||
| 88 | 88 | ||
| 89 | // Gera CSV | 89 | // Gera CSV |
| 90 | $reader = new ArrayReader($printers); | 90 | $reader = new ArrayReader($printers); |
| @@ -120,7 +120,6 @@ | @@ -120,7 +120,6 @@ | ||
| 120 | $dataInicio = $request->get('dtAcaoInicio'); | 120 | $dataInicio = $request->get('dtAcaoInicio'); |
| 121 | $dataFim = $request->get('dtAcaoFim'); | 121 | $dataFim = $request->get('dtAcaoFim'); |
| 122 | 122 | ||
| 123 | - | ||
| 124 | $locale = $request->getLocale(); | 123 | $locale = $request->getLocale(); |
| 125 | $dados = $this->getDoctrine() | 124 | $dados = $this->getDoctrine() |
| 126 | ->getRepository('CacicCommonBundle:LogAcesso') | 125 | ->getRepository('CacicCommonBundle:LogAcesso') |