diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index c4b54edb..b4145503 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -19,10 +19,9 @@ use App\Models\LelongBid; use App\Models\LelongBidMarhun; use App\Models\LelKarat; use App\Models\LelKarat_temp; - use App\Models\Pengesahan; use App\Models\GadaiMarhun; -use App\Models\ScanMarhun; +use App\Models\ScanSemak; use App\Models\TangguhLelong; use Carbon\Carbon; @@ -1212,20 +1211,21 @@ class MarhunController extends Controller $user = Auth::user(); $caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first(); - $senaraiScanKeluar = ScanMarhun::where('kodcaw', '=', $caw->caw_code) + $senaraiScanKeluar = ScanSemak::where('kodcaw', '=', $caw->caw_code) ->where('lelong_id', $lelong_id) - ->whereNull('masa_terima') + ->whereNull('terima_marhun') ->orderBy('id', 'desc') ->get(); - $sedangDinilai = ScanMarhun::where('kodcaw', '=', $caw->caw_code) - ->whereNull('masa_serah') + $sedangDinilai = ScanSemak::where('kodcaw', '=', $caw->caw_code) + ->whereNotNull('terima_marhun') + ->whereNull('serah_marhun') ->where('lelong_id', $lelong_id) ->orderBy('id', 'desc') ->get(); - $sudahSerah = ScanMarhun::where('kodcaw', '=', $caw->caw_code) - ->whereNotNull('masa_serah') + $sudahSerah = ScanSemak::where('kodcaw', '=', $caw->caw_code) + ->whereNotNull('serah_marhun') ->where('lelong_id', $lelong_id) ->orderBy('id', 'desc') ->get(); @@ -1243,9 +1243,9 @@ class MarhunController extends Controller $current = Carbon::now(); foreach ($request->scanKeluar_id as $index) { - $terimaMarhun = ScanMarhun::where('id', '=', $index)->first(); + $terimaMarhun = ScanSemak::where('id', '=', $index)->first(); $terimaMarhun->penilai_id = $user->id; - $terimaMarhun->masa_terima = $current->toTimeString(); + $terimaMarhun->terima_marhun = $current->toDateTimeString(); $terimaMarhun->update(); } return redirect()->route('marhun.terimaserahmarhun', $terimaMarhun->lelong_id)->with('success', 'Terima Marhun Berjaya Direkodkan'); @@ -1257,8 +1257,8 @@ class MarhunController extends Controller $current = Carbon::now(); foreach ($request->sedangDinilai_id as $index) { - $serahMarhun = ScanMarhun::where('id', '=', $index)->first(); - $serahMarhun->masa_serah = $current->toTimeString(); + $serahMarhun = ScanSemak::where('id', '=', $index)->first(); + $serahMarhun->serah_marhun = $current->toDateTimeString(); $serahMarhun->update(); } return redirect()->route('marhun.terimaserahmarhun', $serahMarhun->lelong_id)->with('success', 'Serah Marhun Berjaya Direkodkan'); @@ -1274,15 +1274,15 @@ class MarhunController extends Controller ->where('caw_id', '=', $caw->id) ->get(); - $senaraiScanKeluar = ScanMarhun::where('lelong_id', '=', $lelong_id) + $senaraiScanKeluar = ScanSemak::where('lelong_id', '=', $lelong_id) ->where('kodcaw', '=', $caw->caw_code) - ->whereNull('masa_scanmasuk') + ->whereNull('scan_masuk') ->orderBy('id', 'desc') ->get(); - $senaraiScanMasuk = ScanMarhun::where('lelong_id', '=', $lelong_id) + $senaraiScanMasuk = ScanSemak::where('lelong_id', '=', $lelong_id) ->where('kodcaw', '=', $caw->caw_code) - ->whereNotNull('masa_scanmasuk') + ->whereNotNull('scan_masuk') ->orderBy('id', 'desc') ->get(); @@ -1295,21 +1295,20 @@ class MarhunController extends Controller $user = Auth::user(); $current = Carbon::now(); - $checkExisting = ScanMarhun::where('norujukan', '=', $request->norujukan_barcode) - ->whereNull('masa_scanmasuk') + $checkExisting = ScanSemak::where('norujukan', '=', $request->norujukan_barcode) + ->whereNull('scan_masuk') ->get(); if ($checkExisting->isEmpty()) { $lelongbidItem = LelongBid::where('norujukan', '=', $request->norujukan_barcode)->first(); - $scanKeluar = new ScanMarhun; + $scanKeluar = new ScanSemak(); $scanKeluar->kodcaw = $lelongbidItem['kodcaw']; $scanKeluar->lelong_id = $lelongbidItem['lelong_id']; $scanKeluar->lelongbid_id = $lelongbidItem['id']; $scanKeluar->norujukan = $lelongbidItem['norujukan']; $scanKeluar->khazanah_id = $user['id']; - $scanKeluar->tarikh_scankeluar = $current->toDateString(); - $scanKeluar->masa_scankeluar = $current->toTimeString(); + $scanKeluar->scan_keluar = $current->toDateTimeString(); $scanKeluar->save(); return redirect()->route('marhun.scanbarcode', $request->lelong_id) @@ -1325,19 +1324,18 @@ class MarhunController extends Controller $user = Auth::user(); $current = Carbon::now(); - $scanMasuk = ScanMarhun::where('norujukan', '=', $request->norujukan_barcode) - ->whereNull('masa_scanmasuk') + $scanMasuk = ScanSemak::where('norujukan', '=', $request->norujukan_barcode) + ->whereNotNull('serah_marhun') ->first(); if ($scanMasuk) { - $scanMasuk->tarikh_scanmasuk = $current->toDateString(); - $scanMasuk->masa_scanmasuk = $current->toTimeString(); + $scanMasuk->scan_masuk = $current->toDateTimeString(); $scanMasuk->update(); return redirect()->route('marhun.scanbarcode', $request->lelong_id) ->with('success', 'Marhun Berjaya Di Scan Masuk Ke Peti Besi.'); } else { return redirect()->route('marhun.scanbarcode', $request->lelong_id) - ->with('failed', 'Marhun Gagal Di Scan Masuk Ke Peti Besi.'); + ->with('failed', 'Gagal Scan, Marhun Belum Diserah Oleh Penilai.'); } } diff --git a/app/Models/ScanSemak.php b/app/Models/ScanSemak.php new file mode 100644 index 00000000..8eb1ec51 --- /dev/null +++ b/app/Models/ScanSemak.php @@ -0,0 +1,26 @@ +integer('status')->default(0); //1 = terima, 2 = tangguh lelong $table->integer('status_ubah')->default(0); //1 = ubah mutu, 2 = tambah marhun, 3 = hapus marhun, 4 = ubah berat, 5 = ubah mutu & berat, 6 = tangguh lelong pc $table->timestamps(); - - // $table->foreign('lelong_id') - // ->references('id')->on('lelong') - // ->onDelete('cascade'); - - // $table->foreign('lelongbid_id') - // ->references('id')->on('lelongbid') - // ->onDelete('cascade'); - - // $table->foreign('lelongbidmarhun_id') - // ->references('id')->on('lelongbidmarhun') - // ->onDelete('cascade'); - }); - Schema::create('scanmarhun', function (Blueprint $table) { + Schema::create('scan_semak', function (Blueprint $table) { $table->id(); $table->string('kodcaw'); $table->unsignedBigInteger('lelong_id')->unsigned(); $table->integer('lelongbid_id'); $table->string('norujukan'); $table->string('khazanah_id', '100'); - $table->date('tarikh_scankeluar'); - $table->time('masa_scankeluar'); $table->string('penilai_id', '100')->nullable(); - $table->time('masa_terima')->nullable(); - $table->time('masa_serah')->nullable(); - $table->date('tarikh_scanmasuk')->nullable(); - $table->time('masa_scanmasuk')->nullable(); + $table->datetime('scan_keluar'); + $table->datetime('terima_marhun')->nullable(); + $table->datetime('serah_marhun')->nullable(); + $table->datetime('scan_masuk')->nullable(); + $table->timestamps(); + }); + + Schema::create('scan_jual', function (Blueprint $table) { + $table->id(); $table->timestamps(); }); @@ -69,5 +59,7 @@ class CreatePengesahanTable extends Migration public function down() { Schema::dropIfExists('pengesahan'); + Schema::dropIfExists('scan_semak'); + Schema::dropIfExists('scan_jual'); } } diff --git a/resources/views/marhun/scanbarcode.blade.php b/resources/views/marhun/scanbarcode.blade.php index cea84c74..5d6e9042 100644 --- a/resources/views/marhun/scanbarcode.blade.php +++ b/resources/views/marhun/scanbarcode.blade.php @@ -38,30 +38,28 @@
-
- - - - - - - - - - - - @foreach($lelongbid as $index) - - - - - - - - @endforeach - -
BilNo RujukanMarhunN. MarhunBerat
{{$loop->iteration}}{{$index->norujukan}}{{$index->marhun}}{{ number_format($index->nilaimarhun, 2, '.', ',')}}{{$index->berat}}
-
+ + + + + + + + + + + + @foreach($lelongbid as $index) + + + + + + + + @endforeach + +
BilNo RujukanMarhunN. MarhunBerat
{{$loop->iteration}}{{$index->norujukan}}{{$index->marhun}}{{ number_format($index->nilaimarhun, 2, '.', ',')}}{{$index->berat}}
@@ -74,30 +72,26 @@
-
- - - - - - - - - - - - @foreach ($senaraiScanKeluar as $index) - - - - - - - - @endforeach - -
BilNo RujukanStatusTarikh Scan KeluarMasa Scan Keluar
{{$loop->iteration}}{{$index->norujukan}}Berada Di Luar Peti Besi{{$index->tarikh_scankeluar}}{{$index->masa_scankeluar}}
-
+ + + + + + + + + + + @foreach ($senaraiScanKeluar as $index) + + + + + + + @endforeach + +
BilNo RujukanTarikh/Masa Scan KeluarStatus
{{$loop->iteration}}{{$index->norujukan}}{{$index->scan_keluar}}Berada Di Luar Peti Besi
@@ -110,34 +104,32 @@
-
- - - - - - - - - - - - - - @foreach ($senaraiScanMasuk as $index) - - - - - - - - - - @endforeach - -
BilNo RujukanStatusTarikh Scan KeluarMasa Scan KeluarTarikh Scan MasukMasa Scan Masuk
{{$loop->iteration}}{{$index->norujukan}}Berada Di Dalam Peti Besi{{$index->tarikh_scankeluar}}{{$index->masa_scankeluar}}{{$index->tarikh_scanmasuk}}{{$index->masa_scanmasuk}}
-
+ + + + + + + + + + + + + + @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/marhun/terimaserahmarhun.blade.php b/resources/views/marhun/terimaserahmarhun.blade.php index 892560c5..483d260f 100644 --- a/resources/views/marhun/terimaserahmarhun.blade.php +++ b/resources/views/marhun/terimaserahmarhun.blade.php @@ -38,8 +38,7 @@ Bil No Rujukan - Tarikh Scan Keluar - Masa Scan Keluar + Tarikh/Masa Scan Keluar Status @@ -49,8 +48,7 @@ {{$loop->iteration}} {{$index->norujukan}} - {{$index->tarikh_scankeluar}} - {{$index->masa_scankeluar}} + {{$index->scan_keluar}} Belum Terima @endforeach @@ -71,7 +69,8 @@ Bil No Rujukan - Masa Terima + Tarikh/Masa Scan Keluar + Tarikh/Masa Terima Marhun Status @@ -81,7 +80,8 @@ {{$loop->iteration}} {{$index->norujukan}} - {{$index->masa_terima}} + {{$index->scan_keluar}} + {{$index->terima_marhun}} Sedang Dinilai @endforeach @@ -99,8 +99,9 @@ Bil No Rujukan - Masa Terima - Masa Serah + Tarikh/Masa Scan Keluar + Tarikh/Masa Terima Marhun + Tarikh/Masa Serah Marhun Status @@ -109,8 +110,9 @@ {{$loop->iteration}} {{$index->norujukan}} - {{$index->masa_terima}} - {{$index->masa_serah}} + {{$index->scan_keluar}} + {{$index->terima_marhun}} + {{$index->serah_marhun}} Sudah Serah @endforeach