예제 #1
0
 public function getDashboard()
 {
     $reports = new Report();
     $totalProducts = $reports->getTotalProducts();
     $totalImports = $reports->getTotalImports();
     $totalSales = $reports->getTotalSalesToday();
     $totalPurchase = $reports->getTotalPurchaseToday();
     $accountsBalance = $reports->getAccountBalances();
     $accountBalanceTransfers = $reports->getBalanceTransferFullReport();
     $stocksBranch = $reports->getStocksBranch();
     $stockRequisitions = StockRequisition::orderBy('id', 'desc')->take(3)->get();
     $latestTransactions = Transaction::orderBy('id', 'desc')->take(5)->get();
     $register = Transaction::where('payment_method', '=', 'check')->where('type', '=', 'Receive')->where('cheque_status', '=', 0)->orderBy('id', 'desc')->get();
     $purchaseregister = Transaction::where('payment_method', '=', 'check')->where('type', '=', 'Payment')->where('cheque_status', '=', 0)->orwhere('type', '=', 'Expense')->where('cheque_status', '=', 0)->orderBy('id', 'desc')->get();
     //var_dump($stockRequisitions);
     return view('Users.dashboard')->with('latestTransactions', $latestTransactions)->with('totalProducts', $totalProducts)->with('totalSales', $totalSales)->with('stockRequisitions', $stockRequisitions)->with('stocksBranch', $stocksBranch)->with('accountsBalance', $accountsBalance)->with('accountBalanceTransfers', $accountBalanceTransfers)->with('totalPurchase', $totalPurchase)->with('totalImports', $totalImports)->with('register', $register)->with('purchaseregister', $purchaseregister);
 }
 public function getDel($id)
 {
     $stock = StockRequisition::find($id);
     $stock->delete();
     Session::flash('message', 'Stock Requisition has been Successfully Deleted.');
     return Redirect::to('requisitions/index');
 }