/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $ventas = ventas::with('clientes', 'tiendas', 'factura_remision')->where('remision', 1)->get(); //dd($ventas); return view('app.ventas.ventas_index', compact('ventas')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { //primero verificamos que este abierta la caja $caja_abierta = caja::CajaAbierta(); if (!isset($caja_abierta)) { Session::flash('mensaje', 'Primero debe abrir al caja para Agregar un pago a la venta'); return redirect('caja'); } $ventas = ventas::with('clientes')->whereraw('venta > pagado')->get(); return view('app.ingresos.ingresos_create', compact('ventas')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // //dd(ventas::top_ventas($id)); $cliente = clientes::find($id); $ciudadesJSON = ciudades::all()->toJson(); $departamentos = departamentos::lists('departamento', 'id'); $ciudades = ciudades::lists('ciudad', 'id'); $ventas = ventas::with('clientes', 'tiendas', 'factura_venta')->where('cliente_id', $id)->get(); $datos = ventas::datos($ventas); return view('app.clientes.clientes_show', compact('cliente', 'ciudades', 'ciudadesJSON', 'departamentos', 'ventas', 'datos')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $tipo = facturacion::find($id); if (!$tipo->venta_id == 0) { $venta = ventas::with('venta_detalle.productos_configurables', 'clientes', 'tiendas.company', 'user')->find($tipo->venta_id); } if (!$tipo->remision_id == 0) { $remision = ventas::with('venta_detalle.productos_configurables', 'clientes', 'tiendas.company', 'user')->find($tipo->remision_id); } //dd($remision); return view('app/ventas/ventas_pos_invoice', compact('venta', 'remision')); }
public static function crear_pdf($id) { $venta = ventas::with('venta_detalle.productos_configurables', 'clientes', 'tiendas.company', 'user', 'ingreso_venta.formas_pago')->find($id); $cuenta = cuentas_bancarias::where('principal', 1)->first(); $view = view('app/ventas/ventas_pdf', compact('venta', 'cuenta'))->render(); $pdf = App::make('dompdf.wrapper'); $pdf->loadHTML($view); return $pdf; }
public function imprimir($id) { $venta = ventas::with('venta_detalle.productos_configurables', 'clientes', 'tiendas.company', 'user', 'ingreso_venta.formas_pago')->find($id); $cuenta = cuentas_bancarias::where('principal', 1)->first(); //dd($cuenta); return view('app/ventas/ventas_print', compact('venta', 'cuenta')); }