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;