public function itemProfile($item_id) { $iteminfo = Item::whereId($item_id)->first(); $uoms = Uom::where('active', 'Y')->get(); $catt = ItemCategory::all(); $categories = ItemCategory::all(); $categories_pack = []; foreach ($categories as $category) { $subcategories = ItemSubcategory::where('parent', $category->id)->orderBy('parent', 'asc')->lists('name'); $categories_pack[$category->id] = $subcategories; } $jsonified = json_encode($categories_pack); $data = ['categories' => $jsonified]; $inventory_types = InventoryType::all(); $bulkunits = BulkUnit::where('item_id', $item_id)->where('active', 'Active')->get(); $bulkunits2 = BulkPackaging::where('item_id', $item_id)->where('active', 'Active')->get(); $dropdownbulkunit = BulkUnit::where('item_id', $item_id)->where('type', 'base')->where('active', 'Active')->get(); $bulkid = BulkUnit::where('item_id', $item_id)->where('type', 'base')->first(); $id2 = Request::input('id'); $id = $iteminfo->id; $trapPurchaseOrder = count(PurchaseDetails::where('item_id', $id)->get()); $trapSalesOrder = count(SalesOrder::where('item_id', $id)->get()); return View('operations/profile', $data, compact('inventory_types', 'catt', 'iteminfo', 'uoms', 'subcategories', 'itemcatsub', 'bulkunits', 'bulkunits2', 'dropdownbulkunit', 'updatebulkunits', 'bulkid', 'trapPurchaseOrder', 'trapSalesOrder', 'getbasename')); }
public function displayBulkUnit($item_id) { $bulkunits = BulkUnit::where('item_id', $item_id)->where('type', 'base')->get(); $uoms = Uom::all(); return View('operations/profile', compact('bulkunits', 'uoms')); }
public static function filterAndPaginate($name) { return Uom::name($name)->orderBy('name', 'ASC')->paginate(); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $uom = Uom::findOrFail($id); $uom->delete(); Session::flash('message', $uom->name . ' was delete !'); return \Redirect::route('settings.uoms.index'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $uom = new Uom(); $uom->where('id', $id)->update(['is_active' => 0]); //return Redirect::route('uoms.index')->with('flash_notice', 'You are successfully delete!'); }