fix laporan lagi
This commit is contained in:
@@ -3192,6 +3192,15 @@ class KhazanahController extends Controller
|
||||
return view('khazanah.laporan.ringkasanharian',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
public function laporanRingkasanTerkumpul(){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
return view('khazanah.laporan.ringkasanterkumpul',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
public function cetakLaporanRingkasanHarian(Request $request){
|
||||
|
||||
$api_url = config('api.url');
|
||||
@@ -3271,6 +3280,30 @@ class KhazanahController extends Controller
|
||||
return view('print.laporan_ringkasanharian', compact('cawangan_detail','tarikh_cetak','ringkasan_date','api_url','laporan','totalbilkawalanstok','totalpinjkawalanstok'));
|
||||
}
|
||||
|
||||
// public function cetakLaporanRingkasanTerkumpul(Request $request){
|
||||
// // dd($request);
|
||||
// $api_url = config('api.url');
|
||||
// $auth_user = Auth::user();
|
||||
// $current = Carbon::now();
|
||||
// $current = new Carbon();
|
||||
// $tarikh_cetak = $current->toDateString();
|
||||
// if($request->datetimepicker1 == null){
|
||||
// $tebus_date = $current->toDateString();
|
||||
// }else{
|
||||
// $split_date = explode('-',$request->datetimepicker1);
|
||||
// $tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
// }
|
||||
// $marhun = Http::get(config('api.url'). '/api/gadai/laporan/ringkasan/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
|
||||
// $marhun = $marhun[0];
|
||||
|
||||
// $keseluruhanupahsimpan = $marhun['lelongupahsimpan'] + $marhun['tebus'][0]['upahsimpan'] + $marhun['advansur'][0]['upahsimpan'];
|
||||
|
||||
// $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
// $cawangan_detail=$cawangan[0];
|
||||
// // dd($gadai);
|
||||
// return view('print.laporan_ringkasanterkumpul', compact('keseluruhanupahsimpan','marhun','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
// }
|
||||
|
||||
public function cetakLaporanRingkasanTerkumpul(Request $request){
|
||||
// dd($request);
|
||||
$api_url = config('api.url');
|
||||
@@ -3278,21 +3311,31 @@ class KhazanahController extends Controller
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
if($request->datetimepicker1 == null){
|
||||
$tebus_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datetimepicker1);
|
||||
$tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
$marhun = Http::get(config('api.url'). '/api/gadai/laporan/ringkasan/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
|
||||
$marhun = $marhun[0];
|
||||
|
||||
$keseluruhanupahsimpan = $marhun['lelongupahsimpan'] + $marhun['tebus'][0]['upahsimpan'] + $marhun['advansur'][0]['upahsimpan'];
|
||||
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];
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
$laporan_ringkasan = Http::get(config('api.url') . '/api/laporan/harian',[
|
||||
'kodcaw' => $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_ringkasanterkumpul', compact('keseluruhanupahsimpan','marhun','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
return view('print.laporan_ringkasanterkumpulv2', compact('laporan_ringkasan','cawangan_detail','tarikh_cetak','hingga_date','api_url'));
|
||||
}
|
||||
|
||||
public function laporanKawalanStok(){
|
||||
@@ -4517,4 +4560,56 @@ class KhazanahController extends Controller
|
||||
return view('print.suratgadaianhilang', compact('polis','gadai','customers','cawangan_detail','api_url'));
|
||||
}
|
||||
|
||||
public function PemilihanAnsUpah()
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
|
||||
return view('khazanah.laporan.ansuranupah', compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
public function LaporanUpah()
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
|
||||
return view('khazanah.laporan.upah', compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
public function cetaklaporan_Upah(Request $request)
|
||||
{
|
||||
$api_url = config('api.url');
|
||||
$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];
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
$advansur = Http::get(config('api.url'). '/api/AnsuranByRangeTarikh/' . $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];
|
||||
|
||||
return view('print.laporan_upah', compact('advansur','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user