Merge branch 'amirah' into 'main'
Amirah See merge request online-sistem1/lelong!38
This commit is contained in:
@@ -110,23 +110,26 @@ class LelongController extends Controller
|
||||
|
||||
$keuntungan = 0;
|
||||
$total_upahkeuntungan = 0;
|
||||
$total_upahkeuntungan2 = 0;
|
||||
$total_nilaimarhun = 0;
|
||||
$nilai_marhun = 0;
|
||||
|
||||
foreach($cawanganlel as $cawlel)
|
||||
{
|
||||
$cawangan = Cawangan::where('id','=',$cawlel->caw_id)->first();
|
||||
$databid = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->select('lelongbid.id','lelongbid.berat','lelongbid.marhun','lelongbid.cajlelong','lelongbid.baki','lelongbid.nilaimarhun','lelongbid.pinjaman','lelongbid.hargaasas','lelongbid.cajlelong','gadai.bakipjm','gadai.bakihargajualan','gadai.upah12','gadai.ansakhir','gadai.tempoh','gadai.kadarupah','gadai.tempohbayar')
|
||||
->where('caw_id','=',$cawlel->caw_id)->where('lelong_id','=',$id)->get();
|
||||
|
||||
// dd($databid->toArray());
|
||||
$packet = 0;
|
||||
$berat = 0;
|
||||
$nilai_marhun = 0;
|
||||
$pinjaman =0;
|
||||
$upah = 0;
|
||||
$hargaasas = 0;
|
||||
$cajlelong = 0;
|
||||
$rugilelong = 0;
|
||||
$bakilelong = 0;
|
||||
$total_nilaimarhun = 0;
|
||||
|
||||
foreach($databid as $index1=>$bid)
|
||||
{
|
||||
@@ -134,7 +137,7 @@ class LelongController extends Controller
|
||||
$berat = $berat + $bid['berat'];
|
||||
$nilai_marhun = $nilai_marhun + $bid['nilaimarhun'];
|
||||
$pinjaman =$pinjaman + $bid['pinjaman'];
|
||||
$upah = $upah + $bid['upah'];
|
||||
// $upah = $upah + $bid['upah'];
|
||||
$hargaasas = $hargaasas + $bid['hargaasas'];
|
||||
$cajlelong = $cajlelong + $bid['cajlelong'];
|
||||
|
||||
@@ -142,7 +145,7 @@ class LelongController extends Controller
|
||||
$keuntungan = $bid['bakipjm'] - ($bid['bakihargajualan'] - ($bid['upah12'] - $bid['ansakhir'])-(($bid['tempoh']-$bid['tempohbayar'])*$bid['kadarupah']/100*$bid['bakipjm']) );
|
||||
$databid[$index1]['keuntungan'] = $keuntungan;
|
||||
|
||||
$total_upahkeuntungan = $total_upahkeuntungan + $keuntungan;
|
||||
$total_upahkeuntungan = bcdiv($total_upahkeuntungan,1,1) + bcdiv($keuntungan,1,1);
|
||||
|
||||
|
||||
if($bid['baki'] > 0)
|
||||
@@ -158,7 +161,7 @@ class LelongController extends Controller
|
||||
$total24Kgb += LelongBidMarhun::where('lelongbid_id','=',$bid['id'])
|
||||
->where('karat','=','24.0Kgb')
|
||||
->sum('berat');
|
||||
|
||||
|
||||
$total24K += LelongBidMarhun::where('lelongbid_id','=',$bid['id'])
|
||||
->where('karat','=','24.0K')
|
||||
->sum('berat');
|
||||
@@ -210,13 +213,14 @@ class LelongController extends Controller
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'pinjaman'=>$pinjaman,
|
||||
'keuntungan'=>$keuntungan,
|
||||
'upahsimpan'=>bcdiv($total_upahkeuntungan,1,1),
|
||||
'hargaasas'=>$hargaasas,
|
||||
'cajlelong'=>$cajlelong,
|
||||
'rugilelong'=>$rugilelong,
|
||||
'bakilelong'=>$bakilelong,
|
||||
]);
|
||||
|
||||
$total_upahkeuntungan2 = $total_upahkeuntungan2 + $total_upahkeuntungan;
|
||||
$total_marhun = $total_marhun + sizeof($databid);
|
||||
$total_berat = $total_berat + $berat;
|
||||
$total_pinjaman = $total_pinjaman + $pinjaman;
|
||||
@@ -261,7 +265,8 @@ class LelongController extends Controller
|
||||
'data',
|
||||
'keuntungan',
|
||||
'total_upahkeuntungan',
|
||||
'total_nilaimarhun'));
|
||||
'total_nilaimarhun',
|
||||
'total_upahkeuntungan2'));
|
||||
}
|
||||
|
||||
public function create($id)
|
||||
@@ -436,6 +441,7 @@ class LelongController extends Controller
|
||||
|
||||
public function kemaskini(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
$lelkarat = lelKarat::where('lelong_id','=',$request->idlelong)->get();
|
||||
|
||||
@@ -460,7 +466,7 @@ class LelongController extends Controller
|
||||
|
||||
//update marhun
|
||||
$lelongbid = LelongBid::where('lelong_id','=',$request->idlelong)->get();
|
||||
|
||||
|
||||
foreach($lelongbid as $bid)
|
||||
{
|
||||
$sumhargaasas = 0;
|
||||
@@ -474,18 +480,22 @@ class LelongController extends Controller
|
||||
|
||||
if($karat->karat == $marhun->karat)
|
||||
{
|
||||
$val = round($marhun->berat * $karat->harga);
|
||||
$val = round($marhun->berat * $karat->harga2);
|
||||
$sumhargaasas = $sumhargaasas + $val;
|
||||
|
||||
$marhun->harga = $karat->harga;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga;
|
||||
$marhun->harga = $karat->harga2;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga2;
|
||||
$marhun->hargaasas = floatval(number_format($val,2));
|
||||
$marhun->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lelong = Lelong::where('id',$request->idlelong)->get();
|
||||
$bid->hargaasas = $sumhargaasas;
|
||||
$bid->baki = $sumhargaasas-$bid->pinjaman - $bid->bakiupah - $bid->cajlelong;
|
||||
$sumcajlelong = $sumhargaasas * ($lelong[0]['cajlelong']/100);
|
||||
$bid->cajlelong = bcdiv($sumcajlelong,1,1);
|
||||
$bid->baki = $sumhargaasas-$bid->pinjaman - $bid->bakiupah - $sumcajlelong;
|
||||
$bid->save();
|
||||
|
||||
}
|
||||
@@ -838,7 +848,7 @@ class LelongController extends Controller
|
||||
foreach ($marhuns as $index1=> $cal) {
|
||||
|
||||
$keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
|
||||
$marhuns[$index1]['keuntungan'] = $keuntungan;
|
||||
$marhuns[$index1]['keuntungan'] = bcdiv($keuntungan,1,1);
|
||||
}
|
||||
|
||||
$arrayinfo = [];
|
||||
@@ -950,7 +960,27 @@ class LelongController extends Controller
|
||||
|
||||
|
||||
public function lapbrglelongdetailsindex (Request $request){
|
||||
// dd('hiio');
|
||||
|
||||
$arraydetails = [];
|
||||
|
||||
$brgdetails= Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
|
||||
->select('lelong_id','tarikh_lelong')
|
||||
->groupBy('lelong_id')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
// dd($brgdetails);
|
||||
|
||||
foreach($brgdetails as $brg)
|
||||
{
|
||||
$details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id', $brg['lelong_id'])
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arraydetails,['brg' => $brg, 'detailsbrg' => $details ]);
|
||||
}
|
||||
|
||||
return view('lelong.brgleldetails', compact('arraydetails'));
|
||||
}
|
||||
|
||||
public function lapbidaanpembidaindex (Request $request){
|
||||
|
||||
@@ -377,6 +377,9 @@ class SimulasiController extends Controller
|
||||
{
|
||||
$cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first();
|
||||
$databid = SimulasiBid::join('gadai','simulasibid.norujukan','=','gadai.norujukan')
|
||||
->select('simulasibid.id','simulasibid.berat','simulasibid.marhun','simulasibid.cajlelong','simulasibid.baki','simulasibid.nilaimarhun',
|
||||
'simulasibid.pinjaman','simulasibid.hargaasas','simulasibid.cajlelong','gadai.bakipjm','gadai.bakihargajualan','gadai.upah12',
|
||||
'gadai.ansakhir','gadai.tempoh','gadai.kadarupah','gadai.tempohbayar')
|
||||
->where('caw_id','=',$cawsim->caw_id)->where('simulasi_id','=',$simulasi_id)->get()->toArray();
|
||||
|
||||
$packet = 0;
|
||||
@@ -468,8 +471,6 @@ class SimulasiController extends Controller
|
||||
|
||||
}
|
||||
|
||||
//total keuntungaan full
|
||||
|
||||
array_push($arraycaw,[
|
||||
'id_cawangan'=> $cawangan['id'],
|
||||
'cawangan'=>$cawangan['caw_name'],
|
||||
@@ -601,11 +602,11 @@ class SimulasiController extends Controller
|
||||
|
||||
if($karat->karat == $marhun->karat)
|
||||
{
|
||||
$val = round($marhun->berat * $karat->harga);
|
||||
$val = round($marhun->berat * $karat->harga2);
|
||||
$sumhargaasas = $sumhargaasas + $val;
|
||||
|
||||
$marhun->harga = $karat->harga;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga;
|
||||
$marhun->harga = $karat->harga2;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga2;
|
||||
$marhun->hargaasas = floatval(number_format($val,2));
|
||||
$marhun->save();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<h3 class="pt-3" style="margin-left:1%;">Laporan Barang Lelong Details </h3>
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="" method="POST">
|
||||
<input type="hidden" name="type" value="User">
|
||||
<table class="table table-striped table-xl" id="tablenotislelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Lelong ID</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th class="text-center">Muat Turun</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($arraydetails as $laporan)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $laporan['brg']['lelong_id']}}</td>
|
||||
<td>{{ $laporan['brg']['tarikh_lelong']}}</td>
|
||||
<td>
|
||||
@foreach($laporan['detailsbrg'] as $details)
|
||||
<span class="m-2">{{ $details['caw_name']}}</span><br>
|
||||
@endforeach
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<a href="{{ route('lelong.senaraibrglelong',$laporan['brg']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//Enable tooltips everywhere
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
var tablenotislelong = $('#tablenotislelong').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 3,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@@ -57,7 +57,9 @@
|
||||
<td>{{ $marhun['berat'] }}</td>
|
||||
<td>{{ $marhun['nilaimarhun'] }}</td>
|
||||
<td>{{ $marhun['hargaasas'] }}</td>
|
||||
<td>{{ $marhun['keuntungan'] }}</td>
|
||||
<td>{{ number_format($marhun['keuntungan'], 2, '.', ',') }}</td>
|
||||
|
||||
{{-- <td>{{ $marhun['keuntungan'] }}</td> --}}
|
||||
<td>{{ $marhun['cajlelong'] }}</td>
|
||||
<?php
|
||||
$rugi = 0;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</td>
|
||||
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan2, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@foreach($data as $data1)
|
||||
@@ -97,7 +97,7 @@
|
||||
<td>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['pinjaman'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['keuntungan'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['upahsimpan'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['cajlelong'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['bakilelong'], 2, '.', ',') }}</td>
|
||||
@@ -112,7 +112,7 @@
|
||||
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_upahkeuntungan2, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
|
||||
@@ -121,11 +121,12 @@
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
|
||||
{{-- {{dd($lelkarat)}}; --}}
|
||||
<table class="table table-striped table-xl" id="jumlahberat" style="width:80%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr class="text-center">
|
||||
<th colspan="12">JUMLAH BERAT MENGIKUT MUTU (KESELURUHAN)</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -113,6 +113,7 @@ Route::group(['prefix'=>'lelong'], function () {
|
||||
Route::get('/senaraibrglelong/{lelong_id}',['as'=>'lelong.senaraibrglelong','uses'=>'LelongController@senaraibrglelong']);
|
||||
|
||||
Route::get('/lapbrglelongdetailsindex',['as'=>'lelong.lapbrglelongdetailsindex','uses'=>'LelongController@lapbrglelongdetailsindex']);
|
||||
|
||||
|
||||
Route::get('/lapbidaanpembidaindex', ['as'=>'lelong.lapbidaanpembidaindex','uses'=>'LelongController@lapbidaanpembidaindex']);
|
||||
Route::get('/senarailapbidaan/{lelong_id}',['as' =>'lelong.senarailapbidaan','uses'=>'LelongController@senarailapbidaan']);
|
||||
|
||||
Reference in New Issue
Block a user