diff --git a/app/Http/Controllers/Moons/MoonsController.php b/app/Http/Controllers/Moons/MoonsController.php index 8a0b1773f..6a5c1cbdc 100644 --- a/app/Http/Controllers/Moons/MoonsController.php +++ b/app/Http/Controllers/Moons/MoonsController.php @@ -176,8 +176,10 @@ class MoonsController extends Controller $reprocessing = $request->reprocessing; } - //Set the reprocessing level for 84% - $reprocessing = 0.84; + //Set the reprocessing level for 84% if the value is null + if($request->reprocessing == null) { + $reprocessing = 0.84; + } //Calculate the total moon goo value $totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity, @@ -332,16 +334,6 @@ class MoonsController extends Controller $composition['Thulium'] += floor(($fourthComp->Thulium * $rUnits) * $reprocessing); } - //Remove any items which don't equal a number above 0 in the composition in order to remove them from the total. - //The less we display on the table the better. - foreach($composition as $key => $value) { - if($composition[$key] === 0) { - unset($composition[$key]); - } - } - - dd($composition); - return view('moons.user.displayTotalWorth')->with('totalWorth', $totalWorth) ->with('totalGoo', $totalGoo) ->with('composition', $composition) diff --git a/resources/views/moons/user/formTotalWorth.blade.php b/resources/views/moons/user/formTotalWorth.blade.php index 1fa40392c..2e85f950e 100644 --- a/resources/views/moons/user/formTotalWorth.blade.php +++ b/resources/views/moons/user/formTotalWorth.blade.php @@ -172,6 +172,10 @@ ], 'None') }} {{ Form::text('fourthQuantity', '', ['class' => 'form-control']) }} +