Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $venda = Venda::find($id);
     $clientes = Cliente::orderBy('fantasia')->get(['id', 'fantasia', 'nome_razao']);
     /*if ($venda->status == 2) {
         flash()->error('Venda não pode ser alterar, a mesma já está concluída');
         return redirect('/vendas');
       }*/
     return view('vendas.edit', compact('venda', 'clientes'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     //$clientes = Cliente::search($request->q)->orderBy('fantasia', 'asc')->paginate();
     if ($request->q != '') {
         $clientes = Cliente::where('nome_razao', 'like', "%{$request->q}%")->orWhere('fantasia', 'like', "%{$request->q}%")->orWhere('cpf_cnpj', 'like', "%{$request->q}%")->orWhere('rg_insc', 'like', "%{$request->q}%")->paginate(50);
     } else {
         $clientes = Cliente::orderBy('fantasia', 'asc')->paginate(50);
     }
     $q = $request->q;
     return view('clientes.index', compact('clientes', 'q'));
 }
Exemplo n.º 3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $boleto = Boleto::find($id);
     $clientes = Cliente::orderBy('fantasia')->get();
     $fornecedores = Fornecedor::orderBy('fantasia')->get();
     $edit = true;
     if ($boleto->lancamento->status == '1') {
         return view('boletos.edit', compact('boleto', 'fornecedores', 'clientes'));
     }
     flash('Boleto já está pago');
     return redirect('/boletos');
 }
Exemplo n.º 4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $cheque = Cheque::find($id);
     $bancos = Banco::all()->lists('nome', 'id');
     $clientes = Cliente::orderBy('fantasia')->get();
     $fornecedores = Fornecedor::orderBy('fantasia')->get();
     if ($cheque->lancamento->status != '2' || $cheque->lancamento->status != '3') {
         return view('cheques.edit', compact('cheque', 'bancos', 'clientes', 'fornecedores'));
     }
     flash('Cheque já está pago');
     return redirect('/cheques');
 }