tambah column 1% dan ujrah

This commit is contained in:
Nur Izzati Zulkifli
2023-12-13 09:00:45 +08:00
parent e01835fb59
commit da821d62a7
8 changed files with 287 additions and 13 deletions
@@ -171,7 +171,7 @@ class kemaskiniLelongUjrah extends Command
$loguser->username = 'System';
$loguser->nama_user = 'System';
$loguser->norujukan = $gadai->norujukan;
$loguser->nota = $sebab_keluar == 'A' ? ' KELUAR LELONG '.$lelongbid->lelong_id : ' TEBUS LELONG '.$lelongbid->lelong_id ;
$loguser->nota = $sebab_keluar == 'A' ? ' KELUAR LELONG UJRAH '.$lelongbid->lelong_id : ' TEBUS LELONG UJRAH '.$lelongbid->lelong_id ;
$loguser->save();
$lelongbid->delete();
@@ -182,7 +182,7 @@ class kemaskiniLelongUjrah extends Command
$loguser->username = 'System';
$loguser->nama_user = 'System';
$loguser->norujukan = $gadai->norujukan;
$loguser->nota = $lelongbid->lelong_id.' Kemaskini Tempoh/Bakipjm/Keuntungan' ;
$loguser->nota = $lelongbid->lelong_id.' Kemaskini Tempoh/Bakipjm/Keuntungan Ujrah' ;
$loguser->save();
}
@@ -126,7 +126,9 @@ class LelongUjrahController extends Controller
"status_payment" => 0,
"mora_upah" => 0,
"fasa" => $data->fasa,
"tagujrah" => 1
"tagujrah" => 1,
"onepercent" => $data->onepercent,
"ujrah" => $data->ujrah
]);
@@ -651,6 +651,8 @@ class SimulasiUjrahController extends Controller
$total_cazlelong = 0;
$total_berat = 0;
$total_hargaasas = 0;
$total_onepercent = 0;
$total_ujrah = 0;
$arraycaw = [];
foreach ($cawanganAll as $caw) {
@@ -662,6 +664,8 @@ class SimulasiUjrahController extends Controller
$cajlelong = 0;
$rugilelong = 0;
$bakilelong = 0;
$onepercent = 0;
$ujrah = 0;
foreach ($caw['simulasiBid'] as $sim_bid) {
$total_marhun += 1;
$nilai_marhun += $sim_bid->nilaimarhun;
@@ -669,6 +673,8 @@ class SimulasiUjrahController extends Controller
$bakiupah += $sim_bid->bakiupah;
$berat += $sim_bid->berat;
$hargaasas += $sim_bid->hargaasas;
$onepercent += $sim_bid->onepercent;
$ujrah += $sim_bid->ujrah;
$sumcajlelong = $sim_bid['hargaasas'] * ($simulasi['cajlelong']/100);
@@ -725,6 +731,8 @@ class SimulasiUjrahController extends Controller
'cajlelong' => $cajlelong,
'rugilelong' => $rugilelong,
'bakilelong' => $bakilelong,
'onepercent' => $onepercent,
'ujrah' => $ujrah,
]);
$total_nilaimarhun += $nilai_marhun;
@@ -735,6 +743,8 @@ class SimulasiUjrahController extends Controller
$total_cazlelong += $cajlelong;
$total_berat += $berat;
$total_hargaasas += $hargaasas;
$total_onepercent += $onepercent;
$total_ujrah += $ujrah;
}
$tarikhkemaskini = $simulasi->simkarat[0];
$data = $simulasi;
@@ -752,6 +762,8 @@ class SimulasiUjrahController extends Controller
'total_cazlelong',
'total_rugilelong',
'total_bakilelong',
'total_onepercent',
'total_ujrah',
'total24Kgb',
'total24K',
'total23k',
@@ -800,6 +812,8 @@ class SimulasiUjrahController extends Controller
$bakilelong = 0;
$keuntungan = 0;
$total_baki = 0;
$total_onepercent = 0;
$total_ujrah = 0;
$simulasilel = Simulasi::with('cawangan')->find($simulasi_id);
@@ -839,6 +853,8 @@ class SimulasiUjrahController extends Controller
$total_bakiupah = $total_bakiupah + $cal['bakiupah'];
$total_baki = $total_baki + $baki;
$total_cazlelong = $total_cazlelong + $cajlelongnew;
$total_onepercent += $cal['onepercent'];
$total_ujrah += $cal['ujrah'];
array_push($arraymarhun,[
@@ -852,6 +868,8 @@ class SimulasiUjrahController extends Controller
'bakiupah' => $cal['bakiupah'],
'cajlelong' => $cajlelongnew,
'baki' => $baki,
'onepercent' => $cal['onepercent'],
'ujrah' => $cal['ujrah'],
]);
}
@@ -864,7 +882,7 @@ class SimulasiUjrahController extends Controller
'simulasilel',
'cawanganDetail',
'total_cazlelong',
'total_baki'));
'total_baki','total_onepercent','total_ujrah'));
}
public function listsagbycust($simulasi_id, $cawid)
@@ -1064,5 +1082,112 @@ class SimulasiUjrahController extends Controller
return redirect()->route('analisaujrah.show',$request->idsimulasi)->with('success','Kemaskini Harga Emas Berjaya');
}
public function tempbycawsimulasi($details, $t_gadai1, $fasa)
{
$jbgadai = $t_gadai1;
//$fasa = $request->fasa;
// dd($details);
if($fasa == '1'){
$getsurat = Gadai::on($details)
->where('t_gadai', '<=', $jbgadai)
->where('kodcaw', $details)
->where('sttebus', '=', '')
->where('lelong_tawarruq','=',1)
->where('taglel', '=', 0)
->where('tagpalsu', '=', 0)
->where('tagpalsu2', '=', 0)
->where('tagbaru', '=', 1)
->whereNotNull('upah12')
->get();
$t_gadais = Gadai::on($details)
->where('t_gadai', '<=', $jbgadai)
->where('sttebus', '=', '')
->where('taglel', '=', 0)
->where('tagpalsu', '=', 0)
->where('tagpalsu2', '=', 0)
->where('tagbaru', '=', 1)
->whereNotNull('upah12')
->orderBy('t_gadai')
->select('t_gadai')
->first();
}else{
$getsurat = Gadai::on($details)
->where('t_gadai', '<=', $jbgadai)
->where('kodcaw', $details)
->where('sttebus', '=', '')
->where('taglel', '=', 0)
->where('tagpalsu', '=', 0)
->where('tagpalsu2', '=', 0)
->where('tagbaru', '=', 1)
->whereNotNull('upah12')
->get();
$t_gadais = Gadai::on($details)
->where('t_gadai', '<=', $jbgadai)
->where('sttebus', '=', '')
->where('taglel', '=', 0)
->where('tagpalsu', '=', 0)
->where('tagpalsu2', '=', 0)
->where('tagbaru', '=', 1)
->whereNotNull('upah12')
->orderBy('t_gadai')
->select('t_gadai')
->first();
}
// $tarikh_lelong = Carbon::parse($t_lelong);
// $t_anggaran = ($tarikh_lelong->subMonths(1))->toDateString();
// $t_lelongdisplay = $tarikh_lelong->format('d-m-Y');
//$t_anggaran = ($tarikh_lelong->subDays(20))->format('d/m/Y');
//$t_daftarlelong = ($tarikh_lelong->subMonths(1))->format('d/m/Y');
//dd($getsurat);
foreach($getsurat as $index1=>$surats)
{
$senarai = Gadai::on($details)
->where('norujukan', $surats['norujukan'])
->get();
// dd($surats['tempoh']);
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$surats['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$surats['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
//kiraan keuntungan ujrah
$jeniskeuntungan = 'onepercent';
$keuntungan1 = Http::get(config('app.api_url'). 'upahtawarruq/'.$surats['kodcaw'].'/'.$surats['norujukan'].'/'.$jeniskeuntungan)->json();
if($keuntungan1 == null){
$keuntungan = 0.00;
}else{
$keuntungan = round(($keuntungan1['pendapatan'] *100)/5,0)*5/100;
}
// dd($surats['hargajualan']);
$ktlhbyr = $surats['hargajualan']-$surats['bakihargajualan'];
// dd($ktlhbyr);
$getsurat[$index1]['list_norujukan'] = $senarai;
$getsurat[$index1]['keuntungan'] = $keuntungan;
$getsurat[$index1]['ktlhbyr'] = $ktlhbyr;
// dd($surats['norujukan']);
}
// $keuntungantlhbyr = TransaksiKeuntungan::on('mysql2')
// ->sum('bayaran_keuntungan');
return view('simulasiujrah.tempbycawsimulasi', compact( 'getsurat',
'details',
'senarai',
'keuntungan',
't_gadais',
'ktlhbyr'
));
}
}
@@ -72,6 +72,8 @@
<th>Nilai Marhun Asal (RM)</th>
<th>Pembiayaan (RM)</th>
<th>Keuntungan (RM)</th>
<th>1% (RM)</th>
<th>Ujrah (RM)</th>
<th>Caj Lelong (RM)</th>
<th>Harga Asas (RM)</th>
<th>Baki Lelong (RM)</th>
@@ -92,6 +94,8 @@
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['pinjaman'] , 2, '.', ',') }}</td>
<td>{{ number_format($marhun['bakiupah'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['onepercent'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['ujrah'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['cajlelong'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['hargaasas'], 2, '.', ',') }}</td>
@php
@@ -125,6 +129,8 @@
<td><b>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_pinjaman, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_bakiupah, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_onepercent, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_ujrah, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_cazlelong, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_hargaasas, 2, '.', ',') }}</b></td>
<td align = 'right'><b>@if($bakilelong > 0)
@@ -63,7 +63,7 @@
</div>
</div>
<table class="table text-right table-bordered" id="senaraitemp" style="width:100%">
<thead class="bg-primary text-white">
<thead class="bg-success text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" id="checkall"></th>
<th>Bil</th>
@@ -93,7 +93,7 @@
<td>{{ number_format($send['total_pembiayaan'] , 2) }} </td>
<td>{{ number_format($send['total_bakipjm'] , 2) }} </td>
<td>
<a href=" {{ route('analisa.tempbycawsimulasi', [$send['kodcaw'],$t_gadai1,$fasa]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Gadaian"><i class="far fa-edit"></i></a>
<a href=" {{ route('analisaujrah.tempbycawsimulasi', [$send['kodcaw'],$t_gadai1,$fasa]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Gadaian"><i class="far fa-edit"></i></a>
</td>
</tr>
@endif
@@ -102,7 +102,7 @@
</table>
<div class="modal-footer; text-center" style="margin-top:2%; margin-bottom:2%;">
<a href="{{ route('analisa.janasimulasi') }}" class="btn btn-primary" style="width:8%;">Kembali</a>
<a href="{{ route('analisaujrah.janasimulasi') }}" class="btn btn-primary" style="width:8%;">Kembali</a>
<button type="submit" class="btn btn-success">Jana Simulasi</button>
</div>
</form>
@@ -181,8 +181,9 @@
<th>Berat (gm)</th>
<th>Nilai Marhun Asal (RM)</th>
<th>Pembiayaan (RM)</th>
<th>K.Ujrah(RM)</th>
{{--<th>Harga Asas (RM)</th>--}}
<th>Keuntungan (RM)</th>
<th>1% (RM)</th>
<th>Ujrah (RM)</th>
<th>Caj (RM)</th>
<th>Harga Asas (RM)</th>
<th>Baki (RM)</th>
@@ -200,7 +201,8 @@
<td>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['pinjaman'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['upahsimpan'], 2, '.', ',') }}</td>
{{--<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>--}}
<td>{{ number_format($caw['onepercent'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['ujrah'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['cajlelong'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['bakilelong'], 2, '.', ',') }}</td>
@@ -216,7 +218,9 @@
<td><b>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_pinjaman, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_bakiupah, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_cazlelong, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_onepercent, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_ujrah, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_cazlelong, 2, '.', ',') }}</b></td>
<td><b>{{ number_format($total_hargaasas, 2, '.', ',') }}</b></td>
{{--<td><b>{{ number_format($total_cazlelong, 2, '.', ',') }}</b></td>--}}
<td><b>{{ number_format($total_bakilelong, 2, '.', ',') }}</b></td>
@@ -0,0 +1,136 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<a href="javascript:window.history.go(-1);" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Butiran Gadaian Ujrah Cawangan {{ $details }}
</div>
</div>
<div class="card-body">
{{-- <button type="button" class="btn btn-light" ><a href="javascript:window.history.go(-1);"><h3><i class="fas fa-arrow-alt-circle-left"></i></h3></a></button>
<h3 class="pt-3" style="margin-bottom:2%; margin-top:1%;">Butiran Gadaian Cawangan {{ $details }}</h3> --}}
@if ($message = Session::get('failed'))
<div class="alert alert-danger">
<p>{{ $message }}</p>
</div>
@endif
<form action="{{route('analisaujrah.senaraitempsimulasi')}}" id="formtlelong" method="POST">
@csrf
<table class="table text-right table-bordered" id="detailsgadai" style="width:100%; margin-top:1%;">
<thead class="bg-success text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>No Kad Pengenalan</th>
<th>Tempoh</th>
<th>Berat (gm)</th>
<th>Nilai Marhun Asal (RM)</th>
<th>Pembiayaan (RM)</th>
<th>Baki Pembiayaan (RM)</th>
<th>Jumlah Bayaran (RM)</th>
<th>Keuntungan 6 Bulan (RM)</th>
<th>Keuntungan Semasa (RM)</th>
<th>Tamat Kontrak</th>
</tr>
</thead>
<tbody>
@foreach($getsurat as $surat)
<tr>
<td>{{ $loop->iteration }}</td>
<td style='white-space:nowrap;'>{{ $surat['list_norujukan'][0]['norujukan'] }}</td>
<td>{{ $surat['list_norujukan'][0]['nokp'] }}</td>
<td>{{ $surat['list_norujukan'][0]['tempoh'] }}</td>
<td>{{ number_format($surat['list_norujukan'][0]['berat'] , 2, '.', ',') }}</td>
<td>{{ number_format($surat['list_norujukan'][0]['nilaimarhun'], 2, '.', ',') }}</td>
<td>{{ number_format($surat['list_norujukan'][0]['pinjaman'] , 2, '.', ',') }}</td>
<td>{{ number_format($surat['list_norujukan'][0]['bakipjm'] , 2, '.', ',') }}</td>
<td>{{ number_format($surat['ktlhbyr'] , 2, '.', ',')}}</td>
<td>{{ number_format($surat['list_norujukan'][0]['bakiupah'], 2, '.', ',') }}</td>
<td>{{ number_format($surat['keuntungan'] , 2, '.', ',') }}</td>
<td style='white-space:nowrap;'>{{ $surat['list_norujukan'][0]['t_matang1'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
function kembali() {
$("#formtlelong").submit();
}
var tabledetailsgadai = $('#detailsgadai').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 8,
"orderable": true
}
],
order: [[1, '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: 'PDF Senarai Gadaian',
// 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: 'Senarai Gadaian Excel',
// text: '<i class="fas fa-download"></i>',
// 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: '<i class="fas fa-download"></i>',
// action: function ( e, dt, node, config ) {
// $("#exportform").submit();
// }
// }
]
});
$('.addcaw').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addcaw').removeClass('dt-button');
$( '.export').removeClass('dt-button');
</script>
@endsection
+1
View File
@@ -129,6 +129,7 @@ Route::group(['middleware' => ['permission:analisaujrah'],'prefix'=>'analisaujra
Route::get('/senaraimarhunlel/{simulasi_id}/{cawid}',['as'=>'analisaujrah.senaraimarhunlel','uses'=>'SimulasiUjrahController@senaraimarhunlel']);
Route::get('/listsagbycust/{simulasi_id}/{cawid}',['as'=>'analisaujrah.listsagbycust','uses'=>'SimulasiUjrahController@listsagbycust']);
Route::post('/kemaskini',['as'=>'analisaujrah.kemaskiniharga','uses'=>'SimulasiUjrahController@kemaskini2']);
Route::get('/tempbycawsimulasi/{details}/{t_lelong}/{fasa}',['as'=>'analisaujrah.tempbycawsimulasi','uses'=>'SimulasiUjrahController@tempbycawsimulasi']);
});
Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], function () {