示例#1
0
 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');
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Movicheque::destroy($id);
     \Session::flash('message', 'movimiento Borrado!');
     return redirect('movicheques');
 }