structure controller

This commit is contained in:
2018-12-11 20:06:23 -06:00
parent 423c7ecf86
commit 3ccc0bb1ce

View File

@@ -45,8 +45,6 @@ class StructureController extends Controller
'lastMonthRevRefinery' => $this->GetRevenue($corpId, 'Refinery', $dates['LastMonthStart'], $dates['LastMonthEnd']), 'lastMonthRevRefinery' => $this->GetRevenue($corpId, 'Refinery', $dates['LastMonthStart'], $dates['LastMonthEnd']),
]; ];
dd($totalTaxes);
return view('structures.taxes')->with('totalTaxes', $totalTaxes); return view('structures.taxes')->with('totalTaxes', $totalTaxes);
} }
@@ -146,7 +144,7 @@ class StructureController extends Controller
$taxOwed = 0.00; $taxOwed = 0.00;
} }
//Return the amount //Return the amount
return $taxOwed; return number_format($taxOwed,'2', '.', ',');
} }
private function GetRevenue($corpId, $refType, $start, $end) { private function GetRevenue($corpId, $refType, $start, $end) {
@@ -155,7 +153,7 @@ class StructureController extends Controller
->whereBetween('date', [$start, $end]) ->whereBetween('date', [$start, $end])
->sum('amount'); ->sum('amount');
} else if($refType === 'Refinery'){ } else if($refType === 'Refinery'){
return CorpJournal::where(['ref_type' => 'reprocessing_fee', 'corporation_id' => $corpId]) return CorpJournal::where(['ref_type' => 'reprocessing_tax', 'corporation_id' => $corpId])
->whereBetween('date', [$start, $end]) ->whereBetween('date', [$start, $end])
->sum('amount'); ->sum('amount');
} else { } else {