diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php
index 77c9cfbc..2725bb0d 100644
--- a/app/Http/Controllers/LelongController.php
+++ b/app/Http/Controllers/LelongController.php
@@ -210,7 +210,7 @@ class LelongController extends Controller
'berat'=>$berat,
'n_marhun'=>$nilai_marhun,
'pinjaman'=>$pinjaman,
- 'upah'=>$total_upahkeuntungan,
+ 'keuntungan'=>$keuntungan,
'hargaasas'=>$hargaasas,
'cajlelong'=>$cajlelong,
'rugilelong'=>$rugilelong,
@@ -259,6 +259,7 @@ class LelongController extends Controller
'lelong_id',
'jeniskarat',
'data',
+ 'keuntungan',
'total_upahkeuntungan',
'total_nilaimarhun'));
}
@@ -840,11 +841,27 @@ class LelongController extends Controller
$marhuns[$index1]['keuntungan'] = $keuntungan;
}
+ $arrayinfo = [];
+ $lelong_id = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
+ ->where('cawangan_lelong.lelong_id','=',$lelongid)
+ ->select('lelong_id','tarikh_lelong')
+ ->groupBy('lelong_id')
+ ->get()->toArray();
+
+
+ foreach($lelong_id as $laporan)
+ {
+ $details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
+ ->where('lelong_id',$laporan['lelong_id'])
+ ->get()
+ ->toArray();
+ array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
+ }
- return view('lelong.senaraimarhun',compact('marhuns','lelongid','cawid'));
+ return view('lelong.senaraimarhun',compact('marhuns','lelongid','cawid','arrayinfo'));
}
public function deletemarhun(Request $request){
@@ -913,73 +930,25 @@ class LelongController extends Controller
$keuntungan=0;
$total_hargaasas = 0;
- $total_upahkeuntungan = 0;
- $total_nmarhun = 0;
- $total_pinjaman = 0;
+ $total_berat = 0;
foreach($brglelong as $index1=>$upah)
{
-
- $keuntungan = $upah['bakipjm'] - ($upah['bakihargajualan'] - ($upah['upah12'] - $upah['ansakhir'])-(($upah['tempoh']-$upah['tempohbayar'])*$upah['kadarupah']/100*$upah['bakipjm']) );
- $brglelong[$index1]['keuntungan'] = $keuntungan;
-
+
$total_hargaasas = $total_hargaasas + $upah['hargaasas'];
- $total_upahkeuntungan = $total_upahkeuntungan + $keuntungan;
- $total_nmarhun = $total_nmarhun + $upah['nilaimarhun'];
- $total_pinjaman = $total_pinjaman + $upah['pinjaman'];
+ $total_berat = $total_berat + $upah['berat'];
}
-
-
- return view('lelong.senaraibrglelong',compact('arrayinfo','lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_upahkeuntungan','total_nmarhun','total_pinjaman'));
-
- }
-
- public function pdfsenarailelong(Request $request){
-
- $lelong_id = $request->lelongid;
-
- $lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
- ->where('lelong.id', $lelong_id)
- ->get();
-
- $brglelong = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
- ->where('lelongbid.lelong_id', $lelong_id)
- ->get();
-
- $keuntungan=0;
- $totharga_asas=0;
- $totkeuntungan=0;
- $totnilai_marhun=0;
- $tot_pinjaman=0;
-
-
-
-
- foreach($brglelong as $index1=>$upah)
- {
- $keuntungan = $upah['bakipjm'] - ($upah['bakihargajualan'] - ($upah['upah12'] - $upah['ansakhir']) - (($upah['tempoh']-$upah['tempohbayar'])*$upah['kadarupah']/100*$upah['bakipjm']) );
- $brglelong[$index1]['keuntungan'] = $keuntungan;
-
- }
-
- $totharga_asas = $totharga_asas + ($upah->sum('hargaasas'));
- $totkeuntungan = $totkeuntungan + ($brglelong->sum('keuntungan'));
- $totnilai_marhun = $totnilai_marhun + ($upah->sum('nilaimarhun'));
- $tot_pinjaman = $tot_pinjaman + ($upah->sum('pinjaman'));
-
-
- $pdf = PDF::loadView('pdf.listlelong',compact('brglelong','totharga_asas','totkeuntungan','totnilai_marhun','tot_pinjaman','lelong_id','lelongid'))
+ $pdf = PDF::loadView('pdf.listlelong',compact('arrayinfo','lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_berat'))
->setPaper('a4', 'potrait');
- return $pdf->download('Senarai Lelong.pdf');
-
-
-
+ return $pdf->download('Senarai Barang Lelong.pdf');
}
+
+
public function lapbrglelongdetailsindex (Request $request){
// dd('hiio');
}
diff --git a/app/Http/Controllers/SimulasiController.php b/app/Http/Controllers/SimulasiController.php
index c80df8ea..b5ddddbb 100644
--- a/app/Http/Controllers/SimulasiController.php
+++ b/app/Http/Controllers/SimulasiController.php
@@ -457,6 +457,9 @@ class SimulasiController extends Controller
}
+
+ //total keuntungaan full
+
array_push($arraycaw,[
'id_cawangan'=> $cawangan['id'],
'cawangan'=>$cawangan['caw_name'],
diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php
index 8fc51b08..057d5460 100644
--- a/resources/views/includes/sidebar.blade.php
+++ b/resources/views/includes/sidebar.blade.php
@@ -189,6 +189,14 @@
+
+ Laporan by Cawangan
+
+
@endhasrole
@hasrole('account')
{{--
diff --git a/resources/views/lelong/laporanlelong.blade.php b/resources/views/lelong/laporanlelong.blade.php
index 8b6e4705..3543e7d1 100644
--- a/resources/views/lelong/laporanlelong.blade.php
+++ b/resources/views/lelong/laporanlelong.blade.php
@@ -20,7 +20,7 @@
Lelong ID |
Tarikh Lelong |
Cawangan |
- Action |
+ Muat Turun |
@@ -37,7 +37,7 @@
-
+
|
diff --git a/resources/views/lelong/senaraibrglelong.blade.php b/resources/views/lelong/senaraibrglelong.blade.php
deleted file mode 100644
index 5199206f..00000000
--- a/resources/views/lelong/senaraibrglelong.blade.php
+++ /dev/null
@@ -1,120 +0,0 @@
-@extends('layouts.app')
-
-@section('content')
-
-
-
- @foreach ($arrayinfo as $laporan)
-
-
Laporan Barang Lelong
-
Lelong ID: {{ $laporan['laporan']['lelong_id']}}
-
Tarikh Lelong: {{ $laporan['laporan']['tarikh_lelong']}}
- @foreach($laporan['details'] as $details)
-
Cawangan: {{ $details['caw_name']}}
- @endforeach
-
- @endforeach
-
-
-
- @if ($message = Session::get('success'))
-
- @endif
-
-
-
-
-
-@endsection
diff --git a/resources/views/lelong/senaraimarhun.blade.php b/resources/views/lelong/senaraimarhun.blade.php
index 4c0372d6..bec29d8c 100644
--- a/resources/views/lelong/senaraimarhun.blade.php
+++ b/resources/views/lelong/senaraimarhun.blade.php
@@ -5,6 +5,21 @@
+ @foreach ($arrayinfo as $laporan)
+
+
Lelong ID : {{ $laporan['laporan']['lelong_id']}}
+
Tarikh Lelong : @php
+ $myDateTime = DateTime::createFromFormat('Y-m-d', $laporan['laporan']['tarikh_lelong'] );
+ $datez = $myDateTime->format('d-m-Y');
+ echo($datez);
+
+ @endphp
+ @foreach($laporan['details'] as $details)
+
Nama Cawangan : {{ $details['caw_name']}}
+
Kod Cawangan : {{ $details['caw_code']}}
+ @endforeach
+
+ @endforeach
@if ($message = Session::get('success'))
@@ -19,9 +34,6 @@
| No. |
- Tarikh Lelong |
- Kod Cawangan |
- Nama Cawangan |
Norujukan |
Pinjaman (RM) |
Tempoh |
@@ -39,9 +51,6 @@
@foreach ($marhuns as $index=> $marhun)
| {{$loop->iteration}} |
- {{ $marhun['t_lelong'] }} |
- {{ $marhun['kodcaw'] }} |
- {{ $marhun['caw_name'] }} |
{{ $marhun['norujukan']}} |
{{ $marhun['pinjaman'] }} |
{{ $marhun['jbg']}} |
diff --git a/resources/views/lelong/showlelong.blade.php b/resources/views/lelong/showlelong.blade.php
index 8046e733..2f808e9e 100644
--- a/resources/views/lelong/showlelong.blade.php
+++ b/resources/views/lelong/showlelong.blade.php
@@ -33,7 +33,19 @@
Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }} |
- | Keuntungan Keseluruhan : RM{{ number_format($total_upah, 2, '.', ',') }} |
+ Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan, 2, '.', ',') }} |
+
+
+ @foreach($data as $data1)
+ | Tarikh Lelong :
+ @php
+ $myDateTime = DateTime::createFromFormat('Y-m-d', $data1['tarikh_lelong'] );
+ $datez = $myDateTime->format('d-m-Y');
+ echo($datez);
+
+ @endphp
+ |
+ @endforeach
@@ -51,7 +63,7 @@
@foreach($data as $data)
- | Tempoh: {{$data['jbg'] }} |
+ Tempoh : {{$data['jbg'] }} |
@endforeach
@@ -64,7 +76,6 @@
| No |
Cawangan |
- Tarikh Lelong |
Bil Marhun (Paket) |
Berat (gm) |
Nilai Marhun (RM) |
@@ -82,12 +93,11 @@
| {{$index+1}} |
{{ $caw['cawangan'] }} |
- {{ $caw['t_lelong'] }} |
{{ $caw['bil_marhun'] }} |
{{ number_format($caw['berat'], 2, '.', ',') }} |
{{ number_format($caw['n_marhun'], 2, '.', ',') }} |
{{ number_format($caw['pinjaman'], 2, '.', ',') }} |
- {{ number_format($caw['upah'], 2, '.', ',') }} |
+ {{ number_format($caw['keuntungan'], 2, '.', ',') }} |
{{ number_format($caw['hargaasas'], 2, '.', ',') }} |
{{ number_format($caw['cajlelong'], 2, '.', ',') }} |
{{ number_format($caw['bakilelong'], 2, '.', ',') }} |
@@ -97,7 +107,7 @@
- | JUMLAH KESELURUHAN |
+ JUMLAH KESELURUHAN |
{{ $total_marhun }} |
{{ number_format($total_berat, 2, '.', ',') }} |
{{ number_format($total_nilaimarhun, 2, '.', ',') }} |
diff --git a/resources/views/pdf/listlelong.blade.php b/resources/views/pdf/listlelong.blade.php
index 08af691f..a2056843 100644
--- a/resources/views/pdf/listlelong.blade.php
+++ b/resources/views/pdf/listlelong.blade.php
@@ -56,11 +56,17 @@ table {
border: 0px solid #ddd;
}
-th, td {
+td {
text-align: left;
padding: 16px;
}
+th{
+ text-align: left;
+ padding: 16px;
+ background-color:gainsboro;
+}
+
tr:nth-child(even) {
background-color: #f2f2f2;
}
@@ -75,7 +81,7 @@ tr:nth-child(even) {
- | LAPORAN SENARAI LELONGAN |
+ LAPORAN BARANG LELONG |
@@ -84,63 +90,48 @@ tr:nth-child(even) {
- | Lelong ID: {{$lelong_id}} |
- @foreach ($lelongid as $tarikh)
- Tarikh Lelong: {{ $tarikh->tarikh_lelong }} |
-
+ @foreach ($arrayinfo as $laporan)
+ Lelong ID : {{$laporan['laporan']['lelong_id']}} |
+ Tarikh Lelong : {{$laporan['laporan']['tarikh_lelong']}}
+ @foreach ($laporan['details'] as $details)
+ | Cawangan : {{$details['caw_name']}}
+ @endforeach
@endforeach
+
|
-
-
+
- | No |
- No Rujukan |
- Harga Asas |
- Keuntungan |
- Jbg |
- Nilai Marhun Asal(RM) |
- Pembiayaan(RM) |
- Marhun |
+ No |
+ No Rujukan |
+ Marhun |
+ Berat (gm) |
+ Harga Asas |
-
@foreach($brglelong as $brg)
-
- | {{ $loop->iteration }} |
-
- {{ $brg['norujukan'] }} |
- {{ number_format($brg['hargaasas'], 2, '.', ',') }} |
- {{ number_format($brg['keuntungan'], 2, '.', ',') }} |
- {{ $brg['jbg'] }} |
- {{ number_format($brg['nilaimarhun'], 2, '.', ',') }} |
- {{ number_format($brg['pinjaman'], 2, '.', ',') }} |
- {{ ($brg['marhun']) }} |
-
-
- @endforeach
-
-
- | JUMLAH KESELURUHAN |
- {{ number_format($totharga_asas, 2, '.', ',') }} |
- {{ number_format($totkeuntungan, 2, '.', ',') }} |
- |
- {{ number_format($totnilai_marhun, 2, '.', ',') }} |
- {{ number_format($tot_pinjaman, 2, '.', ',') }} |
- |
-
-
-
-
+ {{ $loop->iteration }} |
+ {{ $brg['norujukan']}} |
+ {{ $brg['marhun']}} |
+ {{ number_format($brg['berat'], 2, '.', ',') }} |
+ {{ number_format($brg['hargaasas'], 2, '.', ',') }} |
+ @endforeach
+
+
+ | JUMLAH KESELURUHAN |
+ {{ number_format($total_berat, 2, '.', ',') }} |
+ {{ number_format($total_hargaasas, 2, '.', ',') }} |
+
+
diff --git a/resources/views/simulasi/senaraimarhunlel.blade.php b/resources/views/simulasi/senaraimarhunlel.blade.php
index dfadf39b..1044373b 100644
--- a/resources/views/simulasi/senaraimarhunlel.blade.php
+++ b/resources/views/simulasi/senaraimarhunlel.blade.php
@@ -6,6 +6,7 @@
+
@if ($message = Session::get('success'))
{{ $message }}
diff --git a/resources/views/simulasi/showsimulasi.blade.php b/resources/views/simulasi/showsimulasi.blade.php
index a63aa75f..161206a4 100644
--- a/resources/views/simulasi/showsimulasi.blade.php
+++ b/resources/views/simulasi/showsimulasi.blade.php
@@ -30,12 +30,20 @@
Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }} |
- | Keuntungan Keseluruhan : RM{{ number_format($total_upah, 2, '.', ',') }} |
+ Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan, 2, '.', ',') }} |
- @foreach ($data as $data1)
- | Tarikh Lelong: {{ $data1['tarikh_lelong']}} |
+ @foreach($data as $data1)
+ Tarikh Lelong :
+ @php
+ $myDateTime = DateTime::createFromFormat('Y-m-d', $data1['tarikh_lelong'] );
+ $datez = $myDateTime->format('d-m-Y');
+ echo($datez);
+
+ @endphp
+ |
@endforeach
+
diff --git a/routes/web.php b/routes/web.php
index 0f07ced7..f2f941ce 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -108,7 +108,6 @@ Route::group(['prefix'=>'lelong'], function () {
Route::get('/lapbrglelongindex',['as'=>'lelong.lapbrglelongindex','uses'=>'LelongController@lapbrglelongindex']);
Route::get('/senaraibrglelong/{lelong_id}',['as'=>'lelong.senaraibrglelong','uses'=>'LelongController@senaraibrglelong']);
- Route::post('/pdfsenarailelong',['as'=>'lelong.pdfsenarailelong','uses'=>'LelongController@pdfsenarailelong']);
Route::get('/lapbrglelongdetailsindex',['as'=>'lelong.lapbrglelongdetailsindex','uses'=>'LelongController@lapbrglelongdetailsindex']);