fix penebusan & gadaian range

This commit is contained in:
fifi97
2021-06-07 19:48:38 +08:00
parent c78e125a6f
commit c0b1bfa09e
6 changed files with 273 additions and 73 deletions
+54 -16
View File
@@ -2770,17 +2770,38 @@ class KhazanahController extends Controller
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datetimepicker1 == null){
$gadai_date = $current->toDateString();
// dd($request->all());
if($request->datemula == null){
$split_date = explode('-', $request->datehingga);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}else{
$split_date = explode('-',$request->datetimepicker1);
$gadai_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
$split_date = explode('-', $request->datemula);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$gadai = Http::get(config('api.url'). '/api/gadai/laporan/'. $auth_user['cawangan'] .'/'. $gadai_date)->json();
if($request->datehingga == null){
$hingga_date = $request->datemula;
}else{
$split_date = explode('-', $request->datehingga);
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
if($request->datemula == null && $request->datehingga == null)
{
$mula_date = $current->toDateString();
$hingga_date = $current->toDateString();
}
// $gadai = Http::get(config('api.url'). '/api/gadai/laporan/'. $auth_user['cawangan'] .'/'. $gadai_date)->json();
$gadai = Http::get(config('api.url'). '/api/gadailaporanRange/'. $auth_user['cawangan'],['mula' => $mula_date, 'akhir' => $hingga_date])->json();
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
// dd($gadai);
return view('print.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','gadai_date','api_url'));
return view('print.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
}
public function laporanPenebusan(){
@@ -2797,20 +2818,37 @@ class KhazanahController extends Controller
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datetimepicker1 == null){
$tebus_date = $current->toDateString();
if($request->datemula == null){
$split_date = explode('-', $request->datehingga);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}else{
$split_date = explode('-',$request->datetimepicker1);
$tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
$split_date = explode('-', $request->datemula);
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$tebus = Http::get(config('api.url'). '/api/tebus/laporan/'. $auth_user['cawangan'] .'/'. $tebus_date)->json();
$tebuspengasingan = Http::get(config('api.url'). '/api/tebus/laporanjenistawarruq/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
$upahlama = Http::get(config('api.url'). '/api/advansurdetails/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
if($request->datehingga == null){
$hingga_date = $request->datemula;
}else{
$split_date = explode('-', $request->datehingga);
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
if($request->datemula == null && $request->datehingga == null)
{
$mula_date = $current->toDateString();
$hingga_date = $current->toDateString();
}
$tebus = Http::get(config('api.url'). '/api/tebuslaporanRange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
$tebuspengasingan = Http::get(config('api.url'). '/api/tebuslaporanjenistawarruqrange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
$upahlama = Http::get(config('api.url'). '/api/advansurdetailsrange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
// dd($gadai);
return view('print.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','tebus_date','tebuspengasingan','api_url','upahlama'));
return view('print.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','tebuspengasingan','api_url','upahlama'));
}
public function laporanLelongan(){
@@ -3332,11 +3370,11 @@ class KhazanahController extends Controller
'akhir' => $hingga_date
])->json();
dd($laporan_ringkasan);
$laporan_ringkasan = $laporan_ringkasan[0];
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
// dd($gadai);
return view('print.laporan_ringkasanterkumpulv2', compact('laporan_ringkasan','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
}