tambah column 1% dan ujrah
This commit is contained in:
@@ -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'
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user