Example #1
0
 public function editCustomRecord($parameters)
 {
     // get resourse to know if set user, depend of view, todos or user todos
     $actions = $this->request->route()->getAction();
     $parameters['resource'] = $actions['resource'];
     if ($parameters['object']->type_id_093 == 2) {
         $response = FacturaDirecta::getClient($parameters['object']->customer_id_093);
         $collection = collect();
         // check that response does not contain httpStatus 404
         if (!isset($response['httpStatus'])) {
             // set id like integer, to compare in select
             $response['id'] = (int) $response['id'];
             $parameters['customers'] = $collection->push(Miscellaneous::arrayToObject($response));
         }
     }
     // types
     $parameters['types'] = array_map(function ($object) {
         $object->name = trans_choice($object->name, 1);
         return $object;
     }, config('projects.types'));
     // projects
     $parameters['projects'] = Project::builder()->where('end_date_090', '>', date('U'))->orWhereNull('end_date_090')->get();
     // todo: cambiar por listado de programadores
     $users = User::builder()->get();
     $parameters['users'] = $users->map(function ($user, $key) {
         $user->name = $user->name_010 . ' ' . $user->surname_010;
         return $user;
     });
     return $parameters;
 }
Example #2
0
 public function editCustomRecord($parameters)
 {
     $response = FacturaDirecta::getClient($parameters['object']->customer_id_090);
     $collection = collect();
     // check that response does not contain httpStatus 404
     if (!isset($response['httpStatus'])) {
         // set id like integer, to compare in select
         $response['id'] = (int) $response['id'];
         $parameters['customers'] = $collection->push(Miscellaneous::arrayToObject($response));
     }
     return $parameters;
 }