update listsagbycust simulasi
This commit is contained in:
@@ -887,6 +887,7 @@ class SimulasiUjrahController extends Controller
|
||||
|
||||
public function listsagbycust($simulasi_id, $cawid)
|
||||
{
|
||||
dd($simulasi_id);
|
||||
$keuntungan = 0;
|
||||
$arraylistgadai = 0;
|
||||
|
||||
@@ -926,13 +927,38 @@ class SimulasiUjrahController extends Controller
|
||||
|
||||
// $keuntungan = bcdiv(($listing['tempoh']-$listing['tempohbayar'])*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
|
||||
// dd($keuntungan);
|
||||
$jbg = $listing['tempoh']-$listing['tempohbayar'];
|
||||
$jbg2 = 12- $listing['tempohbayar'];
|
||||
if($listing['tempoh'] <= '12.00'){
|
||||
$keuntungan = bcdiv(($jbg)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
|
||||
}else{
|
||||
$keuntungan = bcdiv(($jbg2)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
|
||||
// $jbg = $listing['tempoh']-$listing['tempohbayar'];
|
||||
// $jbg2 = 12- $listing['tempohbayar'];
|
||||
// if($listing['tempoh'] <= '12.00'){
|
||||
// $keuntungan = bcdiv(($jbg)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
|
||||
// }else{
|
||||
// $keuntungan = bcdiv(($jbg2)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
|
||||
// }
|
||||
|
||||
if($listing['tempohbayar'] == 12){
|
||||
$keuntungan = 0.00;
|
||||
}
|
||||
elseif($listing['tempohbayar'] == $listing['tempoh'] ){
|
||||
$keuntungan = 0.00;
|
||||
}
|
||||
else{
|
||||
|
||||
//kiraan keuntungan ujrah
|
||||
$jeniskeuntungan = 'onepercent';
|
||||
$keuntungan1 = Http::get(config('app.api_url'). 'upahtawarruq/'.$listing['kodcaw'].'/'.$listing['norujukan'].'/'.$jeniskeuntungan)->json();
|
||||
if($keuntungan1 == null){
|
||||
$keuntungan = 0.00;
|
||||
}else{
|
||||
$keuntungan = round(($keuntungan1['pendapatan'] *100)/5,0)*5/100;
|
||||
}
|
||||
// $ujrahonepercentrebet = Http::get(config('app.api_url'). 'lelong/kiraupahUjrahOnePercentRebate/'.$listing['kodcaw'].'/'.$listing['norujukan'])->json();
|
||||
// $keuntungan = round(($keuntungan1['pendapatan']*100)/5,0)*5/100;
|
||||
// $rounded_ujrah = round(($ujrahonepercentrebet['ujrah']*100)/5,0)*5/100;
|
||||
// $rounded_onepercent = round(($ujrahonepercentrebet['onepercent']*100)/5,0)*5/100;
|
||||
// dd($ujrahonepercent, $ujrahonepercentrebet, $rounded_ujrah, $rounded_onepercent);
|
||||
|
||||
}
|
||||
|
||||
$listsag[$index]['ktlhbyr'] = $ktlhbyr;
|
||||
$listsag[$index]['keuntungan'] = $keuntungan;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user