Пример #1
0
 public function verificatorCredit($id)
 {
     $credit = CreditRequest::where('user_id', $id)->first();
     $locations = Location::where('id', $credit->location)->first();
     $variables = General_variables::all();
     $data = $this->prepareData($this->data);
     $message = [];
     $countCredit = 0;
     if ($variables[0]->value < $data['data_credit']) {
         $countCredit++;
     } else {
         $message = $message + ['data_credit' => 'no superado datacredito'];
     }
     if ($variables[1]->value < $data['data_monthly']) {
         $countCredit++;
     } else {
         $message = $message + ['data_monthly' => 'no superado datos mensuales'];
     }
     if ($variables[2]->value < $data['value_monthly']) {
         $countCredit++;
     } else {
         $message = $message + ['value_monthly' => 'no superado el valor mensual'];
     }
     if ($variables[2]->value < $data['value_monthly']) {
         $countCredit++;
     } else {
         $message = $message + ['value_monthly' => 'no superado el valor mensual'];
     }
     if (isset($data['reference1']) or isset($data['reference2'])) {
         $countCredit++;
     } else {
         $message = $message + ['reference' => 'no tienen ninguna referencia confirmada'];
     }
     if (isset($data['files'])) {
         $countCredit++;
     } else {
         $message = $message + ['files' => 'Los archivos no estan correctos'];
     }
     if (strtolower($locations->name) == "medellin") {
         if ($data['fenalco'] > 0) {
             $countCredit++;
         } else {
             $message = $message + ['fenalco' => 'Fenalco no fue superado'];
         }
         if ($countCredit == 7) {
             return ['return' => true];
         } else {
             return $message + ['accept' => '1'];
         }
     } else {
         if ($countCredit == 6) {
             return ['return' => true];
         } else {
             return $message + ['accept' => '1'];
         }
     }
 }
Пример #2
0
 public function showVariables()
 {
     $variables = General_variables::all();
     return View::make('back.generalVariables', compact('variables'));
 }