diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index 88666520..dc63dbce 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -1930,5 +1930,76 @@ class MarhunController extends Controller return $pdf->download('Senarai SAG Telah Serah Kepada Pembida.pdf'); } + + public function senaraiscanbarcode(Request $request){ + + $auth_user = Auth::user(); + + $auth_user = ScanSemak::where('kodcaw','=',$auth_user['kodcaw'] ) + ->get(); + + return view('marhun.senaraiscanbarcode', compact('auth_user','auth_user')); + + } + + public function cetakscanbarcode(Request $request) + { + + $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]; + } + + $kodcaw = $auth_user['kodcaw']; + + $cawangan = Cawangan::where('caw_code','=',$kodcaw) + ->first(); + + if($request->jenis == 'keluar') + { + $scan=ScanSemak::where('kodcaw','=',$kodcaw) + ->where([['scan_keluar','>=',$request->datemula],['scan_keluar','<=',$request->datehingga]]) + ->get(); + + return view('pdf.laporanscankeluar', compact('scan','auth_user','tarikh_cetak','cawangan')); + + } + + else if($request->jenis == 'masuk'){ + + $scan=ScanSemak::where('kodcaw','=',$kodcaw) + ->where([['scan_masuk','>=',$request->datemula],['scan_masuk','<=',$request->datehingga]]) + ->get(); + // dd($scan); + + return view('pdf.laporanscanmasuk', compact('scan','auth_user','tarikh_cetak','cawangan')); + + } + + // else{ + // $scan=ScanJual::where('kodcaw','=',$kodcaw) + // ->where([['serah_marhun','>=',$request->datemula],['serah_marhun','<=',$request->datehingga]]) + // ->where('serahkpdpembida','=',1) + // ->get(); + + // return view('pdf.laporanscanserah', compact('scan','auth_user','tarikh_cetak','cawangan')); + + // } + + } } diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php index 77b51db9..9419b246 100644 --- a/resources/views/includes/sidebar.blade.php +++ b/resources/views/includes/sidebar.blade.php @@ -66,6 +66,9 @@
  • Scan Barcode Serahan Pembida
  • +
  • + Laporan Scan Barcode +
  • @endhasrole @hasrole('penilai')
  • diff --git a/resources/views/marhun/senaraiscanbarcode.blade.php b/resources/views/marhun/senaraiscanbarcode.blade.php new file mode 100644 index 00000000..fac0e08b --- /dev/null +++ b/resources/views/marhun/senaraiscanbarcode.blade.php @@ -0,0 +1,162 @@ +@extends('layouts.app') + + + + + +@section('content') +
    +
    +
    +
    + + +
    +
    +
    +

    Laporan Scan Barcode

    +
    + +
    +
    +
    + +
    +
    +
    +
    + @csrf +
    +
    + Mula +
    + +
    + Hingga +
    + + +
    + +
    +
    +

    +
    + +
    + + + SAG Keluar + + + SAG Masuk + + {{-- + SAG Serah --}} +
    + +
    + +
    + +
    +
    +
    +
    +
    + + +@endsection \ No newline at end of file diff --git a/resources/views/pdf/laporanscankeluar.blade.php b/resources/views/pdf/laporanscankeluar.blade.php new file mode 100644 index 00000000..0bc73c75 --- /dev/null +++ b/resources/views/pdf/laporanscankeluar.blade.php @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + +

    PERMODALAN KELANTAN BERHAD

    LAPORAN SCAN KELUAR BARCODE
    + + + +
    + + + + + +
    Cawangan : {{$cawangan->caw_name}} + + Tarikh Cetak:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak ); + $t_lelong = $myDateTime->format('d-m-Y'); + echo($t_lelong); + @endphp
    + +
    + + + + + + + + + + + + @foreach ($scan as $keluar) + + + + + + + + @endforeach + + +
    NoNo RujukanTarikh/Masa Scan Keluar
    {{ $loop->iteration }}{{ $keluar['norujukan'] }}{{ $keluar['scan_keluar'] }}
    + + + + + + + + + diff --git a/resources/views/pdf/laporanscanmasuk.blade.php b/resources/views/pdf/laporanscanmasuk.blade.php new file mode 100644 index 00000000..71565e9d --- /dev/null +++ b/resources/views/pdf/laporanscanmasuk.blade.php @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + +

    PERMODALAN KELANTAN BERHAD

    LAPORAN SCAN MASUK BARCODE
    + + + +
    + + + + + +
    Cawangan : {{$cawangan->caw_name}} + + Tarikh Cetak:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak ); + $t_lelong = $myDateTime->format('d-m-Y'); + echo($t_lelong); + @endphp
    + +
    + + + + + + + + + + + + @foreach ($scan as $masuk) + + + + + + + + @endforeach + + +
    NoNo RujukanTarikh/Masa Scan Masuk
    {{ $loop->iteration }}{{ $masuk['norujukan'] }}{{ $masuk['scan_masuk'] }}
    + + + + + + + + + diff --git a/routes/web.php b/routes/web.php index 49d6a175..27283cc7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -265,6 +265,9 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::get('/scanbarcodejual/{lelong_id}',['as'=>'marhun.scanbarcodejual','uses'=>'MarhunController@listScanBarcodejual']); Route::post('/scankeluarmarhunjual',['as'=>'marhun.scankeluarmarhunjual','uses'=>'MarhunController@scanKeluarMarhunjual']); Route::get('/cetakkeluarscanbarcodejual/{lelong_id}',['as'=>'marhun.cetakkeluarscanbarcodejual','uses'=>'MarhunController@cetakkeluarscanbarcodejual']); + Route::get('/senaraiscanbarcode',['as'=>'marhun.senaraiscanbarcode','uses'=>'MarhunController@senaraiscanbarcode']); + Route::post('/cetakscanbarcode',['as'=>'marhun.cetakscanbarcode','uses'=>'MarhunController@cetakscanbarcode']); + //Penilai Route::post('/addphotomarhun',['as'=>'marhun.addphotomarhun','uses'=>'MarhunController@addPhotoMarhun']);