public function getlaporan(Request $request)
 {
     $tgl1 = $request->input('start');
     $tgl2 = $request->input('end');
     // $tabel='jual';
     $datas['datas'] = Penjualan::with('r_pelanggan')->whereBetween('tgl', [$tgl1, $tgl2])->get();
     $datas['tgl1'] = $tgl1;
     $datas['tgl2'] = $tgl2;
     // $jumlah=DB::select('SELECT detail_jual.kodeJual,detail_jual.idBarang,sum(detail_jual.jumlah * barang.hargaBarang) FROM detail_jual JOIN jual ON detail_jual.kodeJual =jual.kodeJual JOIN barang on detail_jual.idBarang=barang.idBarang where jual.kodeJual="JUAL-111215000003"');
     $pdf = PDF::loadView('penjualan.datalaporan', $datas);
     return $pdf->stream('laporan.pdf', array('Attachment' => 0));
 }
Beispiel #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $pjl = Penjualan::find($id);
     $pjl->delete();
     $dtl = Detailjual::where('kodeJual', '=', $id);
     $dtl->delete();
     return redirect('penjualan');
 }