Пример #1
0
 public function edit($id)
 {
     $acquisition = Acquisitions::find($id);
     if ($acquisition) {
         $contacts = Contacts::type('PROVEEDOR')->orderBy('name')->get()->lists('name', 'id');
         $items = Items::orderBy('item_name')->lists('item_name', 'id');
         return view('acquisition.edit', compact('acquisition', 'contacts', 'items'));
     } else {
         return redirect()->action('AcquisitionsController@index')->with('error', 'La compra solicitada no existe');
     }
 }
Пример #2
0
 public function edit($id)
 {
     $transaction = Transactions::find($id);
     $contacts = Contacts::type('CLIENTE')->get()->lists('name', 'id');
     $items = Items::lists('item_name', 'id');
     if ($transaction) {
         return view('transaction.edit', compact('transaction', 'contacts', 'items'));
     } else {
         return redirect()->action('TransactionsController@index')->with('error', 'La orden de venta solicitada no existe');
     }
 }