combine laporan stokaudit (aktif dan tak aktif)
This commit is contained in:
@@ -1502,4 +1502,39 @@ class AkaunController extends Controller
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public function cetaklaporan_stokaudit_combine(Request $request){
|
||||
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
if($request->datetimepicker1 == null){
|
||||
$tebus_date = $current->toDateString();
|
||||
}else{
|
||||
$tebus_date = $request->datetimepicker1;
|
||||
}
|
||||
|
||||
$cawangan=Http::get($api_url.'/api/cawangan/detail/'.$request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
|
||||
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
|
||||
$pdf = PDF::loadView('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait');
|
||||
return $pdf->download('laporan_stokaudit_' . $request->kodcaw .'_'. $tebus_date . '.pdf');
|
||||
}
|
||||
else{
|
||||
|
||||
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
|
||||
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
|
||||
return view('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user