public function getEdit($id)
 {
     $suppliers = new Party();
     $suppliersAll = $suppliers->getSuppliersDropDown();
     $products = new Product();
     $localProducts = $products->getLocalProductsDropDown();
     $stockInfos = new StockInfo();
     $allStockInfos = $stockInfos->getStockInfoDropDown();
     $branches = new Branch();
     $branchAll = $branches->getBranchesDropDown();
     $purchase[0] = PurchaseInvoice::where('invoice_id', '=', $id)->get();
     $var = $purchase[0];
     $purchaseDetails = PurchaseInvoiceDetail::where('detail_invoice_id', '=', $id)->get();
     if (count($purchaseDetails) < 1) {
         return Redirect::to('purchases/index');
     }
     return view('PurchaseInvoice.edit', compact('suppliersAll'))->with('localProducts', $localProducts)->with('purchaseDetails', $purchaseDetails)->with('purchase', $var)->with('branchAll', $branchAll)->with('allStockInfos', $allStockInfos);
 }