Merge branch 'atie' into 'main'
update thousand seperator semakan marhun dan update taglel selepas tangguh lelong See merge request online-sistem1/lelong!47
This commit is contained in:
@@ -11,7 +11,7 @@ use PDF;
|
||||
use App\Models\Cawangan;
|
||||
use App\Models\JenisEmas;
|
||||
use App\Models\JenisKarat;
|
||||
|
||||
use App\Models\Gadai;
|
||||
use App\Models\Lelong;
|
||||
use App\Models\CawanganLelong;
|
||||
use App\Models\LelongBid;
|
||||
@@ -522,6 +522,7 @@ class MarhunController extends Controller
|
||||
{
|
||||
|
||||
$detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
|
||||
->where('lelong_id',$info['lelong_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
@@ -591,6 +592,7 @@ class MarhunController extends Controller
|
||||
'lelongbid.jbg',
|
||||
'lelongbid.kadarupah',
|
||||
'lelongbid.upahsimpan',
|
||||
'lelongbid.bakiupah',
|
||||
'lelongbid.ansuran',
|
||||
'lelongbid.nilaimarhun',
|
||||
'lelongbid.pinjaman',
|
||||
@@ -610,7 +612,10 @@ class MarhunController extends Controller
|
||||
->where('id', $lelbidmarhun->lelongbidmarhun_id)
|
||||
->get()->toArray();
|
||||
|
||||
$lelongbid = LelongBid::where('id', $lelbidmarhun->lelongbid_id)->where('lelong_id', $id)->first();
|
||||
$lelongbid = LelongBid::where('lelongbid.id', $lelbidmarhun->lelongbid_id)
|
||||
->where('lelongbid.lelong_id', $id)
|
||||
->first();
|
||||
|
||||
$karat = Lelkarat::where('lelong_id', $id)->get();
|
||||
|
||||
foreach($marhuns as $index1=>$marhun)
|
||||
@@ -624,13 +629,18 @@ class MarhunController extends Controller
|
||||
->where('norujukan', $lelongbid->norujukan)
|
||||
->first();
|
||||
|
||||
if($lelongbid->baki > 0)
|
||||
$lelong = Lelong::where('id',$id)->get();
|
||||
$sumcajlelong = $lelongbid->hargaasas * ($lelong[0]['cajlelong']/100);
|
||||
//$cajlelong = $cajlelong + bcdiv($sumcajlelong,1,1);
|
||||
$totalbaki = $lelongbid->hargaasas - $lelongbid->pinjaman - $lelongbid->bakiupah - bcdiv($sumcajlelong,1,1);
|
||||
//dd($totalbaki);
|
||||
if($totalbaki > 0)
|
||||
{
|
||||
$bakilelong = $bakilelong + $lelongbid->baki;
|
||||
$bakilelong = $totalbaki;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rugilelong = $rugilelong - $lelongbid->baki;
|
||||
$rugilelong = $totalbaki;
|
||||
}
|
||||
|
||||
$marhuns[$index1]['harga_gadai'] = $gadaimarhun->harga;
|
||||
@@ -638,6 +648,7 @@ class MarhunController extends Controller
|
||||
$marhuns[$index1]['old_marhun'] = $gadaimarhun->marhun;
|
||||
$marhuns[$index1]['status_ubah'] = $status;
|
||||
$marhuns[$index1]['pembiayaan'] = $lelongbid->pinjaman;
|
||||
$marhuns[$index1]['bakiupah'] = $lelongbid->bakiupah;
|
||||
$marhuns[$index1]['baki_lelong'] = $bakilelong;
|
||||
$marhuns[$index1]['rugi_lelong'] = $rugilelong;
|
||||
}
|
||||
@@ -724,6 +735,10 @@ class MarhunController extends Controller
|
||||
$tangguhlelong->ditangguh_pada = $currentdate;
|
||||
$tangguhlelong->nota = $request->nota;
|
||||
$tangguhlelong->save();
|
||||
|
||||
$updategadai = Gadai::where('norujukan','=',$request->norujukan)->first();
|
||||
$updategadai->taglel = 0;
|
||||
$updategadai->update();
|
||||
|
||||
$marhundelete = LelongBid::where('id', $request->lelongbid_id)->delete();
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ class SimulasiController extends Controller
|
||||
$arrayinfo = [];
|
||||
|
||||
$simulasi = Simulasi::join('cawangan_simulasi','simulasi.id','=','cawangan_simulasi.simulasi_id')
|
||||
->select('simulasi_id','tarikh_lelong', 'simulasi.fasa')
|
||||
->select('simulasi_id','tarikh_lelong', 'simulasi.fasa','simulasi.harga_emas_asas')
|
||||
->groupBy('simulasi_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
@@ -68,16 +68,16 @@
|
||||
</td>
|
||||
<td>
|
||||
@if($item->n_marhun != null)
|
||||
{{ $item->n_marhun }}
|
||||
{{ number_format($item->n_marhun, 2, '.', ',') }}
|
||||
@else
|
||||
{{ $item->old_nmarhun }}
|
||||
{{ number_format($item->old_nmarhun, 2, '.', ',') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($item->hargaasas != null)
|
||||
{{ $item->hargaasas }}
|
||||
{{ number_format($item->hargaasas, 2, '.', ',') }}
|
||||
@else
|
||||
{{ $item->old_hargaasas }}
|
||||
{{ number_format($item->old_hargaasas, 2, '.', ',') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $item->nota }}</td>
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
<div class="col-md-12 mx-auto card p-4" style="margin-top:2%; margin-bottom:2%;">
|
||||
<p> <b>Norujukan : </b> {{ $lelongbid->norujukan }}</p>
|
||||
<p> <b>Tempoh / JBG : </b> {{ $lelongbid->jbg }}</p>
|
||||
<p> <b>Pembiayaan : </b> {{ $marhuns[0]['pembiayaan'] }}</p>
|
||||
<p> <b>Keuntungan : </b></p>
|
||||
<p> <b>Baki Lelong : </b>{{ $marhuns[0]['baki_lelong'] }}</p>
|
||||
<p> <b>Rugi Lelong : </b>{{ $marhuns[0]['rugi_lelong'] }}</p>
|
||||
<p> <b>Pembiayaan(RM) : </b> {{ number_format($marhuns[0]['pembiayaan'], 2, '.', ',') }}</p>
|
||||
<p> <b>Keuntungan(RM) : </b> {{ number_format($marhuns[0]['bakiupah'], 2, '.', ',') }}</p>
|
||||
<p> <b>Baki Lelong(RM) : </b>{{ number_format($marhuns[0]['baki_lelong'], 2, '.', ',') }}</p>
|
||||
<p> <b>Rugi Lelong(RM) : </b>{{ number_format($marhuns[0]['rugi_lelong'], 2, '.', ',') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,12 +29,17 @@
|
||||
@foreach($arrayinfo as $lel)
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>
|
||||
<td align = 'left'>
|
||||
@foreach($lel['detailsinfo'] as $details)
|
||||
<span class="m-2">{{$details['caw_name']}}</span><br>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $lel['info']['tarikh_lelong']}}</td>
|
||||
<td> @php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $lel['info']['tarikh_lelong']);
|
||||
$datez = $myDateTime->format('d-m-Y');
|
||||
echo($datez);
|
||||
|
||||
@endphp</td>
|
||||
<td>{{ $lel['info']['harga_emas_asas'] }}</td>
|
||||
<td>{{ $lel['info']['jbg'] }}</td>
|
||||
<td>{{ $lel['info']['cajlelong'] }}</td>
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
<th>Lelong ID</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Fasa</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -40,6 +41,7 @@
|
||||
{{$info2['caw_name']}}<br>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $info['info']['harga_emas_asas'] }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('analisa.show',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran Simulasi" style="margin-right:30px"><i class="far fa-edit"></i></a>
|
||||
<a class="confirmdel" href="{{ route('analisa.delete',$info['info']['simulasi_id']) }}" data-toggle="tooltip" data-placement="top" title="Padam"><i class="far fa-trash-alt"></i></a>
|
||||
|
||||
Reference in New Issue
Block a user