update total show simulasi

This commit is contained in:
Nur Izzati Zulkifli
2022-05-24 13:54:50 +08:00
parent 197eaa2a7a
commit 184ae4fc00
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -370,6 +370,8 @@ class SimulasiController extends Controller
$total14Kp = 0;
$total14K = 0;
$total9K = 0;
$total_upahkeuntungan2 = 0;
$total_nilaimarhun = 0;
foreach($cawangansim as $cawsim)
{
@@ -389,10 +391,7 @@ class SimulasiController extends Controller
$keuntungan = 0;
$total_upahkeuntungan = 0;
$total_nilaimarhun = 0;
foreach($databid as $index1=>$bid)
{
$marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid['id'])->get();
@@ -470,7 +469,7 @@ class SimulasiController extends Controller
}
//total keuntungaan full
array_push($arraycaw,[
'id_cawangan'=> $cawangan['id'],
'cawangan'=>$cawangan['caw_name'],
@@ -490,11 +489,13 @@ class SimulasiController extends Controller
$total_marhun = $total_marhun + sizeof($databid);
$total_berat = $total_berat + $berat;
$total_nilaimarhun = $total_nilaimarhun + $nilai_marhun;
//dd($nilai_marhun);
$total_pinjaman = $total_pinjaman + $pinjaman;
$total_hargaasas = $total_hargaasas + $hargaasas;
$total_cazlelong = $total_cazlelong + $cajlelong;
$total_rugilelong = $total_rugilelong + $rugilelong;
$total_bakilelong = $total_bakilelong + $bakilelong;
$total_upahkeuntungan2 = $total_upahkeuntungan2 + $total_upahkeuntungan;
$data = Simulasi::where('simulasi.id','=',$simulasi_id)
@@ -531,7 +532,8 @@ class SimulasiController extends Controller
'jeniskarat',
'data',
'total_upahkeuntungan',
'total_nilaimarhun'
'total_nilaimarhun',
'total_upahkeuntungan2'
));
}