public function store(Request $request)
 {
     $v = $this->validator($request->all());
     if ($v->fails()) {
         return redirect()->back()->withErrors($v->errors())->withInput();
     } else {
         //SE CREA UN NUEVO PORCENTAJE DE GANANCIA
         if (ProfitPercentage::create($request->all())) {
             //SE REGISTRA LA ACTIVIDAD EN LA BITACORA
             $this->binnacle("REGISTRÓ DE % DE GANANCIA", $request);
         }
         Session::flash('message', 'Ganancia creada correctamente');
         return Redirect::to('/profit/create');
     }
 }
Example #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Prof::create(['profit_name' => '10% Medicinas', 'profit_description' => 'Procentaje aplicable a todos los medicamentos genéricos', 'profit_percentage' => '0.10', 'profit_type' => 'compras']);
     Prof::create(['profit_name' => '5% Soluciones', 'profit_description' => 'Procentaje aplicable a todas las soluciones', 'profit_percentage' => '0.05', 'profit_type' => 'compras']);
     Prof::create(['profit_name' => '4% Equipo médico', 'profit_description' => 'Procentaje aplicable a todo el equipo médico', 'profit_percentage' => '0.04', 'profit_type' => 'compras']);
 }