public function index(Request $request) { $profit = ProfitPercentage::all(); if ($request->ajax()) { return response()->json($profit->toArray()); } //SE REGISTRA LA ACTIVIDAD EN LA BITACORA $this->binnacle("ENTRÓ A LA LISTA DE % DE GANANCIA", $request); return view('profit.index', compact('profit')); }
public function edit(Request $request, $id) { $item = Items::find($id); if ($item) { $profits = ProfitPercentage::all('id', 'profit_name'); $itemtype = ItemType::all(); return view('item.edit', compact('item', 'profits', 'itemtype')); } else { return redirect()->action('ItemsController@index')->with('error', 'El producto solicitado no existe'); } }