public static function getCantidadDeRemitos($planilla_id) { $remitos = Remito::find(array('remito_planillaId =:planilla_id:', 'bind' => array('planilla_id' => $planilla_id))); return count($remitos); }
/** * Dada dos fechas y una planilla busca todos los remitos */ public function buscarRemitosEntreFechasAjaxAction() { $this->view->disable(); $remito = null; $error = array(); $data = array(); $tabla = array(); if ($this->request->getPost('remito_planillaId') == null) { $error[] = "No se encontró la planilla"; } $remito = Remito::find(array('remito_habilitado = 1 AND remito_planillaId =:planilla_id: AND remito_pdf IS NULL', 'bind' => array('planilla_id' => $this->request->getPost('remito_planillaId')), 'order by' => 'remito_nroOrden ASC')); if (count($remito) != 0) { $tabla = $this->generarTablaDeRemitosNuevo($remito, 'extra'); } else { $error[] = "NO SE ENCONTRARON REMITOS"; } $data['problemas'] = $error; echo json_encode(array('data' => $tabla, 'errores' => "")); }