diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index 0d9502d0..0fc0e9ae 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -22,6 +22,7 @@ use App\Models\LelKarat; use App\Models\LelKarat_temp; use App\Models\Pengesahan; use App\Models\GadaiMarhun; +use App\Models\LelongBidder; use App\Models\ScanSemak; use App\Models\TangguhLelong; use Carbon\Carbon; @@ -2058,6 +2059,22 @@ class MarhunController extends Controller public function listScanBarcodejual($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('status_payment', '=', '1') + // ->where('caw_id', '=', $caw->id) + // ->get(); + + // $senaraiScanKeluar = ScanSemak::where('lelong_id', '=', $lelong_id) + // ->where('kodcaw', '=', $caw->caw_code) + // ->where('serahkpdpembida', '=', '1') + // ->orderBy('id', 'desc') + // ->get(); + // dd($senaraiScanKeluar); + $user = Auth::user(); $caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first(); @@ -2065,16 +2082,36 @@ class MarhunController extends Controller $lelongbid = LelongBid::where('lelong_id', '=', $lelong_id) ->where('status_payment', '=', '1') ->where('caw_id', '=', $caw->id) + ->select('id') + ->get() + ->keyBy('id'); + foreach ($lelongbid as $index => $value) { + $namabidder = LelongBidder:: + where('lelongbid_id', '=', $value['id']) + // ->where('lelongbid.kodcaw', '=', $user->kodcaw) + ->where('lelongbidder.status_bidder','=','1') + ->select('lelongbidder.lelongbid_id','lelongbidder.nama_bidder') ->get(); - + // dump($namabidder); + $lelongbid[$index]['nama_bidder'] = $namabidder; + } + // dd($namabidder); $senaraiScanKeluar = ScanSemak::where('lelong_id', '=', $lelong_id) ->where('kodcaw', '=', $caw->caw_code) ->where('serahkpdpembida', '=', '1') - ->orderBy('id', 'desc') + // ->whereNull('scan_masuk') ->get(); - // dd($senaraiScanKeluar); - return view('marhun.scanbarcodejual', compact('lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar')); + $pluckLelongBid = $lelongbid->pluck('id')->toArray(); + $pluckScanKeluar = $senaraiScanKeluar->pluck('lelongbid_id')->toArray(); + $diff_lelong_bid = array_diff($pluckLelongBid, $pluckScanKeluar); + + $new_lelong_bid = LelongBid::with('scanSemakSelesaiJual') + ->whereIn('id', $diff_lelong_bid) + ->get(); + // dd($new_lelong_bid); + + return view('marhun.scanbarcodejual', compact('namabidder','new_lelong_bid','lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar')); } public function scanKeluarMarhunjual(Request $request) { @@ -2280,6 +2317,57 @@ class MarhunController extends Controller return $this->marhunPhotoService->show($request->lelong_id, $marhun); } + public function exportmarhundetailspembida($lelong_id) + { + $user = Auth::user(); + //dd($user); + $lelongs = LelongBid::join('lelongbidder', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id') + ->where('lelongbid.lelong_id', '=', $lelong_id) + ->where('lelongbid.kodcaw', '=', $user->kodcaw) + ->where('lelongbidder.status_bidder','=','1') + ->where('lelongbid.status_jual', '=', 1) + ->where('lelongbid.status_payment', '=', 1) + ->select('lelongbid.id','lelongbid.norujukan','lelongbidder.nama_bidder') + ->orderBy('lelongbid.norujukan') + ->get(); + // ->toArray(); + // dd($lelongs); + + $arraycaw = []; + + $total_berat = 0; + $berat = 0; + + $total_harga = 0; + $harga = 0; + + $total_nmarhun = 0; + $nilai_marhun = 0; + + $total_hargaasas = 0; + $hargaasas = 0; + + foreach ($lelongs as $index1 => $lelong) { + $marhun = LelongBidMarhun::where('lelongbid_id', '=', $lelong['id'])->get(); + $total_berat = $total_berat + $marhun->sum('berat'); + + $lelongs[$index1]['detailmarhun'] = $marhun; + } + // dd( $total_berat ); + + + array_push($arraycaw, [ + 'berat' => $berat, + 'harga' => $harga, + 'n_marhun' => $nilai_marhun, + 'hargaasas' => $hargaasas, + ]); + + $pdf = PDF::loadView('pdf.marhundetailspembida', compact('lelongs', 'arraycaw', 'total_nmarhun', 'total_berat', 'total_harga', 'total_hargaasas'))->setPaper('a4', 'potrait'); + + return $pdf->download('Senarai Marhun Pembida.pdf'); + } + } diff --git a/app/Models/LelongBid.php b/app/Models/LelongBid.php index 6aac38d6..af22f092 100644 --- a/app/Models/LelongBid.php +++ b/app/Models/LelongBid.php @@ -81,4 +81,9 @@ class LelongBid extends Model { return $this->hasOne(Payment::class, 'norujukan', 'norujukan')->where('status', 2); } + + public function scanSemakSelesaiJual() + { + return $this->hasMany(ScanSemak::class, 'lelongbid_id', 'id')->whereNotNull('serahkpdpembida'); + } } diff --git a/resources/views/marhun/scanbarcodejual.blade.php b/resources/views/marhun/scanbarcodejual.blade.php index fd340cfa..17b66d44 100644 --- a/resources/views/marhun/scanbarcodejual.blade.php +++ b/resources/views/marhun/scanbarcodejual.blade.php @@ -3,9 +3,16 @@ @section('content')
-
+
-
Scan Barcode Serahan Marhun Kepada Pembida
+
+ + + +
+ Scan Barcode Keluar Kepada Pembida +
+
@if ($message = Session::get('success'))
@@ -16,7 +23,7 @@

{{ $message }}

@endif - Kembali + {{-- Kembali --}}

Tarikh Lelong: @php @@ -37,7 +44,18 @@

- +
+
+
+ @csrf + +
Scan Barcode Marhun Untuk Serah Kepada Pembida
+ + + +
+
+
@@ -45,16 +63,23 @@ + {{-- --}} - @foreach($lelongbid as $index) + @foreach($new_lelong_bid as $index) + {{-- --}} + @endforeach @@ -63,13 +88,13 @@
-
+ {{-- @csrf
Scan Barcode Marhun Serahan Kepada Pembida
- + --}}
diff --git a/resources/views/marhun/senarailelongscanjual.blade.php b/resources/views/marhun/senarailelongscanjual.blade.php index 080490b5..b4b29d7c 100644 --- a/resources/views/marhun/senarailelongscanjual.blade.php +++ b/resources/views/marhun/senarailelongscanjual.blade.php @@ -8,7 +8,7 @@
- Senarai Lelongan Scan Kepada Pembida + Senarai Batch Lelongan (Scan Barcode Keluar Marhun Kepada Pembida)
@@ -22,7 +22,7 @@
@endif {{--

Senarai Lelongan Scan Kepada Pembida

--}} -
BilMarhun N. Marhun BeratNama Pembida
{{$loop->iteration}} {{$index->norujukan}} {{$index->marhun}} {{ number_format($index->nilaimarhun, 2, '.', ',')}} {{$index->berat}} + @foreach($namabidder as $index=>$nama) + {{ $namabidder[0]['nama_bidder']}} + @endforeach +
+
@@ -49,8 +49,8 @@ diff --git a/resources/views/pdf/marhundetailspembida.blade.php b/resources/views/pdf/marhundetailspembida.blade.php new file mode 100644 index 00000000..703a2a57 --- /dev/null +++ b/resources/views/pdf/marhundetailspembida.blade.php @@ -0,0 +1,158 @@ + + + + + + +
No @if($lel['info']['sts_lelong'] == 3) - - + + @endif
+ + + + + + + +

PERMODALAN KELANTAN BERHAD

LAPORAN SENARAI MARHUN PEMBIDA
+ +

+ + + + + + + + + + {{-- + + --}} + + + + + + + + @foreach ($lelongs as $marhun) + + + + + + + {{-- + + --}} + + + + + + + + {{-- + + + + + + + --}} + @endforeach + @foreach ($arraycaw as $index=>$caw) + + + + + {{-- + + --}} + + + + @endforeach +
NoNo Rujukan Jenis MarhunKaratBerat(gm)Harga(RM)Nilai Marhun(RM)Harga Asas(RM)NotaNama Pembeli
{{ $loop->iteration }} {{ $marhun['norujukan'] }}@foreach ($marhun['detailmarhun'] as $item) + {{ $item['marhun'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['karat'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['berat'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['harga'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['n_marhun'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['hargaasas'] }}
+ @endforeach
@foreach ($marhun['detailmarhun'] as $item) + {{ $item['nota'] }}
+ @endforeach
{{$marhun['nama_bidder']}}
{{dd($marhun['detailmarhun'][berat])}}{{ number_format($marhun['detailmarhun']['berat'], 2, '.', ',') }}
Jumlah Keseluruhan{{ number_format($total_berat, 2, '.', ',') }}{{ number_format($total_harga, 2, '.', ',') }}{{ number_format($total_nmarhun, 2, '.', ',') }}{{ number_format($total_hargaasas, 2, '.', ',') }}
+ + + + diff --git a/resources/views/pembayaran/SAGBidItem.blade.php b/resources/views/pembayaran/SAGBidItem.blade.php index d5e4573b..109814c3 100644 --- a/resources/views/pembayaran/SAGBidItem.blade.php +++ b/resources/views/pembayaran/SAGBidItem.blade.php @@ -143,7 +143,7 @@
@elseif($statuspayment->opencash == '1' && $statuspayment->status_payment == '1')
- +
@endif {{--
diff --git a/resources/views/pembayaran/kaunterpembayaran.blade.php b/resources/views/pembayaran/kaunterpembayaran.blade.php index 17c3c9c7..7ba0b413 100644 --- a/resources/views/pembayaran/kaunterpembayaran.blade.php +++ b/resources/views/pembayaran/kaunterpembayaran.blade.php @@ -61,11 +61,11 @@ @endif - + - + {{-- diff --git a/resources/views/pembayaran/senarailelongbayaran.blade.php b/resources/views/pembayaran/senarailelongbayaran.blade.php index 86ce86c7..04434405 100644 --- a/resources/views/pembayaran/senarailelongbayaran.blade.php +++ b/resources/views/pembayaran/senarailelongbayaran.blade.php @@ -55,7 +55,7 @@ @endif - + @endforeach diff --git a/resources/views/simulasi/senaraitempsimulasi.blade.php b/resources/views/simulasi/senaraitempsimulasi.blade.php index 68a56478..b53166ea 100644 --- a/resources/views/simulasi/senaraitempsimulasi.blade.php +++ b/resources/views/simulasi/senaraitempsimulasi.blade.php @@ -3,7 +3,14 @@ @section('content')
-
+
+
+
+
+ Butiran Gadaian Mengikut Cawangan Lelongan Fasa {{$fasa}} +
+
+
@if ($message = Session::get('failed'))

{{ $message }}

@@ -14,7 +21,7 @@
{{ Session::get('message') }}
@endif --}} -

Butiran Gadaian Mengikut Cawangan Lelongan Fasa {{$fasa}}

+ {{--

Butiran Gadaian Mengikut Cawangan Lelongan Fasa {{$fasa}}

--}}
@@ -56,7 +63,7 @@
- +
@@ -72,13 +79,14 @@ + @php $count = 1; @endphp @foreach($senarai as $send) @if($send['bil_lelong'] > 0) - - + + diff --git a/resources/views/simulasi/tempbycawsimulasi.blade.php b/resources/views/simulasi/tempbycawsimulasi.blade.php index 22dd9b58..30e779a4 100644 --- a/resources/views/simulasi/tempbycawsimulasi.blade.php +++ b/resources/views/simulasi/tempbycawsimulasi.blade.php @@ -3,10 +3,20 @@ @section('content')
-
-
- -

Butiran Gadaian Cawangan {{ $details }}

+
+
+
+ + + +
+ Butiran Gadaian Cawangan {{ $details }} +
+
+
+ {{-- + +

Butiran Gadaian Cawangan {{ $details }}

--}} @if ($message = Session::get('failed'))
@@ -16,7 +26,7 @@ @csrf -
{{ $loop->iteration }}{{ $send['kodcaw'] }}{{ $count++ }}{{ $send['kodcaw'] }} {{ $send['caw_name'] }} {{ $send['bil_lelong'] }} {{ number_format($send['total_berat'], 2) }}
+
@@ -24,12 +34,12 @@ + - + - @@ -38,17 +48,17 @@ @foreach($getsurat as $surat) - + + - + - - + @endforeach @@ -97,22 +107,22 @@ // }) // } // }, - { - className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export', - titleAttr: 'Senarai Gadaian Excel', - text: '', - action: function ( e, dt, node, config ) { - $("#exportform").submit(); - } - }, - { - className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export', - titleAttr: 'Senarai Gadaian PDF', - text: '', - action: function ( e, dt, node, config ) { - $("#exportform").submit(); - } - } + // { + // className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export', + // titleAttr: 'Senarai Gadaian Excel', + // text: '', + // action: function ( e, dt, node, config ) { + // $("#exportform").submit(); + // } + // }, + // { + // className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export', + // titleAttr: 'Senarai Gadaian PDF', + // text: '', + // action: function ( e, dt, node, config ) { + // $("#exportform").submit(); + // } + // } ] }); diff --git a/routes/web.php b/routes/web.php index f47d8ed9..344f5a6e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -273,6 +273,7 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::get('/semak/{id}/{lelong_id}',['as'=>'marhun.semak','uses'=>'MarhunController@semak']); Route::post('/tambahmarhun',['as'=>'marhun.tambahmarhun','uses'=>'MarhunController@tambahmarhun']); Route::get('/exportmarhundetails/{lelong_id}',['as'=>'marhun.exportmarhundetails','uses'=>'MarhunController@exportmarhundetails']); + Route::get('/exportmarhundetailspembida/{lelong_id}',['as'=>'marhun.exportmarhundetailspembida','uses'=>'MarhunController@exportmarhundetailspembida']); //action khazanah untuk serahan marhun kepada pembida menang Route::get('/senarailelongscanjual',['as'=>'marhun.senarailelongscanjual','uses'=>'MarhunController@senarailelongscanjual']);
BilNo Kad Pengenalan Tempoh Berat (gm)Nilai Marhun Asal(RM) Pembiayaan (RM) Baki Pembiayaan (RM)Keuntungan 6 Bulan (RM) Keuntungan Telah Bayar (RM)Keuntungan 6 Bulan (RM) Keuntungan Semasa (RM)Nilai Marhun (RM) Tamat Kontrak
{{ $loop->iteration }}{{ $surat['list_norujukan'][0]['norujukan'] }}{{ $surat['list_norujukan'][0]['norujukan'] }} {{ $surat['list_norujukan'][0]['nokp'] }} {{ $surat['list_norujukan'][0]['tempoh'] }}{{ number_format($surat['list_norujukan'][0]['nilaimarhun'], 2, '.', ',') }} {{ number_format($surat['list_norujukan'][0]['berat'] , 2, '.', ',') }} {{ number_format($surat['list_norujukan'][0]['pinjaman'] , 2, '.', ',') }} {{ number_format($surat['list_norujukan'][0]['bakipjm'] , 2, '.', ',') }}{{ number_format($surat['list_norujukan'][0]['bakiupah'], 2, '.', ',') }} {{ number_format($surat['ktlhbyr'] , 2, '.', ',')}}{{ number_format($surat['list_norujukan'][0]['bakiupah'], 2, '.', ',') }} {{ number_format($surat['keuntungan'] , 2, '.', ',') }}{{ number_format($surat['list_norujukan'][0]['nilaimarhun'], 2, '.', ',') }}{{ $surat['list_norujukan'][0]['t_matang1'] }}{{ $surat['list_norujukan'][0]['t_matang1'] }}