Update range date for laporan penebusan
This commit is contained in:
@@ -353,7 +353,6 @@ class AkaunController extends Controller
|
||||
}
|
||||
|
||||
public function cetakLaporanPenebusan(Request $request){
|
||||
// dd($request);
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
@@ -387,7 +386,6 @@ class AkaunController extends Controller
|
||||
}
|
||||
|
||||
public function cetakLaporanAnsuran(Request $request){
|
||||
// dd($request);
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
@@ -461,7 +459,6 @@ class AkaunController extends Controller
|
||||
}
|
||||
|
||||
public function cetakLaporanPetiBesi(Request $request){
|
||||
// dd($request);
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
@@ -1605,5 +1602,85 @@ class AkaunController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function cetakLaporanAnsuranRangeDate(Request $request){
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
if($request->datetarikh == null){
|
||||
$tarikh_mula = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datetarikh);
|
||||
$tarikh_mula = $request->datetarikh;
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$tarikh_akhir = $current->toDateString();
|
||||
}else{
|
||||
$split_date2 = explode('-',$request->datehingga);
|
||||
$tarikh_akhir = $request->datehingga;
|
||||
}
|
||||
|
||||
$tebus = Http::get($request->hostname. '/api/ansuranujrahByCaw/laporan/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json();
|
||||
$cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$pdf = PDF::loadView('akaun.laporan_ansuran', compact('tebus','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait');
|
||||
return $pdf->download('laporan_ansuran_' . $request->kodcaw .'_'. $tarikh_mula .'-'. $tarikh_akhir .'.pdf');
|
||||
|
||||
}else{
|
||||
return view('akaun.laporan_ansuran', compact('tebus','cawangan_detail','tarikh_cetak','api_url','tarikh_mula','tarikh_akhir'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function cetakLaporanPenebusanRangeDate(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 = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datemula);
|
||||
$mula_date = $request->datemula;
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$hingga_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date2 = explode('-',$request->datehingga);
|
||||
$hingga_date = $request->datehingga;
|
||||
}
|
||||
|
||||
$tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/tebusujrah/laporan/'. $request->kodcaw,['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
$tebuspengasingan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/tebus/laporanjenistawarruqujrah/'.$request->kodcaw,['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
$upahlama = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/advansurdetailsrange/'. $request->kodcaw,['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
$ansuran = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/ansuransummaryrange/'. $request->kodcaw,['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
|
||||
$cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$pdf = PDF::loadView('akaun.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','tebuspengasingan','api_url','upahlama','ansuran'));
|
||||
return $pdf->download('laporan_penebusan_' . $request->kodcaw .'_'. $mula_date .'-'. $hingga_date .'.pdf');
|
||||
}else{
|
||||
return view('akaun.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','tebuspengasingan','api_url','upahlama','ansuran'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user