fix laporan petibesi
This commit is contained in:
@@ -748,6 +748,45 @@ class AkaunController extends Controller
|
||||
return view('akaun.laporan_ringkasanterkumpul', compact('laporan_ringkasan','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
}
|
||||
|
||||
public function cetakPetiBesi(Request $request){
|
||||
|
||||
$api_url = $request->hostname;
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
if($request->datetarikh == null){
|
||||
$tebus_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datetarikh);
|
||||
$tebus_date = $request->datetarikh;
|
||||
}
|
||||
|
||||
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$petibesi = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/laporanpetibesi/'. $request->kodcaw .'/'. $tebus_date)->json();
|
||||
|
||||
if(!$petibesi)
|
||||
{
|
||||
return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.');
|
||||
}
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$pdf = PDF::loadView('akaun.laporan_petibesi', compact('petibesi','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait');
|
||||
return $pdf->download('laporan_petibesi' . $request->kodcaw .'_'. $tebus_date . '.pdf');
|
||||
}else{
|
||||
return view('akaun.laporan_petibesi', compact('petibesi','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function cetakLaporanStokAuditBackdate(Request $request){
|
||||
|
||||
$api_url = $request->hostname;
|
||||
|
||||
Reference in New Issue
Block a user