Merge branch 'atie' into 'main'
update kemaskini keuntungan dalam kemaskini data See merge request online-sistem1/lelong!94
This commit is contained in:
@@ -1813,17 +1813,22 @@ class LelongController extends Controller
|
||||
$query->select('norujukan')
|
||||
->from('gadai');
|
||||
})
|
||||
->select('gadai.norujukan','gadai.tempoh')
|
||||
->select('gadai.norujukan','gadai.tempoh','gadai.bakipjm','gadai.bakihargajualan','gadai.upah12','gadai.tempoh','gadai.ansakhir','gadai.tempohbayar','gadai.kadarupah','gadai.bakiupah')
|
||||
->get()->toArray();
|
||||
// dd($senaraisagtempoh);
|
||||
|
||||
foreach($senaraisagtempoh as $datatempoh)
|
||||
foreach($senaraisagtempoh as $index1=>$datatempoh)
|
||||
{
|
||||
//kemaskini keuntungan baru
|
||||
$keuntungan = $datatempoh['bakipjm'] - ($datatempoh['bakihargajualan'] - ($datatempoh['upah12'] - $datatempoh['ansakhir'])-(($datatempoh['tempoh']-$datatempoh['tempohbayar'])*$datatempoh['kadarupah']/100*$datatempoh['bakipjm']) );
|
||||
$senaraisagtempoh[$index1]['keuntungan'] = $keuntungan;
|
||||
|
||||
// dd($data['norujukan']);
|
||||
$updatetempoh = LelongBid::where('norujukan', $datatempoh['norujukan'])
|
||||
->where('lelong_id', $lelong_id)
|
||||
->first();
|
||||
$updatetempoh->jbg = $datatempoh['tempoh'];
|
||||
$updatetempoh->bakiupah = bcdiv($keuntungan,1,1);
|
||||
$updatetempoh->update();
|
||||
//insert loguser
|
||||
$loguser = new LogUser;
|
||||
@@ -1832,7 +1837,7 @@ class LelongController extends Controller
|
||||
$loguser->username = $user->username;
|
||||
$loguser->nama_user = $user->name;
|
||||
$loguser->norujukan = $datatempoh['norujukan'];
|
||||
$loguser->nota = ' Kemaskini Tempoh '.$lelong_id;
|
||||
$loguser->nota = ' Kemaskini Tempoh '.$lelong_id.' Keuntungan:'.$datatempoh['bakiupah'].' to '.bcdiv($keuntungan,1,1);
|
||||
$loguser->save();
|
||||
}
|
||||
|
||||
|
||||
@@ -1117,7 +1117,7 @@ class SimulasiController extends Controller
|
||||
|
||||
}
|
||||
|
||||
$data1 = [];
|
||||
$datatempoh = [];
|
||||
$senaraisagtempoh = SimulasiBid::join('gadai','gadai.norujukan','=','simulasibid.norujukan')
|
||||
->where('simulasibid.simulasi_id', $simulasi_id)
|
||||
->whereIn('simulasibid.norujukan', function($query) {
|
||||
|
||||
Reference in New Issue
Block a user