diff --git a/app/Http/Controllers/SimulasiController.php b/app/Http/Controllers/SimulasiController.php index 15a7f398..d4c91e36 100644 --- a/app/Http/Controllers/SimulasiController.php +++ b/app/Http/Controllers/SimulasiController.php @@ -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' )); } diff --git a/resources/views/simulasi/showsimulasi.blade.php b/resources/views/simulasi/showsimulasi.blade.php index 161206a4..da78bd15 100644 --- a/resources/views/simulasi/showsimulasi.blade.php +++ b/resources/views/simulasi/showsimulasi.blade.php @@ -110,7 +110,7 @@ {{ number_format($total_berat, 2, '.', ',') }} {{ number_format($total_nilaimarhun, 2, '.', ',') }} {{ number_format($total_pinjaman, 2, '.', ',') }} - {{ number_format($total_upahkeuntungan, 2, '.', ',') }} + {{ number_format($total_upahkeuntungan2, 2, '.', ',') }} {{ number_format($total_hargaasas, 2, '.', ',') }} {{ number_format($total_cazlelong, 2, '.', ',') }} {{ number_format($total_bakilelong, 2, '.', ',') }}