laporan prestasi ar-rahn
This commit is contained in:
@@ -882,4 +882,46 @@ class AkaunController extends Controller
|
||||
return $pdf->download('laporan_aging_' . $request->kodcaw .'_'. $tebus_date . '.pdf');
|
||||
// return view('akaun.laporan_aging', compact('aging','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
}
|
||||
|
||||
public function cetakLaporanPrestasi(Request $request)
|
||||
{
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
if($request->datemula == null){
|
||||
$mula_date = '2017-01-01';
|
||||
}else{
|
||||
$split_date = explode('-', $request->datemula);
|
||||
// $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
$mula_date = $request->datemula;
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$hingga_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
// $hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
$hingga_date = $request->datehingga;
|
||||
}
|
||||
|
||||
$gadaiallcaw = Http::get(config('api.url'). '/api/laporanllcaw/gadai',['mula_date' => $mula_date,'hingga_date' => $hingga_date ])->json();
|
||||
|
||||
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$pdf = PDF::loadView('akaun.laporan_prestasi', compact('gadaiallcaw','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait');
|
||||
return $pdf->download('laporan_prestasi-'. $mula_date . '.pdf');
|
||||
}else{
|
||||
return view('akaun.laporan_prestasi', compact('gadaiallcaw','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user