static function getOrdenesDeCompraCompletas($filter)
 {
     $ocsSolicitudes = SolicitudesEntregaDao::getOrdenesDeCompraCompletas($filter);
     foreach ($ocsSolicitudes as $oc) {
         $ex = ExternalDao::getOrdenDeCompraByIdReadOnly($oc->ordenDeCompraId);
         $oc->proveedorId = $ex->proveedorId;
     }
     foreach ($ocsSolicitudes as $oc) {
         $oc->razonSocial = ExternalDao::getProveedorById($oc->proveedorId)->razonSocial;
     }
     $result = new Response(new Result(), $ocsSolicitudes);
     return json_encode(Utils::utf8ize($result));
 }
Esempio n. 2
0
 static function getUser($userId)
 {
     $data = SecurityDao::getUserById($userId);
     $roles = SecurityDao::getRolesByMail($data->mail);
     $data->roles = Phinq::create($roles)->select(function ($role) {
         return $role->id;
     })->toArray();
     if ($data->proveedorId) {
         $proveedor = ExternalDao::getProveedorById($data->proveedorId);
         $data->proveedorRazonSocial = $proveedor->razonSocial;
     }
     $filter = new \stdClass();
     $filter->pageSize = 99999999;
     $filter->currentPage = 1;
     $filter->multicolumnSearchText = null;
     $filter->userId = $userId;
     $data->proveedores = ExternalDao::getProveedoresByFilter($filter)->data;
     $result = new Response(new Result(), $data);
     return json_encode(Utils::utf8ize($result));
 }