コード例 #1
0
 public function ListAction()
 {
     $filtro = $this->request['filtro'];
     $desde = new Fecha($filtro['desdeFecha']);
     $hasta = new Fecha($filtro['hastaFecha']);
     $filtroSucursal = $filtro['idSucursal'] ? "IDSucursal='{$filtro['idSucursal']}'" : "1";
     $filtroEstado = $filtro['idEstado'] != '' ? "IDEstado='{$filtro['idEstado']}'" : "1";
     $filtroQuery = "(Vencimiento>='{$desde->getaaaammdd()}') and (Vencimiento<='{$hasta->getaaaammdd()}') and ({$filtroSucursal}) and ({$filtroEstado})";
     // and (Iban<>0)";
     $recibos = new RecibosClientes();
     $rows = $recibos->cargaCondicion("IDRecibo", $filtroQuery, "Vencimiento ASC");
     unset($recibos);
     $array = array();
     foreach ($rows as $row) {
         $recibo = new RecibosClientes($row['IDRecibo']);
         $array[] = array('IDRecibo' => $recibo->getIDRecibo(), 'NumeroFactura' => $recibo->getIDFactura()->getNumeroFactura(), 'RazonSocial' => $recibo->getIDCliente()->getRazonSocial(), 'Fecha' => $recibo->getFecha(), 'Vencimiento' => $recibo->getVencimiento(), 'Importe' => $recibo->getImporte(), 'Remesa' => $recibo->getIDRemesa(), 'Iban' => $recibo->getIban(), 'Estado' => $recibo->getIDEstado()->getDescripcion());
     }
     unset($recibo);
     $this->values['datos'] = $array;
     return array('values' => $this->values, 'template' => $this->entity . '/list.html.twig');
 }