Esempio n. 1
0
 public function getPicking($BranchId)
 {
     return View::make('branch.picking')->with('branch', Branch::find($BranchId))->with('delivery', Delivery::where('branch_id', '=', $BranchId)->orderBy('t_begin', 'desc')->paginate())->with('count', Delivery::where('branch_id', '=', $BranchId)->count());
 }
Esempio n. 2
0
 public function getPrint()
 {
     $warehouse = Warehouse::all();
     $users = User::where('grade', '10')->where('disable', '0')->get();
     $warehouse_name = '';
     $user_name = '';
     $prints = array();
     $count_prints = 0;
     $warehouse_id = Input::get('warehouse_id');
     $user_id = Input::get('user_id');
     if ($warehouse_id === '0' || $user_id === '0') {
         return Redirect::to('picking/print')->with('error', '仓库和业务员都需要选择!');
     }
     if ($warehouse_id && $user_id) {
         $warehouse_name = Warehouse::find($warehouse_id)->pluck('name');
         $user = User::find($user_id);
         $user_name = $user->username;
         $prints = Delivery::where('warehouse_id', $warehouse_id)->where('status', '2')->where('user_id', $user_id)->with('items', 'user')->get();
         $count_prints = count($prints);
     }
     return View::make('picking.print')->with(compact('warehouse'))->with(compact('users'))->with(compact('prints'))->with(compact('warehouse_name'))->with(compact('user_name'))->with(compact('count_prints'));
 }