added tax history functions back in but no links yet
This commit is contained in:
@@ -79,6 +79,37 @@ class StructureController extends Controller
|
||||
return view('structures.taxes')->with('totalTaxes', $totalTaxes);
|
||||
}
|
||||
|
||||
public function displayTaxHistory(Request $request) {
|
||||
//Get the months from the request
|
||||
$months = $request->months;
|
||||
|
||||
//Make the helper esi class
|
||||
$helper = new Esi();
|
||||
|
||||
//Get the character's corporation from esi
|
||||
$corpId = $helper->FindCorporationId(Auth::user()->character_id);
|
||||
|
||||
//Declare the structure tax helper class
|
||||
$sHelper = new StructureTaxHelper();
|
||||
|
||||
//Get the dates we are working with
|
||||
$dates = $sHelper->GetTimeFrameInMonths($months);
|
||||
|
||||
//Build the array for displaying the data on the view
|
||||
$totalTaxes = array();
|
||||
|
||||
for($i = 0; $i < $months; $i++) {
|
||||
$totalTaxes[$i] = [
|
||||
'MarketTaxes' => number_format($sHelper->GetTaxes($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
|
||||
'MarketRevenue' => number_format($Helper->GetRevenue($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','),
|
||||
'MonthStart' => $dates[$i]['start']->toFormattedDateString(),
|
||||
];
|
||||
}
|
||||
|
||||
return view('structures.taxhistory')->with(compact('totalTaxes', 'months'));
|
||||
//return view('structures.taxhistory')->with('totalTaxes', $totalTaxes);
|
||||
}
|
||||
|
||||
public function displayJumpBridgeFuel() {
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class StructureTaxHelper {
|
||||
* @var integer
|
||||
* @returns array
|
||||
*/
|
||||
public function GetTimeFrameMonths($months) {
|
||||
public function GetTimeFrameInMonths($months) {
|
||||
//Declare an array of dates
|
||||
$dates = array();
|
||||
//Setup the start of the array as the basis of our start and end dates
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<th>Month</th>
|
||||
<th>Market Tax</th>
|
||||
<th>Market Revenue Minus Fuel Cost</th>
|
||||
<th>Market Tax Minus Fuel Cost / Month</th>
|
||||
<th>Market Revenue</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for($i = 0; $i < 12; $i++)
|
||||
@for($i = 0; $i < $months; $i++)
|
||||
<tr>
|
||||
<td>{{ $totalTaxes[$i]['start'] }}</td>
|
||||
<td>{{ $totalTaxes[$i]['MonthStart'] }}</td>
|
||||
<td>{{ $totalTaxes[$i]['MarketTax'] }}</td>
|
||||
<td>{{ $totalTaxes[$i]['MarketRevenue'] }}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user