diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index 45f65abf..1831aca7 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -854,8 +854,6 @@ class MarhunController extends Controller ) ->get(); - - $arraygadai = $lelbidmarhuns->pluck('norujukan')->toArray(); $datagadai = $lelbidmarhuns; @@ -885,7 +883,7 @@ class MarhunController extends Controller // ->where('id', $lelbidmarhun->lelongbidmarhun_id) ->get(); - $totalhargaasas = $marhunsdet->sum('n_marhun'); + $totalhargaasas = $marhunsdet->sum('hargaasas'); $tothargaasas = bcdiv($totalhargaasas,1); // dd($totalhargaasas); // dd($totalhargaasas); @@ -918,6 +916,7 @@ class MarhunController extends Controller // ->first(); $lelong = Lelong::where('id',$id)->get(); + $sumcajlelong = $totalhargaasas * ($lelong[0]['cajlelong']/100); //$cajlelong = $cajlelong + bcdiv($sumcajlelong,1,1); $totalbaki = $totalhargaasas - $lelongbid->pinjaman - $lelongbid->bakiupah - bcdiv($sumcajlelong,1,1); @@ -939,6 +938,7 @@ class MarhunController extends Controller $marhuns[$index1]['bakiupah'] = $lelongbid->bakiupah; $marhuns[$index1]['baki_lelong'] = $bakilelong; $marhuns[$index1]['rugi_lelong'] = $rugilelong; + $marhuns[$index1]['cajlelong'] = bcdiv($sumcajlelong,1,1); } array_push($arraylelbidmarhun,$marhuns); @@ -1427,5 +1427,73 @@ class MarhunController extends Controller return redirect()->route('marhun.show', [$request->lelongbid_id, $request->lelong_id]) ->with('success', 'Gambar Berjaya Di Tukar.'); } + + public function cetakkeluarscanbarcode($lelong_id) + { + + + + $user = Auth::user(); + $caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first(); + + $lelongDetail = Lelong::where('id', '=', $lelong_id)->first(); + $lelongbid = LelongBid::where('lelong_id', '=', $lelong_id) + ->where('caw_id', '=', $caw->id) + ->get(); + + $senaraiScanKeluar = ScanSemak::where('lelong_id', '=', $lelong_id) + ->where('kodcaw', '=', $caw->caw_code) + ->whereNull('scan_masuk') + ->orderBy('id', 'desc') + ->get(); + + $senaraiScanMasuk = ScanSemak::where('lelong_id', '=', $lelong_id) + ->where('kodcaw', '=', $caw->caw_code) + ->whereNotNull('scan_masuk') + ->orderBy('id', 'desc') + ->get(); + + // return view('pdf.cetakkeluarscanbarcode', compact('lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar', 'senaraiScanMasuk','caw')); + $pdf = PDF::loadView('pdf.cetakkeluarscanbarcode',compact('caw','lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar', 'senaraiScanMasuk' + ))->setPaper('a4', 'potrait'); + + return $pdf->download('Senarai Keluar Peti Besi.pdf'); + + + } + + public function cetakmasukscanbarcode($lelong_id) + { + + + + $user = Auth::user(); + $caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first(); + + $lelongDetail = Lelong::where('id', '=', $lelong_id)->first(); + $lelongbid = LelongBid::where('lelong_id', '=', $lelong_id) + ->where('caw_id', '=', $caw->id) + ->get(); + + $senaraiScanKeluar = ScanSemak::where('lelong_id', '=', $lelong_id) + ->where('kodcaw', '=', $caw->caw_code) + ->whereNull('scan_masuk') + ->orderBy('id', 'desc') + ->get(); + + $senaraiScanMasuk = ScanSemak::where('lelong_id', '=', $lelong_id) + ->where('kodcaw', '=', $caw->caw_code) + ->whereNotNull('scan_masuk') + ->orderBy('id', 'desc') + ->get(); + + // return view('pdf.cetakmasukscanbarcode', compact('lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar', 'senaraiScanMasuk','caw')); + $pdf = PDF::loadView('pdf.cetakmasukscanbarcode',compact('caw','lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar', 'senaraiScanMasuk' + ))->setPaper('a4', 'potrait'); + + return $pdf->download('Senarai Masuk Peti Besi.pdf'); + + + } } diff --git a/resources/views/marhun/scanbarcode.blade.php b/resources/views/marhun/scanbarcode.blade.php index 5d6e9042..23d3bcd7 100644 --- a/resources/views/marhun/scanbarcode.blade.php +++ b/resources/views/marhun/scanbarcode.blade.php @@ -17,6 +17,7 @@ @endif Kembali +

Tarikh Lelong: @php $myDateTime = DateTime::createFromFormat('Y-m-d', $lelongDetail['tarikh_lelong'] ); @@ -66,12 +67,14 @@

