laporan backdate update

This commit is contained in:
Amirah22
2022-10-30 10:18:50 +08:00
parent 72febb9dc4
commit fda7db5f1c
4 changed files with 350 additions and 2 deletions
+40 -1
View File
@@ -961,9 +961,48 @@ class ReportController extends Controller
public function bdbrglelong (){
return view('laporan.bdbrglelong');
$caw = Cawangan::all();
return view('laporan.bdbrglelong',compact('caw'));
}
public function cetakbdbrglelong (Request $request){
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
$arraydetails = [];
$cawangan_id = $request->caw;
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];
}
$cawangan = Cawangan::where('cawangan.id',$cawangan_id)
->join('cawangan_lelong','cawangan.id','=','cawangan_lelong.caw_id')
->join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('lelongbid','cawangan.caw_code','=','lelongbid.kodcaw')
->where([['tarikh_lelong','>=',$request->datemula],['tarikh_lelong','<=',$request->datehingga]])
->get()->toArray();
return view('pdf.cetakbdbrglelong',compact('cawangan'));
}