public function grabarVenta(Request $request) { //$this->validate($request, ['nrocheque' => 'required', 'importe' => 'required', 'fechavto' => 'required', ]); $chv = Cheque::find($request->id_cheque); $chv->estado = "vendido"; $chv->save(); Chequeventa::create($request->all()); $movicaja = new Movicheque(); $neto = 0; $neto = $chv->importe - $chv->desctasa - $chv->descgasto - $chv->descfijo; $movicaja->importe = $neto; $movicaja->operacion_id = $chv->id; $movicaja->concepto_id = 7; $movicaja->comentario = "venta cheque nro:" . $chv->nrocheque; $movicaja->save(); \Session::flash('message', 'Venta Grabada!'); return redirect('cheques'); }