@csrf +
Scan Barcode Marhun Yang Dibawa Keluar Dari Peti Besi
+
Laporan Keluar Peti Besi semasa
@@ -104,6 +107,7 @@ +
Laporan Masuk Peti Besi semasa
@@ -129,7 +133,9 @@ @endforeach +
+ diff --git a/resources/views/pdf/cetakkeluarscanbarcode.blade.php b/resources/views/pdf/cetakkeluarscanbarcode.blade.php new file mode 100644 index 00000000..fd5d6675 --- /dev/null +++ b/resources/views/pdf/cetakkeluarscanbarcode.blade.php @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + +

PERMODALAN KELANTAN BERHAD

LAPORAN MARHUN KELUAR PETI BESI
Cawangan: {{$caw['caw_name']}}
ID Lelong: {{$lelong_id}}
+ +
+ + + + + + + + + + + + @foreach ($senaraiScanKeluar as $index) + + + + + + + @endforeach + +
BilNo RujukanTarikh/Masa Scan KeluarStatus
{{$loop->iteration}}{{$index->norujukan}}{{$index->scan_keluar}}Berada Di Luar Peti Besi
+ + + + diff --git a/resources/views/pdf/cetakmasukscanbarcode.blade.php b/resources/views/pdf/cetakmasukscanbarcode.blade.php new file mode 100644 index 00000000..bd979638 --- /dev/null +++ b/resources/views/pdf/cetakmasukscanbarcode.blade.php @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + +

PERMODALAN KELANTAN BERHAD

LAPORAN MARHUN MASUK PETI BESI
Cawangan: {{$caw['caw_name']}}
ID Lelong: {{$lelong_id}}
+ +
+ + + + + + + + + + + + + + + @foreach ($senaraiScanMasuk as $index) + + + + + + + + + + @endforeach + +
BilNo RujukanStatusTarikh/Masa Scan KeluarTarikh/Masa Terima MarhunTarikh/Masa Serah MarhunTarikh/Masa Scan Masuk
{{$loop->iteration}}{{$index->norujukan}}{{$index->scan_keluar}}{{$index->terima_marhun}}{{$index->serah_marhun}}{{$index->scan_masuk}}Berada Di Dalam Peti Besi
+ + + + diff --git a/resources/views/pengesahan/mutumarhun.blade.php b/resources/views/pengesahan/mutumarhun.blade.php index 879e2b20..fbf1bcd1 100644 --- a/resources/views/pengesahan/mutumarhun.blade.php +++ b/resources/views/pengesahan/mutumarhun.blade.php @@ -28,6 +28,7 @@

Pembiayaan(RM) : {{ number_format($marhuns[0]['pembiayaan'], 2, '.', ',') }}

Keuntungan(RM) : {{ number_format($marhuns[0]['bakiupah'], 2, '.', ',') }}

+

Caj Lelong(RM) : {{ number_format($marhuns[0]['cajlelong'], 2, '.', ',') }}

Baki Lelong(RM) : {{ number_format($marhuns[0]['baki_lelong'], 2, '.', ',') }}

Rugi Lelong(RM) : {{ number_format($marhuns[0]['rugi_lelong'], 2, '.', ',') }}

@@ -98,15 +99,15 @@ {{ number_format($detail[0]['hargaasas'], 2, '.', ',') }} - @if($detail[0]['status_ubah'] == 1) + @if($detail[0]['status_ubah'] == '1') - @elseif($detail[0]['status_ubah'] == 2) + @elseif($detail[0]['status_ubah'] == '2') - @elseif($detail[0]['status_ubah'] == 3) + @elseif($detail[0]['status_ubah'] == '3') - @elseif($detail[0]['status_ubah'] == 4) + @elseif($detail[0]['status_ubah'] == '4') - @elseif($detail[0]['status_ubah'] == 5) + @elseif($detail[0]['status_ubah'] == '5') @else diff --git a/routes/web.php b/routes/web.php index cc22607e..f7898f8c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -264,6 +264,10 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::post('/addphotomarhun',['as'=>'marhun.addphotomarhun','uses'=>'MarhunController@addPhotoMarhun']); Route::post('/deletephotomarhun',['as'=>'marhun.deletephotomarhun','uses'=>'MarhunController@deletePhotoMarhun']); Route::post('/updatephotomarhun',['as'=>'marhun.updatephotomarhun','uses'=>'MarhunController@updatePhotoMarhun']); + + //khazanah + Route::get('/cetakkeluarscanbarcode/{lelong_id}',['as'=>'marhun.cetakkeluarscanbarcode','uses'=>'MarhunController@cetakkeluarscanbarcode']); + Route::get('/cetakmasukscanbarcode/{lelong_id}',['as'=>'marhun.cetakmasukscanbarcode','uses'=>'MarhunController@cetakmasukscanbarcode']); }); //Khazanah