diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index e3dab427..e15a2510 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -620,6 +620,7 @@ class LelongController extends Controller $lelongbidmarhun->bil = $simbidmarhun->bil; $lelongbidmarhun->marhun = $simbidmarhun->marhun; $lelongbidmarhun->nota = $simbidmarhun->nota; + $lelongbidmarhun->old_marhun = $simbidmarhun->marhun; $lelongbidmarhun->old_karat = $simbidmarhun->karat; $lelongbidmarhun->old_berat = $simbidmarhun->berat; $lelongbidmarhun->old_harga = $simbidmarhun->harga; diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index e475e46f..e9b7b021 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -1730,10 +1730,11 @@ class MarhunController extends Controller $user = Auth::user(); - $cawangan = Pengesahan::join('users', 'pengesahan.diminta_oleh', 'users.id') - ->where('pengesahan.lelong_id', $id) + $cawangan = Pengesahan::where('pengesahan.lelong_id', $id) + ->where('pengesahan.status', 1) ->whereNotNull('pengesahan.disahkan_oleh') - ->select('pengesahan.diminta_oleh','pengesahan.disahkan_oleh', 'pengesahan.disahkan_pada', 'pengesahan.norujukan', 'pengesahan.lelong_id', 'users.id as user_id', 'users.name', 'users.username', 'users.kodcaw') + ->select('pengesahan.lelongbid_id','pengesahan.diminta_oleh','pengesahan.disahkan_oleh', 'pengesahan.disahkan_pada', 'pengesahan.norujukan', 'pengesahan.lelong_id') + ->orderBy('pengesahan.lelongbid_id') ->distinct() ->get(); // dd($cawangan); @@ -1741,6 +1742,7 @@ class MarhunController extends Controller foreach($cawangan as $index1=>$caw) { // dd($caw); + $getpengesahan = Cawangan::where('caw_code', $caw['kodcaw'])->first(); // dd($getpengesahan); @@ -1748,9 +1750,22 @@ class MarhunController extends Controller $getdimintaoleh = User::where('id', $caw['diminta_oleh'])->first(); // dd($getdisahkanoleh); - $cawangan[$index1]['namacaw'] = $getpengesahan['caw_name']; + // dd(/$caw['lelongbid_id']); + $status = Pengesahan::where('lelongbid_id', $caw['lelongbid_id']) + ->select('id as sahid','status_ubah', 'request_karat', 'request_berat', 'request_marhun') + ->get(); + // dump($status); + + // $marhun= LelongBidMarhun::where('lelongbid_id','=',$caw['lelongbid_id']) + // ->get(); + $marhuns = LelongBidMarhun::where('lelongbid_id', $caw['lelongbid_id']) + ->get()->toArray(); + // dd($marhuns); + // $cawangan[$index1]['namacaw'] = $getpengesahan['caw_name']; $cawangan[$index1]['disahkan_oleh'] = $getdisahkanoleh['name']; $cawangan[$index1]['diminta_oleh'] = $getdimintaoleh['name']; + $cawangan[$index1]['detailmarhun']=$status; + $cawangan[$index1]['detail']=$marhuns; } return view('pengesahan.listperubahanmutumarhun', compact('cawangan', 'id')); @@ -2386,5 +2401,7 @@ class MarhunController extends Controller } + + } diff --git a/database/migrations/2021_12_14_041557_create_lelongs_table.php b/database/migrations/2021_12_14_041557_create_lelongs_table.php index 82311997..1dc55c27 100644 --- a/database/migrations/2021_12_14_041557_create_lelongs_table.php +++ b/database/migrations/2021_12_14_041557_create_lelongs_table.php @@ -123,7 +123,8 @@ class CreateLelongsTable extends Migration $table->bigIncrements('id'); $table->unsignedBigInteger('lelongbid_id')->unsigned(); $table->decimal('bil', $precision = 3, $scale = 0); - $table->string('marhun'); + $table->string('old_marhun'); + $table->string('marhun'); $table->string('nota')->nullable(); $table->string('old_karat'); $table->string('karat'); diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index 7de5f10b..66dd01ff 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -169,11 +169,11 @@ @elseif($status['status'] == 1) @else - + + @endif {{-- --}} @elseif($lelongbid->status_semak == 1) diff --git a/resources/views/pengesahan/listperubahanmutumarhun.blade.php b/resources/views/pengesahan/listperubahanmutumarhun.blade.php index 4016aaac..cde3c494 100644 --- a/resources/views/pengesahan/listperubahanmutumarhun.blade.php +++ b/resources/views/pengesahan/listperubahanmutumarhun.blade.php @@ -13,40 +13,104 @@ Senarai SAG: Pengesahan Oleh PC +
@if ($message = Session::get('success'))

{{ $message }}

@endif - +
- - + {{-- --}} + {{-- --}} + + + + + + + - - + {{-- + --}} - @foreach($cawangan as $marhun) + {{-- @foreach($cawangan as $marhun) --}} + @forelse($cawangan as $marhun) - - + {{-- --}} + {{-- --}} - - + {{-- {{dd($marhun['detailmarhun'])}} --}} + + + + + + + + + + {{-- --}} + {{-- --}} - @endforeach + @empty + + + + + @endforelse
BilID LelongCawanganID LelongCawanganNo RujukanPerubahanMarhun AsalMarhun BaruMutu AsalMutu BaruBerat Asal (gm)Berat Baru (gm) StatusDiminta OlehDisahkan OlehDiminta OlehDisahkan Oleh
{{ $loop->iteration }}{{ $marhun['lelong_id'] }}{{ $marhun['namacaw'] }}{{ $marhun['lelong_id'] }}{{ $marhun['namacaw'] }}{{ $marhun['norujukan'] }} - - {{ $marhun['diminta_oleh'] }}{{ $marhun['disahkan_oleh'] }}@foreach ($marhun['detailmarhun'] as $item) + @if($item['status_ubah'] == 1) + Mutu + @elseif($item['status_ubah'] == 2) + Pertambahan Marhun + @elseif($item['status_ubah'] == 3) + Hapus Marhun + @elseif($item['status_ubah'] == 4) + Berat + @elseif($item['status_ubah'] == 5) + Mutu & Berat + @elseif($item['status_ubah'] == 7) + Marhun + @elseif($item['status_ubah'] == 8) + Mutu, Berat & Marhun + @elseif($item['status_ubah'] == 9) + Mutu & Marhun + @elseif($item['status_ubah'] == 10) + Berat & Marhun + @endif +
+ @endforeach
@foreach ($marhun['detail'] as $item) + {{$item['old_marhun']}}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + @if($item['request_marhun'] == null) + @else + + @endif {{$item['request_marhun']}}
+ @endforeach
@foreach ($marhun['detail'] as $item) + {{$item['old_karat']}}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + @if($item['request_karat'] == null) + @else + + @endif{{$item['request_karat']}}
+ @endforeach
@foreach ($marhun['detail'] as $item) + {{$item['old_berat']}}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + @if($item['request_berat'] == null) + @else + + @endif{{$item['request_berat']}}
+ @endforeach
{{ $marhun['diminta_oleh'] }}{{ $marhun['disahkan_oleh'] }}
No Data