From 67adb05516c4c353fad06e3cfccbae8a62d1ac74 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 14 Dec 2018 17:43:42 -0600 Subject: [PATCH] choose corp tax history for admins --- app/Library/Structures/StructureTaxHelper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Library/Structures/StructureTaxHelper.php b/app/Library/Structures/StructureTaxHelper.php index 8c70f7644..3f0c9f921 100644 --- a/app/Library/Structures/StructureTaxHelper.php +++ b/app/Library/Structures/StructureTaxHelper.php @@ -36,9 +36,15 @@ class StructureTaxHelper { $revenue = $this->GetRevenue($corpId, $refType, $start, $end); $revenue = $revenue - ($fuelCost * $count); - dd($revenue); + //Check to see if the revenue is greater than zero to avoid division by zero error. + //Then calculate the tax owed which is revenue divided by ratio previously calcualted. + //if($revenue > 0.00) { + // $taxOwed = $revenue / $ratio; + //} else { + // $taxOwed = 0.00; + //} //Calculate the tax owed which is revenue divided by ratio previously calculated - $taxOwed = $revenue / $ratio; + $taxOwed = (float)$revenue / (float)$ratio; //Check for negative number, and if negative, zero it out. if($taxOwed < 0.00){ $taxOwed = 0.00;