public function getIndex() { //$konsumen = konsumen::all(); //data untuk laporan penagihan diambil berdasarkan nilai keuangan resi $tagihan = resi::where('crbyr', 'Non Tunai')->where('status', '>', 1)->get(); return view('admin.report.penagihan')->with('tagihans', $tagihan)->with('cab', 0)->with('kon', 0); }
public function dpenagihan($id) { $total = 0; $header = \App\resi::select('resi.*', 'resi.status', 'resi.noresi', 'resi.tglresi', 'resi.tagihan', 'resi.totalbiaya', 'resi.dp', 'resi.sisa', 'k.nama AS ppengirim', 'k.cp AS cppengirim', 'k.notelp AS telppengirim', 'k.alamat AS alamatpengirim', 'ktk.nmkota AS kotapengirim', 't.nama AS ppenerima', 't.cp AS cppenerima', 't.notelp AS telppenerima', 't.alamat AS alamatpenerima', 'ktp.nmkota AS kotapenerima', 'u.name AS pegawai')->leftJoin('konsumen AS k', 'k.idkonsumen', '=', 'resi.idkonsumen')->leftJoin('konsumen AS t', 't.idkonsumen', '=', 'resi.idpenerima')->leftJoin('kota AS ktk', 'ktk.idkota', '=', 'k.kota')->leftJoin('kota AS ktp', 'ktp.idkota', '=', 't.kota')->leftJoin('users AS u', 'u.id', '=', 'resi.user')->where('noresi', '=', $id)->first(); $dresi = \App\dresi::where('dresi.idresi', '=', $id)->leftJoin('satuan AS s', 's.idsatuan', '=', 'dresi.satuan')->select('dresi.*', 's.namasatuan')->get(); return view('laporan.dpenagihan')->with('header', $header)->with('dresis', $dresi); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $error = ''; /* $track = resi::select('resi.noresi','k.nama AS konsumen', 'ca.nama AS asal','ct.nama AS tujuan', 'b.tglberangkat',//'b.jamberangkat', 'b.tgltiba', 'b.nopolisi','ps.nama AS sopir','pk.nama AS kenek', 'u.name AS user', 'resi.status') ->leftJoin('konsumen as k','k.idkonsumen','=','resi.idkonsumen') ->leftJoin('berangkat as b','b.idberangkat','=','resi.idberangkat') ->leftJoin('cabang as ca','ca.idcabang','=','b.idasal') ->leftJoin('cabang as ct','ct.idcabang','=','b.idtujuan') ->leftJoin('pegawai as ps','ps.idpegawai','=','b.idsopir') ->leftJoin('pegawai as pk','pk.idpegawai','=','b.idkenek') ->leftJoin('users as u','u.id','=','resi.user') ->where('resi.noresi','=',Request::get('id'))->get(); //*/ $resi = resi::find(Request::get('id')); if (!$resi) { $error = new MessageBag(); $error->add('notfound', 'Maaf resi dengan nomer ' . Request::get('id') . ' tidak ditemukan'); return view('master')->with('track', true)->withErrors($error); } else { $data = resi::select('resi.idberangkat', 'resi.idrute', 'resi.noresi', 'tk.nama as prspengirim', 'tk.cp as cppengirim', 'rk.nama as prspenerima', 'rk.cp as cppenerima', 'tc.nama as cabangasal', 'rc.nama as cabangtujuan', 'berangkat.nopolisi', 'berangkat.supir1', 'berangkat.supir2', 'rute.tglbrkt', 'rute.tgltiba')->leftJoin('konsumen AS tk', 'tk.idkonsumen', '=', 'resi.idkonsumen')->leftJoin('konsumen AS rk', 'rk.idkonsumen', '=', 'resi.idpenerima')->leftJoin('rute', function ($join) { $join->on('rute.sjt', '=', 'resi.idberangkat'); $join->on('rute.id', '=', 'resi.idrute'); })->leftJoin('cabang AS tc', 'tc.idcabang', '=', 'rute.kotamuat')->leftJoin('cabang AS rc', 'rc.idcabang', '=', 'rute.kotabongkar')->leftJoin('berangkat', 'berangkat.idberangkat', '=', 'rute.sjt')->where('resi.noresi', Request::get('id'))->first(); $posisi = posisiarmada::where('sjt', $data->idberangkat)->where('id', $data->idrute)->get(); return view('master')->with('track', true)->with('data', $data)->with('posisi', $posisi); } //('errorstracking',$error); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $resi = resi::find($id); dd($resi->pengirim->nama); $dresi = $resi->detail; return view('world.dashboard.dresi')->with('resi', $resi); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $back = false; if (\Request::get('back')) { $back = true; } $resi = resi::find($id); return view('admin.transaction.resi-detail')->with('resi', $resi)->with('back', $back); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $berangkat = \App\berangkat::find($id); $data = []; $rute = \App\rute::where('sjt', '=', $id)->get(); $i = 0; foreach ($rute as $rt) { $resi = \App\resi::where('idberangkat', $rt->sjt)->where('idrute', $rt->id)->get(); $data[$i]['rute'] = $rt; $data[$i]['resi'] = $resi; $i++; } return view('admin.transaction.keberangkatan-detail')->with('berangkat', $berangkat)->with('data', $data); }
$table .= '<tbody>'; foreach ($resi as $r) { $table .= '<tr><td>' . $r->tglresi . '</td>'; $table .= '<td>' . $r->noresi . '</td>'; $table .= '<td>' . $r->totqty . '</td>'; $table .= '<td>' . $r->idkonsumen . '</td>'; $table .= '<td>' . $r->idpenerima . '</td>'; $table .= '<td>' . $r->totalbiaya . '</td>'; $table .= '<td>' . $r->dp . '</td>'; $table .= '<td>' . $r->sisa . '</td></tr>'; } $table .= '</tbody>'; $table .= '</table>'; return $table; }); Route::get('go', function () { return view('test.test1'); }); Route::get('go2/{id}', function ($id) { $berangkat = \App\berangkat::find($id); $data = []; $rute = \App\rute::where('sjt', '=', $id)->get(); $i = 0; foreach ($rute as $rt) { $resi = \App\resi::where('idberangkat', $rt->sjt)->where('idrute', $rt->id)->get(); $data[$i]['rute'] = $rt; $data[$i]['resi'] = $resi; $i++; } return view('test.test2')->with('data', $data)->with('berangkat', $berangkat); });
public function getNilaiMuatan($idberangkat, $idrute) { return \App\resi::where('idberangkat', $idberangkat)->where('idrute', $idrute)->sum('totalbiaya'); }
public function getJmlResi($sjt) { return \App\resi::where('idberangkat', $sjt)->count('noresi'); }