update status pembayaran dan status serahan pembida
This commit is contained in:
@@ -226,11 +226,15 @@ class PembidaController extends Controller
|
||||
public function senlelbelumbayarbidaan(Request $request)
|
||||
{
|
||||
$kodcaw = $request->kodcaw;
|
||||
$arraysms = [];
|
||||
$arraysls = [];
|
||||
$tarikh_semasa = date('Y-m-d', strtotime(now()));
|
||||
|
||||
$lelong = LelongBid::join('cawangan_lelong','lelongbid.lelong_id','=','cawangan_lelong.lelong_id')
|
||||
->join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id')
|
||||
->join('lelong','lelong.id','=','lelongbid.lelong_id')
|
||||
->join('cawangan','cawangan.id','=','lelongbid.caw_id')
|
||||
->select('lelongbid.lelong_id','lelongbid.caw_id','lelongbid.kodcaw','lelongbid.t_lelong','lelong.sts_lelong','cawangan.caw_name')
|
||||
->select('lelongbid.lelong_id','lelongbid.caw_id','lelongbid.kodcaw','lelongbid.t_lelong','lelong.sts_lelong','cawangan.caw_name','lelong.tarikh_lelong')
|
||||
->distinct()
|
||||
->orderBy('lelongbid.lelong_id')
|
||||
->where('lelongbid.status_jual', 1)
|
||||
@@ -240,8 +244,19 @@ class PembidaController extends Controller
|
||||
->orWhere('lelongbidder.status_payment',2)
|
||||
->where('lelongbidder.status_bidder', 1);
|
||||
})
|
||||
->orderBy('lelong.id', 'DESC')
|
||||
->get();
|
||||
return view('pembida.senlelbelumbayarbidaan', compact('lelong'));
|
||||
// dd($lelong);
|
||||
foreach($lelong as $index=>$info)
|
||||
{
|
||||
if($info['tarikh_lelong'] == $tarikh_semasa)
|
||||
{
|
||||
array_push($arraysms, ['info'=>$info]);
|
||||
} else {
|
||||
array_push($arraysls, ['info'=>$info]);
|
||||
}
|
||||
}
|
||||
return view('pembida.senlelbelumbayarbidaan', compact('arraysms','arraysls','lelong'));
|
||||
}
|
||||
|
||||
public function pembayaranbidaan(Request $request)
|
||||
@@ -974,7 +989,9 @@ class PembidaController extends Controller
|
||||
'lelongBidJual:lelong_id,id,norujukan,caw_id,kodcaw',
|
||||
'lelongBidJual.lelongBidderMenang:lelongbid_id,user_id,nama_bidder,hargabida,status_payment',
|
||||
'lelongBidJual.lelongBidderMenang.payment:lelongbid_id,user_id,status_payment_opt',
|
||||
'lelongBidJual.lelongBidderMenang.payment.user:id,name'
|
||||
'lelongBidJual.lelongBidderMenang.payment.user:id,name',
|
||||
'lelongBidJual.scanjual:lelongbid_id,norujukan,serahkpdpembida',
|
||||
'lelongBidJual.lelongBidderMenang.scanjual:lelongbid_id,norujukan,serahkpdpembida'
|
||||
)->select('id', 'tarikh_lelong')->where('sts_lelong', 3)->orderBy('id', 'DESC')->get();
|
||||
|
||||
$lelong_array = [];
|
||||
@@ -1000,6 +1017,7 @@ class PembidaController extends Controller
|
||||
$user_to_be_added['name_bidder'] = $user[0]->nama_bidder;
|
||||
$user_to_be_added['jumlah_bidaan'] = $user->sum('hargabida');
|
||||
$user_to_be_added['status_bayaran'] = $user[0]->status_payment;
|
||||
$user_to_be_added['serah'] = $user[0]->scanjual ? $user[0]->scanjual->serahkpdpembida : "";
|
||||
if ($user[0]->payment != null) {
|
||||
$user_to_be_added['jenis_bayaran'] = $user[0]->payment->status_payment_opt;
|
||||
} else {
|
||||
|
||||
@@ -60,4 +60,8 @@ class Lelong extends Model
|
||||
{
|
||||
return $this->hasMany(Pengesahan::class, 'lelong_id', 'id')->whereNotNull('disahkan_oleh');
|
||||
}
|
||||
public function scanjual()
|
||||
{
|
||||
return $this->hasMany(ScanJual::class, 'lelong_id', 'id')->where('serahkpdpembida', 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,8 @@ class LelongBid extends Model
|
||||
{
|
||||
return $this->hasOne(LelongBidder::class, 'lelongbid_id', 'id')->where('status_bidder', 1);
|
||||
}
|
||||
public function scanjual()
|
||||
{
|
||||
return $this->belongsTo(ScanJual::class, 'id', 'lelongbid_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,9 @@ class LelongBidder extends Model
|
||||
{
|
||||
return $this->hasOne(Payment::class, 'lelongbid_id', 'lelongbid_id')->where('remark', '<>', '');
|
||||
}
|
||||
|
||||
public function scanjual() {
|
||||
return $this->hasOne(ScanJual::class, 'lelongbid_id', 'lelongbid_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,22 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<table class="table table-bordered table-xl text-center" id="senarailelongonline" style="width:100%">
|
||||
<ul class="nav mb-2 nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="belum-lelong-tab" data-toggle="tab" href="#belum-lelong" role="tab" aria-controls="belum-lelong" aria-selected="false">
|
||||
Lelongan Semasa
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="selesai-lelong-tab" data-toggle="tab" href="#selesai-lelong" role="tab" aria-controls="selesai-lelong" aria-selected="false">
|
||||
Lelongan Selesai
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" style="overflow-x: auto;" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="belum-lelong" role="tabpanel" aria-labelledby="sedang-lelong-tab">
|
||||
<div style="overflow-x: auto;">
|
||||
<table class="table table-bordered table-xl text-center" id="tablestatusbelumlelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
@@ -29,7 +43,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($lelong as $index=> $lel)
|
||||
@forelse($arraysms as $index=> $lel)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $lel['lelong_id']}}</td>
|
||||
@@ -50,11 +64,52 @@
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
@empty
|
||||
<td colspan="5">No Data</td>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="selesai-lelong" role="tabpanel" aria-labelledby="selesai-lelong-tab">
|
||||
<div style="overflow-x: auto;">
|
||||
<table class="table table-bordered table-xl text-center" id="tablestatusselesailelong" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Batch Lelong</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Status Lelong</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($arraysls as $index=> $lel)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $lel['info']['lelong_id']}}</td>
|
||||
<td>@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $lel['info']['t_lelong'] );
|
||||
$t_lelong = $myDateTime->format('d-m-Y');
|
||||
echo($t_lelong);
|
||||
@endphp</td>
|
||||
<td class="text-left">
|
||||
<a class="btn m-1 btn-info" href=" {{ route('pembida.belumbayarbidaan', ['lelong_id'=>$lel['info']['lelong_id'], 'kodcaw'=>$lel['info']['kodcaw']]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a>
|
||||
<span class="m-2">{{ $lel['info']['caw_name']}}
|
||||
</span><br>
|
||||
</td>
|
||||
<td>
|
||||
@if($lel['info']['sts_lelong'] == 3)
|
||||
<button class="btn btn-success btn-sm" disabled>LELONG SELESAI</button>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -62,47 +117,45 @@
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
var tablesenarailelongonline = $('#senarailelongonline').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 7,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[0, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
// buttons: [
|
||||
// {
|
||||
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
// text: '<i class="fas fa-plus" id="test"></i>',
|
||||
// titleAttr: 'Tambah Cawangan',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// // alert( 'Button activated' );
|
||||
// // console.log('hye');
|
||||
|
||||
// $('#myModal').modal("show");
|
||||
// $('#myModal').on('shown.bs.modal', function () {
|
||||
// $('#rolename').trigger('focus')
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
// titleAttr: 'Export to CSV',
|
||||
// text: '<i class="fas fa-download"></i>',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// $("#exportform").submit();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
});
|
||||
var tablestatusbelumlelong = $('#tablestatusbelumlelong').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 7,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
// "ordering": false,
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
|
||||
});
|
||||
|
||||
var tablestatusselesailelong = $('#tablestatusselesailelong').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 7,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
// "ordering": false,
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
|
||||
});
|
||||
|
||||
// $('.addcaw').tooltip();
|
||||
// $('.export').tooltip();
|
||||
|
||||
@@ -89,7 +89,14 @@
|
||||
@elseif($pembida['jenis_bayaran'] == 3)
|
||||
<span class="badge badge-pill badge-secondary">CDM</span>
|
||||
@else
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if($pembida['serah'] == 1)
|
||||
<button class="btn btn-sm btn-success" disabled>Selesai Serah</button>
|
||||
@else
|
||||
<button class="btn btn-sm btn-danger" disabled>Belum Serah</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -144,6 +151,7 @@
|
||||
<th class="text-right" style="min-width: 125px;">Jumlah Bidaan</th>
|
||||
<th class="text-center">Status Bayaran</th>
|
||||
<th class="text-center">Jenis Bayaran</th>
|
||||
<th class="text-center">Status Serah</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -170,12 +178,21 @@
|
||||
<span class="badge badge-pill badge-secondary">CDM</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{-- {{dd($pembida['serah'])}} --}}
|
||||
@if($pembida['serah'] == 1)
|
||||
<button class="btn btn-sm btn-success" disabled>Selesai Serah</button>
|
||||
@else
|
||||
<button class="btn btn-sm btn-danger" disabled>Belum Serah</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
<tr>
|
||||
<td class="text-center" colspan="2"><b>JUMLAH KESELURUHAN</b></td>
|
||||
<td class="text-right"><b>{{ number_format($cawangan['jumlah_bidaan_cawangan'], 2, '.', ',')}}</b></td>
|
||||
<td class="text-center" colspan="2"></td>
|
||||
<td class="text-center" colspan="3"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user